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

效果

相关推荐
BS_Li37 分钟前
【Linux网络编程】NAT、代理服务、内网穿透
linux·网络·智能路由器
用户029266661332 小时前
Linux 用户管理知识与应用实践(三:用户组及修改用户密码)
linux
Mortalbreeze3 小时前
深入 Linux 线程机制(三):线程互斥——竞争条件与互斥锁的本质
linux·运维·服务器·c++·算法
鱼听禅3 小时前
CentOS 源码模式配置SVNAdmin2管理SVN仓库
linux·svn·centos
Amonter3 小时前
RK3399ProD移植主线Linux内核
linux·rockchip·rk3399pro
星云_byto3 小时前
五分钟从零配置好VSCode + Claude Code + DeepSeek V4 Pro
ide·vscode·编辑器·cursor·codex·claude code·deepseekv4
从零开始的代码生活_3 小时前
Linux select 多路转接详解
linux·运维·服务器·网络·网络协议·tcp/ip·计算机网络
say_fall3 小时前
【Git 精品详解】企业规范:企业级开发模型、Git Flow、发版流程规范、Code Owner 制度、事故应急回滚
大数据·linux·服务器·git·学习·elasticsearch
一杯奶茶¥4 小时前
Ubuntu系统镜像各个版本下载Ubuntu镜像合集资源Linux系统镜像乌班图Linux系统镜像
linux·运维·ubuntu·镜像·;inux镜像·ubuntu镜像
三84414 小时前
文件查找/文件压缩/解压缩
linux·运维·服务器