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

效果

相关推荐
米高梅狮子29 分钟前
03.网络类服务实践
linux·运维·服务器·网络·kubernetes·centos·openstack
June`37 分钟前
网络编程时内核究竟做了什么???
linux·服务器·网络
楼兰公子1 小时前
RK3588 + Linux7.0.3 网络工程调试错误速查手册
linux·网络·3588
Elnaij2 小时前
Linux系统与系统编程(9)——自设计shell与基础IO
linux·服务器
IMPYLH2 小时前
Linux 的 unexpand 命令
linux·运维·服务器·bash
|_⊙3 小时前
Linux 文件知识 补充
linux·运维·服务器
落羽的落羽3 小时前
【算法札记】练习 | Week4
linux·服务器·数据结构·c++·人工智能·算法·动态规划
Mortalbreeze4 小时前
深度理解文件系统 ---- 从磁盘存储到内核存储
大数据·linux·数据库
LN花开富贵6 小时前
Ubuntu aarch64 架构安装 NoMachine 远程控制 避坑与实战
linux·运维·笔记·学习·ubuntu·嵌入式
取经蜗牛7 小时前
Windows 11 WSL + Ubuntu 24.04 安装指南
linux·windows·ubuntu