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

效果

相关推荐
2601_956139421 分钟前
广州VI设计公司哪家强
linux·运维·服务器·python
想唱rap29 分钟前
五种IO模型和非阻塞IO
linux·运维·服务器·网络·数据库·tcp/ip
哈哈浩丶1 小时前
存储相关知识①—通用NAND Flash 基础
linux·存储·nand
mzhan0173 小时前
Linux: config: CRYPTO_USER_API_AEAD
linux·安全·module
wangjialelele3 小时前
【SystemV】基于建造者模式的信号量
linux·c语言·c++·算法·建造者模式
源远流长jerry3 小时前
Linux 网络虚拟化深度解析:从 veth 设备对到容器网络实战
linux·运维·服务器·网络·性能优化·php
|_⊙4 小时前
Linux 深入理解文件(Ext2文件系统:上)
linux·运维·数据库
kidwjb4 小时前
Linux共享内存
linux·服务器·进程间通信
红茶要加冰4 小时前
七、正则表达式
linux·运维·正则表达式·shell
ALINX技术博客4 小时前
【黑金云课堂】FPGA技术教程Linux开发:串行通信接口与实时时钟模块
linux·fpga开发