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

效果

相关推荐
黑猫学长呀1 小时前
存储宝典第2篇:盲封TT wafer是什么意思?
linux·嵌入式硬件·项目·芯片·ufs·晶圆·产测
Strugglingler1 小时前
【Linux 用户态操作 UART】
linux·uart
代码熬夜敲Q1 小时前
ENSP 网络工程实验
linux·运维·服务器
csdn_life182 小时前
OpenClaw v2026.5.12+ 高级密钥管理:使用SecretRef实现真正的隐蔽存储
linux·openclaw
Terrence Shen2 小时前
Claude Code Harness 源码学习讲义
linux·学习·ubuntu
赵药师2 小时前
dpkg: warning: files list file for package ‘libselinux1:amd64‘ missing;
linux·运维·服务器
STDD2 小时前
Samba 文件共享:Linux 服务器与 Windows/Mac 共享文件夹
linux·服务器·windows
liudanzhengxi3 小时前
CRM系统技术文章
linux·服务器·网络·人工智能·新人首发
南境十里·墨染春水3 小时前
守护进程编程流程
linux·学习
eggrall4 小时前
Linux进程信号——像收快递一样理解 Linux 信号
linux·开发语言·c++