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

效果

相关推荐
祖力551 小时前
驱动工程搭建与字符设备驱动框架
linux·运维·服务器·内核·arm·imx6ull·驱动
Escalating_xu3 小时前
【Linux 网络编程】网络基础概念(下):IP、端口、Socket 与网络字节序,写代码前先打好基础
linux·网络·tcp/ip
刚入门的大一新生3 小时前
Linux-Ext系列文件系统
linux·运维·服务器
无足鸟ICT4 小时前
【RHCA+】select循环
linux
SKH.4 小时前
Linux驱动-led、beep
linux·运维·单片机
碧海银沙音频科技研究院4 小时前
炬芯ATS308X的扩音器:麦克风到扬声器直通功能实现
java·linux·运维
睡一觉就好了。4 小时前
序列化与非序列化
linux·网络
想做小南娘,发现自己是女生喵5 小时前
第三周学习文档 Linux C 多进程与多线程
linux·c语言·学习
此生决int6 小时前
Linux系列(06)——进程概念(上)
linux·运维·服务器
H.莓飛7 小时前
【C++】内存管理
linux·开发语言·jvm·c++·visual studio