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

效果

相关推荐
GDAL32 分钟前
vscode 插件开发activityba
vscode·编辑器
learn_coder33 分钟前
在vscode中和obsidian中使用Mermaid
ide·vscode·编辑器
程序员黄老师35 分钟前
Ubuntu 24.04上安装 Intelligent Pinyin 中文输入法
linux·运维·ubuntu
HONG_YANG1 小时前
ERPNext 介绍、安装和维护建议
linux
HONG_YANG1 小时前
ERPNext 搭建教程:Linux 一键部署与维护
linux
Enti7c1 小时前
什么是void,什么时候使用void类型?never和void的区别
linux·运维·ubuntu
scilwb3 小时前
基于Isaac Sim场景的Coverage Path Planning 项目部署完整指南
linux
知北游天3 小时前
Linux:多线程---同步&&生产者消费者模型
java·linux·网络
kfepiza4 小时前
`nmcli con add type vlan`中的: `ifname` , `dev` ,`vlan.parent`, `id`,`vlan.id`
linux·网络协议·tcp/ip
kfepiza4 小时前
Linux的NetworkManager的`nmcli connection add` 笔记250712
linux·网络协议·tcp/ip