[vim] vim多窗口切换

需求

写代码的过程中,经常需要在不相邻窗口之间跳转。

方案

使用 neovim-window切换。

插件管理使用lazy.nvim

neovim配置

~/.config/nvim/lua/plugins/下增加文件window-picker.lua,内容为

lua 复制代码
return {
  {
    "yorickpeterse/nvim-window",
    name = "neovim-window-picker",
    event = "VeryLazy",
    version = "2.*",
    keys = {
      { "<leader>wp", "<cmd>lua require('nvim-window').pick()<cr>", desc = "nvim-window: Jump to window" },
    },
    config = function()
      require("nvim-window").setup({
        -- The characters available for hinting windows.
         chars = {
            'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
            'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
         },

        -- A group to use for overwriting the Normal highlight group in the floating
        -- window. This can be used to change the background color.
        normal_hl = "Normal",

        -- The highlight group to apply to the line that contains the hint characters.
        -- This is used to make them stand out more.
        hint_hl = "Bold",

        -- The border style to use for the floating window.
        border = "single",

        -- How the hints should be rendered. The possible values are:
        --
        -- - "float" (default): renders the hints using floating windows
        -- - "status": renders the hints to a string and calls `redrawstatus`,
        --   allowing you to show the hints in a status or winbar line
        render = "float",
      })
    end,
}

效果

相关推荐
utf8mb4安全女神13 小时前
磁盘管理(交换分区)(MGR分区)(GPT分区)
linux·运维·服务器
不会就选b13 小时前
linux之vim
linux·运维·vim
2301_7779983414 小时前
进程控制:进程创建、进程终止、进程等待、进程程序替换
linux·服务器
xiaobobo333014 小时前
Ubuntu 26.04下编译s5pv210芯片的linux内核源码,无法进入menuconfig界面
linux·运维·ubuntu
REDcker14 小时前
Linux文件IO底层原理详解
linux·运维·spring
为思念酝酿的痛14 小时前
线程同步与互斥
linux·运维·服务器·后端
一条代码鱼14 小时前
Linux 文件实时同步完全指南:Lsyncd vs Inotifywait+Rsync
linux·运维·服务器
艾莉丝努力练剑14 小时前
【Linux网络】Linux 网络编程:传输层协议TCP(三)
linux·运维·服务器·网络·tcp/ip·http
keyipatience14 小时前
21,22 (半)深入理解Linux重定向与缓冲区机制
linux·运维·服务器
fengyehongWorld15 小时前
Linux command 命令
linux