[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,
}

效果

相关推荐
真的想上岸啊22 分钟前
4、修改开发板内核启动日志级别
linux
RisunJan26 分钟前
Linux命令-kill(向进程发送信号的核心命令)
linux·运维·服务器
物理与数学39 分钟前
linux内核 页缓存的脏页管理
linux·linux内核
范纹杉想快点毕业1 小时前
嵌入式工程师一年制深度进阶学习计划(纯技术深耕版)
linux·运维·服务器·c语言·数据库·算法
物理与数学1 小时前
Linux 内核 vm_area_struct与vm_struct
linux·linux内核
txinyu的博客1 小时前
sprintf & snprintf
linux·运维·算法
EverydayJoy^v^2 小时前
RH124简单知识点——第2章——调度未来任务
linux·运维
顶点多余2 小时前
静态链接 vs 动态链接,静态库 vs 动态库
linux·c++·算法
有梦想有行动2 小时前
ClickHouse的Partition和Part概念
linux·数据库·clickhouse
物理与数学2 小时前
linux内核 Multi-Gen LRU 算法
linux·linux内核