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

效果

相关推荐
ElasticPDF-新国产PDF编辑器21 分钟前
【最新·免费PDF编辑器·不限终端·最高性价比SDK】高亮、评论、图章、手绘与签名,一套完成 PDF 批注
pdf·编辑器
yunwei3726 分钟前
eBPF 教程:精准隔离已建立的 TCP 连接
linux·安全·开源
weixin_445476681 小时前
linux下lims部署详细步骤参考
linux
奇特認2 小时前
数据库MySQL 1.安装环境部署
linux·运维·服务器
小小龙学IT3 小时前
Day 26-27 项目实战:从零构建一个高并发聊天室(epoll + 线程池)
linux·服务器·c语言·开发语言·网络
风静如云3 小时前
Yocto:关于Layer
linux
无足鸟ICT3 小时前
【RHCA+】for循环
linux
雨声不在3 小时前
vm.mmap_rnd_bits 引发 ASAN CPU 100% 问题解析
linux·服务器·网络
进击切图仔4 小时前
在 windows 和 ubuntu 中配置 host 文件
linux·windows·ubuntu
郭涤生4 小时前
C++ 零拷贝(Zero-Copy)
linux·开发语言·c++