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

效果

相关推荐
唠玖馆6 分钟前
文件系统详解
linux·文件系统·ext2
GeW15 分钟前
当Linux内核开始“确定性”,制造高端化才有了底层语法
linux
星恒随风2 小时前
MySQL 从零入门(三):表的约束详解
linux·服务器·数据库·笔记·mysql
StarsGreen4 小时前
libva在intel平台上的前端流程简介
linux
慧都产品智能化5 小时前
Qt 表格升级攻略:复用已有编辑器,减少重复开发
c++·qt·编辑器·qt6.3
坤坤子吖7 小时前
Linux网络编程:自定义应用层协议与 JSON 序列化
linux·服务器·网络·c++·笔记·json
Felven8 小时前
华为鲲鹏920s芯片serdestool工具使用说明
linux·运维·服务器·华为·鲲鹏920·serdestool
莫晓燚8 小时前
mall 电商项目完整部署---实战
linux·运维·docker·容器
咋的啥名都用不了呢~9 小时前
Linux项目部署5(安装Nginx的插件)
linux
CodeYp20199 小时前
第11讲:应用层协议 HTTP
linux·http