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

效果

相关推荐
study_小达人2 分钟前
ubuntu 22.04设置limit不生效
linux·运维·ubuntu
Johny_Zhao3 分钟前
黑客msfconsole渗透工具超详细使用说明
linux·python·网络安全·信息安全·渗透测试·云计算·系统运维·攻防演练
挨踢攻城12 分钟前
Linux 下合并多个 PDF 文件为一个 PDF 文件的方法
linux·前端·rhce·rhca·linux运维·红帽认证·公众号:厦门微思网络
liulilittle15 分钟前
XDP VNP虚拟以太网关(章节:二)
linux·服务器·网络·c++·通信·xdp
比奇堡派星星16 分钟前
Linux 平台设备驱动框架详解
linux·开发语言·驱动开发
代码游侠27 分钟前
应用——Linux Framebuffer 图形库显示
linux·运维·服务器·数据库·笔记·算法
会飞的小新29 分钟前
Linux PCI 设备查看工具 lspci 的工作机制与使用方法
linux
xingzhemengyou130 分钟前
LINUX modprobe 智能加载和卸载内核模块
linux·服务器·前端
xingzhemengyou134 分钟前
Linux who指令查询和显示当前登录系统的用户信息
linux·服务器·网络
wadesir36 分钟前
Linux MySQL Sysbench一键部署与压测实战教程
linux·mysql·adb