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

效果

相关推荐
mounter62538 分钟前
eBPF 驱动的云原生网络变革:Cilium 的前世今生与全机套接字迭代技术演进
linux·ebpf·linux kernel·kernel
赵庆明老师38 分钟前
用同一个用户登录宝塔面板的ftp与Linux的sftp
linux·运维·服务器
oushaojun239 分钟前
深入理解 Linux I2C 框架:内核子系统分层解析(转)
linux
不会就选b1 小时前
Linux之socket编程(六)----TCP-->模拟shell命令
linux·运维·tcp/ip
比兔代理2 小时前
住宅代理IP的出口节点调度:ASN、BGP 与 IP 段信誉机制解析
linux·服务器·网络
AAA代码批发商2 小时前
DAYS 38 TCP并发服务器模型详解
linux·网络·笔记·学习
spencer_tseng2 小时前
kylin redis-6.2.14.tar.gz
linux·redis·kylin·edis-6.2.14
昌原的儿子LEO2 小时前
Linux 网络编程:select 与 epoll IO 多路复用详解
linux·网络·数据库
Jason_zhao_MR2 小时前
Linux与采集MCU通信为什么我们用了双SPI
linux·arm开发·单片机·嵌入式硬件·嵌入式
草莓熊Lotso2 小时前
【Redis 初阶】特殊数据类型、渐进式遍历与数据库操作生产指南
linux·网络·数据库·redis·tcp/ip·缓存·bootstrap