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

效果

相关推荐
2301_7779983413 小时前
Linux线程控制——从线程创建到线程分离(第三部分:线程等待 pthread_join)
linux·运维·服务器·c语言·c++
谜之锋14 小时前
Linux 源码编译安装 net-snmp-5.9.1 并配置使用 SNMPv3
linux·运维·服务器·snmpv3
一直在努力学习的菜鸟14 小时前
阿里云2G2核的服务器可以做什么?
linux·运维
ShineWinsu14 小时前
对于Linux:自定义协议(基于TCP)实现网络计算器的解析
linux·网络·c++·网络协议·tcp/ip·面试·网络计算器
tedcloud12314 小时前
Orca 部署指南:开源 AI 推理服务的 Linux 部署实践
linux·运维·服务器·人工智能·开源·自动化·excel
寒水馨15 小时前
Windows下载、安装neovim-v0.12.4(附安装包nvim-win64.msi)
windows·编辑器·vim·lua·终端·lsp·neovim
小生不才yz15 小时前
Linux设备与存储精读 · L01-03 | 验证环境:Android 设备 + 远程 Linux 服务器怎么分工练
linux
OpenPomeloxCommunity15 小时前
Linux 同步机制之 spinlock 设计与实现(二):ARM32实现
linux
爱莉希雅&&&16 小时前
Rocky Linux 10.1 + K8s 1.36.3 离线集群部署笔记(Kubernetes)
linux·笔记·docker·kubernetes·calico
三84416 小时前
基于 NFS 共享存储的 Nginx Web 服务部署项目
linux·运维·服务器