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

效果

相关推荐
Fcy6481 分钟前
Linux下 Socket编程 —— UDP网络编程
linux·网络·udp
lajidecrd29 分钟前
Ubuntu 24.04 LTS安装
linux·运维·ubuntu
沫璃染墨37 分钟前
《从零入门Linux系统篇(二十九):文件篇·二——深入文件描述符:从文件描述符表到重定向,再到Shell实现》
linux·运维·服务器·c++·驱动开发·系统架构
jing.wang_20251 小时前
制作最小Linux(Ubuntu)系统
linux·嵌入式硬件·ubuntu·dsp开发
陈年老古董1 小时前
Shell 脚本编程基础完整学习笔记
linux·sql·mysql
byte轻骑兵1 小时前
【BlueZ 】蓝牙地址与 UUID:BlueZ 源码中核心标识的定义与使用
linux·bluez·电脑蓝牙·嵌入式蓝牙
Baron X1 小时前
Linux PAM登录告警
linux·运维·告警
团子股股东峥哥1 小时前
day27-RHEL-访问Linux文件系统
linux·运维·服务器
佳児素花痴╮2 小时前
Linux IO模型详解:从阻塞到多路复用
linux·运维·服务器
朝发如雪2 小时前
快速掌握Linux(4)(进程)
java·linux·服务器