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

效果

相关推荐
i***48611 天前
【漏洞复现】CVE-2019-11043(PHP远程代码执行漏洞)信息安全论文_含漏洞复现完整过程_含Linux环境go语言编译环境安装
linux·golang·php
百***66171 天前
linux上redis升级
linux·运维·redis
小糖学代码1 天前
网络:4.1加餐 - 进程间关系与守护进程
linux·网络
小兔薯了1 天前
6. Linux 硬盘分区管理
linux·运维·服务器
努力的Andy1 天前
Linux 云服务器新增硬盘:从分区、格式化到挂载的完整指南
linux·运维·服务器
裤裤兔1 天前
linux卡在启动界面的解决办法
linux·运维·服务器·centos·centos7·linux系统
kka杰1 天前
Linux:基础IO介绍-1
linux·运维·服务器
QT 小鲜肉1 天前
【Linux常用命令大全】在 Linux 系统下 Git + Vim编辑器常用指令完全指南(亲测有效)
linux·开发语言·c++·笔记·git·编辑器·vim
Xの哲學1 天前
Linux slab分配器深度剖析:从原理到实践
linux·服务器·算法·架构·边缘计算
Murphy_lx1 天前
Linux中信号量的相关操作
linux·运维·服务器