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

效果

相关推荐
code monkey.13 小时前
【Linux之旅】HTTP 协议解析:从请求格式到构建 Web 服务器
linux·服务器·网络·http
vortex513 小时前
Linux 传统设计哲学:通过调用名区分行为的艺术
linux·运维·网络
嵌入式-老费13 小时前
esp32开发与应用(esp32-s3的usb转串口功能)
linux·运维·服务器
壮Sir不壮14 小时前
GO语言——GMP调度模型
linux·开发语言·golang·go·操作系统·线程·协程
m0_6932006514 小时前
VSCode使用ssh remote插件远程连接linux主机
linux·vscode·ssh
筵陌14 小时前
Linux网络数据链路层
linux·网络
Aurora_Dawn_yy14 小时前
单机部署数据同步_jdk,mysql,kafka,flink,zookeeper,达梦,starrocks
大数据·linux·starrocks·zookeeper·达梦
bush414 小时前
嵌入式linux学习记录十三
linux·嵌入式
毒爪的小新14 小时前
Open WebUI 从零到一:打造属于你的私人ChatGPT
linux·ai·语言模型·chatgpt·openwebui
keyipatience14 小时前
命名管道:跨进程通信的终极指南
linux·运维·服务器