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

效果

相关推荐
weixin_444579302 分钟前
Rockylinux 与 K8s 的安装
linux·云原生·容器·kubernetes
听风3474 分钟前
Arch Linux 包管理 TUI 工具集
linux·服务器·archlinux
Interview Aid1128 分钟前
Akuna OA 题目拆解|三题思路复盘
linux·运维·算法·面试·职场和发展
qq210846295319 分钟前
Ubuntu 磁盘空间清理实战:从 Docker 到 VirtualBox 的完整指南
linux·ubuntu·docker
MNLoser44 分钟前
AI agent开发——LangGraph接入持久化
linux·人工智能·windows·python
啦啦啦啦啦zzzz1 小时前
升序链表的定时器
linux·服务器·网络·数据结构·c++·链表
mwmbfh1 小时前
【CentOS7环境下Redis 6.2.14 源码编译部署说明】
linux·运维·数据库·redis
渡我白衣1 小时前
Acceptor模块的设计与实现
java·linux·服务器·开发语言·网络·c++·人工智能
沫璃染墨1 小时前
《从零入门Linux系统篇(二十八):文件篇·一——Linux为什么“万物皆文件”:从C语言文件流到系统调用》
linux·运维·服务器·开发语言·c++·文件
咯哦哦哦哦5 小时前
linux so库(arm)对比分析
linux·运维·arm开发