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

效果

相关推荐
上海合宙LuatOS1 分钟前
LuatOS ——Modbus RTU 通信模式
java·linux·服务器·开发语言·网络·嵌入式硬件·物联网
新时代牛马7 分钟前
CANopen 协议详解
linux·微信
Francek Chen9 分钟前
【大数据基础】实验1:熟悉常用的Linux操作和Hadoop操作
大数据·linux·hadoop·hdfs
南林yan10 分钟前
通过lspci和lsusb理解PCI设备和USB设备
linux
虾..11 分钟前
Linux 多线程,线程分离
linux·运维·服务器
zhanglianzhao16 分钟前
Win 11 WSL 配置Claude code 并在VsCode中使用
ide·vscode·编辑器·claude·cladue code
hampeter21 分钟前
【填坑指南】Trae/VS Code 远程连接 Ubuntu,终端总是自动激活特定的 Conda 环境?三招教你彻底解决!
linux·ubuntu·conda·trae
Keying,,,,27 分钟前
VScode中终端闪退问题
ide·vscode·编辑器
驱动探索者38 分钟前
linux genpool 学习
java·linux·学习
热爱生活的五柒41 分钟前
如何在vscode中使用Claude code以及插件中配置setting.json无效的解决方法
ide·vscode·编辑器