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

效果

相关推荐
叮咚侠13 小时前
Ubuntu 24.04 安装zabbix-agent 5.0 服务
linux·ubuntu·zabbix·zabbix-agent
左手厨刀右手茼蒿15 小时前
数据仓库的架构演进:从MySQL到ClickHouse到数据湖的工程化实践
linux·嵌入式·系统内核
左手厨刀右手茼蒿16 小时前
创业团队技术选型:别用大厂架构解决小团队问题
linux·嵌入式·系统内核
bosins16 小时前
将 Hyper-V 上的 Ubuntu 虚拟机内容迁移到 WSL (Windows Subsystem for Linux) 中
linux·windows·ubuntu
我星期八休息17 小时前
扩展—DNS与ICMP
linux·服务器·网络
筝筝ba17 小时前
linux 查询当前登录的用户数量
linux·服务器·网络
woniu_buhui_fei18 小时前
日常工作常用的命令(Linux+JDK)
linux·运维·服务器
coward9118 小时前
全志T507 (sun50iw9p1)sunxi pinctrl 子系统实现分析
linux·嵌入式硬件
imaol118 小时前
文件编程--标准IO
linux·运维·算法
我是小灰灰吖19 小时前
解决高频率图像处理中的内存“只增不减”:glibc malloc_trim实战指南
linux·qt