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

效果

相关推荐
NJCloud11 分钟前
MooseFS 分布式存储部署与高可用架构实践
linux·运维·分布式·架构
mounter62512 分钟前
将 RDMA 引入容器:Soft-RoCE (RXE) 网络命名空间支持深度解析
linux·linux kernel·kernel·rdma·net namespace
奈斯先生Vector38 分钟前
从 127.0.0.1:3080 到插件运行时:DeepSeek Harness 远程开发与版本治理实战
linux·运维·人工智能·ubuntu·aigc
wuminyu43 分钟前
JDK21中虚拟线程和FFM协同实现高并发源码剖析
java·linux·c语言·jvm·c++
Android系统攻城狮1 小时前
Linux PipeWire深度解析之pw_stream_new调用流程与实战(七十八)
linux·运维·服务器·音频进阶·pipewire音频实战进阶
换个号退隐江湖i2 小时前
LLM 调试日志刷屏怎么办?用 tee 边看边存
linux
DYWorker0013 小时前
搭建嵌入式Linux虚拟机开发环境
linux
weipt3 小时前
从ollama到llama.cpp
linux·服务器·llama
加油码3 小时前
动静态库的链接底层原理(进阶版)
linux·c++
笨笨饿3 小时前
#110_SCH3000 平台图传系统配置指南:从 DVP 摄像头到 UVC/WiFi 双通道传输
c语言·stm32·单片机·嵌入式硬件·物联网·vim