[vim] vim多窗口切换 [复制链接]
发表于 2026-2-8 21:20:19 | 显示全部楼层 |阅读模式
需求

代码的过程中,经常须要在不相邻窗口之间跳转。
方案

使用 neovim-window切换。
插件管理使用lazy.nvim
neovim设置

在~/.config/nvim/lua/plugins/下增长文件window-picker.lua,内容为
  1. return {
  2.   {
  3.     "yorickpeterse/nvim-window",
  4.     name = "neovim-window-picker",
  5.     event = "VeryLazy",
  6.     version = "2.*",
  7.     keys = {
  8.       { "<leader>wp", "<cmd>lua require('nvim-window').pick()<cr>", desc = "nvim-window: Jump to window" },
  9.     },
  10.     config = function()
  11.       require("nvim-window").setup({
  12.         -- The characters available for hinting windows.
  13.          chars = {
  14.             'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
  15.             'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
  16.          },
  17.         -- A group to use for overwriting the Normal highlight group in the floating
  18.         -- window. This can be used to change the background color.
  19.         normal_hl = "Normal",
  20.         -- The highlight group to apply to the line that contains the hint characters.
  21.         -- This is used to make them stand out more.
  22.         hint_hl = "Bold",
  23.         -- The border style to use for the floating window.
  24.         border = "single",
  25.         -- How the hints should be rendered. The possible values are:
  26.         --
  27.         -- - "float" (default): renders the hints using floating windows
  28.         -- - "status": renders the hints to a string and calls `redrawstatus`,
  29.         --   allowing you to show the hints in a status or winbar line
  30.         render = "float",
  31.       })
  32.     end,
  33. }
复制代码
效果



免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!qidao123.com:ToB企服之家,中国第一个企服评测及软件市场,开放入驻,技术点评得现金

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表