[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 小时前
《从零入门Linux系统篇(十五):系统工具篇·六——GDB调试器详解:从程序执行控制到高级调试技巧》
linux·运维·服务器·c语言·c++
AIgorithmGEEK1 小时前
Linux 环境变量完全指南:从入门到理解底层原理
linux·运维·服务器
酷可达拉斯2 小时前
Linux操作系统-升级OpenSSH修复漏洞
linux·运维·服务器·云计算
Molesidy3 小时前
【Linux】基于busybox的根文件系统的完善
linux·服务器·嵌入式linux
iCxhust5 小时前
8088单板机VScode集成开发环境使用方法
ide·笔记·vscode·编辑器·微机原理·8088单板机
jufeng13076 小时前
【系列:MiniKV 原理剖析 · 第 6 篇】
linux·软件工程·个人开发·makefile
IT摆渡者6 小时前
ubuntu系统网络问题
linux·运维·ubuntu
jufeng13076 小时前
【系列:MiniKV 原理剖析 · 第 5 篇】
linux·网络·c++·软件工程
kdxiaojie7 小时前
Linux 驱动研究 —— SDIO (1)
linux·运维·笔记·学习·sdio