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

效果

相关推荐
pride.li2 小时前
开发板和Linux--nfs服务挂载
linux·运维·服务器
looking_for__2 小时前
【Linux】应用层协议
linux·服务器·网络
BB_CC_DD3 小时前
Linux截图工具(ubuntu18.04+flameshot(火焰截图))
linux
云泽8083 小时前
不止是命令:Linux 高频指令实战 + 芯片架构底层逻辑
linux·运维·服务器
j_xxx404_4 小时前
Linux:基础IO
linux·运维·服务器
wdfk_prog4 小时前
[Linux]学习笔记系列 -- [drivers][i2c]i2c-dev
linux·笔记·学习
Trouvaille ~5 小时前
【Linux】网络编程基础(二):数据封装与网络传输流程
linux·运维·服务器·网络·c++·tcp/ip·通信
旅途中的宽~6 小时前
【深度学习】通过nohup后台运行训练命令后,如何通过日志文件反向查找并终止进程?
linux·深度学习
dump linux7 小时前
内核驱动调试接口与使用方法入门
linux·驱动开发·嵌入式硬件
Trouvaille ~7 小时前
【Linux】网络编程基础(三):Socket编程预备知识
linux·运维·服务器·网络·c++·socket·网络字节序