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

效果

相关推荐
生信大表哥11 小时前
单细胞测序分析(五)降维聚类&数据整合
linux·python·聚类·数信院生信服务器
“αβ”11 小时前
MySQL表的操作
linux·网络·数据库·c++·网络协议·mysql·https
神秘的土鸡11 小时前
openEuler 25.09 企业级 MySQL主从复制部署与性能优化实战提升50%
linux·数据库·mysql·性能优化·openeuler
知识分享小能手12 小时前
CentOS Stream 9入门学习教程,从入门到精通, CentOS Stream 9 命令行基础 —语法知识点与实战详解(4)
linux·学习·centos
烤鱼骑不快13 小时前
linux 软Raid
linux
hhwyqwqhhwy13 小时前
Linux file->private
linux·运维·服务器
WongKyunban13 小时前
在Linux下制作软件安装包
linux·运维·服务器
IT 乔峰13 小时前
Centos7中部署DNS服务器
linux
hweiyu0013 小时前
Linux 命令:parted
linux·运维·服务器
搞全栈小苏14 小时前
Linux下 cmake所有版本适用/下载编译使用教程 附cmake3.26安装包
linux·运维·ubuntu