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

效果

相关推荐
cyber_两只龙宝3 分钟前
【Oracle】Oracle之SQL的聚合函数和分组
linux·运维·数据库·sql·云原生·oracle
做运维的阿瑞3 分钟前
Linux 系统启动过程解析
linux·运维·服务器
菜菜小狗的学习笔记3 分钟前
八股(六)操作系统
linux·运维·服务器
zhou7577121712 分钟前
linux搭建 Hermes Agent(爱马仕)
linux·运维·服务器
原来是猿18 分钟前
Linux线程同步与互斥(三):POSIX信号量与环形队列生产者消费者模型
linux·运维·服务器·开发语言
ic爱吃蓝莓35 分钟前
破译 Linux 的“黑话”(常用命令解释)
linux·运维·服务器
charlie11451419137 分钟前
嵌入式Linux驱动开发(3)——内核模块机制 - Linux 的插件系统
linux·运维·开发语言·驱动开发·嵌入式硬件·学习
杨云龙UP1 小时前
2000—CentOS Linux 7上部署Oracle 19c(19.3) RAC(RedHat/CentOS 7/8)
linux·运维·服务器·数据库·oracle·centos
java_logo1 小时前
Docker 部署 Hermes Agent 完整指南(Windows / Linux 通用)
linux·windows·docker·hermes-agent部署·docker部署hermes·hermes-agent教程·hermes-agent文档
牛十二1 小时前
nacos2.4连接出错源码分析
java·linux·开发语言