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

效果

相关推荐
鱼香rose__12 小时前
管道、环境变量与常用命令
linux
RisunJan13 小时前
Linux命令-last(查看用户登录历史)
linux·服务器·网络
断水客13 小时前
搭建ARM LINUX 内核 QEMU 仿真调试环境
linux·运维·arm开发·嵌入式
fantasy5_513 小时前
深入理解 Linux 动静态库:制作、原理与加载机制
linux·运维·restful
龙仔72513 小时前
n2n supernode Linux完整部署笔记,包含离线部署,
linux·运维·笔记·n2n·supernode
c++逐梦人13 小时前
进程控制(2)进程程序替换
linux·操作系统·进程
CoderIsArt14 小时前
做一个类似VS code的AI 编辑器技术方案
人工智能·编辑器
鱼香rose__14 小时前
Linux基础概念知识
linux·网络
彭泽布衣14 小时前
gdb调试方法总结
linux·c语言·gdb·故障排查·段错误
KL's pig/猪头/爱心/猪头14 小时前
写一个rv1106的gpio输入驱动(带中断)
linux·驱动开发·rv1106