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

效果

相关推荐
hehelm25 分钟前
AI大模型接入SDK—通用模块设计
linux·开发语言·c++
Ai拆代码的曹操3 小时前
K8s Pod Pending 逐层排查:从 FailedScheduling 到 PVC StorageClass 不存在的实战记录
java·linux·kubernetes
wangbing11254 小时前
JPA下自定义主键
java·linux·服务器
bush44 小时前
正点原子imx6ull-uboot,奇怪的问题
linux·学习
dddwjzx5 小时前
嵌入式Linux C应用编程——Framebuffer应用编程
linux·嵌入式
今天也想躺ping6 小时前
linux系统移植pjsua库实现sip通话功能
linux·sip·交叉编译
信仰8747 小时前
Linux进阶篇01:网络基础配置
linux·网络·php
hkj88087 小时前
Linux 总线-设备-驱动(Bus-Device-Driver)完整协作原理
linux·运维·microsoft
早点睡啊Y7 小时前
深入学 LangChain 官方文档(一):总览、安装与快速开始
linux·服务器·langchain
一直在努力学习的菜鸟7 小时前
Rocky8.5编译安装PHP8.4
linux·运维