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

效果

相关推荐
似水এ᭄往昔27 分钟前
【Linux】--基础IO
linux·服务器
StarryX1 小时前
Mac 用 UTM 装 Debian 实操教程(二)
linux
陆伟峰(云固件作者)1 小时前
Linux Mint 22.3:给初学者的第一份 Linux 说明书
linux·运维·服务器
顺风尿一寸2 小时前
深入 Linux 6.8.12 内核:x86_64 系统调用的快速路径与安全博弈
linux
齐潇宇2 小时前
Docker概述与安装
linux·运维·docker·容器
沉默中爆发的IT男3 小时前
BGP基础配置实验总结
linux·服务器·前端
爱莉希雅&&&3 小时前
MySQL MGR 组复制 完整笔记
linux·数据库·笔记·mysql·mgr·数据库同步
遇见火星3 小时前
linux设置开启启动服务
linux·运维·服务器·nginx
念恒123063 小时前
进程概念(1)
linux·c语言
峥无3 小时前
Linux进程控制完全笔记(fork→exec→wait→Shell)
linux·笔记·unix