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

效果

相关推荐
hi_ro_a2 小时前
Ext系列⽂件系统详解
linux·服务器·操作系统
你住过的屋檐5 小时前
【SeaweedFS】Linux上搭建SeaweedFS文件存储服务完整教程
linux·运维·服务器
少司府6 小时前
嵌入式外设篇(三)GPIO·三:MCU系统结构、总线与统一编制
linux·python·stm32·单片机·嵌入式硬件·mcu·嵌入式软件
不积跬步无以至千里mmbb266 小时前
Rust三大核心:Trait Crate Mod详解
linux·rust
ScilogyHunter7 小时前
[14] TMS570LC4357_VIM向量中断:128 通道、双 VIM 与硬件向量分发
单片机·编辑器·vim·excel·hercules·tms570
无忧.芙桃21 小时前
Linux系统编程(四):用户与权限管理
linux·运维·服务器
戊本菌1 天前
进程(三)进程优先级:谁先上 CPU
linux·c语言·硬件架构
aningx1 天前
Arch 系用 greetd 实现开机自动进 Plasma Wayland,注销自动回桌面
linux
江无行者1 天前
Linux 服务器 top 命令详解
linux
嵌入式 Linux手记1 天前
一块内存,三种解释:union 的真实用法
linux·c语言·驱动开发·嵌入式