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

效果

相关推荐
苏宸啊15 分钟前
进程替换库函数
linux
时光之源25 分钟前
安装WSL2后在其中安装Ubuntu24.04.4再安装OpenClaw全流程傻瓜式教学:WSL2 + Ubuntu 24.04 + OpenClaw
linux·运维·ubuntu·openclaw·龙虾
大袁同学34 分钟前
【进程信号】:溯源硬件起中断,掌舵内核控信号
linux·信号处理
能喵烧香34 分钟前
跨越系统的开源尝试:KDE Windows版本全解析
linux·windows·开源
智算菩萨1 小时前
OpenAI Codex 国内使用完全指南:Windows/macOS/Linux 三平台详细安装配置教程(现在最新的有gpt-5.3-codex和gpt-5.4)
linux·windows·gpt·macos·ai·ai编程·codex
Yupureki1 小时前
《Linux网络编程》4.应用层HTTP协议
linux·服务器·c语言·网络·c++·http
孙同学_1 小时前
【Linux篇】网络层与数据链路层详解
linux·网络·智能路由器
拾光Ծ1 小时前
【Linux系统】进程信号(上)
linux·运维·服务器·面试·信号处理
咖喱o1 小时前
网络-堆叠
linux·运维·服务器·网络
Java面试题总结1 小时前
一文搞定 Linux Nginx 从安装、启动到 nginx.conf 全配置详解(新手也能看懂)
linux·运维·nginx