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

效果

相关推荐
阿拉丁的梦8 分钟前
Pi-Flow-H3-Rev2V+-DWD(极速生成)多参考图生视频+Kandinsky+Video+SR超分放大工作流
linux·服务器·音视频
master33612 分钟前
Linux 运维常见问题汇总与实战排障手册
linux·运维
Android系统攻城狮1 小时前
FFmpeg深度解析之av_frame_get_plane_buffer:如何获取视频Plane缓冲区?(八十八)
linux·ffmpeg·音视频·车载音频·ffmpeg音视频进阶
智购科技自动贩卖机1 小时前
自动售货机SaaS多租户数据库实战:分库分表与租户隔离~YH
android·java·linux·开发语言·javascript·网络
lontran2 小时前
EMRKit:可嵌入、可定制的电子病历编辑器,支持评估量表与体温单
编辑器
wtblszn2 小时前
污水源热泵组态监控管理物联网解决方案
linux·运维·物联网
青草地溪水旁3 小时前
缓冲头解剖:Linux 0.11 里那 36 字节如何管住 1KB 磁盘块
linux·运维·服务器
雷✘4 小时前
C++map 和 set 的使用
linux·开发语言·c++
老一岁12 小时前
csdn-mysql索引与redis命令
linux
handsome_sai14 小时前
《Linux 小白查看系统与软件商店指南》
linux·运维·服务器