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

效果

相关推荐
小陈phd1 分钟前
langgraph从入门到精通(一)——langgraph概念解析
linux·运维·数据库
inquisiter8 分钟前
cove-salus-tellus测试程序时序逻辑
linux·服务器·网络·riscv
这儿有一堆花10 分钟前
告别“脚本小子”:真正理解 Linux 包管理器
linux
噜啦噜啦嘞好21 分钟前
Linux:线程池
linux·运维·c++
屿行屿行27 分钟前
【Linux】音视频处理(gstreamer和ffmpeg的实际应用)
linux·ffmpeg·音视频·视频编解码
用户311879455921828 分钟前
银河麒麟V10 申威架构 docker-compose rpm 包安装教程(附命令)
linux
峥嵘life30 分钟前
Android EDLA 搭建Linux测试环境简介
android·linux·运维
小嘟嘟1330 分钟前
第3章 Shell 条件判断:解决 90% 的分支逻辑问题
linux·运维·shell
⁤⁢初遇37 分钟前
Linux------线程概念与控制
linux·运维·服务器
Forest_HAHA41 分钟前
<13>_Linux网络基础(下)
linux·服务器