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

效果

相关推荐
hehelm7 分钟前
IO 多路复用 — Reactor
linux·服务器·网络·数据库·c++
浅止菌37 分钟前
嵌入式项目Makefile越写越乱?一张万能模板+5个技巧,告别重复劳动
linux
FREEDOM_X2 小时前
嵌入式Linux摄像头采集与图像处理
linux·图像处理·ubuntu
studytosky2 小时前
OpenClaw 入门与 Skill 开发
linux·服务器·ai编程
kaoa0002 小时前
Linux入门攻坚——82、kvm虚拟化-2
linux·运维·服务器
学无止境_永不停歇4 小时前
3. 进程状态
linux·服务器
刘某的Cloud4 小时前
Nginx 最小安全配置模板
linux·运维·nginx·安全·系统
kdxiaojie4 小时前
Linux 驱动研究 —— V4L2 (2)
linux·运维·笔记·学习
DB哥讲数据库4 小时前
MySQL 8.4 安装教程:超详细图文讲解(附mysql安装包)
linux·数据库·mysql·centos
xlxxy_4 小时前
sap获取批次特性报表
java·linux·开发语言·前端·数据库·abap·mm