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

效果

相关推荐
。几秒前
【无标题】
linux·服务器·负载均衡·lvs
weixin_416667963 分钟前
linux ping命令详解
linux·运维·php
硅基手札13 分钟前
【Linux 内核专栏 17】进程间通信 IPC(上)— 管道·信号·System V IPC·mmap·文件锁
linux·运维·服务器·stm32·单片机·mcu
小能喵14 分钟前
kismet -h 帮助信息 中文版
linux·服务器·网络
AR-26710-19 分钟前
Linux Day21——systemctl操作
linux·运维
额额额对了40 分钟前
Linux 驱动开发:基于 platform 总线 + misc 设备的 DS18B20 单总线温度驱动
linux·c语言·开发语言·驱动开发·嵌入式硬件
Android系统攻城狮1 小时前
Linux Gstreamer深度解析之gst_audio_ring_buffer_activate调用流程与实战(七十九)
linux·运维·服务器·gstreamer音视频·gstreamer音视频进阶
Escalating_xu2 小时前
【Linux 网络编程】网络命令加餐:用 ping、netstat、watch 和 pidof 排查服务问题
linux·运维·网络
mounter6252 小时前
现代 Linux 内核在异构内存与硬件演进下的架构变革:压缩 RAM、CXL 与分布式内存
linux·linux kernel·kernel
cccccc语言我来了3 小时前
Linux (11) 进程控制
linux·运维·数据库