diff --git a/README.md b/README.md index f3fbc937..24565e41 100644 --- a/README.md +++ b/README.md @@ -19,67 +19,68 @@ plugins. -* [Features](#features) -* [Screenshot](#screenshot) -* [Prerequisites](#prerequisites) -* [Install](#install) -* [Install LSP, DAP, Linters, Formatters](#install-lsp-dap-linters-formatters) - * [Language-Server Protocol (LSP)](#language-server-protocol-lsp) - * [Recommended LSP](#recommended-lsp) - * [Recommended Linters](#recommended-linters) - * [Recommended Formatters](#recommended-formatters) -* [Recommended Fonts](#recommended-fonts) -* [Upgrade](#upgrade) -* [Structure](#structure) -* [Extending](#extending) - * [Extend: Config](#extend-config) - * [Extend: Plugins](#extend-plugins) - * [Extend: Defaults](#extend-defaults) - * [Extend: LSP Settings](#extend-lsp-settings) -* [Plugin Highlights](#plugin-highlights) -* [Plugins Included](#plugins-included) - * [Completion & Code-Analysis](#completion--code-analysis) - * [Editor Plugins](#editor-plugins) - * [Coding Plugins](#coding-plugins) - * [Colorscheme Plugins](#colorscheme-plugins) - * [Git Plugins](#git-plugins) - * [Misc Plugins](#misc-plugins) - * [Treesitter & Syntax](#treesitter--syntax) - * [UI Plugins](#ui-plugins) -* [Extra Plugins](#extra-plugins) - * [Extra Plugins: Coding](#extra-plugins-coding) - * [Extra Plugins: Colorscheme](#extra-plugins-colorscheme) - * [Extra Plugins: Editor](#extra-plugins-editor) - * [Extra Plugins: Git](#extra-plugins-git) - * [Extra Plugins: Lang](#extra-plugins-lang) - * [Extra Plugins: LSP](#extra-plugins-lsp) - * [Extra Plugins: Org](#extra-plugins-org) - * [Extra Plugins: Treesitter](#extra-plugins-treesitter) - * [Extra Plugins: UI](#extra-plugins-ui) - * [LazyVim Extras](#lazyvim-extras) -* [Custom Key-mappings](#custom-key-mappings) - * [Picker](#picker) - * [Toggle Features](#toggle-features) - * [Navigation](#navigation) - * [Selection](#selection) - * [Jump To](#jump-to) - * [Buffers](#buffers) - * [Clipboard](#clipboard) - * [Auto-Completion](#auto-completion) - * [LSP](#lsp) - * [Diagnostics](#diagnostics) - * [Coding](#coding) - * [Search, Substitute, Diff](#search-substitute-diff) - * [Command & History](#command--history) - * [File Operations](#file-operations) - * [Window Management](#window-management) - * [Plugins](#plugins) - * [Plugin: Mini.Surround](#plugin-minisurround) - * [Plugin: Gitsigns](#plugin-gitsigns) - * [Plugin: Diffview](#plugin-diffview) - * [Plugin: Neo-Tree](#plugin-neo-tree) - * [Plugin: Marks](#plugin-marks) - * [Plugin: Zk](#plugin-zk) +- [Rafael Bodill's Neovim Config](#rafael-bodills-neovim-config) + - [Features](#features) + - [Screenshot](#screenshot) + - [Prerequisites](#prerequisites) + - [Install](#install) + - [Install LSP, DAP, Linters, Formatters](#install-lsp-dap-linters-formatters) + - [Language-Server Protocol (LSP)](#language-server-protocol-lsp) + - [Recommended LSP](#recommended-lsp) + - [Recommended Linters](#recommended-linters) + - [Recommended Formatters](#recommended-formatters) + - [Recommended Fonts](#recommended-fonts) + - [Upgrade](#upgrade) + - [Structure](#structure) + - [Extending](#extending) + - [Extend: Config](#extend-config) + - [Extend: Plugins](#extend-plugins) + - [Extend: Defaults](#extend-defaults) + - [Extend: LSP Settings](#extend-lsp-settings) + - [Plugin Highlights](#plugin-highlights) + - [Plugins Included](#plugins-included) + - [Completion \& Code-Analysis](#completion--code-analysis) + - [Editor Plugins](#editor-plugins) + - [Coding Plugins](#coding-plugins) + - [Colorscheme Plugins](#colorscheme-plugins) + - [Git Plugins](#git-plugins) + - [Misc Plugins](#misc-plugins) + - [Treesitter \& Syntax](#treesitter--syntax) + - [UI Plugins](#ui-plugins) + - [Extra Plugins](#extra-plugins) + - [Extra Plugins: Coding](#extra-plugins-coding) + - [Extra Plugins: Colorscheme](#extra-plugins-colorscheme) + - [Extra Plugins: Editor](#extra-plugins-editor) + - [Extra Plugins: Git](#extra-plugins-git) + - [Extra Plugins: Lang](#extra-plugins-lang) + - [Extra Plugins: LSP](#extra-plugins-lsp) + - [Extra Plugins: Org](#extra-plugins-org) + - [Extra Plugins: Treesitter](#extra-plugins-treesitter) + - [Extra Plugins: UI](#extra-plugins-ui) + - [LazyVim Extras](#lazyvim-extras) + - [Custom Key-mappings](#custom-key-mappings) + - [Picker](#picker) + - [Toggle Features](#toggle-features) + - [Navigation](#navigation) + - [Selection](#selection) + - [Jump To](#jump-to) + - [Buffers](#buffers) + - [Clipboard](#clipboard) + - [Auto-Completion](#auto-completion) + - [LSP](#lsp) + - [Diagnostics](#diagnostics) + - [Coding](#coding) + - [Search, Substitute, Diff](#search-substitute-diff) + - [Command \& History](#command--history) + - [File Operations](#file-operations) + - [Window Management](#window-management) + - [Plugins](#plugins) + - [Plugin: Mini.Surround](#plugin-minisurround) + - [Plugin: Gitsigns](#plugin-gitsigns) + - [Plugin: Diffview](#plugin-diffview) + - [Plugin: Neo-Tree](#plugin-neo-tree) + - [Plugin: Marks](#plugin-marks) + - [Plugin: Zk](#plugin-zk) @@ -142,7 +143,7 @@ Enjoy! :smile: Use `:Mason` (or Space+cm) to install and manage LSP servers, DAP servers, linters and formatters. See `:h mason.nvim` and -[williamboman/mason.nvim] for more information. +[mason-org/mason.nvim] for more information. ### Language-Server Protocol (LSP) @@ -153,7 +154,7 @@ for the official list, and the [Language server mapping](https://github.com/will list. You can also view at `:h mason-lspconfig-server-map` You'll need utilities like `npm` and `curl` to install some extensions, see -[requirements](https://github.com/williamboman/mason.nvim#requirements) +[requirements](https://github.com/mason-org/mason.nvim#requirements) (or `:h mason-requirements`) for more information. See [lua/rafi/plugins/lsp/init.lua] for custom key-mappings and configuration @@ -442,111 +443,111 @@ _Note_ that 95% of the plugins are **lazy-loaded**. ### Completion & Code-Analysis -| Name | Description | -| -------------- | ---------------------- | -| [neovim/nvim-lspconfig] | Quickstart configurations for the Nvim LSP client | -| [williamboman/mason.nvim] | Portable package manager for Neovim | -| [williamboman/mason-lspconfig.nvim] | Mason extension for easier lspconfig integration | -| [stevearc/conform.nvim] | Lightweight yet powerful formatter plugin | -| [mfussenegger/nvim-lint] | Asynchronous linter plugin | +| Name | Description | +| ----------------------------------- | ------------------------------------------------- | +| [neovim/nvim-lspconfig] | Quickstart configurations for the Nvim LSP client | +| [mason-org/mason.nvim] | Portable package manager for Neovim | +| [williamboman/mason-lspconfig.nvim] | Mason extension for easier lspconfig integration | +| [stevearc/conform.nvim] | Lightweight yet powerful formatter plugin | +| [mfussenegger/nvim-lint] | Asynchronous linter plugin | ### Editor Plugins -| Name | Description | -| -------------- | ---------------------- | -| [folke/lazy.nvim] | Modern plugin manager for Neovim | -| [nmac427/guess-indent.nvim] | Automatic indentation style detection | -| [tweekmonster/helpful.vim] | Display vim version numbers in docs | -| [lambdalisue/suda.vim] | An alternative sudo for Vim and Neovim | -| [folke/persistence.nvim] | Simple lua plugin for automated session management | -| [mbbill/undotree] | Ultimate undo history visualizer | -| [folke/flash.nvim] | Search labels, enhanced character motions | -| [folke/todo-comments.nvim] | Highlight, list and search todo comments in your projects | -| [folke/trouble.nvim] | Pretty lists to help you solve all code diagnostics | -| [hedyhli/outline.nvim] | Code outline sidebar powered by LSP | -| [s1n7ax/nvim-window-picker] | Fancy Window picker | -| [dnlhc/glance.nvim] | Pretty window for navigating LSP locations | -| [MagicDuck/grug-far.nvim] | Search/replace in multiple files | +| Name | Description | +| --------------------------- | --------------------------------------------------------- | +| [folke/lazy.nvim] | Modern plugin manager for Neovim | +| [nmac427/guess-indent.nvim] | Automatic indentation style detection | +| [tweekmonster/helpful.vim] | Display vim version numbers in docs | +| [lambdalisue/suda.vim] | An alternative sudo for Vim and Neovim | +| [folke/persistence.nvim] | Simple lua plugin for automated session management | +| [mbbill/undotree] | Ultimate undo history visualizer | +| [folke/flash.nvim] | Search labels, enhanced character motions | +| [folke/todo-comments.nvim] | Highlight, list and search todo comments in your projects | +| [folke/trouble.nvim] | Pretty lists to help you solve all code diagnostics | +| [hedyhli/outline.nvim] | Code outline sidebar powered by LSP | +| [s1n7ax/nvim-window-picker] | Fancy Window picker | +| [dnlhc/glance.nvim] | Pretty window for navigating LSP locations | +| [MagicDuck/grug-far.nvim] | Search/replace in multiple files | ### Coding Plugins -| Name | Description | -| -------------- | ---------------------- | -| [rafamadriz/friendly-snippets] | Preconfigured snippets for different languages | -| [echasnovski/mini.pairs] | Automatically manage character pairs | -| [echasnovski/mini.surround] | Fast and feature-rich surround actions | +| Name | Description | +| --------------------------------------------- | -------------------------------------------------- | +| [rafamadriz/friendly-snippets] | Preconfigured snippets for different languages | +| [echasnovski/mini.pairs] | Automatically manage character pairs | +| [echasnovski/mini.surround] | Fast and feature-rich surround actions | | [JoosepAlviste/nvim-ts-context-commentstring] | Set the commentstring based on the cursor location | -| [numToStr/Comment.nvim] | Powerful line and block-wise commenting | -| [echasnovski/mini.splitjoin] | Split and join arguments | -| [echasnovski/mini.trailspace] | Trailing whitespace highlight and remove | -| [AndrewRadev/linediff.vim] | Perform diffs on blocks of code | -| [echasnovski/mini.ai] | Extend and create `a`/`i` textobjects | -| [folke/lazydev.nvim] | Faster LuaLS setup | -| [Bilal2453/luvit-meta] | Manage libuv types with lazy | +| [numToStr/Comment.nvim] | Powerful line and block-wise commenting | +| [nvim-mini/mini.splitjoin] | Split and join arguments | +| [nvim-mini/mini.trailspace] | Trailing whitespace highlight and remove | +| [AndrewRadev/linediff.vim] | Perform diffs on blocks of code | +| [echasnovski/mini.ai] | Extend and create `a`/`i` textobjects | +| [folke/lazydev.nvim] | Faster LuaLS setup | +| [Bilal2453/luvit-meta] | Manage libuv types with lazy | ### Colorscheme Plugins -| Name | Description | -| -------------- | ---------------------- | -| [rafi/theme-loader.nvim] | Use last-used colorscheme | -| [rafi/neo-hybrid.vim] | Modern dark colorscheme, hybrid improved | -| [rafi/awesome-colorschemes] | Awesome color-schemes | +| Name | Description | +| --------------------------- | ---------------------------------------- | +| [rafi/theme-loader.nvim] | Use last-used colorscheme | +| [rafi/neo-hybrid.vim] | Modern dark colorscheme, hybrid improved | +| [rafi/awesome-colorschemes] | Awesome color-schemes | ### Git Plugins -| Name | Description | -| -------------- | ---------------------- | -| [lewis6991/gitsigns.nvim] | Git signs written in pure lua | -| [sindrets/diffview.nvim] | Tabpage interface for cycling through diffs | -| [NeogitOrg/neogit] | Magit clone for Neovim | -| [FabijanZulj/blame.nvim] | Git blame visualizer | -| [rhysd/committia.vim] | Pleasant editing on Git commit messages | +| Name | Description | +| ------------------------- | ------------------------------------------- | +| [lewis6991/gitsigns.nvim] | Git signs written in pure lua | +| [sindrets/diffview.nvim] | Tabpage interface for cycling through diffs | +| [NeogitOrg/neogit] | Magit clone for Neovim | +| [FabijanZulj/blame.nvim] | Git blame visualizer | +| [rhysd/committia.vim] | Pleasant editing on Git commit messages | ### Misc Plugins -| Name | Description | -| -------------- | ---------------------- | -| [folke/snacks.nvim] | Collection of small QoL plugins | -| [hoob3rt/lualine.nvim] | Statusline plugin written in pure lua | -| [nvim-neo-tree/neo-tree.nvim] | File explorer written in Lua | +| Name | Description | +| ------------------------------- | ------------------------------------- | +| [folke/snacks.nvim] | Collection of small QoL plugins | +| [hoob3rt/lualine.nvim] | Statusline plugin written in pure lua | +| [nvim-neo-tree/neo-tree.nvim] | File explorer written in Lua | | [nvim-telescope/telescope.nvim] | Find, Filter, Preview, Pick. All lua. | -| [jvgrootveld/telescope-zoxide] | Telescope extension for Zoxide | -| [rafi/telescope-thesaurus.nvim] | Browse synonyms for a word | -| [nvim-lua/plenary.nvim] | Lua functions library | +| [jvgrootveld/telescope-zoxide] | Telescope extension for Zoxide | +| [rafi/telescope-thesaurus.nvim] | Browse synonyms for a word | +| [nvim-lua/plenary.nvim] | Lua functions library | ### Treesitter & Syntax -| Name | Description | -| -------------- | ---------------------- | -| [nvim-treesitter/nvim-treesitter] | Nvim Treesitter configurations and abstraction layer | -| [nvim-treesitter/nvim-treesitter-textobjects] | Textobjects using treesitter queries | -| [windwp/nvim-ts-autotag] | Use treesitter to auto close and auto rename html tag | -| [andymass/vim-matchup] | Modern matchit and matchparen | -| [iloginow/vim-stylus] | Better vim plugin for stylus | -| [mustache/vim-mustache-handlebars] | Mustache and handlebars syntax | -| [lifepillar/pgsql.vim] | PostgreSQL syntax and indent | -| [MTDL9/vim-log-highlighting] | Syntax highlighting for generic log files | -| [reasonml-editor/vim-reason-plus] | Reason syntax and indent | +| Name | Description | +| --------------------------------------------- | ----------------------------------------------------- | +| [nvim-treesitter/nvim-treesitter] | Nvim Treesitter configurations and abstraction layer | +| [nvim-treesitter/nvim-treesitter-textobjects] | Textobjects using treesitter queries | +| [windwp/nvim-ts-autotag] | Use treesitter to auto close and auto rename html tag | +| [andymass/vim-matchup] | Modern matchit and matchparen | +| [iloginow/vim-stylus] | Better vim plugin for stylus | +| [mustache/vim-mustache-handlebars] | Mustache and handlebars syntax | +| [lifepillar/pgsql.vim] | PostgreSQL syntax and indent | +| [MTDL9/vim-log-highlighting] | Syntax highlighting for generic log files | +| [reasonml-editor/vim-reason-plus] | Reason syntax and indent | ### UI Plugins -| Name | Description | -| -------------- | ---------------------- | -| [echasnovski/mini.icons] | Icon provider | -| [MunifTanjim/nui.nvim] | UI Component Library | -| [stevearc/dressing.nvim] | Improve the default vim-ui interfaces | -| [akinsho/bufferline.nvim] | Snazzy tab/bufferline | -| [folke/noice.nvim] | Replaces the UI for messages, cmdline and the popupmenu | -| [SmiteshP/nvim-navic] | Shows your current code context in winbar/statusline | -| [chentau/marks.nvim] | Interacting with and manipulating marks | -| [lukas-reineke/indent-blankline.nvim] | Visually display indent levels | -| [echasnovski/mini.indentscope] | Visualize and operate on indent scope | -| [folke/which-key.nvim] | Create key bindings that stick | -| [tenxsoydev/tabs-vs-spaces.nvim] | Hint and fix deviating indentation | -| [t9md/vim-quickhl] | Highlight words quickly | +| Name | Description | +| ------------------------------------- | ------------------------------------------------------- | +| [echasnovski/mini.icons] | Icon provider | +| [MunifTanjim/nui.nvim] | UI Component Library | +| [stevearc/dressing.nvim] | Improve the default vim-ui interfaces | +| [akinsho/bufferline.nvim] | Snazzy tab/bufferline | +| [folke/noice.nvim] | Replaces the UI for messages, cmdline and the popupmenu | +| [SmiteshP/nvim-navic] | Shows your current code context in winbar/statusline | +| [chentau/marks.nvim] | Interacting with and manipulating marks | +| [lukas-reineke/indent-blankline.nvim] | Visually display indent levels | +| [echasnovski/mini.indentscope] | Visualize and operate on indent scope | +| [folke/which-key.nvim] | Create key bindings that stick | +| [tenxsoydev/tabs-vs-spaces.nvim] | Hint and fix deviating indentation | +| [t9md/vim-quickhl] | Highlight words quickly | [neovim/nvim-lspconfig]: https://github.com/neovim/nvim-lspconfig -[williamboman/mason.nvim]: https://github.com/williamboman/mason.nvim +[mason-org/mason.nvim]: https://github.com/mason-org/mason.nvim [williamboman/mason-lspconfig.nvim]: https://github.com/williamboman/mason-lspconfig.nvim [stevearc/conform.nvim]: https://github.com/stevearc/conform.nvim [mfussenegger/nvim-lint]: https://github.com/mfussenegger/nvim-lint @@ -569,8 +570,8 @@ _Note_ that 95% of the plugins are **lazy-loaded**. [echasnovski/mini.surround]: https://github.com/echasnovski/mini.surround [JoosepAlviste/nvim-ts-context-commentstring]: https://github.com/JoosepAlviste/nvim-ts-context-commentstring [numToStr/Comment.nvim]: https://github.com/numToStr/Comment.nvim -[echasnovski/mini.splitjoin]: https://github.com/echasnovski/mini.splitjoin -[echasnovski/mini.trailspace]: https://github.com/echasnovski/mini.trailspace +[nvim-mini/mini.splitjoin]: https://github.com/nvim-mini/mini.splitjoin +[nvim-mini/mini.trailspace]: https://github.com/nvim-mini/mini.trailspace [AndrewRadev/linediff.vim]: https://github.com/AndrewRadev/linediff.vim [echasnovski/mini.ai]: https://github.com/echasnovski/mini.ai [folke/lazydev.nvim]: https://github.com/folke/lazydev.nvim @@ -636,17 +637,17 @@ Following are extra-extras available with Rafi's Neovim on-top of LazyVim's: Spec: `rafi.plugins.extras.coding.` -| Name | Repository | Description | -| -------------- | -------------- | ---------------------- | -| `align` | [echasnovski/mini.align] | Align text interactively | -| `chainsaw` | [chrisgrieser/nvim-chainsaw] | Create log statements on the fly | -| `debugprint.lua` | [andrewferrier/debugprint.nvim] | Easily add debug print lines | -| `editorconfig` | [sgur/vim-editorconfig] | EditorConfig plugin written entirely in Vimscript | -| `emmet` | [mattn/emmet-vim] | Provides support for expanding abbreviations alá emmet | -| `nvim-cmp` | [hrsh7th/nvim-cmp] | Completion plugin | -| `sandwich` | [machakann/vim-sandwich] | Search, select, and edit sandwich text objects | - -[echasnovski/mini.align]: https://github.com/echasnovski/mini.align +| Name | Repository | Description | +| ---------------- | ------------------------------- | ------------------------------------------------------ | +| `align` | [nvim-mini/mini.align] | Align text interactively | +| `chainsaw` | [chrisgrieser/nvim-chainsaw] | Create log statements on the fly | +| `debugprint.lua` | [andrewferrier/debugprint.nvim] | Easily add debug print lines | +| `editorconfig` | [sgur/vim-editorconfig] | EditorConfig plugin written entirely in Vimscript | +| `emmet` | [mattn/emmet-vim] | Provides support for expanding abbreviations alá emmet | +| `nvim-cmp` | [hrsh7th/nvim-cmp] | Completion plugin | +| `sandwich` | [machakann/vim-sandwich] | Search, select, and edit sandwich text objects | + +[nvim-mini/mini.align]: https://github.com/nvim-mini/mini.align [chrisgrieser/nvim-chainsaw]: https://github.com/chrisgrieser/nvim-chainsaw [andrewferrier/debugprint.nvim]: https://github.com/andrewferrier/debugprint.nvim [sgur/vim-editorconfig]: https://github.com/sgur/vim-editorconfig @@ -658,13 +659,13 @@ Spec: `rafi.plugins.extras.coding.` Spec: `rafi.plugins.extras.colorscheme.` -| Name | Repository | Description | -| -------------- | -------------- | ---------------------- | -| `bamboo` | [ribru17/bamboo.nvim] | Warm green theme | -| `cyberdream` | [scottmckendry/cyberdream.nvim] | High-contrast, futuristic & vibrant theme | -| `github` | [projekt0n/github-nvim-theme] | GitHub's theme | -| `kanagawa` | [rebelot/kanagawa.nvim] | Inspired by the colors of the famous painting by Katsushika Hokusai | -| `monokai-pro` | [loctvl842/monokai-pro.nvim] | Monokai Pro theme with multiple filters | +| Name | Repository | Description | +| ------------- | ------------------------------- | ------------------------------------------------------------------- | +| `bamboo` | [ribru17/bamboo.nvim] | Warm green theme | +| `cyberdream` | [scottmckendry/cyberdream.nvim] | High-contrast, futuristic & vibrant theme | +| `github` | [projekt0n/github-nvim-theme] | GitHub's theme | +| `kanagawa` | [rebelot/kanagawa.nvim] | Inspired by the colors of the famous painting by Katsushika Hokusai | +| `monokai-pro` | [loctvl842/monokai-pro.nvim] | Monokai Pro theme with multiple filters | [ribru17/bamboo.nvim]: https://github.com/ribru17/bamboo.nvim [scottmckendry/cyberdream.nvim]: https://github.com/scottmckendry/cyberdream.nvim @@ -676,21 +677,21 @@ Spec: `rafi.plugins.extras.colorscheme.` Spec: `rafi.plugins.extras.editor.` -| Name | Repository | Description | -| --------------| -------------- | ---------------------- | -| `anyjump` | [pechorin/any-jump.vim] | Jump to any definition and references without overhead | -| `flybuf` | [glepnir/flybuf.nvim] | List buffers in a float window | -| `harpoon2` | [ThePrimeagen/harpoon] | Marks for navigating your project | -| `mini-visits` | [echasnovski/mini.visits] | Track and reuse file system visits | -| `rest` | [rest-nvim/rest.nvim] | Fast Neovim http client written in Lua | -| `sidebar` | [sidebar-nvim/sidebar.nvim] | Generic and modular lua sidebar | -| `spectre` | [nvim-pack/nvim-spectre] | Find and replace | -| `ufo` | [kevinhwang91/nvim-ufo] | Make folds look modern and keep a high performance | +| Name | Repository | Description | +| ------------- | --------------------------- | ------------------------------------------------------ | +| `anyjump` | [pechorin/any-jump.vim] | Jump to any definition and references without overhead | +| `flybuf` | [glepnir/flybuf.nvim] | List buffers in a float window | +| `harpoon2` | [ThePrimeagen/harpoon] | Marks for navigating your project | +| `mini-visits` | [nvim-mini/mini.visits] | Track and reuse file system visits | +| `rest` | [rest-nvim/rest.nvim] | Fast Neovim http client written in Lua | +| `sidebar` | [sidebar-nvim/sidebar.nvim] | Generic and modular lua sidebar | +| `spectre` | [nvim-pack/nvim-spectre] | Find and replace | +| `ufo` | [kevinhwang91/nvim-ufo] | Make folds look modern and keep a high performance | [pechorin/any-jump.vim]: https://github.com/pechorin/any-jump.vim [glepnir/flybuf.nvim]: https://github.com/glepnir/flybuf.nvim [ThePrimeagen/harpoon]: https://github.com/ThePrimeagen/harpoon -[echasnovski/mini.visits]: https://github.com/echasnovski/mini.visits +[nvim-mini/mini.visits]: https://github.com/nvim-mini/mini.visits [rest-nvim/rest.nvim]: https://github.com/rest-nvim/rest.nvim [sidebar-nvim/sidebar.nvim]: https://github.com/sidebar-nvim/sidebar.nvim [nvim-pack/nvim-spectre]: https://github.com/nvim-pack/nvim-spectre @@ -700,10 +701,10 @@ Spec: `rafi.plugins.extras.editor.` Spec: `rafi.plugins.extras.git.` -| Name | Repository | Description | -| -------------| -------------- | ---------------------- | -| `cmp-git` | [petertriho/cmp-git] | Git source for nvim-cmp | -| `fugitive` | [tpope/vim-fugitive] | Git client, including [junegunn/gv.vim] | +| Name | Repository | Description | +| ---------- | -------------------- | --------------------------------------- | +| `cmp-git` | [petertriho/cmp-git] | Git source for nvim-cmp | +| `fugitive` | [tpope/vim-fugitive] | Git client, including [junegunn/gv.vim] | [petertriho/cmp-git]: https://github.com/petertriho/cmp-git [tpope/vim-fugitive]: https://github.com/tpope/vim-fugitive @@ -713,15 +714,15 @@ Spec: `rafi.plugins.extras.git.` Spec: `rafi.plugins.extras.lang.` -| Name | Description | -| ---------------- | ---------------------- | -| `ansible` | imports `lazyvim.plugins.extras.lang.ansible`, add syntax and [pearofducks/ansible-vim] | -| `go` | imports `lazyvim.plugins.extras.lang.go`, add tools, patterns, etc. | -| `helm` | imports `lazyvim.plugins.extras.lang.helm`, add filetype patterns | -| `kubernetes` | imports `lazyvim.plugins.extras.lang.yaml`, add filetype patterns and [ramilito/kubectl.nvim] | -| `markdown` | imports `lazyvim.plugins.extras.lang.markdown`, disable headlines, add [mzlogin/vim-markdown-toc] | -| `python` | imports `lazyvim.plugins.extras.lang.python`, add syntax and filetype patterns | -| `tmux` | syntax, completion [andersevenrud/cmp-tmux], keymaps [christoomey/tmux-navigator] | +| Name | Description | +| ------------ | ------------------------------------------------------------------------------------------------- | +| `ansible` | imports `lazyvim.plugins.extras.lang.ansible`, add syntax and [pearofducks/ansible-vim] | +| `go` | imports `lazyvim.plugins.extras.lang.go`, add tools, patterns, etc. | +| `helm` | imports `lazyvim.plugins.extras.lang.helm`, add filetype patterns | +| `kubernetes` | imports `lazyvim.plugins.extras.lang.yaml`, add filetype patterns and [ramilito/kubectl.nvim] | +| `markdown` | imports `lazyvim.plugins.extras.lang.markdown`, disable headlines, add [mzlogin/vim-markdown-toc] | +| `python` | imports `lazyvim.plugins.extras.lang.python`, add syntax and filetype patterns | +| `tmux` | syntax, completion [andersevenrud/cmp-tmux], keymaps [christoomey/tmux-navigator] | [pearofducks/ansible-vim]: https://github.com/pearofducks/ansible-vim [ramilito/kubectl.nvim]: https://github.com/ramilito/kubectl.nvim @@ -733,11 +734,11 @@ Spec: `rafi.plugins.extras.lang.` Spec: `rafi.plugins.extras.lsp.` -| Key | Name | Description | -| ---------------- | -------------- | ---------------------- | -| `gtd` | [hrsh7th/nvim-gtd] | LSP's go-to definition plugin | -| `lightbulb` | [kosayoda/nvim-lightbulb] | VSCode 💡 for neovim's built-in LSP | -| `yaml-companion` | [yaml-companion.nvim] | Get, set and autodetect YAML schemas in your buffers | +| Key | Name | Description | +| ---------------- | ------------------------- | ---------------------------------------------------- | +| `gtd` | [hrsh7th/nvim-gtd] | LSP's go-to definition plugin | +| `lightbulb` | [kosayoda/nvim-lightbulb] | VSCode 💡 for neovim's built-in LSP | +| `yaml-companion` | [yaml-companion.nvim] | Get, set and autodetect YAML schemas in your buffers | [hrsh7th/nvim-gtd]: https://github.com/hrsh7th/nvim-gtd [kosayoda/nvim-lightbulb]: https://github.com/kosayoda/nvim-lightbulb @@ -747,13 +748,13 @@ Spec: `rafi.plugins.extras.lsp.` Spec: `rafi.plugins.extras.org.` -| Key | Name | Description | -| -------------- | -------------- | ---------------------- | -| `calendar` | [itchyny/calendar.vim] | Calendar application | -| `kiwi` | [serenevoid/kiwi.nvim] | Stripped down VimWiki | -| `telekasten` | [renerocksai/telekasten.nvim] | Manage text-based, markdown zettelkasten or wiki with telescope | -| `vimwiki` | [vimwiki/vimwiki] | Personal Wiki for Vim | -| `zk-nvim` | [zk-org/zk-nvim] | Extension for the zk plain text note-taking assistant | +| Key | Name | Description | +| ------------ | ----------------------------- | --------------------------------------------------------------- | +| `calendar` | [itchyny/calendar.vim] | Calendar application | +| `kiwi` | [serenevoid/kiwi.nvim] | Stripped down VimWiki | +| `telekasten` | [renerocksai/telekasten.nvim] | Manage text-based, markdown zettelkasten or wiki with telescope | +| `vimwiki` | [vimwiki/vimwiki] | Personal Wiki for Vim | +| `zk-nvim` | [zk-org/zk-nvim] | Extension for the zk plain text note-taking assistant | [itchyny/calendar.vim]: https://github.com/itchyny/calendar.vim [serenevoid/kiwi.nvim]: https://github.com/serenevoid/kiwi.nvim @@ -765,10 +766,10 @@ Spec: `rafi.plugins.extras.org.` Spec: `rafi.plugins.extras.treesitter.` -| Key | Name | Description | -| -------------- | ---------------------------- | ---------------------- | -| `endwise` | [RRethy/nvim-treesitter-endwise] | Wisely add "end" in various filetypes | -| `treesj` | [Wansmer/treesj] | Splitting and joining blocks of code | +| Key | Name | Description | +| --------- | -------------------------------- | ------------------------------------- | +| `endwise` | [RRethy/nvim-treesitter-endwise] | Wisely add "end" in various filetypes | +| `treesj` | [Wansmer/treesj] | Splitting and joining blocks of code | [RRethy/nvim-treesitter-endwise]: https://github.com/RRethy/nvim-treesitter-endwise [Wansmer/treesj]: https://github.com/Wansmer/treesj @@ -777,25 +778,25 @@ Spec: `rafi.plugins.extras.treesitter.` Spec: `rafi.plugins.extras.ui.` -| Key | Name | Description | -| ----------------- | -------------- | ---------------------- | -| `alpha` | [goolord/alpha-nvim] | Fast and fully programmable greeter | -| `barbecue` | [utilyre/barbecue.nvim] | VS Code like winbar | -| `bookmarks` | [tomasky/bookmarks.nvim] | Bookmarks plugin with global file store | -| `bqf` | [kevinhwang91/nvim-bqf] | Better quickfix window | -| `ccc` | [uga-rosa/ccc.nvim] | Super powerful color picker/colorizer plugin | -| `cursorword` | [itchyny/cursorword] | Underlines word under cursor | -| `cybu` | [ghillb/cybu.nvim] | Cycle buffers with a customizable notification window | -| `deadcolumn` | [Bekaboo/deadcolumn.nvim] | Show colorcolumn dynamically | -| `goto-preview` | [rmagatti/goto-preview] | Preview definitions using floating windows | -| `headlines` | [lukas-reineke/headlines.nvim] | Adds horizontal highlights for headlines and code background. | -| `illuminate` | [RRethy/vim-illuminate] | Highlights other uses of the word under the cursor | -| `incline` | [b0o/incline.nvim] | Floating statuslines | -| `marks` | [chentoast/marks.nvim] | Interacting with and manipulating marks | -| `mini-clue` | [echasnovski/mini.clue] | Show next key clues | -| `mini-map` | [echasnovski/mini.map] | Window with buffer text overview, scrollbar and highlights | -| `quicker` | [stevearc/quicker.nvim] | Improved quickfix UI and workflow | -| `symbols-outline` | [simrat39/symbols-outline.nvim] | Tree like view for symbols using LSP | +| Key | Name | Description | +| ----------------- | ------------------------------- | ------------------------------------------------------------- | +| `alpha` | [goolord/alpha-nvim] | Fast and fully programmable greeter | +| `barbecue` | [utilyre/barbecue.nvim] | VS Code like winbar | +| `bookmarks` | [tomasky/bookmarks.nvim] | Bookmarks plugin with global file store | +| `bqf` | [kevinhwang91/nvim-bqf] | Better quickfix window | +| `ccc` | [uga-rosa/ccc.nvim] | Super powerful color picker/colorizer plugin | +| `cursorword` | [itchyny/cursorword] | Underlines word under cursor | +| `cybu` | [ghillb/cybu.nvim] | Cycle buffers with a customizable notification window | +| `deadcolumn` | [Bekaboo/deadcolumn.nvim] | Show colorcolumn dynamically | +| `goto-preview` | [rmagatti/goto-preview] | Preview definitions using floating windows | +| `headlines` | [lukas-reineke/headlines.nvim] | Adds horizontal highlights for headlines and code background. | +| `illuminate` | [RRethy/vim-illuminate] | Highlights other uses of the word under the cursor | +| `incline` | [b0o/incline.nvim] | Floating statuslines | +| `marks` | [chentoast/marks.nvim] | Interacting with and manipulating marks | +| `mini-clue` | [nvim-mini/mini.clue] | Show next key clues | +| `mini-map` | [nvim-mini/mini.map] | Window with buffer text overview, scrollbar and highlights | +| `quicker` | [stevearc/quicker.nvim] | Improved quickfix UI and workflow | +| `symbols-outline` | [simrat39/symbols-outline.nvim] | Tree like view for symbols using LSP | [goolord/alpha-nvim]: https://github.com/goolord/alpha-nvim [utilyre/barbecue.nvim]: https://github.com/utilyre/barbecue.nvim @@ -810,8 +811,8 @@ Spec: `rafi.plugins.extras.ui.` [RRethy/vim-illuminate]: https://github.com/RRethy/vim-illuminate [b0o/incline.nvim]: https://github.com/b0o/incline.nvim [chentoast/marks.nvim]: https://github.com/chentoast/marks.nvim -[echasnovski/mini.clue]: https://github.com/echasnovski/mini.clue -[echasnovski/mini.map]: https://github.com/echasnovski/mini.map +[nvim-mini/mini.clue]: https://github.com/nvim-mini/mini.clue +[nvim-mini/mini.map]: https://github.com/nvim-mini/mini.map [stevearc/quicker.nvim]: https://github.com/stevearc/quicker.nvim [simrat39/symbols-outline.nvim]: https://github.com/simrat39/symbols-outline.nvim @@ -862,515 +863,515 @@ Legend: | Ⓝormal | Ⓥisual | Ⓢelect | Ⓘnsert | Ⓞperator | Ⓒommand | (Telescope/Snacks/FZF) -| Key | Mode | Action | -| ----- |:----:| ------------------ | -| Space ; | Ⓝ | Select picker | -| ;r | Ⓝ | Resume previous picker | -| ;p | Ⓝ | Projects | -| ;f | Ⓝ | File | -| ;F | Ⓝ | File (cwd) | -| ;g | Ⓝ | Grep search | -| ;G | Ⓝ | Grep search (cwd) | -| ;b | Ⓝ | Switch buffers | -| ;h | Ⓝ | Help pages | -| ;H | Ⓝ | Highlights | -| ;j | Ⓝ | Jumplist | -| ;m | Ⓝ | Jump to mark | -| ;M | Ⓝ | Man pages | -| ;o | Ⓝ | Options | -| ;t | Ⓝ | Goto symbol | -| ;T | Ⓝ | Goto symbol (workspace) | -| ;v | Ⓝ Ⓥ | Registers | -| ;s | Ⓝ | Sessions | -| ;u | Ⓝ | Spelling suggestions | -| ;x | Ⓝ | Recent | -| ;X | Ⓝ | Recent (cwd) | -| ;z | Ⓝ | Zoxide directories | -| ;; | Ⓝ | Command history | -| ;: | Ⓝ | Commands | -| ;/ | Ⓝ | Search history | -| ;dd | Ⓝ | LSP definitions | -| ;di | Ⓝ | LSP implementations | -| ;dr | Ⓝ | LSP references | -| ;da | Ⓝ Ⓥ | LSP code actions | -| Space / | Ⓝ | Buffer fuzzy find | -| Space gs | Ⓝ | Git status | -| Space gr | Ⓝ | Git branches | -| Space gh | Ⓝ | Git stashes | -| Space gF | Ⓝ | Find files matching word under cursor | -| Space gg | Ⓝ Ⓥ | Grep word/selection | -| Space gG | Ⓝ Ⓥ | Grep word/selection (cwd) | -| Space sc | Ⓝ | Colorschemes | -| Space sd | Ⓝ | Document diagnostics | -| Space sD | Ⓝ | Workspace diagnostics | -| Space sh | Ⓝ | Help tags | -| Space sk | Ⓝ | Key-maps | -| Space sm | Ⓝ | Man pages | -| Space ss | Ⓝ | LSP document symbols | -| Space sS | Ⓝ | LSP workspace symbols | -| Space st | Ⓝ | Todo list | -| Space sT | Ⓝ | Todo/Fix/Fixme list | -| Space sw | Ⓝ | Grep string | -| | |   | -| ;i | Ⓝ | (Snacks only) Icons | -| ;w | Ⓝ | (Telescope only) Notes | -| ;n | Ⓝ | (Telescope only) Plugin directories | -| ;k | Ⓝ | (Telescope only) Thesaurus | -| | |   | -| **Within _Picker_ window** | |   | -| ? | Ⓝ | Keymaps help screen | -| Ctrl+Space | Ⓝ | Move from none fuzzy search to fuzzy | -| jj or Escape | Ⓘ | Leave Insert mode | -| i | Ⓝ | Enter Insert mode (filter input) | -| q or Escape | Ⓝ | Exit | -| Tab or Shift+Tab | Ⓝ Ⓘ | Next/previous candidate | -| Ctrl+d/u | Ⓝ Ⓘ | Scroll down/upwards | -| Ctrl+f/b | Ⓝ Ⓘ | Scroll preview down/upwards | -| Ctrl+j/k | Ⓝ Ⓘ | Scroll preview vertically | -| Ctrl+h/l | Ⓝ Ⓘ | Scroll preview horizontally | -| J or K | Ⓝ | Select candidates up/downwards | -| st | Ⓝ | Open in a new tab | -| sg | Ⓝ | Open in a vertical split | -| sv | Ⓝ | Open in a split | -| * | Ⓝ | Toggle selection | -| u | Ⓝ | Drop all | -| w | Ⓝ | Smart send to quickfix list | -| e | Ⓝ | Send to quickfix list | -| Ctrl+q | Ⓘ | Send to quickfix list | -| dd | Ⓝ | Delete entry (buffer list) | -| ! | Ⓝ | Edit in command line | +| Key | Mode | Action | +| ------------------------------------------------- | :---: | ------------------------------------- | +| Space ; | Ⓝ | Select picker | +| ;r | Ⓝ | Resume previous picker | +| ;p | Ⓝ | Projects | +| ;f | Ⓝ | File | +| ;F | Ⓝ | File (cwd) | +| ;g | Ⓝ | Grep search | +| ;G | Ⓝ | Grep search (cwd) | +| ;b | Ⓝ | Switch buffers | +| ;h | Ⓝ | Help pages | +| ;H | Ⓝ | Highlights | +| ;j | Ⓝ | Jumplist | +| ;m | Ⓝ | Jump to mark | +| ;M | Ⓝ | Man pages | +| ;o | Ⓝ | Options | +| ;t | Ⓝ | Goto symbol | +| ;T | Ⓝ | Goto symbol (workspace) | +| ;v | Ⓝ Ⓥ | Registers | +| ;s | Ⓝ | Sessions | +| ;u | Ⓝ | Spelling suggestions | +| ;x | Ⓝ | Recent | +| ;X | Ⓝ | Recent (cwd) | +| ;z | Ⓝ | Zoxide directories | +| ;; | Ⓝ | Command history | +| ;: | Ⓝ | Commands | +| ;/ | Ⓝ | Search history | +| ;dd | Ⓝ | LSP definitions | +| ;di | Ⓝ | LSP implementations | +| ;dr | Ⓝ | LSP references | +| ;da | Ⓝ Ⓥ | LSP code actions | +| Space / | Ⓝ | Buffer fuzzy find | +| Space gs | Ⓝ | Git status | +| Space gr | Ⓝ | Git branches | +| Space gh | Ⓝ | Git stashes | +| Space gF | Ⓝ | Find files matching word under cursor | +| Space gg | Ⓝ Ⓥ | Grep word/selection | +| Space gG | Ⓝ Ⓥ | Grep word/selection (cwd) | +| Space sc | Ⓝ | Colorschemes | +| Space sd | Ⓝ | Document diagnostics | +| Space sD | Ⓝ | Workspace diagnostics | +| Space sh | Ⓝ | Help tags | +| Space sk | Ⓝ | Key-maps | +| Space sm | Ⓝ | Man pages | +| Space ss | Ⓝ | LSP document symbols | +| Space sS | Ⓝ | LSP workspace symbols | +| Space st | Ⓝ | Todo list | +| Space sT | Ⓝ | Todo/Fix/Fixme list | +| Space sw | Ⓝ | Grep string | +| | |   | +| ;i | Ⓝ | (Snacks only) Icons | +| ;w | Ⓝ | (Telescope only) Notes | +| ;n | Ⓝ | (Telescope only) Plugin directories | +| ;k | Ⓝ | (Telescope only) Thesaurus | +| | |   | +| **Within _Picker_ window** | |   | +| ? | Ⓝ | Keymaps help screen | +| Ctrl+Space | Ⓝ | Move from none fuzzy search to fuzzy | +| jj or Escape | Ⓘ | Leave Insert mode | +| i | Ⓝ | Enter Insert mode (filter input) | +| q or Escape | Ⓝ | Exit | +| Tab or Shift+Tab | Ⓝ Ⓘ | Next/previous candidate | +| Ctrl+d/u | Ⓝ Ⓘ | Scroll down/upwards | +| Ctrl+f/b | Ⓝ Ⓘ | Scroll preview down/upwards | +| Ctrl+j/k | Ⓝ Ⓘ | Scroll preview vertically | +| Ctrl+h/l | Ⓝ Ⓘ | Scroll preview horizontally | +| J or K | Ⓝ | Select candidates up/downwards | +| st | Ⓝ | Open in a new tab | +| sg | Ⓝ | Open in a vertical split | +| sv | Ⓝ | Open in a split | +| * | Ⓝ | Toggle selection | +| u | Ⓝ | Drop all | +| w | Ⓝ | Smart send to quickfix list | +| e | Ⓝ | Send to quickfix list | +| Ctrl+q | Ⓘ | Send to quickfix list | +| dd | Ⓝ | Delete entry (buffer list) | +| ! | Ⓝ | Edit in command line | ### Toggle Features -| Key | Mode | Action | -| ----- |:----:| ------------------ | -| Space dph | Ⓝ | Toggle profiler highlights | -| Space dpp | Ⓝ | Toggle profiler | -| Space ua | Ⓝ | Toggle animation | -| Space uA | Ⓝ | Toggle tabline | -| Space ub | Ⓝ | Toggle background dark/light | -| Space uc | Ⓝ | Toggle conceal level | -| Space uC | Ⓝ | Colorschemes | -| Space ud | Ⓝ | Toggle buffer diagnostics | -| Space uD | Ⓝ | Toggle text dim | -| Space uf | Ⓝ | Toggle format on Save | -| Space uF | Ⓝ | Toggle format on Save (Global) | -| Space ug | Ⓝ | Toggle indentation lines | -| Space uG | Ⓝ | Toggle git signs | -| Space uh | Ⓝ | Toggle inlay-hints | -| Space ui | Ⓝ | Inspect position | -| Space uI | Ⓝ | Inspect tree | -| Space ul | Ⓝ | Toggle line numbers | -| Space uL | Ⓝ | Toggle relative line numbers | -| Space um | Ⓝ | Toggle markdown render | -| Space un | Ⓝ | Dismiss all notifications | -| Space up | Ⓝ | Disable auto-pairs | -| Space ur | Ⓝ | Redraw, clear hlsearch, and diff update | -| Space us | Ⓝ | Toggle spell-checker | -| Space uS | Ⓝ | Toggle smooth scroll | -| Space uT | Ⓝ | Toggle tree-sitter | -| Space uw | Ⓝ | Toggle wrap | -| Space uz | Ⓝ | Toggle distraction-free zen writing | -| Space uZ | Ⓝ | Toggle window zoom | +| Key | Mode | Action | +| ------------------------------- | :---: | --------------------------------------- | +| Space dph | Ⓝ | Toggle profiler highlights | +| Space dpp | Ⓝ | Toggle profiler | +| Space ua | Ⓝ | Toggle animation | +| Space uA | Ⓝ | Toggle tabline | +| Space ub | Ⓝ | Toggle background dark/light | +| Space uc | Ⓝ | Toggle conceal level | +| Space uC | Ⓝ | Colorschemes | +| Space ud | Ⓝ | Toggle buffer diagnostics | +| Space uD | Ⓝ | Toggle text dim | +| Space uf | Ⓝ | Toggle format on Save | +| Space uF | Ⓝ | Toggle format on Save (Global) | +| Space ug | Ⓝ | Toggle indentation lines | +| Space uG | Ⓝ | Toggle git signs | +| Space uh | Ⓝ | Toggle inlay-hints | +| Space ui | Ⓝ | Inspect position | +| Space uI | Ⓝ | Inspect tree | +| Space ul | Ⓝ | Toggle line numbers | +| Space uL | Ⓝ | Toggle relative line numbers | +| Space um | Ⓝ | Toggle markdown render | +| Space un | Ⓝ | Dismiss all notifications | +| Space up | Ⓝ | Disable auto-pairs | +| Space ur | Ⓝ | Redraw, clear hlsearch, and diff update | +| Space us | Ⓝ | Toggle spell-checker | +| Space uS | Ⓝ | Toggle smooth scroll | +| Space uT | Ⓝ | Toggle tree-sitter | +| Space uw | Ⓝ | Toggle wrap | +| Space uz | Ⓝ | Toggle distraction-free zen writing | +| Space uZ | Ⓝ | Toggle window zoom | ### Navigation -| Key | Mode | Action | Plugin or Mapping | -| ----- |:----:| ------------------ | ------ | -| j / k | Ⓝ Ⓥ | Cursor moves through display-lines | `g` `j/k` | -| ]i / [i | Ⓝ Ⓥ | Jump to scope edges | [folke/snacks.nvim] | -| gh / gl | Ⓝ Ⓥ | Easier line-wise movement | `g^` `g$` | -| zl / zh | Ⓝ | Scroll horizontally and vertically wider | `z4` `l/h` | -| Ctrl+j | Ⓝ | Move to split below | `j` or [christoomey/tmux-navigator] | -| Ctrl+k | Ⓝ | Move to upper split | `k` or [christoomey/tmux-navigator] | -| Ctrl+h | Ⓝ | Move to left split | `h` or [christoomey/tmux-navigator] | -| Ctrl+l | Ⓝ | Move to right split | `l` or [christoomey/tmux-navigator] | -| Return | Ⓝ | Toggle fold under cursor | `za` | -| Shift+Return | Ⓝ | Focus the current fold by closing all others | `zMzv` | -| Ctrl+f | Ⓒ | Move cursor forwards in command | Right | -| Ctrl+b | Ⓒ | Move cursor backwards in command | Left | -| Ctrl+h | Ⓒ | Move cursor to the beginning in command | Home | -| Ctrl+l | Ⓒ | Move cursor to the end in command | End | -| Ctrl+Tab | Ⓝ | Go to next tab | `:tabnext` | -| Ctrl+ShiftTab | Ⓝ | Go to previous tab | `:tabprevious` | -| Alt+j or ] | Ⓝ | Go to next tab | `:tabnext` | -| Alt+k or [ | Ⓝ | Go to previous tab | `:tabprevious` | -| Alt+{ | Ⓝ | Move tab backward | `:-tabmove` | -| Alt+} | Ⓝ | Move tab forward | `:+tabmove` | +| Key | Mode | Action | Plugin or Mapping | +| ---------------------------------------------- | :---: | -------------------------------------------- | ------------------------------------------------------- | +| j / k | Ⓝ Ⓥ | Cursor moves through display-lines | `g` `j/k` | +| ]i / [i | Ⓝ Ⓥ | Jump to scope edges | [folke/snacks.nvim] | +| gh / gl | Ⓝ Ⓥ | Easier line-wise movement | `g^` `g$` | +| zl / zh | Ⓝ | Scroll horizontally and vertically wider | `z4` `l/h` | +| Ctrl+j | Ⓝ | Move to split below | `j` or [christoomey/tmux-navigator] | +| Ctrl+k | Ⓝ | Move to upper split | `k` or [christoomey/tmux-navigator] | +| Ctrl+h | Ⓝ | Move to left split | `h` or [christoomey/tmux-navigator] | +| Ctrl+l | Ⓝ | Move to right split | `l` or [christoomey/tmux-navigator] | +| Return | Ⓝ | Toggle fold under cursor | `za` | +| Shift+Return | Ⓝ | Focus the current fold by closing all others | `zMzv` | +| Ctrl+f | Ⓒ | Move cursor forwards in command | Right | +| Ctrl+b | Ⓒ | Move cursor backwards in command | Left | +| Ctrl+h | Ⓒ | Move cursor to the beginning in command | Home | +| Ctrl+l | Ⓒ | Move cursor to the end in command | End | +| Ctrl+Tab | Ⓝ | Go to next tab | `:tabnext` | +| Ctrl+ShiftTab | Ⓝ | Go to previous tab | `:tabprevious` | +| Alt+j or ] | Ⓝ | Go to next tab | `:tabnext` | +| Alt+k or [ | Ⓝ | Go to previous tab | `:tabprevious` | +| Alt+{ | Ⓝ | Move tab backward | `:-tabmove` | +| Alt+} | Ⓝ | Move tab forward | `:+tabmove` | ### Selection -| Key | Mode | Action | Plugin or Mapping | -| ----- |:----:| ------------------ | ------ | -| Space+Space | Ⓝ Ⓥ | Toggle visual-line mode | `V` / Escape | -| Ctrl+Space / V | Ⓥ | Increment/shrink selection | [nvim-treesitter] | -| vsp | Ⓝ | Select last paste | [config/keymaps.lua] | -| sg | Ⓥ | Replace within selected area | [config/keymaps.lua] | -| Ctrl+r | Ⓥ | Replace selection with step-by-step confirmation | [config/keymaps.lua] | -| > / < | Ⓥ | Indent and re-select | [config/keymaps.lua] | -| Tab / Shift+Tab | Ⓥ | Indent and re-select | [config/keymaps.lua] | -| I / gI / A | Ⓥ | Force blockwise operation | [config/keymaps.lua] | +| Key | Mode | Action | Plugin or Mapping | +| ------------------------------------------------ | :---: | ------------------------------------------------ | -------------------------------------- | +| Space+Space | Ⓝ Ⓥ | Toggle visual-line mode | `V` / Escape | +| Ctrl+Space / V | Ⓥ | Increment/shrink selection | [nvim-treesitter] | +| vsp | Ⓝ | Select last paste | [config/keymaps.lua] | +| sg | Ⓥ | Replace within selected area | [config/keymaps.lua] | +| Ctrl+r | Ⓥ | Replace selection with step-by-step confirmation | [config/keymaps.lua] | +| > / < | Ⓥ | Indent and re-select | [config/keymaps.lua] | +| Tab / Shift+Tab | Ⓥ | Indent and re-select | [config/keymaps.lua] | +| I / gI / A | Ⓥ | Force blockwise operation | [config/keymaps.lua] | ### Jump To -| Key | Mode | Action | Plugin or Mapping | -| ----- |:----:| ------------------ | ------ | -| ], or [, | Ⓝ | Next/previous parameter | [akinsho/bufferline.nvim] | -| ]q or [q | Ⓝ | Next/previous on quick-fix | `:cnext` / `:cprev` | -| ]a or [a | Ⓝ | Next/previous on location-list | `:lnext` / `:lprev` | -| ]d or [d | Ⓝ | Next/previous diagnostics | [config/keymaps.lua] | -| ]e or [e | Ⓝ | Next/previous error | [config/keymaps.lua] | -| ]w or [w | Ⓝ | Next/previous warning | [config/keymaps.lua] | -| ]b or [b | Ⓝ | Next/previous buffer | [akinsho/bufferline.nvim] | -| ]f or [f | Ⓝ | Next/previous function start | [echasnovski/mini.ai] | -| ]F or [F | Ⓝ | Next/previous function end | [echasnovski/mini.ai] | -| ]c or [c | Ⓝ | Next/previous class start | [echasnovski/mini.ai] | -| ]C or [C | Ⓝ | Next/previous class end | [echasnovski/mini.ai] | -| ]m or [m | Ⓝ | Next/previous method start | [echasnovski/mini.ai] | -| ]M or [M | Ⓝ | Next/previous method end | [echasnovski/mini.ai] | -| ]g or [g | Ⓝ | Next/previous Git hunk | [lewis6991/gitsigns.nvim] | -| ]i or [i | Ⓝ | Next/previous indent scope | [echasnovski/mini.indentscope] | -| ]t or [t | Ⓝ | Next/previous TODO | [folke/todo-comments.nvim] | -| ]z or [z | Ⓝ | Next/previous whitespace error | [config/keymaps.lua] | +| Key | Mode | Action | Plugin or Mapping | +| ------------------------------ | :---: | ------------------------------ | --------------------------------------------- | +| ], or [, | Ⓝ | Next/previous parameter | [akinsho/bufferline.nvim] | +| ]q or [q | Ⓝ | Next/previous on quick-fix | `:cnext` / `:cprev` | +| ]a or [a | Ⓝ | Next/previous on location-list | `:lnext` / `:lprev` | +| ]d or [d | Ⓝ | Next/previous diagnostics | [config/keymaps.lua] | +| ]e or [e | Ⓝ | Next/previous error | [config/keymaps.lua] | +| ]w or [w | Ⓝ | Next/previous warning | [config/keymaps.lua] | +| ]b or [b | Ⓝ | Next/previous buffer | [akinsho/bufferline.nvim] | +| ]f or [f | Ⓝ | Next/previous function start | [echasnovski/mini.ai] | +| ]F or [F | Ⓝ | Next/previous function end | [echasnovski/mini.ai] | +| ]c or [c | Ⓝ | Next/previous class start | [echasnovski/mini.ai] | +| ]C or [C | Ⓝ | Next/previous class end | [echasnovski/mini.ai] | +| ]m or [m | Ⓝ | Next/previous method start | [echasnovski/mini.ai] | +| ]M or [M | Ⓝ | Next/previous method end | [echasnovski/mini.ai] | +| ]g or [g | Ⓝ | Next/previous Git hunk | [lewis6991/gitsigns.nvim] | +| ]i or [i | Ⓝ | Next/previous indent scope | [echasnovski/mini.indentscope] | +| ]t or [t | Ⓝ | Next/previous TODO | [folke/todo-comments.nvim] | +| ]z or [z | Ⓝ | Next/previous whitespace error | [config/keymaps.lua] | ### Buffers -| Key | Mode | Action | Plugin or Mapping | -| ----- |:----:| ------------------ | ------ | -| Space+bd | Ⓝ | Delete buffer | [folke/snacks.nvim] | +| Key | Mode | Action | Plugin or Mapping | +| ------------------------------ | :---: | ------------- | ---------------------------------- | +| Space+bd | Ⓝ | Delete buffer | [folke/snacks.nvim] | ### Clipboard -| Key | Mode | Action | Plugin or Mapping | -| ----- |:----:| ------------------ | ------ | -| p or P | Ⓥ | Paste without yank | `:let @+=@0` | -| Space+y | Ⓝ | Copy relative file-path to clipboard | [config/keymaps.lua] | -| Space+Y | Ⓝ | Copy absolute file-path to clipboard | [config/keymaps.lua] | +| Key | Mode | Action | Plugin or Mapping | +| ----------------------------- | :---: | ------------------------------------ | ----------------------------------- | +| p or P | Ⓥ | Paste without yank | `:let @+=@0` | +| Space+y | Ⓝ | Copy relative file-path to clipboard | [config/keymaps.lua] | +| Space+Y | Ⓝ | Copy absolute file-path to clipboard | [config/keymaps.lua] | ### Auto-Completion -| Key | Mode | Action | Plugin or Mapping | -| ----- |:----:| ------------------ | ------ | -| Tab / Shift-Tab | Ⓘ Ⓢ | Navigate/open completion-menu | [nvim-cmp] | -| Tab / Shift-Tab | Ⓘ Ⓢ | Navigate snippet placeholders | [L3MON4D3/LuaSnip] | -| Ctrl+Space | Ⓘ | Open completion menu | [nvim-cmp] | -| Enter | Ⓘ | Select completion item or expand snippet | [nvim-cmp] | -| Shift+Enter | Ⓘ | Select and replace with completion item | [nvim-cmp] | -| Ctrl+n/p | Ⓘ | Movement in completion pop-up | [nvim-cmp] | -| Ctrl+f/b | Ⓘ | Scroll documentation | [nvim-cmp] | -| Ctrl+d/u | Ⓘ | Scroll candidates | [nvim-cmp] | -| Ctrl+e | Ⓘ | Abort selection and close pop-up | [nvim-cmp] | -| Ctrl+l | Ⓘ | Expand snippet at cursor | [L3MON4D3/LuaSnip] | -| Ctrl+c | Ⓘ | Close completion menu | [nvim-cmp] | +| Key | Mode | Action | Plugin or Mapping | +| ----------------------------------------- | :---: | ---------------------------------------- | --------------------------------- | +| Tab / Shift-Tab | Ⓘ Ⓢ | Navigate/open completion-menu | [nvim-cmp] | +| Tab / Shift-Tab | Ⓘ Ⓢ | Navigate snippet placeholders | [L3MON4D3/LuaSnip] | +| Ctrl+Space | Ⓘ | Open completion menu | [nvim-cmp] | +| Enter | Ⓘ | Select completion item or expand snippet | [nvim-cmp] | +| Shift+Enter | Ⓘ | Select and replace with completion item | [nvim-cmp] | +| Ctrl+n/p | Ⓘ | Movement in completion pop-up | [nvim-cmp] | +| Ctrl+f/b | Ⓘ | Scroll documentation | [nvim-cmp] | +| Ctrl+d/u | Ⓘ | Scroll candidates | [nvim-cmp] | +| Ctrl+e | Ⓘ | Abort selection and close pop-up | [nvim-cmp] | +| Ctrl+l | Ⓘ | Expand snippet at cursor | [L3MON4D3/LuaSnip] | +| Ctrl+c | Ⓘ | Close completion menu | [nvim-cmp] | ### LSP -| Key | Mode | Action | Plugin or Mapping | -| ----- |:----:| ------------------ | ------ | -| gr | Ⓝ | Go to references | [plugins/lsp/keymaps.lua] | -| gR | Ⓝ | List references with Trouble | [folke/trouble.nvim] | -| gd | Ⓝ | Go to definition | [plugins/lsp/keymaps.lua] | -| gD | Ⓝ | Go to declaration | [plugins/lsp/keymaps.lua] | -| gI | Ⓝ | Go to implementation | [plugins/lsp/keymaps.lua] | -| gy | Ⓝ | Go to type definition | [plugins/lsp/keymaps.lua] | -| K | Ⓝ | Show hover help or collapsed fold | [plugins/lsp/keymaps.lua] | -| gK | Ⓝ | Show signature help | [plugins/lsp/keymaps.lua] | -| Space cr | Ⓝ | Rename | [plugins/lsp/keymaps.lua] | -| Space ce | Ⓝ | Open diagnostics window | [plugins/lsp/keymaps.lua] | -| Space cs | Ⓝ | Formatter menu selection | [plugins/lsp/keymaps.lua] | -| Space ca | Ⓝ Ⓥ | Code action | [plugins/lsp/keymaps.lua] | -| Space cA | Ⓝ | Source action | [plugins/lsp/keymaps.lua] | -| Space cli | Ⓝ | LSP incoming calls | [plugins/lsp/keymaps.lua] | -| Space clo | Ⓝ | LSP outgoing calls | [plugins/lsp/keymaps.lua] | -| Space fwa | Ⓝ | Add workspace folder | [plugins/lsp/keymaps.lua] | -| Space fwr | Ⓝ | Remove workspace folder | [plugins/lsp/keymaps.lua] | -| Space fwl | Ⓝ | List workspace folders | [plugins/lsp/keymaps.lua] | -| Space cgd | Ⓝ | Glance definitions | [dnlhc/glance.nvim] | -| Space cgr | Ⓝ | Glance references | [dnlhc/glance.nvim] | -| Space cgy | Ⓝ | Glance type definitions | [dnlhc/glance.nvim] | -| Space cgi | Ⓝ | Glance implementations | [dnlhc/glance.nvim] | -| Space cgu | Ⓝ | Glance resume | [dnlhc/glance.nvim] | +| Key | Mode | Action | Plugin or Mapping | +| ------------------------------- | :---: | --------------------------------- | ---------------------------------------- | +| gr | Ⓝ | Go to references | [plugins/lsp/keymaps.lua] | +| gR | Ⓝ | List references with Trouble | [folke/trouble.nvim] | +| gd | Ⓝ | Go to definition | [plugins/lsp/keymaps.lua] | +| gD | Ⓝ | Go to declaration | [plugins/lsp/keymaps.lua] | +| gI | Ⓝ | Go to implementation | [plugins/lsp/keymaps.lua] | +| gy | Ⓝ | Go to type definition | [plugins/lsp/keymaps.lua] | +| K | Ⓝ | Show hover help or collapsed fold | [plugins/lsp/keymaps.lua] | +| gK | Ⓝ | Show signature help | [plugins/lsp/keymaps.lua] | +| Space cr | Ⓝ | Rename | [plugins/lsp/keymaps.lua] | +| Space ce | Ⓝ | Open diagnostics window | [plugins/lsp/keymaps.lua] | +| Space cs | Ⓝ | Formatter menu selection | [plugins/lsp/keymaps.lua] | +| Space ca | Ⓝ Ⓥ | Code action | [plugins/lsp/keymaps.lua] | +| Space cA | Ⓝ | Source action | [plugins/lsp/keymaps.lua] | +| Space cli | Ⓝ | LSP incoming calls | [plugins/lsp/keymaps.lua] | +| Space clo | Ⓝ | LSP outgoing calls | [plugins/lsp/keymaps.lua] | +| Space fwa | Ⓝ | Add workspace folder | [plugins/lsp/keymaps.lua] | +| Space fwr | Ⓝ | Remove workspace folder | [plugins/lsp/keymaps.lua] | +| Space fwl | Ⓝ | List workspace folders | [plugins/lsp/keymaps.lua] | +| Space cgd | Ⓝ | Glance definitions | [dnlhc/glance.nvim] | +| Space cgr | Ⓝ | Glance references | [dnlhc/glance.nvim] | +| Space cgy | Ⓝ | Glance type definitions | [dnlhc/glance.nvim] | +| Space cgi | Ⓝ | Glance implementations | [dnlhc/glance.nvim] | +| Space cgu | Ⓝ | Glance resume | [dnlhc/glance.nvim] | ### Diagnostics -| Key | Mode | Action | Plugin or Mapping | -| ----- |:----:| ------------------ | ------ | -| Space ud | Ⓝ | Toggle buffer diagnostics | [plugins/lsp/keymaps.lua] | -| Space xt | Ⓝ | List TODO with Trouble | [folke/todo-comments.nvim] | -| Space xT | Ⓝ | List TODO/FIXME with Trouble | [folke/todo-comments.nvim] | -| Space st | Ⓝ | Select TODO with Telescope | [folke/todo-comments.nvim] | -| Space sT | Ⓝ | Select TODO/FIXME with Telescope | [folke/todo-comments.nvim] | -| Space xx | Ⓝ | Toggle Trouble | [folke/trouble.nvim] | -| Space xd | Ⓝ | Toggle Trouble document | [folke/trouble.nvim] | -| Space xw | Ⓝ | Toggle Trouble workspace | [folke/trouble.nvim] | -| Space xq | Ⓝ | Toggle Quickfix via Trouble | [folke/trouble.nvim] | -| Space xl | Ⓝ | Toggle Locationlist via Trouble | [folke/trouble.nvim] | +| Key | Mode | Action | Plugin or Mapping | +| ------------------------------ | :---: | -------------------------------- | ----------------------------------------- | +| Space ud | Ⓝ | Toggle buffer diagnostics | [plugins/lsp/keymaps.lua] | +| Space xt | Ⓝ | List TODO with Trouble | [folke/todo-comments.nvim] | +| Space xT | Ⓝ | List TODO/FIXME with Trouble | [folke/todo-comments.nvim] | +| Space st | Ⓝ | Select TODO with Telescope | [folke/todo-comments.nvim] | +| Space sT | Ⓝ | Select TODO/FIXME with Telescope | [folke/todo-comments.nvim] | +| Space xx | Ⓝ | Toggle Trouble | [folke/trouble.nvim] | +| Space xd | Ⓝ | Toggle Trouble document | [folke/trouble.nvim] | +| Space xw | Ⓝ | Toggle Trouble workspace | [folke/trouble.nvim] | +| Space xq | Ⓝ | Toggle Quickfix via Trouble | [folke/trouble.nvim] | +| Space xl | Ⓝ | Toggle Locationlist via Trouble | [folke/trouble.nvim] | ### Coding -| Key | Mode | Action | Plugin or Mapping | -| ----- |:----:| ------------------ | ------ | -| Ctrl+q | Ⓝ | Start recording macro | `q` | -| Space cf | Ⓝ Ⓥ | Format | [plugins/formatting.lua] | -| Space cF | Ⓝ Ⓥ | Format injected langs | [plugins/formatting.lua] | -| Space cc | Ⓝ | Generate doc annotations | [danymat/neogen] | -| Shift+Return | Ⓘ | Start new line from any cursor position | `o` | -| ] Space | Ⓝ | Add new line below | `o` | -| [ Space | Ⓝ | Add new line above | `O` | -| gc | Ⓝ Ⓥ | Comment prefix | [numToStr/Comment.nvim] | -| gcc | Ⓝ Ⓥ | Toggle comments | [numToStr/Comment.nvim] | -| Space+j or k | Ⓝ Ⓥ | Move lines down/up | `:m` … | -| Space+v | Ⓝ Ⓥ | Toggle line-wise comments | [numToStr/Comment.nvim] | -| Space+V | Ⓝ Ⓥ | Toggle block-wise comments | [numToStr/Comment.nvim] | -| Space+dd | Ⓝ Ⓥ | Duplicate line or selection | [config/keymaps.lua] | -| Space+cw | Ⓝ | Remove all spaces at EOL | [echasnovski/mini.trailspace] | -| Space+cid | Ⓝ | LazyDev | [folke/lazydev.nvim] | -| Space+cif | Ⓝ | LazyFormatterInfo | [LazyVim/LazyVim] | -| Space+cir | Ⓝ | LazyRoot | [LazyVim/LazyVim] | -| sj / sk | Ⓝ | Join/split arguments | [echasnovski/mini.splitjoin] | +| Key | Mode | Action | Plugin or Mapping | +| --------------------------------------------- | :---: | --------------------------------------- | ------------------------------------------ | +| Ctrl+q | Ⓝ | Start recording macro | `q` | +| Space cf | Ⓝ Ⓥ | Format | [plugins/formatting.lua] | +| Space cF | Ⓝ Ⓥ | Format injected langs | [plugins/formatting.lua] | +| Space cc | Ⓝ | Generate doc annotations | [danymat/neogen] | +| Shift+Return | Ⓘ | Start new line from any cursor position | `o` | +| ] Space | Ⓝ | Add new line below | `o` | +| [ Space | Ⓝ | Add new line above | `O` | +| gc | Ⓝ Ⓥ | Comment prefix | [numToStr/Comment.nvim] | +| gcc | Ⓝ Ⓥ | Toggle comments | [numToStr/Comment.nvim] | +| Space+j or k | Ⓝ Ⓥ | Move lines down/up | `:m` … | +| Space+v | Ⓝ Ⓥ | Toggle line-wise comments | [numToStr/Comment.nvim] | +| Space+V | Ⓝ Ⓥ | Toggle block-wise comments | [numToStr/Comment.nvim] | +| Space+dd | Ⓝ Ⓥ | Duplicate line or selection | [config/keymaps.lua] | +| Space+cw | Ⓝ | Remove all spaces at EOL | [nvim-mini/mini.trailspace] | +| Space+cid | Ⓝ | LazyDev | [folke/lazydev.nvim] | +| Space+cif | Ⓝ | LazyFormatterInfo | [LazyVim/LazyVim] | +| Space+cir | Ⓝ | LazyRoot | [LazyVim/LazyVim] | +| sj / sk | Ⓝ | Join/split arguments | [nvim-mini/mini.splitjoin] | ### Search, Substitute, Diff -| Key | Mode | Action | Plugin or Mapping | -| ----- |:----:| ------------------ | ------ | -| \* / # | Ⓝ Ⓥ | Search partial words | `g*` / `g#` | -| g\* / g# | Ⓝ Ⓥ | Search whole-word forward/backward | `*` / `#` | -| Ctrl+c | Ⓝ | Change inner word | `ciw` | -| Escape | Ⓝ | Clear search highlight | `:nohlsearch` | -| Backspace | Ⓝ | Match bracket | `%` | -| Space+bf | Ⓝ | Diff current windows in tab | `windo diffthis` | -| Space+bF | Ⓝ | External diff | `!vim.g.diffprg % #` | -| ss | Ⓝ Ⓥ Ⓞ | Flash jump | [folke/flash.nvim] | -| S | Ⓝ Ⓥ Ⓞ | Flash treesitter | [folke/flash.nvim] | -| r | Ⓞ | Flash remote | [folke/flash.nvim] | -| R | Ⓥ Ⓞ | Flash treesitter search | [folke/flash.nvim] | -| Ctrl+s | Ⓒ | Toggle flash in search input | [folke/flash.nvim] | +| Key | Mode | Action | Plugin or Mapping | +| ------------------------------ | :---: | ---------------------------------- | ----------------------------------- | +| \* / # | Ⓝ Ⓥ | Search partial words | `g*` / `g#` | +| g\* / g# | Ⓝ Ⓥ | Search whole-word forward/backward | `*` / `#` | +| Ctrl+c | Ⓝ | Change inner word | `ciw` | +| Escape | Ⓝ | Clear search highlight | `:nohlsearch` | +| Backspace | Ⓝ | Match bracket | `%` | +| Space+bf | Ⓝ | Diff current windows in tab | `windo diffthis` | +| Space+bF | Ⓝ | External diff | `!vim.g.diffprg % #` | +| ss | Ⓝ Ⓥ Ⓞ | Flash jump | [folke/flash.nvim] | +| S | Ⓝ Ⓥ Ⓞ | Flash treesitter | [folke/flash.nvim] | +| r | Ⓞ | Flash remote | [folke/flash.nvim] | +| R | Ⓥ Ⓞ | Flash treesitter search | [folke/flash.nvim] | +| Ctrl+s | Ⓒ | Toggle flash in search input | [folke/flash.nvim] | ### Command & History -| Key | Mode | Action | Plugin or Mapping | -| ----- |:----:| ------------------ | ------ | -| g! | Ⓝ | Read vim command into buffer | `:put=execute('⌴')` | -| Ctrl+n / p | Ⓒ | Switch history search pairs | / | -| / | Ⓒ | Switch history search pairs | `Ctrl` `n`/`p` | +| Key | Mode | Action | Plugin or Mapping | +| ------------------------------------------- | :---: | ---------------------------- | ---------------------------------- | +| g! | Ⓝ | Read vim command into buffer | `:put=execute('⌴')` | +| Ctrl+n / p | Ⓒ | Switch history search pairs | / | +| / | Ⓒ | Switch history search pairs | `Ctrl` `n`/`p` | ### File Operations -| Key | Mode | Action | Plugin or Mapping | -| ----- |:----:| ------------------ | ------ | -| Space+cd | Ⓝ | Switch tab to the directory of current buffer | `:tcd %:p:h` | -| Space+w or M+s | Ⓝ | Write buffer to file | `:write` | -| Ctrl+s | Ⓝ Ⓥ Ⓒ | Write buffer to file | `:write` | +| Key | Mode | Action | Plugin or Mapping | +| ---------------------------------------------------------- | :---: | --------------------------------------------- | --------------------------- | +| Space+cd | Ⓝ | Switch tab to the directory of current buffer | `:tcd %:p:h` | +| Space+w or M+s | Ⓝ | Write buffer to file | `:write` | +| Ctrl+s | Ⓝ Ⓥ Ⓒ | Write buffer to file | `:write` | ### Window Management -| Key | Mode | Action | Plugin or Mapping | -| ----- |:----:| ------------------ | ------ | -| Space qq | Ⓝ | Quit all and exit | `:quitall` | -| s] | Ⓝ | Rotate window placement | `C-w` `x` | -| sp | Ⓝ | Choose a window to edit | [s1n7ax/nvim-window-picker] | -| sw | Ⓝ | Switch editing window with selected | [s1n7ax/nvim-window-picker] | -| sv | Ⓝ | Horizontal split | `:split` | -| sg | Ⓝ | Vertical split | `:vsplit` | -| st | Ⓝ | Open new tab | `:tabnew` | -| so | Ⓝ | Close other windows | `:only` | -| sb | Ⓝ | Previous buffer | `:b#` | -| sc | Ⓝ | Close current buffer | `:close` | -| sd | Ⓝ | Delete buffer | `:bdelete` | -| sq | Ⓝ | Quit window (if last window, quit nvim) | `:quit` | -| sx | Ⓝ | Delete buffer, leave blank window | `:enew │ bdelete` | -| sz | Ⓝ | Toggle window zoom | `:vertical resize │ resize` | -| sh | Ⓝ | Toggle colorscheme background=dark/light | `:set background` … | +| Key | Mode | Action | Plugin or Mapping | +| ------------------------------ | :---: | ---------------------------------------- | ------------------------------------------ | +| Space qq | Ⓝ | Quit all and exit | `:quitall` | +| s] | Ⓝ | Rotate window placement | `C-w` `x` | +| sp | Ⓝ | Choose a window to edit | [s1n7ax/nvim-window-picker] | +| sw | Ⓝ | Switch editing window with selected | [s1n7ax/nvim-window-picker] | +| sv | Ⓝ | Horizontal split | `:split` | +| sg | Ⓝ | Vertical split | `:vsplit` | +| st | Ⓝ | Open new tab | `:tabnew` | +| so | Ⓝ | Close other windows | `:only` | +| sb | Ⓝ | Previous buffer | `:b#` | +| sc | Ⓝ | Close current buffer | `:close` | +| sd | Ⓝ | Delete buffer | `:bdelete` | +| sq | Ⓝ | Quit window (if last window, quit nvim) | `:quit` | +| sx | Ⓝ | Delete buffer, leave blank window | `:enew │ bdelete` | +| sz | Ⓝ | Toggle window zoom | `:vertical resize │ resize` | +| sh | Ⓝ | Toggle colorscheme background=dark/light | `:set background` … | ### Plugins -| Key | Mode | Action | Plugin or Mapping | -| ----- |:----:| ------------------ | ------ | -| ;+c | Ⓝ | Open context-menu | [lua/rafi/util/contextmenu.lua] | -| gCtrl+o | Ⓝ | Navigate to previous file on jumplist | [util/edit.lua] | -| gCtrl+i | Ⓝ | Navigate to next file on jumplist | [util/edit.lua] | -| Ctrl+/ | Ⓝ | Toggle terminal | [folke/snacks.nvim] | -| Space l | Ⓝ | Open Lazy | [folke/lazy.nvim] | -| Space o | Ⓝ | Open Outline side | [hedyhli/outline.nvim] | -| Space ? | Ⓝ | Open the macOS dictionary on current word | `:!open dict://` | -| Space cp | Ⓝ | Toggle Markdown preview | iamcco/markdown-preview.nvim | -| Space mc | Ⓝ | Open color-picker | [uga-rosa/ccc.nvim] | -| Space tt | Ⓝ | Open terminal (root dir) | [config/keymaps.lua] | -| Space tT | Ⓝ | Open terminal (cwd) | [config/keymaps.lua] | -| Space gt | Ⓝ | Open Lazygit (root dir) | [config/keymaps.lua] | -| Space gT | Ⓝ | Open Lazygit (cwd) | [config/keymaps.lua] | -| Space gF | Ⓝ | Open Lazygit on current file history | [config/keymaps.lua] | -| Space gl | Ⓝ | Open Lazygit log | [config/keymaps.lua] | -| Space gL | Ⓝ | Open Lazygit log (cwd) | [config/keymaps.lua] | -| Space gb | Ⓝ | Git blame | [FabijanZulj/blame.nvim] | -| Space gB | Ⓝ | Git blame in window | [FabijanZulj/blame.nvim] | -| Space gm | Ⓝ | Reveal commit under cursor | [config/keymaps.lua] | -| Space go | Ⓝ Ⓥ | Open source-code URL in browser | [config/keymaps.lua] | -| Space gY | Ⓝ Ⓥ | Copy source-code URL | [config/keymaps.lua] | -| Space gu | Ⓝ | Open undo-tree | [mbbill/undotree] | -| Space mg | Ⓝ | Open Neogit | [NeogitOrg/neogit] | -| Space ml | Ⓝ | Append modeline to end of buffer | [config/keymaps.lua] | -| Space mda | Ⓥ | Sequentially mark region for diff | [AndrewRadev/linediff.vim] | -| Space mdf | Ⓥ | Mark region for diff and compare if more than one | [AndrewRadev/linediff.vim] | -| Space mds | Ⓝ | Shows the comparison for all marked regions | [AndrewRadev/linediff.vim] | -| Space mdr | Ⓝ | Removes the signs denoting the diff regions | [AndrewRadev/linediff.vim] | -| Space mh | Ⓝ | Open HTTP Rest UI | [rest-nvim/rest.nvim] | -| Space mt | Ⓝ Ⓥ | Toggle highlighted word | [t9md/vim-quickhl] | -| Space mo | Ⓝ | Update Markdown TOC | [mzlogin/vim-markdown-toc] | +| Key | Mode | Action | Plugin or Mapping | +| ---------------------------------------- | :---: | ------------------------------------------------- | ---------------------------------------------- | +| ;+c | Ⓝ | Open context-menu | [lua/rafi/util/contextmenu.lua] | +| gCtrl+o | Ⓝ | Navigate to previous file on jumplist | [util/edit.lua] | +| gCtrl+i | Ⓝ | Navigate to next file on jumplist | [util/edit.lua] | +| Ctrl+/ | Ⓝ | Toggle terminal | [folke/snacks.nvim] | +| Space l | Ⓝ | Open Lazy | [folke/lazy.nvim] | +| Space o | Ⓝ | Open Outline side | [hedyhli/outline.nvim] | +| Space ? | Ⓝ | Open the macOS dictionary on current word | `:!open dict://` | +| Space cp | Ⓝ | Toggle Markdown preview | iamcco/markdown-preview.nvim | +| Space mc | Ⓝ | Open color-picker | [uga-rosa/ccc.nvim] | +| Space tt | Ⓝ | Open terminal (root dir) | [config/keymaps.lua] | +| Space tT | Ⓝ | Open terminal (cwd) | [config/keymaps.lua] | +| Space gt | Ⓝ | Open Lazygit (root dir) | [config/keymaps.lua] | +| Space gT | Ⓝ | Open Lazygit (cwd) | [config/keymaps.lua] | +| Space gF | Ⓝ | Open Lazygit on current file history | [config/keymaps.lua] | +| Space gl | Ⓝ | Open Lazygit log | [config/keymaps.lua] | +| Space gL | Ⓝ | Open Lazygit log (cwd) | [config/keymaps.lua] | +| Space gb | Ⓝ | Git blame | [FabijanZulj/blame.nvim] | +| Space gB | Ⓝ | Git blame in window | [FabijanZulj/blame.nvim] | +| Space gm | Ⓝ | Reveal commit under cursor | [config/keymaps.lua] | +| Space go | Ⓝ Ⓥ | Open source-code URL in browser | [config/keymaps.lua] | +| Space gY | Ⓝ Ⓥ | Copy source-code URL | [config/keymaps.lua] | +| Space gu | Ⓝ | Open undo-tree | [mbbill/undotree] | +| Space mg | Ⓝ | Open Neogit | [NeogitOrg/neogit] | +| Space ml | Ⓝ | Append modeline to end of buffer | [config/keymaps.lua] | +| Space mda | Ⓥ | Sequentially mark region for diff | [AndrewRadev/linediff.vim] | +| Space mdf | Ⓥ | Mark region for diff and compare if more than one | [AndrewRadev/linediff.vim] | +| Space mds | Ⓝ | Shows the comparison for all marked regions | [AndrewRadev/linediff.vim] | +| Space mdr | Ⓝ | Removes the signs denoting the diff regions | [AndrewRadev/linediff.vim] | +| Space mh | Ⓝ | Open HTTP Rest UI | [rest-nvim/rest.nvim] | +| Space mt | Ⓝ Ⓥ | Toggle highlighted word | [t9md/vim-quickhl] | +| Space mo | Ⓝ | Update Markdown TOC | [mzlogin/vim-markdown-toc] | #### Plugin: Mini.Surround See [echasnovski/mini.surround] for more mappings and usage information. -| Key | Mode | Action | -| -------------- |:-----:| ---------------------------- | -| sa & movement | Ⓝ Ⓥ | Add surrounding | -| cs & movement | Ⓝ | Replace surrounding | -| ds & movement | Ⓝ | Delete surrounding | -| gzf & movement | Ⓝ | Find surrounding (to the right) | -| gzF & movement | Ⓝ | Find surrounding (to the left) | -| gzh & movement | Ⓝ | Highlight surrounding | -| gzn & movement | Ⓝ | Update neighbor lines | +| Key | Mode | Action | +| ------------------------- | :---: | ------------------------------- | +| sa & movement | Ⓝ Ⓥ | Add surrounding | +| cs & movement | Ⓝ | Replace surrounding | +| ds & movement | Ⓝ | Delete surrounding | +| gzf & movement | Ⓝ | Find surrounding (to the right) | +| gzF & movement | Ⓝ | Find surrounding (to the left) | +| gzh & movement | Ⓝ | Highlight surrounding | +| gzn & movement | Ⓝ | Update neighbor lines | #### Plugin: Gitsigns See [lewis6991/gitsigns.nvim] for more mappings and usage information. -| Key | Mode | Action | -| ----- |:----:| ------------------ | -| ]g or ]g | Ⓝ | Next/previous Git hunk | -| gs | Ⓝ | Preview hunk | -| Space hp | Ⓝ | Preview hunk inline | -| Space hb | Ⓝ | Blame line | -| Space hs | Ⓝ Ⓥ | Stage hunk | -| Space hr | Ⓝ Ⓥ | Reset hunk | -| Space hu | Ⓝ | Undo stage hunk | -| Space hS | Ⓝ | Stage buffer | -| Space hR | Ⓝ | Reset buffer | -| Space hd | Ⓝ | Diff against the index | -| Space hD | Ⓝ | Diff against the last commit | -| Space hw | Ⓝ | Toggle word diff | -| Space hl | Ⓝ | Publish hunks to location-list | -| Space htb | Ⓝ | Toggle git current line blame | -| Space htd | Ⓝ | Toggle git deleted | -| Space htw | Ⓝ | Toggle git word diff | -| Space htl | Ⓝ | Toggle git line highlight | -| Space htn | Ⓝ | Toggle git number highlight | -| Space hts | Ⓝ | Toggle git signs | -| ih | Ⓞ | Select inner hunk operator | +| Key | Mode | Action | +| ------------------------------- | :---: | ------------------------------ | +| ]g or ]g | Ⓝ | Next/previous Git hunk | +| gs | Ⓝ | Preview hunk | +| Space hp | Ⓝ | Preview hunk inline | +| Space hb | Ⓝ | Blame line | +| Space hs | Ⓝ Ⓥ | Stage hunk | +| Space hr | Ⓝ Ⓥ | Reset hunk | +| Space hu | Ⓝ | Undo stage hunk | +| Space hS | Ⓝ | Stage buffer | +| Space hR | Ⓝ | Reset buffer | +| Space hd | Ⓝ | Diff against the index | +| Space hD | Ⓝ | Diff against the last commit | +| Space hw | Ⓝ | Toggle word diff | +| Space hl | Ⓝ | Publish hunks to location-list | +| Space htb | Ⓝ | Toggle git current line blame | +| Space htd | Ⓝ | Toggle git deleted | +| Space htw | Ⓝ | Toggle git word diff | +| Space htl | Ⓝ | Toggle git line highlight | +| Space htn | Ⓝ | Toggle git number highlight | +| Space hts | Ⓝ | Toggle git signs | +| ih | Ⓞ | Select inner hunk operator | #### Plugin: Diffview See [sindrets/diffview.nvim] for more mappings and usage information. -| Key | Mode | Action | -| ----- |:----:| ------------------ | -| Space gd | Ⓝ | Diff view file history | -| Space gv | Ⓝ | Diff view open | -| | |   | -| **Within _diffview_ "view" window** | |   | -| | |   | -| Tab / Shift+Tab | Ⓝ | Select next/previous entry | -| ; a | Ⓝ | Focus file | -| ; e | Ⓝ | Toggle files panel | -| | |   | -| **Within _diffview_ "file" panel** | |   | -| | |   | -| q | Ⓝ | Close | -| h | Ⓝ | Previous entry | -| o | Ⓝ | Focus entry | -| gf | Ⓝ | Open file | -| sg | Ⓝ | Open file in split | -| st | Ⓝ | Open file in new tab | -| Ctrl+r | Ⓝ | Refresh files | -| ; e | Ⓝ | Toggle panel | -| | |   | -| **Within _diffview_ "history" panel** | |   | -| | |   | -| q | Ⓝ | Close diffview | -| o | Ⓝ | Focus entry | -| O | Ⓝ | Show options | +| Key | Mode | Action | +| ------------------------------------------------ | :---: | -------------------------- | +| Space gd | Ⓝ | Diff view file history | +| Space gv | Ⓝ | Diff view open | +| | |   | +| **Within _diffview_ "view" window** | |   | +| | |   | +| Tab / Shift+Tab | Ⓝ | Select next/previous entry | +| ; a | Ⓝ | Focus file | +| ; e | Ⓝ | Toggle files panel | +| | |   | +| **Within _diffview_ "file" panel** | |   | +| | |   | +| q | Ⓝ | Close | +| h | Ⓝ | Previous entry | +| o | Ⓝ | Focus entry | +| gf | Ⓝ | Open file | +| sg | Ⓝ | Open file in split | +| st | Ⓝ | Open file in new tab | +| Ctrl+r | Ⓝ | Refresh files | +| ; e | Ⓝ | Toggle panel | +| | |   | +| **Within _diffview_ "history" panel** | |   | +| | |   | +| q | Ⓝ | Close diffview | +| o | Ⓝ | Focus entry | +| O | Ⓝ | Show options | #### Plugin: Neo-Tree See [nvim-neo-tree/neo-tree.nvim] for more mappings and usage information. -| Key | Mode | Action | -| ----- |:----:| ------------------ | -| Space e/fe | Ⓝ | Toggle file explorer (root) | -| Space E/fE | Ⓝ | Toggle file explorer (cwd) | -| ge | Ⓝ | Open Git explorer | -| be | Ⓝ | Open Buffer explorer | -| ;a | Ⓝ | Reveal in file explorer | -| ;A | Ⓝ | Reveal in file explorer (cwd) | -| | |   | -| **Within _Neo-Tree_ window** | |   | -| | |   | -| g? | Ⓝ | Show help | -| q | Ⓝ | Close window | -| j or k | Ⓝ | Move up and down the tree | -| Tab or Shift+Tab | Ⓝ | Next or previous source | -| ]g or [g | Ⓝ | Jump to next/previous git modified node | -| l | Ⓝ | Toggle collapse/expand directory or open file | -| h | Ⓝ | Collapse directory tree | -| Return | Ⓝ | Select window to open file | -| gr | Ⓝ | Grep in current position | -| gf | Ⓝ | Find files in current position | -| . | Ⓝ | Set as root directory | -| Backspace | Ⓝ | Change into parent directory | -| sv or S | Ⓝ | Open file in a horizontal split | -| sg or s | Ⓝ | Open file in a vertical split | -| st or t | Ⓝ | Open file in new tab | -| p | Ⓝ | Preview toggle | -| a | Ⓝ | Create new directories and/or files | -| N | Ⓝ | Create new directory | -| r | Ⓝ | Rename file or directory | -| dd | Ⓝ | Delete | -| c / m | Ⓝ | Copy/move | -| y / x / P | Ⓝ | Clipboard copy/cut/paste | -| ! | Ⓝ | Filter | -| D | Ⓝ | Filter directories | -| # | Ⓝ | Fuzzy sorter | -| F | Ⓝ | Filter on submit | -| Ctrl+c | Ⓝ | Clear filter | -| Ctrl+r or R | Ⓝ | Refresh | -| fi / fe | Ⓝ | Include/exclude | -| H | Ⓝ | Toggle hidden files | -| e | Ⓝ | Toggle auto-expand window width | -| w | Ⓝ | Toggle window width | -| z | Ⓝ | Collapse all nodes | +| Key | Mode | Action | +| ------------------------------------------------- | :---: | --------------------------------------------- | +| Space e/fe | Ⓝ | Toggle file explorer (root) | +| Space E/fE | Ⓝ | Toggle file explorer (cwd) | +| ge | Ⓝ | Open Git explorer | +| be | Ⓝ | Open Buffer explorer | +| ;a | Ⓝ | Reveal in file explorer | +| ;A | Ⓝ | Reveal in file explorer (cwd) | +| | |   | +| **Within _Neo-Tree_ window** | |   | +| | |   | +| g? | Ⓝ | Show help | +| q | Ⓝ | Close window | +| j or k | Ⓝ | Move up and down the tree | +| Tab or Shift+Tab | Ⓝ | Next or previous source | +| ]g or [g | Ⓝ | Jump to next/previous git modified node | +| l | Ⓝ | Toggle collapse/expand directory or open file | +| h | Ⓝ | Collapse directory tree | +| Return | Ⓝ | Select window to open file | +| gr | Ⓝ | Grep in current position | +| gf | Ⓝ | Find files in current position | +| . | Ⓝ | Set as root directory | +| Backspace | Ⓝ | Change into parent directory | +| sv or S | Ⓝ | Open file in a horizontal split | +| sg or s | Ⓝ | Open file in a vertical split | +| st or t | Ⓝ | Open file in new tab | +| p | Ⓝ | Preview toggle | +| a | Ⓝ | Create new directories and/or files | +| N | Ⓝ | Create new directory | +| r | Ⓝ | Rename file or directory | +| dd | Ⓝ | Delete | +| c / m | Ⓝ | Copy/move | +| y / x / P | Ⓝ | Clipboard copy/cut/paste | +| ! | Ⓝ | Filter | +| D | Ⓝ | Filter directories | +| # | Ⓝ | Fuzzy sorter | +| F | Ⓝ | Filter on submit | +| Ctrl+c | Ⓝ | Clear filter | +| Ctrl+r or R | Ⓝ | Refresh | +| fi / fe | Ⓝ | Include/exclude | +| H | Ⓝ | Toggle hidden files | +| e | Ⓝ | Toggle auto-expand window width | +| w | Ⓝ | Toggle window width | +| z | Ⓝ | Collapse all nodes | #### Plugin: Marks See [chentau/marks.nvim] for more mappings and usage information. -| Key | Mode | Action | -| ----- |:----:| ------------------ | -| m, | Ⓝ | Set the next available alphabetical (lowercase) mark | -| m; | Ⓝ | Toggle the next available mark at the current line | -| m a-z | Ⓝ | Set mark | -| dm a-z | Ⓝ | Remove mark | -| dm- | Ⓝ | Delete all marks on the current line | -| dm\ | Ⓝ | Delete all marks in the current buffer | -| m] | Ⓝ | Move to next mark | -| m[ | Ⓝ | Move to previous mark | -| m: a-z | Ⓝ | Preview mark | -| m/ | Ⓝ | List marks from all opened buffers | +| Key | Mode | Action | +| ---------------------------- | :---: | ---------------------------------------------------- | +| m, | Ⓝ | Set the next available alphabetical (lowercase) mark | +| m; | Ⓝ | Toggle the next available mark at the current line | +| m a-z | Ⓝ | Set mark | +| dm a-z | Ⓝ | Remove mark | +| dm- | Ⓝ | Delete all marks on the current line | +| dm\ | Ⓝ | Delete all marks in the current buffer | +| m] | Ⓝ | Move to next mark | +| m[ | Ⓝ | Move to previous mark | +| m: a-z | Ⓝ | Preview mark | +| m/ | Ⓝ | List marks from all opened buffers | #### Plugin: Zk See [zk-org/zk-nvim] and [zk](https://github.com/zk-org/zk) for more mappings and usage information. -| Key | Mode | Action | -| ------------------------------ |:----:| ----------------------------------- | -| Space+zn | Ⓝ | Ask for title and create new note | -| Space+zo | Ⓝ | Browse notes sorted by modification time | -| Space+zt | Ⓝ | Browse tags | -| Space+zf | Ⓝ | Search notes | -| Space+zf | Ⓥ | Search notes with selection | -| Space+zb | Ⓝ | Show backlinks | -| Space+zl | Ⓝ | Show links | +| Key | Mode | Action | +| ------------------------------ | :---: | ---------------------------------------- | +| Space+zn | Ⓝ | Ask for title and create new note | +| Space+zo | Ⓝ | Browse notes sorted by modification time | +| Space+zt | Ⓝ | Browse tags | +| Space+zf | Ⓝ | Search notes | +| Space+zf | Ⓥ | Search notes with selection | +| Space+zb | Ⓝ | Show backlinks | +| Space+zl | Ⓝ | Show links | diff --git a/README_zh.md b/README_zh.md new file mode 100644 index 00000000..9b9fd375 --- /dev/null +++ b/README_zh.md @@ -0,0 +1,1174 @@ +# Rafael Bodill 的 Neovim 配置 + +一个精简且强大的 Neovim 配置,启动时间仅需 **30–45ms**。 +推荐使用 **Neovim ≥ 0.10**(基于 [LazyVim]💤)。 + +⚙️ 想要自定义或扩展?参见 [扩展配置](#扩展配置)。 + +> 推荐你 fork 本仓库,根据自己的习惯调整。 +> 学会修改和管理 Neovim 配置是很有价值的技能。 +> 本配置汇集了我多年来的经验,你可以将其作为远程上游参考,也可以仅采纳部分内容。 + +
+ + 目录 + (🔎 点击展开/收起) + + + + +* [特性](#特性) +* [截图](#截图) +* [前置依赖](#前置依赖) +* [安装](#安装) +* [安装 LSP、DAP、Linters、Formatters](#安装-lspdaplintersformatters) + * [语言服务器(LSP)](#语言服务器lsp) + * [推荐 LSP](#推荐-lsp) + * [推荐 Linter](#推荐-linter) + * [推荐 Formatter](#推荐-formatter) + * [推荐字体](#推荐字体) +* [升级](#升级) +* [结构](#结构) +* [扩展配置](#扩展配置) + * [扩展:配置](#扩展配置-1) + * [推荐 LSP](#推荐-lsp-1) + * [推荐 Linter](#推荐-linter-1) + * [推荐 Formatter](#推荐-formatter-1) +* [推荐字体](#推荐字体-1) +* [升级](#升级-1) +* [结构](#结构-1) +* [扩展](#扩展) + * [扩展:配置](#扩展配置-2) +* [扩展插件(Extra Plugins)](#扩展插件extra-plugins) + * [扩展插件:编码(Coding)](#扩展插件编码coding) + * [扩展插件:配色方案(Colorscheme)](#扩展插件配色方案colorscheme) + * [扩展插件:编辑器(Editor)](#扩展插件编辑器editor) + * [扩展插件:Git](#扩展插件git) + * [扩展插件:语言支持(Lang)](#扩展插件语言支持lang) + * [扩展插件:LSP](#扩展插件lsp) + * [扩展插件:Org](#扩展插件org) + * [扩展插件:Treesitter](#扩展插件treesitter) + * [扩展插件:UI](#扩展插件ui) + * [LazyVim 扩展插件](#lazyvim-扩展插件) +* [自定义快捷键(Custom Key-mappings)](#自定义快捷键custom-key-mappings) + * [选择器(Picker)](#选择器picker) + * [功能切换(Toggle Features)](#功能切换toggle-features) + * [导航(Navigation)](#导航navigation) + * [选择(Selection)](#选择selection) + * [跳转(Jump To)](#跳转jump-to) + * [缓冲区(Buffers)](#缓冲区buffers) + * [剪贴板(Clipboard)](#剪贴板clipboard) + * [自动补全(Auto-Completion)](#自动补全auto-completion) + * [LSP(语言服务器协议)](#lsp语言服务器协议) + * [诊断(Diagnostics)](#诊断diagnostics) + * [Coding](#coding) + * [搜索、替换与差异(Search, Substitute, Diff)](#搜索替换与差异search-substitute-diff) + * [命令与历史(Command & History)](#命令与历史command--history) + * [文件操作](#文件操作) + * [窗口管理](#窗口管理) + * [插件与工具](#插件与工具) + * [插件:Mini.Surround](#插件minisurround) + * [插件:Gitsigns](#插件gitsigns) + * [插件:Diffview](#插件diffview) + * [插件:Neo-Tree](#插件neo-tree) + * [插件:Marks](#插件marks) + * [插件:Zk](#插件zk) +* [参考链接](#参考链接) + + +
+ +## 特性 + +* 启动极快——插件几乎全部 **按需延迟加载** +* 功能强大,保持轻量级 +* 插件管理采用 [folke/lazy.nvim](`:Lazy` 或 Space+l) +* 使用 `:Mason` 或 Space+cm 管理 LSP、DAP、Linter、Formatter +* LSP 配置基于 [nvim-lspconfig] +* [telescope.nvim] 驱动的工作流(试试 ;+f) +* 自定义右键上下文菜单(;+c) +* 支持 [blink.cmp] 或 [nvim-cmp] 自动补全 +* [hedyhli/outline.nvim] 结构视图 +* 内置 Git 支持([gitsigns.nvim]、[diffview.nvim] 等) +* [persistence.nvim] 会话管理 +* 状态栏和标签栏简洁但信息丰富 +* 多种高级配色方案,自动记忆上次主题 + +## 截图 + +![Vim screenshot](http://rafi.io/img/project/vim-config/features.png) + +## 前置依赖 + +必需: + +* [git](https://git-scm.com/) ≥ 2.19.0 +* [Neovim](https://github.com/neovim/neovim/wiki/Installing-Neovim) ≥ v0.10.0 + +推荐安装: + +* [bat] +* [fd] +* [fzf] +* [ripgrep] +* [zoxide] + +## 安装 + +1. 克隆仓库到 `~/.config/nvim`: + + ```bash + mkdir -p ~/.config + git clone git@github.com:H-Haynes/vim-config.git ~/.config/nvim + cd ~/.config/nvim + ``` + +2. 直接运行 `nvim`(首次启动会自动安装所有插件) + + 推荐在 Neovim 内执行 `:checkhealth` 检查环境。 + +3. 在 Neovim 里运行 `:LazyExtras`,按 x 安装扩展插件。 + +## 安装 LSP、DAP、Linters、Formatters + +使用: +`:Mason` 或 Space+cm + +可用于安装和管理: + +- LSP 服务器 +- DAP 调试器 +- Linter +- Formatter + +更多文档: +`:h mason.nvim` 或访问 [mason-org/mason.nvim] + +### 语言服务器(LSP) + +你可以通过以下方式安装语言服务器: + +- 使用 Mason UI:`:Mason` +- 命令行:`:MasonInstall ` +- 语言服务器快捷命令:`:LspInstall `(Tab 可补全) + +官方资源: + +- Mason 包列表: https://mason-registry.dev/registry/list +- LSP 映射表:`mason-lspconfig.nvim` 文档 +- `:h mason-lspconfig-server-map` + +部分语言服务器需要 `npm`、`curl` 等外部工具。 + +自定义 LSP 配置示例见: +`lua/rafi/plugins/lsp/init.lua` + +--- + +### 推荐 LSP + +以下是我日常使用、稳定且高效的语言服务器推荐: + +| 语言 | 推荐 LSP | 说明 | +| ----------------------- | ---------------------- | ------------------------ | +| Bash | `bash-language-server` | 轻量、可靠 | +| C / C++ | `clangd` | 功能强大、广泛使用 | +| CSS / Less / SCSS | `cssls` | 前端开发常用 | +| Docker | `dockerls` | 官方 Docker LSP | +| Go | `gopls` | Google 官方语言服务器 | +| HTML | `html` | 前端通用 | +| Java | `jdtls` | Java 官方语言服务器 | +| JavaScript / TypeScript | `tsserver` 或 `vtsls` | 推荐 `vtsls`,更快更稳定 | +| JSON | `jsonls` | 支持 JSON Schema | +| Lua | `lua_ls` | Neovim 生态最优 | +| Markdown | `marksman` | 功能完善 | +| Python | `pyright` | 快速、准确 | +| Rust | `rust_analyzer` | Rust 官方推荐 | +| YAML | `yamlls` | 支持 schema、格式化 | + +可批量安装示例: + +```vim +:MasonInstall ansible-language-server bash-language-server css-lsp +:MasonInstall dockerfile-language-server gopls html-lsp json-lsp +:MasonInstall lua-language-server marksman pyright sqlls +:MasonInstall svelte-language-server typescript-language-server +:MasonInstall tailwindcss-language-server +:MasonInstall vim-language-server yaml-language-server +``` + +查看更多: https://github.com/mason-org/mason-lspconfig.nvim/blob/main/doc/server-mapping.md + +--- + +### 推荐 Linter + +推荐以下 Linter,稳定高效,支持主流语言: + +- **ESLint** → JavaScript / TypeScript +- **ShellCheck** → Shell 脚本 +- **flake8 / ruff** → Python +- **markdownlint** → Markdown +- **yamllint** → YAML +- **hadolint** → Dockerfile + +安装示例: + +```vim +:MasonInstall vint shellcheck editorconfig-checker flake8 gitlint hadolint +:MasonInstall markdownlint mypy selene shellharden write-good yamllint +``` +--- + +### 推荐 Formatter + +以下格式化器简单易用,与 Neovim 集成良好: + +| 语言 | Formatter | +| -------- | ------------------------ | +| JS/TS | `prettier` | +| HTML/CSS | `prettier` | +| Markdown | `prettier` | +| Python | `black` 或 `ruff format` | +| Lua | `stylua` | +| JSON | `prettier` | +| YAML | `prettier` | + +安装示例: + +```vim +:MasonInstall black fixjson gofumpt golines isort +:MasonInstall shfmt sql-formatter stylua +``` +--- + +### 推荐字体 + +macOS 安装示例: + +```sh +brew tap homebrew/cask-fonts +brew search nerd-font +brew install --cask font-victor-mono-nerd-font +brew install --cask font-iosevka-nerd-font-mono +brew install --cask font-hack-nerd-font +brew install --cask font-fira-code +``` + +--- + +## 升级 + +升级插件和包: + +* Neovim 插件:`:Lazy update` +* Mason 包:`:Mason` 后按 U + +更新 Neovim 配置: + +```bash +git pull --ff --ff-only +``` + +## 结构 + +``` +nvim/ +├── after/ # 针对特定语言的自定义设置和插件 +├── init.lua +├── lua/ # Lua 配置 +│ └── rafi/ +│ ├── config/ # Neovim 配置 +│ ├── autocmd.lua # 自动命令 +│ ├── init.lua # 初始化 +│ ├── keymaps.lua # 快捷键映射 +│ ├── lazy.lua # 插件管理入口 +│ └── options.lua # 编辑器参数 +│ ├── plugins/ # 插件及其配置 +│ ├── settings/ # UI、选项、快捷键 +│ └── utils/ # 工具函数 +├── snippets/ # 个人代码片段 +└── lazy-lock.json # 插件锁定版本 +``` + +--- + +## 扩展配置 + +### 扩展:配置 + +Fork 本仓库后,在 `lua/config` 目录下可添加如下文件(可选): + +- `lua/config/autocmds.lua` — 自定义自动命令 +- `lua/config/options.lua` — 自定义参数 +- `lua/config/keymaps.lua` — 自定义快捷键 +- `lua/config/setup.lua` — 覆盖配置,详见 [扩展默认值](#扩展默认值) + +添加插件或覆盖现有配置: +- `lua/plugins/*.lua` 或 `lua/plugins.lua` — 插件(语法见 [lazy.nvim] 说明) + +### 推荐 LSP + +```vim +:MasonInstall ansible-language-server bash-language-server css-lsp +:MasonInstall dockerfile-language-server gopls html-lsp json-lsp +:MasonInstall lua-language-server marksman pyright sqlls +:MasonInstall svelte-language-server typescript-language-server +:MasonInstall tailwindcss-language-server +:MasonInstall vim-language-server yaml-language-server +``` + +以及更多:https://github.com/mason-org/mason-lspconfig.nvim/blob/main/doc/server-mapping.md + +### 推荐 Linter + +```vim +:MasonInstall vint shellcheck editorconfig-checker flake8 gitlint hadolint +:MasonInstall markdownlint mypy selene shellharden write-good yamllint +``` + +### 推荐 Formatter + +```vim +:MasonInstall black fixjson gofumpt golines isort +:MasonInstall shfmt sql-formatter stylua +``` + +## 推荐字体 + +* [Pragmata Pro] (€19 — €1,990):我最喜欢的字体 +* 任何 [Nerd Fonts] + +macOS 上用 Homebrew 安装 [Nerd Fonts] 示例: + +```sh +brew tap homebrew/cask-fonts +brew search nerd-font +brew install --cask font-victor-mono-nerd-font +brew install --cask font-iosevka-nerd-font-mono +brew install --cask font-hack-nerd-font +brew install --cask font-fira-code +``` + +[Pragmata Pro]: https://www.fsd.it/shop/fonts/pragmatapro/ +[Nerd Fonts]: https://www.nerdfonts.com + +## 升级 + +升级插件和包: + +* Neovim 插件:`:Lazy update` +* Mason 包:`:Mason` 后按 U + +从本仓库拉取最新配置: + +```bash +git pull --ff --ff-only +``` + +## 结构 + +* [after/](./after) — 针对语言的自定义设置和插件 +* [lua/](./lua) — Lua 配置 + * **`config/`** — 用户自定义配置 + * **`plugins/`** — 用户自定义插件(或 `lua/plugins.lua`) + * [rafi/](./lua/rafi) + * [config/](./lua/config) — Neovim 配置 + * [autocmd.lua](./lua/rafi/config/autocmd.lua) — 自动命令 + * [init.lua](./lua/rafi/config/init.lua) — 初始化 + * [keymaps.lua](./lua/rafi/config/keymaps.lua) — 快捷键映射 + * [lazy.lua](./lua/rafi/config/lazy.lua) — 插件管理入口 + * [options.lua](./lua/rafi/config/options.lua) — 编辑器参数 + * [plugins/](./lua/plugins) — 插件及其配置 + * [util/](./lua/rafi/util) — 工具库 +* [snippets/](./snippets) — 个人代码片段 + +## 扩展 + +### 扩展:配置 + +Fork 此仓库并在 `lua/config` 目录下添加如下文件(可选): + +- `lua/config/autocmds.lua` — 自定义自动命令 +- `lua/config/options.lua` — 自定义参数 +- `lua/config/keymaps.lua` — 自定义快捷键 +- `lua/config/setup.lua` — 覆盖配置,详见 [扩展默认值](#扩展默认值) + +添加插件或覆盖现有配置: + +- `lua/plugins/*.lua` 或 `lua/plugins.lua` — 插件(语法见 [lazy.nvim] 说明) + +## 扩展插件(Extra Plugins) + +
+ 扩展插件列表 (🔎 点击展开/收起) + +你可以在 [lazyvim.org/extras] 查看所有 LazyVim 的扩展插件。 + +这些插件默认未启用。需要通过 `:LazyExtras` 并按 x 安装(或通过 specs 导入)。 +如何添加插件与示例见 [扩展:插件](#扩展)。 + +以下为 Rafi Neovim 配置在 LazyVim 之上额外集成的扩展插件: + +### 扩展插件:编码(Coding) + +Spec: `rafi.plugins.extras.coding.` + +| 名称 | 插件仓库 | 说明 | +| ---------------- | ------------------------------- | ----------------------------------------- | +| `align` | [nvim-mini/mini.align] | 交互式文本对齐 | +| `chainsaw` | [chrisgrieser/nvim-chainsaw] | 快速插入日志语句 | +| `debugprint.lua` | [andrewferrier/debugprint.nvim] | 轻松插入调试打印语句 | +| `editorconfig` | [sgur/vim-editorconfig] | 完全用 Vimscript 实现的 EditorConfig 插件 | +| `emmet` | [mattn/emmet-vim] | Emmet 缩写快速扩展支持 | +| `nvim-cmp` | [hrsh7th/nvim-cmp] | 自动补全插件 | +| `sandwich` | [machakann/vim-sandwich] | 搜索、选择并编辑配对文本对象 | + +[nvim-mini/mini.align]: https://github.com/nvim-mini/mini.align +[chrisgrieser/nvim-chainsaw]: https://github.com/chrisgrieser/nvim-chainsaw +[andrewferrier/debugprint.nvim]: https://github.com/andrewferrier/debugprint.nvim +[sgur/vim-editorconfig]: https://github.com/sgur/vim-editorconfig +[mattn/emmet-vim]: https://github.com/mattn/emmet-vim +[hrsh7th/nvim-cmp]: https://github.com/hrsh7th/nvim-cmp +[machakann/vim-sandwich]: https://github.com/machakann/vim-sandwich + +### 扩展插件:配色方案(Colorscheme) + +Spec: `rafi.plugins.extras.colorscheme.` + +| 名称 | 插件仓库 | 说明 | +| ------------- | ------------------------------- | ---------------------------- | +| `bamboo` | [ribru17/bamboo.nvim] | 温暖的绿色主题 | +| `cyberdream` | [scottmckendry/cyberdream.nvim] | 高对比、未来感与鲜艳色彩主题 | +| `github` | [projekt0n/github-nvim-theme] | GitHub 官方主题 | +| `kanagawa` | [rebelot/kanagawa.nvim] | 葛饰北斋名画色彩灵感主题 | +| `monokai-pro` | [loctvl842/monokai-pro.nvim] | Monokai Pro 多滤镜主题 | + +[ribru17/bamboo.nvim]: https://github.com/ribru17/bamboo.nvim +[scottmckendry/cyberdream.nvim]: https://github.com/scottmckendry/cyberdream.nvim +[projekt0n/github-nvim-theme]: https://github.com/projekt0n/github-nvim-theme +[rebelot/kanagawa.nvim]: https://github.com/rebelot/kanagawa.nvim +[loctvl842/monokai-pro.nvim]: https://github.com/loctvl842/monokai-pro.nvim + +### 扩展插件:编辑器(Editor) + +Spec: `rafi.plugins.extras.editor.` + +| 名称 | 插件仓库 | 说明 | +| ------------- | --------------------------- | ------------------------------------ | +| `anyjump` | [pechorin/any-jump.vim] | 快速跳转到任意定义和引用,无额外开销 | +| `flybuf` | [glepnir/flybuf.nvim] | 浮窗方式列出缓冲区 | +| `harpoon2` | [ThePrimeagen/harpoon] | 项目内导航标记 | +| `mini-visits` | [nvim-mini/mini.visits] | 跟踪和复用文件系统访问记录 | +| `rest` | [rest-nvim/rest.nvim] | 快速的 Neovim HTTP 客户端 | +| `sidebar` | [sidebar-nvim/sidebar.nvim] | 通用且模块化的 Lua 侧边栏 | +| `spectre` | [nvim-pack/nvim-spectre] | 查找与替换 | +| `ufo` | [kevinhwang91/nvim-ufo] | 现代高性能代码折叠 | + +[pechorin/any-jump.vim]: https://github.com/pechorin/any-jump.vim +[glepnir/flybuf.nvim]: https://github.com/glepnir/flybuf.nvim +[ThePrimeagen/harpoon]: https://github.com/ThePrimeagen/harpoon +[nvim-mini/mini.visits]: https://github.com/nvim-mini/mini.visits +[rest-nvim/rest.nvim]: https://github.com/rest-nvim/rest.nvim +[sidebar-nvim/sidebar.nvim]: https://github.com/sidebar-nvim/sidebar.nvim +[nvim-pack/nvim-spectre]: https://github.com/nvim-pack/nvim-spectre +[kevinhwang91/nvim-ufo]: https://github.com/kevinhwang91/nvim-ufo + +### 扩展插件:Git + +Spec: `rafi.plugins.extras.git.` + +| 名称 | 插件仓库 | 说明 | +| ---------- | -------------------- | ---------------------------------- | +| `cmp-git` | [petertriho/cmp-git] | nvim-cmp 的 Git 源 | +| `fugitive` | [tpope/vim-fugitive] | Git 客户端,集成 [junegunn/gv.vim] | + +[petertriho/cmp-git]: https://github.com/petertriho/cmp-git +[tpope/vim-fugitive]: https://github.com/tpope/vim-fugitive +[junegunn/gv.vim]: https://github.com/junegunn/gv.vim + +### 扩展插件:语言支持(Lang) + +Spec: `rafi.plugins.extras.lang.` + +| 名称 | 说明 | +| ------------ | -------------------------------------------------------------------------------------------- | +| `ansible` | 引入 `lazyvim.plugins.extras.lang.ansible`,并集成语法和 [pearofducks/ansible-vim] | +| `go` | 引入 `lazyvim.plugins.extras.lang.go`,集成工具、文件模式等 | +| `helm` | 引入 `lazyvim.plugins.extras.lang.helm`,添加文件类型识别 | +| `kubernetes` | 引入 `lazyvim.plugins.extras.lang.yaml`,文件类型识别与 [ramilito/kubectl.nvim] | +| `markdown` | 引入 `lazyvim.plugins.extras.lang.markdown`,禁用 headlines,集成 [mzlogin/vim-markdown-toc] | +| `python` | 引入 `lazyvim.plugins.extras.lang.python`,集成语法和文件类型 | +| `tmux` | 语法、补全 [andersevenrud/cmp-tmux],导航键 [christoomey/tmux-navigator] | + +[pearofducks/ansible-vim]: https://github.com/pearofducks/ansible-vim +[ramilito/kubectl.nvim]: https://github.com/ramilito/kubectl.nvim +[mzlogin/vim-markdown-toc]: https://github.com/mzlogin/vim-markdown-toc +[andersevenrud/cmp-tmux]: https://github.com/andersevenrud/cmp-tmux +[christoomey/tmux-navigator]: https://github.com/christoomey/vim-tmux-navigator + +### 扩展插件:LSP + +Spec: `rafi.plugins.extras.lsp.` + +| 键 | 插件仓库 | 说明 | +| ---------------- | ------------------------- | -------------------------- | +| `gtd` | [hrsh7th/nvim-gtd] | LSP 跳转到定义插件 | +| `lightbulb` | [kosayoda/nvim-lightbulb] | VSCode 风格 💡 LSP 操作提示 | +| `yaml-companion` | [yaml-companion.nvim] | YAML Schema 智能检测与设置 | + +[hrsh7th/nvim-gtd]: https://github.com/hrsh7th/nvim-gtd +[kosayoda/nvim-lightbulb]: https://github.com/kosayoda/nvim-lightbulb +[yaml-companion.nvim]: https://github.com/someone-stole-my-name/yaml-companion.nvim + +### 扩展插件:Org + +Spec: `rafi.plugins.extras.org.` + +| 键 | 插件仓库 | 说明 | +| ------------ | ----------------------------- | ------------------------------------------ | +| `calendar` | [itchyny/calendar.vim] | 日历应用 | +| `kiwi` | [serenevoid/kiwi.nvim] | 极简版 VimWiki | +| `telekasten` | [renerocksai/telekasten.nvim] | 基于 Telescope 的 Markdown 知识库/维基管理 | +| `vimwiki` | [vimwiki/vimwiki] | Vim 的个人 Wiki | +| `zk-nvim` | [zk-org/zk-nvim] | zk 纯文本笔记扩展 | + +[itchyny/calendar.vim]: https://github.com/itchyny/calendar.vim +[serenevoid/kiwi.nvim]: https://github.com/serenevoid/kiwi.nvim +[renerocksai/telekasten.nvim]: https://github.com/renerocksai/telekasten.nvim +[vimwiki/vimwiki]: https://github.com/vimwiki/vimwiki +[zk-org/zk-nvim]: https://github.com/zk-org/zk-nvim + +### 扩展插件:Treesitter + +Spec: `rafi.plugins.extras.treesitter.` + +| 键 | 插件仓库 | 说明 | +| --------- | -------------------------------- | ------------------------------- | +| `endwise` | [RRethy/nvim-treesitter-endwise] | 智能补全 `end` 关键字(多语言) | +| `treesj` | [Wansmer/treesj] | 代码块智能拆分与合并 | + +[RRethy/nvim-treesitter-endwise]: https://github.com/RRethy/nvim-treesitter-endwise +[Wansmer/treesj]: https://github.com/Wansmer/treesj + +### 扩展插件:UI + +Spec: `rafi.plugins.extras.ui.` + +| 键 | 插件仓库 | 说明 | +| ----------------- | ------------------------------- | -------------------------------- | +| `alpha` | [goolord/alpha-nvim] | 快速且可编程的欢迎界面 | +| `barbecue` | [utilyre/barbecue.nvim] | VSCode 风格 winbar | +| `bookmarks` | [tomasky/bookmarks.nvim] | 支持全局文件存储的书签插件 | +| `bqf` | [kevinhwang91/nvim-bqf] | 更好的 quickfix 窗口 | +| `ccc` | [uga-rosa/ccc.nvim] | 超强色彩选择与着色器插件 | +| `cursorword` | [itchyny/cursorword] | 下划线当前光标下单词 | +| `cybu` | [ghillb/cybu.nvim] | 可自定义通知窗口的缓冲区切换插件 | +| `deadcolumn` | [Bekaboo/deadcolumn.nvim] | 动态显示 colorcolumn | +| `goto-preview` | [rmagatti/goto-preview] | 浮窗预览定义 | +| `headlines` | [lukas-reineke/headlines.nvim] | 标题与代码背景高亮 | +| `illuminate` | [RRethy/vim-illuminate] | 高亮光标下单词的其他用法 | +| `incline` | [b0o/incline.nvim] | 浮动状态栏 | +| `marks` | [chentoast/marks.nvim] | 交互与管理 mark 标记 | +| `mini-clue` | [nvim-mini/mini.clue] | 下一个按键提示 | +| `mini-map` | [nvim-mini/mini.map] | 迷你地图、滚动条与高亮 | +| `quicker` | [stevearc/quicker.nvim] | 改进的 quickfix UI 与工作流 | +| `symbols-outline` | [simrat39/symbols-outline.nvim] | LSP 符号树型视图 | + +[goolord/alpha-nvim]: https://github.com/goolord/alpha-nvim +[utilyre/barbecue.nvim]: https://github.com/utilyre/barbecue.nvim +[tomasky/bookmarks.nvim]: https://github.com/tomasky/bookmarks.nvim +[kevinhwang91/nvim-bqf]: https://github.com/kevinhwang91/nvim-bqf +[uga-rosa/ccc.nvim]: https://github.com/uga-rosa/ccc.nvim +[itchyny/cursorword]: https://github.com/itchyny/vim-cursorword +[ghillb/cybu.nvim]: https://github.com/ghillb/cybu.nvim +[Bekaboo/deadcolumn.nvim]: https://github.com/Bekaboo/deadcolumn.nvim +[rmagatti/goto-preview]: https://github.com/rmagatti/goto-preview +[lukas-reineke/headlines.nvim]: https://github.com/lukas-reineke/headlines.nvim +[RRethy/vim-illuminate]: https://github.com/RRethy/vim-illuminate +[b0o/incline.nvim]: https://github.com/b0o/incline.nvim +[chentoast/marks.nvim]: https://github.com/chentoast/marks.nvim +[nvim-mini/mini.clue]: https://github.com/nvim-mini/mini.clue +[nvim-mini/mini.map]: https://github.com/nvim-mini/mini.map +[stevearc/quicker.nvim]: https://github.com/stevearc/quicker.nvim +[simrat39/symbols-outline.nvim]: https://github.com/simrat39/symbols-outline.nvim + +### LazyVim 扩展插件 + +LazyVim 已在 specs 中导入(见 [lua/rafi/config/lazy.lua](./lua/rafi/config/lazy.lua))。 +因此,你可以直接导入 [LazyVim/LazyVim](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/plugins/extras) 下定义的任何 "Extras" 插件, +并参考 [lazyvim.org/extras] 文档。 + +使用 Spacemx 或 `:LazyExtras` 安装。 + +**以下为部分精选:** + +* `ai.copilot` +* `coding.neogen` +* `coding.yanky` +* `dap.core` +* `test.core` +* `util.mini-hipatterns` +* `lang.docker` +* `lang.json` +* `lang.markdown` +* `lang.svelte` +* `lang.terraform` +* 以及 [更多插件](https://www.lazyvim.org/extras)…… + +
+ +## 自定义快捷键(Custom Key-mappings) + +注意事项: + +* **主前缀**(Leader)键为 Space +* **本地前缀**(Local-Leader)键为 ;,用于导航与搜索 + (Telescope/Snacks/FZF 和 Neo-tree) +* 启用 `vim.g.elite_mode` 后,普通模式下禁用 方向键 + +
+ + 快捷键总览 + (🔎 点击展开/收起) + + +图例:| Ⓝormal 正常 | Ⓥisual 可视 | Ⓢelect 选择 | Ⓘnsert 插入 | Ⓞperator 操作 | Ⓒommand 命令 | + +### 选择器(Picker) + +(Telescope/Snacks/FZF) + +| 快捷键 | 模式 | 功能说明 | +| ------------------------------------------------- | :---: | -------------------------- | +| Space ; | Ⓝ | 选择选择器 | +| ;r | Ⓝ | 恢复上次选择器 | +| ;p | Ⓝ | 项目 | +| ;f | Ⓝ | 文件 | +| ;F | Ⓝ | 文件(当前目录) | +| ;g | Ⓝ | 全局搜索 | +| ;G | Ⓝ | 全局搜索(当前目录) | +| ;b | Ⓝ | 切换缓冲区 | +| ;h | Ⓝ | 帮助文档 | +| ;H | Ⓝ | 高亮 | +| ;j | Ⓝ | 跳转列表 | +| ;m | Ⓝ | 跳转到标记 | +| ;M | Ⓝ | Man 手册 | +| ;o | Ⓝ | 选项 | +| ;t | Ⓝ | 跳转到符号 | +| ;T | Ⓝ | 跳转到符号(工作区) | +| ;v | Ⓝ Ⓥ | 寄存器 | +| ;s | Ⓝ | 会话管理 | +| ;u | Ⓝ | 拼写建议 | +| ;x | Ⓝ | 最近文件 | +| ;X | Ⓝ | 最近文件(当前目录) | +| ;z | Ⓝ | Zoxide 目录 | +| ;; | Ⓝ | 命令历史 | +| ;: | Ⓝ | 命令 | +| ;/ | Ⓝ | 搜索历史 | +| ;dd | Ⓝ | LSP 定义 | +| ;di | Ⓝ | LSP 实现 | +| ;dr | Ⓝ | LSP 引用 | +| ;da | Ⓝ Ⓥ | LSP 代码操作 | +| Space / | Ⓝ | 当前缓冲区模糊查找 | +| Space gs | Ⓝ | Git 状态 | +| Space gr | Ⓝ | Git 分支 | +| Space gh | Ⓝ | Git 存档 | +| Space gF | Ⓝ | 查找光标下单词相关文件 | +| Space gg | Ⓝ Ⓥ | 全文/选区搜索 | +| Space gG | Ⓝ Ⓥ | 全文/选区搜索(当前目录) | +| Space sc | Ⓝ | 主题切换 | +| Space sd | Ⓝ | 文档诊断 | +| Space sD | Ⓝ | 工作区诊断 | +| Space sh | Ⓝ | 帮助标签 | +| Space sk | Ⓝ | 快捷键映射 | +| Space sm | Ⓝ | Man 手册 | +| Space ss | Ⓝ | LSP 文档符号 | +| Space sS | Ⓝ | LSP 工作区符号 | +| Space st | Ⓝ | 待办列表 | +| Space sT | Ⓝ | 待办/Fix/Fixme 列表 | +| Space sw | Ⓝ | 字符串查找 | +| | |   | +| ;i | Ⓝ | (Snacks 专用)图标 | +| ;w | Ⓝ | (Telescope 专用)笔记 | +| ;n | Ⓝ | (Telescope 专用)插件目录 | +| ;k | Ⓝ | (Telescope 专用)同义词 | +| | |   | +| **选择器窗口内** | |   | +| ? | Ⓝ | 快捷键帮助屏幕 | +| Ctrl+Space | Ⓝ | 切换模糊搜索 | +| jjEscape | Ⓘ | 离开插入模式 | +| i | Ⓝ | 进入插入模式(筛选输入) | +| qEscape | Ⓝ | 退出 | +| TabShift+Tab | Ⓝ Ⓘ | 下/上一个候选项 | +| Ctrl+d/u | Ⓝ Ⓘ | 向下/向上滚动 | +| Ctrl+f/b | Ⓝ Ⓘ | 预览区向下/向上滚动 | +| Ctrl+j/k | Ⓝ Ⓘ | 预览区垂直滚动 | +| Ctrl+h/l | Ⓝ Ⓘ | 预览区水平滚动 | +| JK | Ⓝ | 候选项上下选择 | +| st | Ⓝ | 新 tab 打开 | +| sg | Ⓝ | 垂直分屏打开 | +| sv | Ⓝ | 水平分屏打开 | +| * | Ⓝ | 切换选择 | +| u | Ⓝ | 清空所有 | +| w | Ⓝ | 智能发送至 quickfix | +| e | Ⓝ | 发送至 quickfix | +| Ctrl+q | Ⓘ | 发送至 quickfix | +| dd | Ⓝ | 删除条目(缓冲区列表) | +| ! | Ⓝ | 命令行编辑 | + +### 功能切换(Toggle Features) + +| 快捷键 | 模式 | 功能说明 | +| ------------------------------- | :---: | ------------------------- | +| Space dph | Ⓝ | 开关性能分析高亮 | +| Space dpp | Ⓝ | 开关性能分析 | +| Space ua | Ⓝ | 开关动画 | +| Space uA | Ⓝ | 开关标签栏 | +| Space ub | Ⓝ | 切换深色/浅色背景 | +| Space uc | Ⓝ | 切换折叠级别 | +| Space uC | Ⓝ | 切换配色方案 | +| Space ud | Ⓝ | 切换当前缓冲区诊断 | +| Space uD | Ⓝ | 切换文本变暗 | +| Space uf | Ⓝ | 切换保存时自动格式化 | +| Space uF | Ⓝ | 全局切换保存时自动格式化 | +| Space ug | Ⓝ | 切换缩进线 | +| Space uG | Ⓝ | 切换 Git 标记 | +| Space uh | Ⓝ | 切换 inlay-hints | +| Space ui | Ⓝ | 检查光标位置 | +| Space uI | Ⓝ | 检查树结构 | +| Space ul | Ⓝ | 切换行号 | +| Space uL | Ⓝ | 切换相对行号 | +| Space um | Ⓝ | 切换 Markdown 渲染 | +| Space un | Ⓝ | 清除所有通知 | +| Space up | Ⓝ | 禁用自动配对 | +| Space ur | Ⓝ | 重绘、清除高亮并更新 diff | +| Space us | Ⓝ | 切换拼写检查 | +| Space uS | Ⓝ | 切换平滑滚动 | +| Space uT | Ⓝ | 切换 Treesitter | +| Space uw | Ⓝ | 切换自动换行 | +| Space uz | Ⓝ | 切换专注写作(Zen 模式) | +| Space uZ | Ⓝ | 切换窗口缩放 | + +### 导航(Navigation) + +| 快捷键 | 模式 | 功能说明 | 插件或映射 | +| ---------------------------------------------- | :---: | ------------------------ | ------------------------------------------------------- | +| j / k | Ⓝ Ⓥ | 按显示行上下移动光标 | `g` `j/k` | +| ]i / [i | Ⓝ Ⓥ | 跳转到缩进块边缘 | [folke/snacks.nvim] | +| gh / gl | Ⓝ Ⓥ | 快速行首/行尾移动 | `g^` `g$` | +| zl / zh | Ⓝ | 水平滚动 | `z4l/h` | +| Ctrl+j | Ⓝ | 跳转到下方分屏 | `j` 或 [christoomey/tmux-navigator] | +| Ctrl+k | Ⓝ | 跳转到上方分屏 | `k` 或 [christoomey/tmux-navigator] | +| Ctrl+h | Ⓝ | 跳转到左侧分屏 | `h` 或 [christoomey/tmux-navigator] | +| Ctrl+l | Ⓝ | 跳转到右侧分屏 | `l` 或 [christoomey/tmux-navigator] | +| Return | Ⓝ | 切换当前折叠 | `za` | +| Shift+Return | Ⓝ | 只展开当前折叠,关闭其它 | `zMzv` | +| Ctrl+f | Ⓒ | 命令行中向前移动光标 | | +| Ctrl+b | Ⓒ | 命令行中向后移动光标 | | +| Ctrl+h | Ⓒ | 命令行移动到行首 | Home | +| Ctrl+l | Ⓒ | 命令行移动到行尾 | End | +| Ctrl+Tab | Ⓝ | 下一个标签页 | `:tabnext` | +| Ctrl+ShiftTab | Ⓝ | 上一个标签页 | `:tabprevious` | +| Alt+j] | Ⓝ | 下一个标签页 | `:tabnext` | +| Alt+k[ | Ⓝ | 上一个标签页 | `:tabprevious` | +| Alt+{ | Ⓝ | 标签页左移 | `:-tabmove` | +| Alt+} | Ⓝ | 标签页右移 | `:+tabmove` | + +### 选择(Selection) + +| 快捷键 | 模式 | 功能说明 | 插件或映射 | +| ------------------------------------------------ | :---: | --------------------------- | -------------------------------------- | +| Space+Space | Ⓝ Ⓥ | 切换可视行模式 | `V` / Escape | +| Ctrl+Space / V | Ⓥ | 增加/缩小选择范围(语法树) | [nvim-treesitter] | +| vsp | Ⓝ | 选择上次粘贴区域 | [config/keymaps.lua] | +| sg | Ⓥ | 在选区内替换 | [config/keymaps.lua] | +| Ctrl+r | Ⓥ | 选区内逐步确认替换 | [config/keymaps.lua] | +| > / < | Ⓥ | 缩进并保持选区 | [config/keymaps.lua] | +| Tab / Shift+Tab | Ⓥ | 缩进并保持选区 | [config/keymaps.lua] | +| I / gI / A | Ⓥ | 强制块操作 | [config/keymaps.lua] | + +### 跳转(Jump To) + +| 快捷键 | 模式 | 功能说明 | 插件或映射 | +| ------------------------------ | :---: | ------------------ | --------------------------------------------- | +| ],[, | Ⓝ | 下/上一个参数 | [akinsho/bufferline.nvim] | +| ]q[q | Ⓝ | quickfix 下/上一项 | `:cnext` / `:cprev` | +| ]a[a | Ⓝ | 位置列表下/上一项 | `:lnext` / `:lprev` | +| ]d[d | Ⓝ | 下/上一个诊断 | [config/keymaps.lua] | +| ]e[e | Ⓝ | 下/上一个错误 | [config/keymaps.lua] | +| ]w[w | Ⓝ | 下/上一个警告 | [config/keymaps.lua] | +| ]b[b | Ⓝ | 下/上一个缓冲区 | [akinsho/bufferline.nvim] | +| ]f[f | Ⓝ | 下/上一个函数开头 | [echasnovski/mini.ai] | +| ]F[F | Ⓝ | 下/上一个函数结尾 | [echasnovski/mini.ai] | +| ]c[c | Ⓝ | 下/上一个类开头 | [echasnovski/mini.ai] | +| ]C[C | Ⓝ | 下/上一个类结尾 | [echasnovski/mini.ai] | +| ]m[m | Ⓝ | 下/上一个方法开头 | [echasnovski/mini.ai] | +| ]M[M | Ⓝ | 下/上一个方法结尾 | [echasnovski/mini.ai] | +| ]g[g | Ⓝ | 下/上一个 Git hunk | [lewis6991/gitsigns.nvim] | +| ]i[i | Ⓝ | 下/上一个缩进块 | [echasnovski/mini.indentscope] | +| ]t[t | Ⓝ | 下/上一个 TODO | [folke/todo-comments.nvim] | +| ]z[z | Ⓝ | 下/上一个空白错误 | [config/keymaps.lua] | + +### 缓冲区(Buffers) + +| 快捷键 | 模式 | 功能说明 | 插件或映射 | +| ------------------------------ | :---: | ---------- | ---------------------------------- | +| Space+bd | Ⓝ | 删除缓冲区 | [folke/snacks.nvim] | + +### 剪贴板(Clipboard) + +| 快捷键 | 模式 | 功能说明 | 插件或映射 | +| ----------------------------- | :---: | ------------------------ | ----------------------------------- | +| pP | Ⓥ | 粘贴但不覆盖寄存器 | `:let @+=@0` | +| Space+y | Ⓝ | 复制相对文件路径到剪贴板 | [config/keymaps.lua] | +| Space+Y | Ⓝ | 复制绝对文件路径到剪贴板 | [config/keymaps.lua] | + +### 自动补全(Auto-Completion) + +| 快捷键 | 模式 | 功能说明 | 插件或映射 | +| ----------------------------------------- | :---: | -------------------- | --------------------------------- | +| Tab / Shift-Tab | Ⓘ Ⓢ | 补全菜单内切换/打开 | [nvim-cmp] | +| Tab / Shift-Tab | Ⓘ Ⓢ | 片段占位符切换 | [L3MON4D3/LuaSnip] | +| Ctrl+Space | Ⓘ | 打开补全菜单 | [nvim-cmp] | +| Enter | Ⓘ | 选择补全项或展开片段 | [nvim-cmp] | +| Shift+Enter | Ⓘ | 选择并替换补全项 | [nvim-cmp] | +| Ctrl+n/p | Ⓘ | 补全弹窗内上下移动 | [nvim-cmp] | +| Ctrl+f/b | Ⓘ | 滚动文档 | [nvim-cmp] | +| Ctrl+d/u | Ⓘ | 候选项滚动 | [nvim-cmp] | +| Ctrl+e | Ⓘ | 取消选择并关闭弹窗 | [nvim-cmp] | +| Ctrl+l | Ⓘ | 在光标处展开片段 | [L3MON4D3/LuaSnip] | +| Ctrl+c | Ⓘ | 关闭补全菜单 | [nvim-cmp] | + +### LSP(语言服务器协议) + +| 快捷键 | 模式 | 操作说明 | 插件或映射 | +| ------------------------------- | :---: | ---------------------- | ---------------------------------------- | +| gr | Ⓝ | 跳转到引用 | [plugins/lsp/keymaps.lua] | +| gR | Ⓝ | 使用 Trouble 列出引用 | [folke/trouble.nvim] | +| gd | Ⓝ | 跳转到定义 | [plugins/lsp/keymaps.lua] | +| gD | Ⓝ | 跳转到声明 | [plugins/lsp/keymaps.lua] | +| gI | Ⓝ | 跳转到实现 | [plugins/lsp/keymaps.lua] | +| gy | Ⓝ | 跳转到类型定义 | [plugins/lsp/keymaps.lua] | +| K | Ⓝ | 显示悬浮帮助或折叠提示 | [plugins/lsp/keymaps.lua] | +| gK | Ⓝ | 显示签名帮助 | [plugins/lsp/keymaps.lua] | +| Space cr | Ⓝ | 重命名 | [plugins/lsp/keymaps.lua] | +| Space ce | Ⓝ | 打开诊断窗口 | [plugins/lsp/keymaps.lua] | +| Space cs | Ⓝ | 格式化菜单选择 | [plugins/lsp/keymaps.lua] | +| Space ca | Ⓝ Ⓥ | 代码操作 | [plugins/lsp/keymaps.lua] | +| Space cA | Ⓝ | 源码操作 | [plugins/lsp/keymaps.lua] | +| Space cli | Ⓝ | LSP 传入调用 | [plugins/lsp/keymaps.lua] | +| Space clo | Ⓝ | LSP 传出调用 | [plugins/lsp/keymaps.lua] | +| Space fwa | Ⓝ | 添加工作区文件夹 | [plugins/lsp/keymaps.lua] | +| Space fwr | Ⓝ | 移除工作区文件夹 | [plugins/lsp/keymaps.lua] | +| Space fwl | Ⓝ | 列出工作区文件夹 | [plugins/lsp/keymaps.lua] | +| Space cgd | Ⓝ | Glance 查看定义 | [dnlhc/glance.nvim] | +| Space cgr | Ⓝ | Glance 查看引用 | [dnlhc/glance.nvim] | +| Space cgy | Ⓝ | Glance 查看类型定义 | [dnlhc/glance.nvim] | +| Space cgi | Ⓝ | Glance 查看实现 | [dnlhc/glance.nvim] | +| Space cgu | Ⓝ | Glance 恢复上次查看 | [dnlhc/glance.nvim] | + +### 诊断(Diagnostics) + +| 快捷键 | 模式 | 操作说明 | 插件或映射 | +| ------------------------------ | :---: | ------------------------------ | ----------------------------------------- | +| Space ud | Ⓝ | 切换缓冲区诊断 | [plugins/lsp/keymaps.lua] | +| Space xt | Ⓝ | 使用 Trouble 列出 TODO | [folke/todo-comments.nvim] | +| Space xT | Ⓝ | 使用 Trouble 列出 TODO/FIXME | [folke/todo-comments.nvim] | +| Space st | Ⓝ | 使用 Telescope 选择 TODO | [folke/todo-comments.nvim] | +| Space sT | Ⓝ | 使用 Telescope 选择 TODO/FIXME | [folke/todo-comments.nvim] | +| Space xx | Ⓝ | 切换 Trouble 诊断面板 | [folke/trouble.nvim] | +| Space xd | Ⓝ | 切换 Trouble 文档诊断 | [folke/trouble.nvim] | +| Space xw | Ⓝ | 切换 Trouble 工作区诊断 | [folke/trouble.nvim] | +| Space xq | Ⓝ | 使用 Trouble 切换 Quickfix | [folke/trouble.nvim] | +| Space xl | Ⓝ | 使用 Trouble 切换 Locationlist | [folke/trouble.nvim] | + +### Coding + +| Key | Mode | Action | Plugin or Mapping | +| --------------------------------------------- | :---: | --------------------------------------- | ------------------------------------------ | +| Ctrl+q | Ⓝ | Start recording macro | `q` | +| Space cf | Ⓝ Ⓥ | Format | [plugins/formatting.lua] | +| Space cF | Ⓝ Ⓥ | Format injected langs | [plugins/formatting.lua] | +| Space cc | Ⓝ | Generate doc annotations | [danymat/neogen] | +| Shift+Return | Ⓘ | Start new line from any cursor position | `o` | +| ] Space | Ⓝ | Add new line below | `o` | +| [ Space | Ⓝ | Add new line above | `O` | +| gc | Ⓝ Ⓥ | Comment prefix | [numToStr/Comment.nvim] | +| gcc | Ⓝ Ⓥ | Toggle comments | [numToStr/Comment.nvim] | +| Space+j or k | Ⓝ Ⓥ | Move lines down/up | `:m` … | +| Space+v | Ⓝ Ⓥ | Toggle line-wise comments | [numToStr/Comment.nvim] | +| Space+V | Ⓝ Ⓥ | Toggle block-wise comments | [numToStr/Comment.nvim] | +| Space+dd | Ⓝ Ⓥ | Duplicate line or selection | [config/keymaps.lua] | +| Space+cw | Ⓝ | Remove all spaces at EOL | [nvim-mini/mini.trailspace] | +| Space+cid | Ⓝ | LazyDev | [folke/lazydev.nvim] | +| Space+cif | Ⓝ | LazyFormatterInfo | [LazyVim/LazyVim] | +| Space+cir | Ⓝ | LazyRoot | [LazyVim/LazyVim] | +| sj / sk | Ⓝ | Join/split arguments | [nvim-mini/mini.splitjoin] | + +### 搜索、替换与差异(Search, Substitute, Diff) + +| 快捷键 | 模式 | 操作说明 | 插件或映射 | +| ------------------------------ | :---: | -------------------------- | ----------------------------------- | +| \* / # | Ⓝ Ⓥ | 搜索部分单词 | `g*` / `g#` | +| g\* / g# | Ⓝ Ⓥ | 搜索完整单词(前/后) | `*` / `#` | +| Ctrl+c | Ⓝ | 修改当前单词 | `ciw` | +| Escape | Ⓝ | 清除搜索高亮 | `:nohlsearch` | +| Backspace | Ⓝ | 匹配括号 | `%` | +| Space+bf | Ⓝ | 在当前标签页窗口间比对差异 | `windo diffthis` | +| Space+bF | Ⓝ | 外部 diff 比较 | `!vim.g.diffprg % #` | +| ss | Ⓝ Ⓥ Ⓞ | Flash 跳转 | [folke/flash.nvim] | +| S | Ⓝ Ⓥ Ⓞ | Flash Treesitter 跳转 | [folke/flash.nvim] | +| r | Ⓞ | Flash 远程跳转 | [folke/flash.nvim] | +| R | Ⓥ Ⓞ | Flash Treesitter 搜索 | [folke/flash.nvim] | +| Ctrl+s | Ⓒ | 在搜索输入时切换 Flash | [folke/flash.nvim] | + +### 命令与历史(Command & History) + +| 快捷键 | 模式 | 操作说明 | 插件或映射 | +| ------------------------------------------- | :---: | --------------------- | ---------------------------------- | +| g! | Ⓝ | 读取 Vim 命令到缓冲区 | `:put=execute('⌴')` | +| Ctrl+n / p | Ⓒ | 切换历史搜索条目 | / | +| / | Ⓒ | 切换历史搜索条目 | `Ctrl` `n`/`p` | + +### 文件操作 + +| 按键 | 模式 | 动作说明 | 插件或映射 | +| ---------------------------------------------------------- | :---: | ------------------------------------ | --------------------------- | +| Space+cd | Ⓝ | 将当前标签页切换到当前缓冲区所在目录 | `:tcd %:p:h` | +| Space+wM+s | Ⓝ | 保存缓冲区到文件 | `:write` | +| Ctrl+s | Ⓝ Ⓥ Ⓒ | 保存缓冲区到文件 | `:write` | + +### 窗口管理 + +| 按键 | 模式 | 动作说明 | 插件或映射 | +| ------------------------------ | :---: | ----------------------------------------- | ------------------------------------------ | +| Space qq | Ⓝ | 退出全部窗口并关闭 Neovim | `:quitall` | +| s] | Ⓝ | 旋转窗口位置 | `C-w` `x` | +| sp | Ⓝ | 选择一个窗口进行编辑 | [s1n7ax/nvim-window-picker] | +| sw | Ⓝ | 与所选窗口互换内容 | [s1n7ax/nvim-window-picker] | +| sv | Ⓝ | 水平分割窗口 | `:split` | +| sg | Ⓝ | 垂直分割窗口 | `:vsplit` | +| st | Ⓝ | 新建标签页 | `:tabnew` | +| so | Ⓝ | 关闭其他窗口 | `:only` | +| sb | Ⓝ | 切换到上一个缓冲区 | `:b#` | +| sc | Ⓝ | 关闭当前窗口 | `:close` | +| sd | Ⓝ | 删除当前缓冲区 | `:bdelete` | +| sq | Ⓝ | 关闭窗口(若为最后一个窗口则退出 Neovim) | `:quit` | +| sx | Ⓝ | 删除缓冲区并保留空窗口 | `:enew │ bdelete` | +| sz | Ⓝ | 切换窗口放大/还原 | `:vertical resize │ resize` | +| sh | Ⓝ | 切换配色方案背景(深色/浅色) | `:set background` … | + +### 插件与工具 + +| 按键 | 模式 | 动作说明 | 插件或映射 | +| ---------------------------------------- | :---: | ---------------------------------------- | ---------------------------------------------- | +| ;+c | Ⓝ | 打开上下文菜单 | [lua/rafi/util/contextmenu.lua] | +| gCtrl+o | Ⓝ | 在跳转列表中回到较旧的文件 | [util/edit.lua] | +| gCtrl+i | Ⓝ | 在跳转列表中前进到较新的文件 | [util/edit.lua] | +| Ctrl+/ | Ⓝ | 切换浮动终端 | [folke/snacks.nvim] | +| Space l | Ⓝ | 打开 Lazy 插件管理器 | [folke/lazy.nvim] | +| Space o | Ⓝ | 打开 Outline 侧边栏 | [hedyhli/outline.nvim] | +| Space ? | Ⓝ | 查询当前单词的 macOS 词典 | `:!open dict://` | +| Space cp | Ⓝ | 切换 Markdown 预览 | iamcco/markdown-preview.nvim | +| Space mc | Ⓝ | 打开取色器 | [uga-rosa/ccc.nvim] | +| Space tt | Ⓝ | 在项目根目录打开终端 | [config/keymaps.lua] | +| Space tT | Ⓝ | 在当前工作目录打开终端 | [config/keymaps.lua] | +| Space gt | Ⓝ | 在项目根目录启动 Lazygit | [config/keymaps.lua] | +| Space gT | Ⓝ | 在当前工作目录启动 Lazygit | [config/keymaps.lua] | +| Space gF | Ⓝ | 在 Lazygit 中查看当前文件的提交历史 | [config/keymaps.lua] | +| Space gl | Ⓝ | 打开 Lazygit 提交日志 | [config/keymaps.lua] | +| Space gL | Ⓝ | 打开 Lazygit 当前目录的提交日志 | [config/keymaps.lua] | +| Space gb | Ⓝ | 查看 Git blame | [FabijanZulj/blame.nvim] | +| Space gB | Ⓝ | 在新窗口中查看 Git blame | [FabijanZulj/blame.nvim] | +| Space gm | Ⓝ | 查看光标下提交的详细信息 | [config/keymaps.lua] | +| Space go | Ⓝ Ⓥ | 打开光标选区的源码链接 | [config/keymaps.lua] | +| Space gY | Ⓝ Ⓥ | 复制光标选区的源码链接 | [config/keymaps.lua] | +| Space gu | Ⓝ | 打开撤销树 | [mbbill/undotree] | +| Space mg | Ⓝ | 打开 Neogit | [NeogitOrg/neogit] | +| Space ml | Ⓝ | 在文件末尾追加 modeline 设置行 | [config/keymaps.lua] | +| Space mda | Ⓥ | 依次标记多段区域用于 diff | [AndrewRadev/linediff.vim] | +| Space mdf | Ⓥ | 标记区域并在超过一个标记时进行 diff 对比 | [AndrewRadev/linediff.vim] | +| Space mds | Ⓝ | 展示所有标记区域的比较结果 | [AndrewRadev/linediff.vim] | +| Space mdr | Ⓝ | 清除 diff 标记 | [AndrewRadev/linediff.vim] | +| Space mh | Ⓝ | 打开 HTTP Rest UI | [rest-nvim/rest.nvim] | +| Space mt | Ⓝ Ⓥ | 切换高亮当前单词 | [t9md/vim-quickhl] | +| Space mo | Ⓝ | 更新 Markdown 目录 | [mzlogin/vim-markdown-toc] | + +#### 插件:Mini.Surround + +参见 [echasnovski/mini.surround] 获取更多快捷键和用法说明。 + +| 快捷键 | 模式 | 功能说明 | +| --------------------- | :---: | ---------------- | +| sa & 移动 | Ⓝ Ⓥ | 添加包裹符号 | +| cs & 移动 | Ⓝ | 替换包裹符号 | +| ds & 移动 | Ⓝ | 删除包裹符号 | +| gzf & 移动 | Ⓝ | 查找右侧包裹符号 | +| gzF & 移动 | Ⓝ | 查找左侧包裹符号 | +| gzh & 移动 | Ⓝ | 高亮包裹对象 | +| gzn & 移动 | Ⓝ | 更新邻近行的包裹 | + +#### 插件:Gitsigns + +参见 [lewis6991/gitsigns.nvim] 获取更多快捷键和用法说明。 + +| 快捷键 | 模式 | 功能说明 | +| ------------------------------- | :---: | -------------------------- | +| ]g[g | Ⓝ | 下/上一个 Git hunk | +| gs | Ⓝ | 预览 hunk | +| Space hp | Ⓝ | 行内预览 hunk | +| Space hb | Ⓝ | 查看该行 blame | +| Space hs | Ⓝ Ⓥ | 暂存 hunk | +| Space hr | Ⓝ Ⓥ | 恢复 hunk | +| Space hu | Ⓝ | 撤销暂存 hunk | +| Space hS | Ⓝ | 暂存整个缓冲区 | +| Space hR | Ⓝ | 恢复整个缓冲区 | +| Space hd | Ⓝ | 与索引比较差异 | +| Space hD | Ⓝ | 与上一次提交比较差异 | +| Space hw | Ⓝ | 切换单词级 diff | +| Space hl | Ⓝ | 发布 hunk 到 location-list | +| Space htb | Ⓝ | 切换当前行 blame | +| Space htd | Ⓝ | 切换已删除行显示 | +| Space htw | Ⓝ | 切换单词高亮 diff | +| Space htl | Ⓝ | 切换行高亮 | +| Space htn | Ⓝ | 切换行号高亮 | +| Space hts | Ⓝ | 切换 Git 标记 | +| ih | Ⓞ | 选择 hunk 操作对象 | + +#### 插件:Diffview + +参见 [sindrets/diffview.nvim] 获取更多快捷键和用法说明。 + +| 快捷键 | 模式 | 功能说明 | +| ------------------------------------------------ | :---: | --------------------- | +| Space gd | Ⓝ | 查看文件历史差异 | +| Space gv | Ⓝ | 打开差异视图 | +| | |   | +| **在 _diffview_ “视图”窗口内** | |   | +| | |   | +| Tab / Shift+Tab | Ⓝ | 选择下一个/上一个条目 | +| ; a | Ⓝ | 聚焦文件 | +| ; e | Ⓝ | 切换文件面板 | +| | |   | +| **在 _diffview_ “文件”面板内** | |   | +| | |   | +| q | Ⓝ | 关闭 | +| h | Ⓝ | 上一个条目 | +| o | Ⓝ | 聚焦条目 | +| gf | Ⓝ | 打开文件 | +| sg | Ⓝ | 分屏打开文件 | +| st | Ⓝ | 新标签页打开文件 | +| Ctrl+r | Ⓝ | 刷新文件 | +| ; e | Ⓝ | 切换面板 | +| | |   | +| **在 _diffview_ “历史”面板内** | |   | +| | |   | +| q | Ⓝ | 关闭 diffview | +| o | Ⓝ | 聚焦条目 | +| O | Ⓝ | 显示选项 | + +#### 插件:Neo-Tree + +参见 [nvim-neo-tree/neo-tree.nvim] 获取更多快捷键和用法说明。 + +| 快捷键 | 模式 | 功能说明 | +| ------------------------------------------------- | :---: | ------------------------------ | +| Space e/fe | Ⓝ | 切换文件浏览器(根目录) | +| Space E/fE | Ⓝ | 切换文件浏览器(当前目录) | +| ge | Ⓝ | 打开 Git 浏览器 | +| be | Ⓝ | 打开缓冲区浏览器 | +| ;a | Ⓝ | 在文件浏览器中定位 | +| ;A | Ⓝ | 在文件浏览器中定位(当前目录) | +| | |   | +| **在 _Neo-Tree_ 窗口内** | |   | +| | |   | +| g? | Ⓝ | 显示帮助 | +| q | Ⓝ | 关闭窗口 | +| jk | Ⓝ | 上下移动树节点 | +| TabShift+Tab | Ⓝ | 下一个/上一个源 | +| ]g[g | Ⓝ | 跳转到下/上一个 Git 修改节点 | +| l | Ⓝ | 展开/收起目录或打开文件 | +| h | Ⓝ | 收起目录树 | +| Return | Ⓝ | 选择窗口打开文件 | +| gr | Ⓝ | 在当前位置 grep 搜索 | +| gf | Ⓝ | 在当前位置查找文件 | +| . | Ⓝ | 设为根目录 | +| Backspace | Ⓝ | 切换到上级目录 | +| svS | Ⓝ | 水平分屏打开文件 | +| sgs | Ⓝ | 垂直分屏打开文件 | +| stt | Ⓝ | 新标签页打开文件 | +| p | Ⓝ | 切换预览 | +| a | Ⓝ | 新建目录和/或文件 | +| N | Ⓝ | 新建目录 | +| r | Ⓝ | 重命名文件或目录 | +| dd | Ⓝ | 删除 | +| c / m | Ⓝ | 复制/移动 | +| y / x / P | Ⓝ | 剪贴板复制/剪切/粘贴 | +| ! | Ⓝ | 过滤 | +| D | Ⓝ | 过滤目录 | +| # | Ⓝ | 模糊排序 | +| F | Ⓝ | 提交时过滤 | +| Ctrl+c | Ⓝ | 清除过滤 | +| Ctrl+rR | Ⓝ | 刷新 | +| fi / fe | Ⓝ | 包含/排除 | +| H | Ⓝ | 显示/隐藏隐藏文件 | +| e | Ⓝ | 自动展开窗口宽度 | +| w | Ⓝ | 切换窗口宽度 | +| z | Ⓝ | 收起所有节点 | + +#### 插件:Marks + +参见 [chentau/marks.nvim] 获取更多快捷键和用法说明。 + +| 快捷键 | 模式 | 功能说明 | +| ---------------------------- | :---: | ------------------------------ | +| m, | Ⓝ | 设置下一个可用字母(小写)标记 | +| m; | Ⓝ | 切换当前行下一个可用标记 | +| m a-z | Ⓝ | 设置标记 | +| dm a-z | Ⓝ | 删除指定标记 | +| dm- | Ⓝ | 删除当前行所有标记 | +| dm\ | Ⓝ | 删除当前缓冲区所有标记 | +| m] | Ⓝ | 跳转到下一个标记 | +| m[ | Ⓝ | 跳转到上一个标记 | +| m: a-z | Ⓝ | 预览指定标记 | +| m/ | Ⓝ | 列出所有已打开缓冲区的标记 | + +#### 插件:Zk + +参见 [zk-org/zk-nvim] 和 [zk](https://github.com/zk-org/zk) 获取更多快捷键和用法说明。 + +| 快捷键 | 模式 | 功能说明 | +| ------------------------------ | :---: | ------------------------- | +| Space+zn | Ⓝ | 输入标题并创建新笔记 | +| Space+zo | Ⓝ | 按修改时间浏览笔记 | +| Space+zt | Ⓝ | 浏览标签 | +| Space+zf | Ⓝ | 搜索笔记 | +| Space+zf | Ⓥ | 选区内搜索笔记 | +| Space+zb | Ⓝ | 显示反向链接(backlinks) | +| Space+zl | Ⓝ | 显示当前笔记的所有链接 | + +
+ + +--- + +## 参考链接 + +[Neovim]: https://github.com/neovim/neovim +[LazyVim]: https://www.lazyvim.org/ +[lazy.nvim]: https://github.com/folke/lazy.nvim +[lua/rafi/plugins/lsp/init.lua]: ./lua/rafi/plugins/lsp/init.lua +[nvim-lspconfig]: https://github.com/neovim/nvim-lspconfig +[blink.cmp]: https://github.com/saghen/blink.cmp +[nvim-cmp]: https://github.com/hrsh7th/nvim-cmp +[telescope.nvim]: https://github.com/nvim-telescope/telescope.nvim +[config/keymaps.lua]: ./lua/rafi/config/keymaps.lua +[util/edit.lua]: ./lua/rafi/util/edit.lua +[plugins/lsp/keymaps.lua]: ./lua/rafi/plugins/lsp/keymaps.lua +[lua/rafi/util/contextmenu.lua]: ./lua/rafi/util/contextmenu.lua +[nvim-treesitter]: https://github.com/nvim-treesitter/nvim-treesitter +[lazyvim.org/extras]: https://www.lazyvim.org/extras + +--- + diff --git a/after/ftplugin/markdown.lua b/after/ftplugin/markdown.lua index 917abcd1..ce16c064 100644 --- a/after/ftplugin/markdown.lua +++ b/after/ftplugin/markdown.lua @@ -20,7 +20,7 @@ local function link_surround() cscol, cecol = cecol, cscol end if csrow ~= cerow then - vim.notify('Cannot link across lines', vim.log.levels.ERROR) + vim.notify('无法跨行创建链接', vim.log.levels.ERROR) return end idx = cscol - 1 @@ -29,7 +29,7 @@ local function link_surround() local esc = vim.api.nvim_replace_termcodes('', true, false, true) vim.api.nvim_feedkeys(esc, 'x', true) else - vim.notify('Cannot link across lines', vim.log.levels.ERROR) + vim.notify('无法跨行创建链接', vim.log.levels.ERROR) return end diff --git a/lazy-lock.json b/lazy-lock.json index 301203c0..c13e4785 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,68 +1,149 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "LazyVim": { "branch": "main", "commit": "2bea40c447b72e54ffb2d5cddc98d7798990796f" }, + "CopilotChat.nvim": { "branch": "main", "commit": "df5376c132382dd47e3e552612940cbf25b3580c" }, + "LazyVim": { "branch": "main", "commit": "28db03f958d58dfff3c647ce28fdc1cb88ac158d" }, + "SchemaStore.nvim": { "branch": "main", "commit": "aa25399c48236b77af71d4b64cdf157d2ba4e990" }, + "alpha-nvim": { "branch": "main", "commit": "3979b01cb05734331c7873049001d3f2bb8477f4" }, + "ansible-vim": { "branch": "master", "commit": "6718ff81fe36f5f4fbf6675d95b16e4a74814827" }, + "any-jump.vim": { "branch": "master", "commit": "f95674d9a4251ac02f452d5f1861e4422f4652c7" }, "awesome-vim-colorschemes": { "branch": "master", "commit": "ae5e02298c8de6a5aa98fe4d29a21874cfcc3619" }, - "blame.nvim": { "branch": "main", "commit": "39bb4cda9e658d053a43919b10ca52c0a4d738e1" }, - "blink.cmp": { "branch": "main", "commit": "b6f11a0aa33e601c469a126e3ed6e35208fe3ea3" }, + "barbecue.nvim": { "branch": "main", "commit": "3e31404f0b93a2c30d151abf0648650ac811c664" }, + "blame.nvim": { "branch": "main", "commit": "f3f6153ea94e1120f2776f22bbbd63c4aeebaf32" }, + "bookmarks.nvim": { "branch": "main", "commit": "0540d52ba64d0ec7677ec1ef14b3624c95a2aaba" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" }, + "calendar.vim": { "branch": "master", "commit": "36d1a3a76e39b9d73ff964db2f75dacaf2d2bef3" }, + "catppuccin": { "branch": "main", "commit": "ce4a8e0d5267e67056f9f4dcf6cb1d0933c8ca00" }, + "ccc.nvim": { "branch": "main", "commit": "9d1a256e006decc574789dfc7d628ca11644d4c2" }, + "claudecode.nvim": { "branch": "main", "commit": "1552086ebcce9f4a2ea3b9793018a884d6b60169" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" }, + "cmp-git": { "branch": "main", "commit": "b24309c386c9666c549a1abaedd4956541676d06" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, + "cmp-tmux": { "branch": "main", "commit": "95b1b921802e6f60627b3e76afb9380fddd87f9a" }, "committia.vim": { "branch": "master", "commit": "c8c0f255e8090ed90dd9d5dd2e8672994f8e3671" }, - "conform.nvim": { "branch": "master", "commit": "363243c03102a531a8203311d4f2ae704c620d9b" }, + "conform.nvim": { "branch": "master", "commit": "4993e07fac6679d0a5005aa7499e0bad2bd39f19" }, + "copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" }, + "copilot.lua": { "branch": "master", "commit": "4383e05a47493d7ff77b058c0548129eb38ec7fb" }, + "cyberdream.nvim": { "branch": "main", "commit": "22b993f79c7aab934c00bfc3437d41f4621974dc" }, + "cybu.nvim": { "branch": "main", "commit": "c8a8c71cd0e38d4165b02819dfdc32dedc35a6b6" }, + "deadcolumn.nvim": { "branch": "master", "commit": "92c86f10bfba2717ca2280e2e759b047135d5288" }, + "debugprint.nvim": { "branch": "main", "commit": "0374b2017a888c9ad78ddf881fb192caecb34d81" }, + "dial.nvim": { "branch": "master", "commit": "f97c0c7fa7d5111bc04a91d0f693900fb2d95861" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, - "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, - "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, - "gitsigns.nvim": { "branch": "main", "commit": "c6fedfd0b1715ee624384b134becec0a7b0a3d28" }, - "glance.nvim": { "branch": "master", "commit": "1a08824835d7582457b67acbe23ca33487912a5e" }, - "grug-far.nvim": { "branch": "main", "commit": "59e744e21069fa382c898913e77d576fe9132214" }, - "guess-indent.nvim": { "branch": "main", "commit": "6cd61f7a600bb756e558627cd2e740302c58e32d" }, - "helpful.vim": { "branch": "master", "commit": "7fdda7a7c4a80ac2f3166cc5ea4610dfa523b334" }, - "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, - "lazydev.nvim": { "branch": "main", "commit": "a1b78b2ac6f978c72e76ea90ae92a94edf380cfc" }, + "emmet-vim": { "branch": "master", "commit": "e98397144982d1e75b20d94d55a82de3ec8f648d" }, + "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" }, + "flybuf.nvim": { "branch": "main", "commit": "fe1fbd9699f6988a1db3b2e2ffa599154784c6e1" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "gh.nvim": { "branch": "main", "commit": "6f367b2ab8f9d4a0a23df2b703a3f91137618387" }, + "github-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" }, + "gitsigns.nvim": { "branch": "main", "commit": "684270f22364bd248fcedd51598b6433266fdc47" }, + "glance.nvim": { "branch": "master", "commit": "bf86d8b79dce808e65fdb6e9269d0b4ed6d2eefc" }, + "goto-preview": { "branch": "main", "commit": "cf561d10b4b104db20375c48b86cf36af9f96e00" }, + "grug-far.nvim": { "branch": "main", "commit": "b58b2d65863f4ebad88b10a1ddd519e5380466e0" }, + "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, + "gv.vim": { "branch": "master", "commit": "b6bb6664e2c95aa584059f195eb3a9f3cb133994" }, + "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, + "headlines.nvim": { "branch": "master", "commit": "bf17c96a836ea27c0a7a2650ba385a7783ed322e" }, + "helm-ls.nvim": { "branch": "main", "commit": "d6f3a8d4ad59b4f54cd734267dfb5411679ea608" }, + "helpful.vim": { "branch": "master", "commit": "aa7f1844090c4f3ebc162f63dbe2917025f0c257" }, + "inc-rename.nvim": { "branch": "main", "commit": "2597bccb57d1b570fbdbd4adf88b955f7ade715b" }, + "incline.nvim": { "branch": "main", "commit": "6a3b0635bcd2490dbb1fa124217d41bf69ca0fa2" }, + "kanagawa.nvim": { "branch": "master", "commit": "aef7f5cec0a40dbe7f3304214850c472e2264b10" }, + "kiwi.nvim": { "branch": "master", "commit": "61e86fc29365e32b44c2914a2b10c90d04a3b22e" }, + "kubectl.nvim": { "branch": "main", "commit": "bd6bdec3b2fc6d2933a8c0826ec9a27a7e7b8642" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, + "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, "linediff.vim": { "branch": "main", "commit": "ddae71ef5f94775d101c1c70032ebe8799f32745" }, - "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "e942edf5c85b6a2ab74059ea566cac5b3e1514a4" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "mini.ai": { "branch": "main", "commit": "ebb04799794a7f94628153991e6334c3304961b8" }, - "mini.icons": { "branch": "main", "commit": "910db5df9724d65371182948f921fce23c2c881e" }, - "mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" }, - "mini.splitjoin": { "branch": "main", "commit": "3e92f6764e770ba392325cad3a4497adcada695f" }, - "mini.surround": { "branch": "main", "commit": "aa5e245829dd12d8ff0c96ef11da28681d6049aa" }, - "mini.trailspace": { "branch": "main", "commit": "3a328e62559c33014e422fb9ae97afc4208208b1" }, + "litee.nvim": { "branch": "main", "commit": "4efaf373322d9e71eaff31164abb393417cc6f6a" }, + "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "marks.nvim": { "branch": "master", "commit": "f353e8c08c50f39e99a9ed474172df7eddd89b72" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "7d527c76c43f46294de9c19d39c5a86317809b4b" }, + "mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" }, + "mini.ai": { "branch": "main", "commit": "bfb26d9072670c3aaefab0f53024b2f3729c8083" }, + "mini.align": { "branch": "main", "commit": "60c61c8c63dca41b5ac6bfc36b52df69b1a03e6b" }, + "mini.clue": { "branch": "main", "commit": "c465495a962d8bcca1718666ec33769b6f6969ad" }, + "mini.hipatterns": { "branch": "main", "commit": "add8d8abad602787377ec5d81f6b248605828e0f" }, + "mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" }, + "mini.map": { "branch": "main", "commit": "234eaf5cbcaee320d87e96465fbb534aa05b301e" }, + "mini.pairs": { "branch": "main", "commit": "b316e68f2d242d5bd010deaab645daa27ed86297" }, + "mini.splitjoin": { "branch": "main", "commit": "9fcd8856efb95a505090c3225726466494076127" }, + "mini.surround": { "branch": "main", "commit": "88c52297ed3e69ecf9f8652837888ecc727a28ee" }, + "mini.trailspace": { "branch": "main", "commit": "f8083ca969e1b2098480c10f3c3c4d2ce3586680" }, + "mini.visits": { "branch": "main", "commit": "f6b86565acc690aa111627433906be3d38e2ba81" }, + "monokai-pro.nvim": { "branch": "master", "commit": "1ac671f6da720cba967d28d25c2f16b8b4e18808" }, "neo-hybrid.vim": { "branch": "master", "commit": "ddc005b14c6fece50bd495f6a2bac768c3f8e635" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "5d172e8315444dbc32867d1c7b04d8e7e68ec4e1" }, - "neogit": { "branch": "master", "commit": "63124cf520ff24d09deb3b850e053908ab0fc66a" }, - "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, - "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, - "nvim-lint": { "branch": "master", "commit": "789b7ada1b4f00e08d026dffde410dcfa6a0ba87" }, - "nvim-lspconfig": { "branch": "master", "commit": "9962e25a23f0e992116b99a9a6400947d5a7177b" }, - "nvim-treesitter": { "branch": "master", "commit": "043d5fb1505ca4bc0f48b42666ae7ebc4bb1a671" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, - "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" }, + "neogit": { "branch": "master", "commit": "411d615291d9e8f49b377410385febd1e9ce1787" }, + "neotest": { "branch": "master", "commit": "deadfb1af5ce458742671ad3a013acb9a6b41178" }, + "neotest-golang": { "branch": "main", "commit": "b982da5f39980797c1bdec875d688a302245f31f" }, + "neotest-python": { "branch": "master", "commit": "b0d3a861bd85689d8ed73f0590c47963a7eb1bf9" }, + "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-ansible": { "branch": "main", "commit": "bba61168b7aef735e7f950fdfece5ef6c388eacf" }, + "nvim-bqf": { "branch": "main", "commit": "ba2b365969d7c2c6301d48e13aeee59568765529" }, + "nvim-chainsaw": { "branch": "main", "commit": "3bbdbe48fe38a512eaf30e36829491cc873068b5" }, + "nvim-cmp": { "branch": "main", "commit": "d97d85e01339f01b842e6ec1502f639b080cb0fc" }, + "nvim-gtd": { "branch": "main", "commit": "f046db08e31ca79769c7f4f82f67f611e8cf97a6" }, + "nvim-lightbulb": { "branch": "master", "commit": "aa3a8b0f4305b25cfe368f6c9be9923a7c9d0805" }, + "nvim-lint": { "branch": "master", "commit": "d1118791070d090777398792a73032a0ca5c79ff" }, + "nvim-lspconfig": { "branch": "master", "commit": "de659c9c0d53df0e6b4747d8d1ef22ba1164291d" }, + "nvim-navic": { "branch": "master", "commit": "7d914a39a1ef8f4e22c2c4381abeef7c556f5a13" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-snippets": { "branch": "main", "commit": "56b4052f71220144689caaa2e5b66222ba5661eb" }, + "nvim-spectre": { "branch": "master", "commit": "72f56f7585903cd7bf92c665351aa585e150af0f" }, + "nvim-treesitter": { "branch": "main", "commit": "d56ed0f7f90d6492ce422f5e0a9cb36d3169eb96" }, + "nvim-treesitter-endwise": { "branch": "master", "commit": "a61a9de7965324d4019fb1637b66bfacdcb01f51" }, + "nvim-treesitter-textobjects": { "branch": "main", "commit": "6f2dc7e41a648ec90314f0f94b5f574c75c5c58b" }, + "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, - "nvim-window-picker": { "branch": "main", "commit": "0dfef64eaf063e1cd27983ab11a30e7bc5b74fac" }, - "outline.nvim": { "branch": "main", "commit": "d5c29ee3ff3b7d1bdd454b37698316e67808c36e" }, - "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, + "nvim-ufo": { "branch": "main", "commit": "72d54c31079d38d8dfc5456131b1d0fb5c0264b0" }, + "nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" }, + "outline.nvim": { "branch": "main", "commit": "6b62f73a6bf317531d15a7ae1b724e85485d8148" }, + "persistence.nvim": { "branch": "main", "commit": "b20b2a7887bd39c1a356980b45e03250f3dce49c" }, "pgsql.vim": { "branch": "master", "commit": "736c9899163a7f4e212c1675d8a1fe42570a027a" }, - "plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" }, - "snacks.nvim": { "branch": "main", "commit": "e7d609b544d4e83dd940aa7c5884e9b3690ae2e6" }, - "suda.vim": { "branch": "master", "commit": "9adda7d195222d4e2854efb2a88005a120296c47" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, + "quicker.nvim": { "branch": "master", "commit": "9983d4b28881e1df626e3682167b45c284d4da8c" }, + "render-markdown.nvim": { "branch": "main", "commit": "6e0e8902dac70fecbdd8ce557d142062a621ec38" }, + "rest.nvim": { "branch": "main", "commit": "5466d1e447fc4b038ef511a7a2c4c7cbb13da01a" }, + "sidebar.nvim": { "branch": "main", "commit": "082e4903c1659a65e27a075b752178b0c56fffb2" }, + "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, + "suda.vim": { "branch": "master", "commit": "c492741b4679b3cdd4d9e34138209784e061d916" }, + "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, "tabs-vs-spaces.nvim": { "branch": "main", "commit": "4fbc894fa11b282a0dd5d5a670922abd185ae527" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, + "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" }, + "telekasten.nvim": { "branch": "main", "commit": "0697efb39e24a1c9a66d3eaeac9e38fc06ebba5a" }, "telescope-thesaurus.nvim": { "branch": "master", "commit": "0bd7f7c2ce67c8b86b98b80dd42ec597bea72c7c" }, "telescope-zoxide": { "branch": "main", "commit": "54bfe630bad08dc9891ec78c7cf8db38dd725c97" }, - "telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" }, + "telescope.nvim": { "branch": "master", "commit": "f0caedf064aa8c926325d7fe64c141d29b8e7853" }, "theme-loader.nvim": { "branch": "master", "commit": "ad8774ec8267a447d469b4e6603b43f49b946e53" }, - "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, - "tokyonight.nvim": { "branch": "main", "commit": "c3ab53c3f544e4a04f2a05d43451fd9bedff51b4" }, - "trouble.nvim": { "branch": "main", "commit": "6f380b8826fb819c752c8fd7daaee9ef96d4c689" }, - "ts-comments.nvim": { "branch": "main", "commit": "872dcfa0418f4a33b7437fb4d9f4e89f2f000d74" }, - "undotree": { "branch": "master", "commit": "2556c6800b210b2096b55b66e74b4cc1d9ebbe4f" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, + "treesj": { "branch": "main", "commit": "4770492244ccecdc9b01e0e81fa8f2f6b4a23841" }, + "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, + "ts-comments.nvim": { "branch": "main", "commit": "123a9fb12e7229342f807ec9e6de478b1102b041" }, + "undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" }, + "venv-selector.nvim": { "branch": "main", "commit": "58bae72c84b9f7f864c879ec1896e384296f9ffb" }, + "vim-cursorword": { "branch": "master", "commit": "371fdd7fa8817c28aa09d181cfcfa3c7ca29bf56" }, + "vim-dadbod": { "branch": "master", "commit": "e95afed23712f969f83b4857a24cf9d59114c2e6" }, + "vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" }, + "vim-dadbod-ui": { "branch": "master", "commit": "48c4f271da13d380592f4907e2d1d5558044e4e5" }, + "vim-editorconfig": { "branch": "master", "commit": "5c3a5b4e7830a6885ec3e70fa5151c59afde2ad5" }, + "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, + "vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" }, "vim-log-highlighting": { "branch": "master", "commit": "1037e26f3120e6a6a2c0c33b14a84336dee2a78f" }, - "vim-matchup": { "branch": "master", "commit": "aca23ce53ebfe34e02c4fe07e29e9133a2026481" }, + "vim-markdown-toc": { "branch": "master", "commit": "66026b323379c9a712c6169cd43153216acef090" }, + "vim-matchup": { "branch": "master", "commit": "1c276e12b49a83c1bdca74351187b8adea5da4b9" }, "vim-mustache-handlebars": { "branch": "master", "commit": "0153fe03a919add2d6cf2d41b2d5b6e1188bc0e0" }, "vim-quickhl": { "branch": "master", "commit": "be1f44169c3fdee3beab629e83380515da03835e" }, "vim-reason-plus": { "branch": "master", "commit": "c11a2940f8f3e3915e472c366fe460b0fe008bac" }, + "vim-sandwich": { "branch": "master", "commit": "74cf93d58ccc567d8e2310a69860f1b93af19403" }, "vim-stylus": { "branch": "master", "commit": "0e457b09db55d3518703bb22e1555872c5c44b7a" }, - "which-key.nvim": { "branch": "main", "commit": "0e76a87ac51772569aec678dc74baa8e2a86100c" } + "vim-tmux-navigator": { "branch": "master", "commit": "c45243dc1f32ac6bcf6068e5300f3b2b237e576a" }, + "vimwiki": { "branch": "dev", "commit": "72792615e739d0eb54a9c8f7e0a46a6e2407c9e8" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }, + "yaml-companion.nvim": { "branch": "main", "commit": "131b0d67bd2e0f1a02e0daf2f3460482221ce3c0" }, + "yanky.nvim": { "branch": "main", "commit": "04775cc6e10ef038c397c407bc17f00a2f52b378" } } diff --git a/lazyvim.json b/lazyvim.json new file mode 100644 index 00000000..d64f9aaa --- /dev/null +++ b/lazyvim.json @@ -0,0 +1,88 @@ +{ + "extras": [ + "lazyvim.plugins.extras.ai.claudecode", + "lazyvim.plugins.extras.ai.copilot", + "lazyvim.plugins.extras.ai.copilot-chat", + "lazyvim.plugins.extras.ai.copilot-native", + "lazyvim.plugins.extras.coding.yanky", + "lazyvim.plugins.extras.editor.dial", + "lazyvim.plugins.extras.editor.fzf", + "lazyvim.plugins.extras.editor.inc-rename", + "lazyvim.plugins.extras.editor.neo-tree", + "lazyvim.plugins.extras.editor.snacks_explorer", + "lazyvim.plugins.extras.editor.snacks_picker", + "lazyvim.plugins.extras.lang.git", + "lazyvim.plugins.extras.lang.json", + "lazyvim.plugins.extras.lang.markdown", + "lazyvim.plugins.extras.lang.sql", + "lazyvim.plugins.extras.lang.tailwind", + "lazyvim.plugins.extras.lang.toml", + "lazyvim.plugins.extras.lang.typescript", + "lazyvim.plugins.extras.lang.vue", + "lazyvim.plugins.extras.test.core", + "lazyvim.plugins.extras.ui.alpha", + "lazyvim.plugins.extras.util.dot", + "lazyvim.plugins.extras.util.gh", + "lazyvim.plugins.extras.util.mini-hipatterns", + "lazyvim.plugins.extras.vscode", + "rafi.plugins.extras.coding.align", + "rafi.plugins.extras.coding.chainsaw", + "rafi.plugins.extras.coding.debugprint", + "rafi.plugins.extras.coding.editorconfig", + "rafi.plugins.extras.coding.emmet", + "rafi.plugins.extras.coding.nvim-cmp", + "rafi.plugins.extras.coding.sandwich", + "rafi.plugins.extras.colorscheme.cyberdream", + "rafi.plugins.extras.colorscheme.github", + "rafi.plugins.extras.colorscheme.kanagawa", + "rafi.plugins.extras.colorscheme.monokai-pro", + "rafi.plugins.extras.editor.anyjump", + "rafi.plugins.extras.editor.flybuf", + "rafi.plugins.extras.editor.harpoon2", + "rafi.plugins.extras.editor.mini-visits", + "rafi.plugins.extras.editor.rest", + "rafi.plugins.extras.editor.sidebar", + "rafi.plugins.extras.editor.spectre", + "rafi.plugins.extras.editor.ufo", + "rafi.plugins.extras.git.cmp-git", + "rafi.plugins.extras.git.fugitive", + "rafi.plugins.extras.lang.ansible", + "rafi.plugins.extras.lang.go", + "rafi.plugins.extras.lang.helm", + "rafi.plugins.extras.lang.kubernetes", + "rafi.plugins.extras.lang.markdown", + "rafi.plugins.extras.lang.python", + "rafi.plugins.extras.lang.tmux", + "rafi.plugins.extras.lsp.gtd", + "rafi.plugins.extras.lsp.lightbulb", + "rafi.plugins.extras.lsp.yaml-companion", + "rafi.plugins.extras.org.calendar", + "rafi.plugins.extras.org.kiwi", + "rafi.plugins.extras.org.telekasten", + "rafi.plugins.extras.org.vimwiki", + "rafi.plugins.extras.treesitter.endwise", + "rafi.plugins.extras.treesitter.treesj", + "rafi.plugins.extras.ui.alpha", + "rafi.plugins.extras.ui.barbecue", + "rafi.plugins.extras.ui.bookmarks", + "rafi.plugins.extras.ui.bqf", + "rafi.plugins.extras.ui.ccc", + "rafi.plugins.extras.ui.cursorword", + "rafi.plugins.extras.ui.cybu", + "rafi.plugins.extras.ui.deadcolumn", + "rafi.plugins.extras.ui.goto-preview", + "rafi.plugins.extras.ui.headlines", + "rafi.plugins.extras.ui.illuminate", + "rafi.plugins.extras.ui.incline", + "rafi.plugins.extras.ui.marks", + "rafi.plugins.extras.ui.mini-clue", + "rafi.plugins.extras.ui.mini-map", + "rafi.plugins.extras.ui.quicker", + "rafi.plugins.extras.ui.symbols-outline" + ], + "install_version": 8, + "news": [ + + ], + "version": 8 +} \ No newline at end of file diff --git a/lua/rafi/config/autocmds.lua b/lua/rafi/config/autocmds.lua index ed2c193c..973ed096 100644 --- a/lua/rafi/config/autocmds.lua +++ b/lua/rafi/config/autocmds.lua @@ -2,6 +2,8 @@ -- https://github.com/rafi/vim-config -- === + + -- This file is automatically loaded by lua/rafi/config/lazy.lua -- Extends $XDG_DATA_HOME/nvim/lazy/LazyVim/lua/lazyvim/config/autocmds.lua @@ -52,7 +54,7 @@ vim.api.nvim_create_autocmd('FileType', { end, { buffer = event.buf, silent = true, - desc = 'Quit buffer', + desc = '关闭缓冲区', }) end) end, @@ -113,3 +115,5 @@ vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufReadPre' }, { vim.opt_global.writebackup = false end, }) + + diff --git a/lua/rafi/config/init.lua b/lua/rafi/config/init.lua index cc09a085..570701fe 100644 --- a/lua/rafi/config/init.lua +++ b/lua/rafi/config/init.lua @@ -1,15 +1,20 @@ + -- Rafi's Neovim config loader -- https://github.com/rafi/vim-config -- This uses LazyVim's config module. -- See $XDG_DATA_HOME/nvim/lazy/LazyVim/lua/lazyvim/config/init.lua + + + + local M = {} ---@type table M.deprecated_extras = { - ['rafi.plugins.extras.editor.telescope'] = '`telescope.nvim` is now the default **RafiVim** picker.', - ['rafi.plugins.extras.ui.indent-blankline'] = "Use LazyVim's `indent-blankline.nvim` instead.", + ['rafi.plugins.extras.editor.telescope'] = '`telescope.nvim` 现已成为 **RafiVim** 的默认选择器。', + ['rafi.plugins.extras.ui.indent-blankline'] = '请改用 LazyVim 自带的 `indent-blankline.nvim`。', } -- Load lua/rafi/config/* and user lua/config/* files. @@ -19,7 +24,7 @@ function M.load(name) if require('lazy.core.cache').find(mod)[1] then LazyVim.try(function() require(mod) - end, { msg = 'Failed loading ' .. mod }) + end, { msg = '加载 ' .. mod .. ' 失败' }) end if name == 'options' then @@ -75,17 +80,17 @@ function M.setup() LazyVim.extras.sources = { { name = 'LazyVim', - desc = 'LazyVim extras', + desc = 'LazyVim 扩展', module = 'lazyvim.plugins.extras', }, { name = 'Rafi ', - desc = 'Rafi extras', + desc = 'Rafi 扩展', module = 'rafi.plugins.extras', }, { name = 'User ', - desc = 'User extras', + desc = '用户扩展', module = 'plugins.extras', }, } diff --git a/lua/rafi/config/keymaps.lua b/lua/rafi/config/keymaps.lua index 60fba24f..f0eb7d99 100644 --- a/lua/rafi/config/keymaps.lua +++ b/lua/rafi/config/keymaps.lua @@ -21,59 +21,59 @@ end -- Picker {{{ -- Bind localleader to common LazyVim picker (telescope/fzf/snacks) keymaps. -map('n', 'r', 'sR', { remap = true, desc = 'Resume Last' }) -map('n', 'f', 'ff', { remap = true, desc = 'Find Files (Root Dir)' }) -map('n', 'F', 'fF', { remap = true, desc = 'Find Files (cwd)' }) -map('n', 'g', 'sg', { remap = true, desc = 'Grep (Root Dir)' }) -map('n', 'G', 'sG', { remap = true, desc = 'Grep (cwd)' }) -map('n', 'b', ',', { remap = true, desc = 'Switch Buffer' }) -map('n', 'B', 'sB', { remap = true, desc = 'Grep open buffers' }) -map('n', 'l', 'sb', { remap = true, desc = 'Buffer lines' }) -map('n', 'h', 'sh', { remap = true, desc = 'Help Pages' }) -map('n', 'H', 'sH', { remap = true, desc = 'Search Highlight Groups' }) -map('n', 'j', 'sj', { remap = true, desc = 'Jumplist' }) -map('n', 'm', 'sm', { remap = true, desc = 'Jump to Mark' }) -map('n', 'M', 'sM', { remap = true, desc = 'Man Pages' }) -map('n', 'o', 'so', { remap = true, desc = 'Options' }) -map('n', 't', 'ss', { remap = true, desc = 'Goto Symbol' }) -map('n', 'T', 'sS', { remap = true, desc = 'Goto Symbol (Workspace)' }) -map('n', 'v', 's"', { remap = true, desc = 'Registers' }) -map('n', 's', 'qS', { remap = true, desc = 'Sessions' }) -map('n', 'x', 'fr', { remap = true, desc = 'Recent' }) -map('n', 'X', 'fR', { remap = true, desc = 'Recent (cwd)' }) -map('n', ';', 'sc', { remap = true, desc = 'Command History' }) -map('n', ':', 'sC', { remap = true, desc = 'Commands' }) -map('n', 'p', 'fp', { remap = true, desc = 'Projects' }) -map({ 'n', 'x' }, 'gg', 'sw', { remap = true, desc = 'Visual selection or word (Root Dir)' }) -map({ 'n', 'x' }, 'gG', 'sW', { remap = true, desc = 'Visual selection or word (cwd)' }) +map('n', 'r', 'sR', { remap = true, desc = '恢复上次' }) +map('n', 'f', 'ff', { remap = true, desc = '查找文件(根目录)' }) +map('n', 'F', 'fF', { remap = true, desc = '查找文件(当前目录)' }) +map('n', 'g', 'sg', { remap = true, desc = '全局搜索(根目录)' }) +map('n', 'G', 'sG', { remap = true, desc = '全局搜索(当前目录)' }) +map('n', 'b', ',', { remap = true, desc = '切换缓冲区' }) +map('n', 'B', 'sB', { remap = true, desc = '搜索已打开的缓冲区' }) +map('n', 'l', 'sb', { remap = true, desc = '搜索当前缓冲区行' }) +map('n', 'h', 'sh', { remap = true, desc = '帮助文档' }) +map('n', 'H', 'sH', { remap = true, desc = '搜索高亮组' }) +map('n', 'j', 'sj', { remap = true, desc = '跳转列表' }) +map('n', 'm', 'sm', { remap = true, desc = '跳转到标记' }) +map('n', 'M', 'sM', { remap = true, desc = 'Man 文档' }) +map('n', 'o', 'so', { remap = true, desc = '选项' }) +map('n', 't', 'ss', { remap = true, desc = '跳转符号' }) +map('n', 'T', 'sS', { remap = true, desc = '跳转符号(工作区)' }) +map('n', 'v', 's"', { remap = true, desc = '寄存器' }) +map('n', 's', 'qS', { remap = true, desc = '会话' }) +map('n', 'x', 'fr', { remap = true, desc = '最近文件' }) +map('n', 'X', 'fR', { remap = true, desc = '最近文件(当前目录)' }) +map('n', ';', 'sc', { remap = true, desc = '命令历史' }) +map('n', ':', 'sC', { remap = true, desc = '命令' }) +map('n', 'p', 'fp', { remap = true, desc = '项目' }) +map({ 'n', 'x' }, 'gg', 'sw', { remap = true, desc = '选区或单词(根目录)' }) +map({ 'n', 'x' }, 'gG', 'sW', { remap = true, desc = '选区或单词(当前目录)' }) -- }}} -- Navigation {{{ if vim.F.if_nil(vim.g.elite_mode, false) then -- Elite-mode: Arrow-keys resize window - map('n', '', 'resize +1', { desc = 'Increase Window Height' }) - map('n', '', 'resize -1', { desc = 'Decrease Window Height' }) - map('n', '', 'vertical resize +1', { desc = 'Increase Window Width' }) - map('n', '', 'vertical resize -1', { desc = 'Decrease Window Width' }) + map('n', '', 'resize +1', { desc = '增加窗口高度' }) + map('n', '', 'resize -1', { desc = '减少窗口高度' }) + map('n', '', 'vertical resize +1', { desc = '增加窗口宽度' }) + map('n', '', 'vertical resize -1', { desc = '减少窗口宽度' }) unmap('n', { '', '', '', '' }) else -- Moves through display-lines, unless count is provided - map({ 'n', 'x' }, '', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true, desc = 'Down' }) - map({ 'n', 'x' }, '', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true, desc = 'Up' }) + map({ 'n', 'x' }, '', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true, desc = '向下' }) + map({ 'n', 'x' }, '', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true, desc = '向上' }) -- Resize window using arrow keys - map('n', '', 'resize +2', { desc = 'Increase Window Height' }) - map('n', '', 'resize -2', { desc = 'Decrease Window Height' }) - map('n', '', 'vertical resize -2', { desc = 'Decrease Window Width' }) - map('n', '', 'vertical resize +2', { desc = 'Increase Window Width' }) + map('n', '', 'resize +2', { desc = '增加窗口高度' }) + map('n', '', 'resize -2', { desc = '减少窗口高度' }) + map('n', '', 'vertical resize -2', { desc = '减少窗口宽度' }) + map('n', '', 'vertical resize +2', { desc = '增加窗口宽度' }) end unmap('n', { '', '' }) -- Easier line-wise movement -map('n', 'gh', 'g^', { desc = 'Jump to first screen character' }) -map('n', 'gl', 'g$', { desc = 'Jump to last screen character' }) +map('n', 'gh', 'g^', { desc = '跳至屏幕首字符' }) +map('n', 'gl', 'g$', { desc = '跳至屏幕尾字符' }) -- Navigation in command line map('c', '', '') @@ -88,34 +88,34 @@ map('n', 'zh', 'z4h') -- Toggle fold or select option from popup menu map('n', '', function() return vim.fn.pumvisible() == 1 and '' or 'za' -end, { expr = true, desc = 'Toggle Fold' }) +end, { expr = true, desc = '切换折叠' }) -- Focus the current fold by closing all others -map('n', '', 'zMzv', { remap = true, desc = 'Focus Fold' }) +map('n', '', 'zMzv', { remap = true, desc = '聚焦折叠' }) -- Tabs: Many ways to navigate them -map('n', '', 'tabnext', { desc = 'Next Tab' }) -map('n', '', 'tabprevious', { desc = 'Previous Tab' }) -map('n', '', 'tabprevious', { desc = 'Previous Tab' }) -map('n', '', 'tabnext', { desc = 'Next Tab' }) -map('n', '', 'tabnext', { desc = 'Next Tab' }) -map('n', '', 'tabprevious', { desc = 'Previous Tab' }) +map('n', '', 'tabnext', { desc = '下一个标签页' }) +map('n', '', 'tabprevious', { desc = '上一个标签页' }) +map('n', '', 'tabprevious', { desc = '上一个标签页' }) +map('n', '', 'tabnext', { desc = '下一个标签页' }) +map('n', '', 'tabnext', { desc = '下一个标签页' }) +map('n', '', 'tabprevious', { desc = '上一个标签页' }) -- Moving tabs -map('n', '', '-tabmove', { desc = 'Tab Move Backwards' }) -map('n', '', '+tabmove', { desc = 'Tab Move Forwards' }) +map('n', '', '-tabmove', { desc = '标签左移' }) +map('n', '', '+tabmove', { desc = '标签右移' }) -- }}} -- Selection {{{ -map('n', '', 'V', { desc = 'Visual Mode' }) -map('x', '', '', { desc = 'Exit Visual Mode' }) +map('n', '', 'V', { desc = '可视模式' }) +map('x', '', '', { desc = '退出可视模式' }) -- Select last paste -map('n', 'vsp', "'`['.strpart(getregtype(), 0, 1).'`]'", { expr = true, desc = 'Select Paste' }) +map('n', 'vsp', "'`['.strpart(getregtype(), 0, 1).'`]'", { expr = true, desc = '选择粘贴区域' }) -- Quick substitute within selected area -map('x', 'sg', ':s//gc', { desc = 'Substitute Within Selection' }) +map('x', 'sg', ':s//gc', { desc = '选区替换' }) -- C-r: Easier search and replace visual/select mode map( @@ -123,12 +123,12 @@ map( '', ":%s/\\V=v:lua.get_visual_selection()" .. '//gc', - { desc = 'Replace Selection' } + { desc = '替换选区' } ) -- Use tab for indenting in visual/select mode -map('x', '', '>', { remap = true, desc = 'Indent Left' }) -map('x', '', '<', { remap = true, desc = 'Indent Right' }) +map('x', '', '>', { remap = true, desc = '向右缩进' }) +map('x', '', '<', { remap = true, desc = '向左缩进' }) -- Better block-wise operations on selected area local blockwise_force = function(key) @@ -142,19 +142,19 @@ local blockwise_force = function(key) return keyseq[key][vim.fn.mode()] end end -map('x', 'I', blockwise_force('I'), { expr = true, noremap = true, desc = 'Blockwise Insert' }) -map('x', 'gI', blockwise_force('gI'), { expr = true, noremap = true, desc = 'Blockwise Insert' }) -map('x', 'A', blockwise_force('A'), { expr = true, noremap = true, desc = 'Blockwise Append' }) +map('x', 'I', blockwise_force('I'), { expr = true, noremap = true, desc = '块插入' }) +map('x', 'gI', blockwise_force('gI'), { expr = true, noremap = true, desc = '块插入' }) +map('x', 'A', blockwise_force('A'), { expr = true, noremap = true, desc = '块追加' }) -- }}} -- Jump to {{{ -map('n', ']a', 'lnext', { desc = 'Next Loclist' }) -map('n', '[a', 'lprev', { desc = 'Previous Loclist' }) +map('n', ']a', 'lnext', { desc = '下一个位置列表' }) +map('n', '[a', 'lprev', { desc = '上一个位置列表' }) -- Whitespace jump (see plugin/whitespace.vim) -map('n', ']z', function() whitespace_jump(1) end, { desc = 'Next Whitespace' }) -map('n', '[z', function() whitespace_jump(-1) end, { desc = 'Previous Whitespace' }) +map('n', ']z', function() whitespace_jump(1) end, { desc = '下一个空白问题' }) +map('n', '[z', function() whitespace_jump(-1) end, { desc = '上一个空白问题' }) -- Diagnostic movement local diagnostic_jump = function(count, severity) @@ -171,67 +171,67 @@ local diagnostic_jump = function(count, severity) jump({ severity = severity_int }) end end -map('n', ']d', diagnostic_jump(1), { desc = 'Next Diagnostic' }) -map('n', '[d', diagnostic_jump(-1), { desc = 'Prev Diagnostic' }) -map('n', ']e', diagnostic_jump(1, 'ERROR'), { desc = 'Next Error' }) -map('n', '[e', diagnostic_jump(-1, 'ERROR'), { desc = 'Prev Error' }) -map('n', ']w', diagnostic_jump(1, 'WARN'), { desc = 'Next Warning' }) -map('n', '[w', diagnostic_jump(-1, 'WARN'), { desc = 'Prev Warning' }) +map('n', ']d', diagnostic_jump(1), { desc = '下一个诊断' }) +map('n', '[d', diagnostic_jump(-1), { desc = '上一个诊断' }) +map('n', ']e', diagnostic_jump(1, 'ERROR'), { desc = '下一个错误' }) +map('n', '[e', diagnostic_jump(-1, 'ERROR'), { desc = '上一个错误' }) +map('n', ']w', diagnostic_jump(1, 'WARN'), { desc = '下一个警告' }) +map('n', '[w', diagnostic_jump(-1, 'WARN'), { desc = '上一个警告' }) -- }}} -- Clipboard {{{ -- === -- Paste in visual-mode without pushing to register -map('x', 'p', 'p:let @+=@0:let @"=@0', { silent = true, desc = 'Paste' }) -map('x', 'P', 'P:let @+=@0:let @"=@0', { silent = true, desc = 'Paste In-place' }) +map('x', 'p', 'p:let @+=@0:let @"=@0', { silent = true, desc = '粘贴' }) +map('x', 'P', 'P:let @+=@0:let @"=@0', { silent = true, desc = '原位粘贴' }) -- Yank buffer's relative path to clipboard map('n', 'y', function() local path = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ':~:.') or '' vim.fn.setreg('+', path) - vim.notify(path, vim.log.levels.INFO, { title = 'Yanked relative path' }) -end, { silent = true, desc = 'Yank relative path' }) + vim.notify(path, vim.log.levels.INFO, { title = '已复制相对路径' }) +end, { silent = true, desc = '复制相对路径' }) -- Yank absolute path map('n', 'Y', function() local path = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ':p') or '' vim.fn.setreg('+', path) - vim.notify(path, vim.log.levels.INFO, { title = 'Yanked absolute path' }) -end, { silent = true, desc = 'Yank absolute path' }) + vim.notify(path, vim.log.levels.INFO, { title = '已复制绝对路径' }) +end, { silent = true, desc = '复制绝对路径' }) -- }}} -- Coding {{{ -- Comment unmap('n', { 'gra', 'gri', 'grr', 'grn' }) -map('n', 'v', 'gcc', { remap = true, desc = 'Comment Line' }) -map('x', 'v', 'gc', { remap = true, desc = 'Comment Selection' }) +map('n', 'v', 'gcc', { remap = true, desc = '注释当前行' }) +map('x', 'v', 'gc', { remap = true, desc = '注释选区' }) -- Macros -map('n', '', 'q', { desc = 'Macro Prefix' }) +map('n', '', 'q', { desc = '宏前缀' }) -- Formatting -map('n', 'cid', 'LazyDev', { silent = true, desc = 'Dev' }) -map('n', 'cif', 'LazyFormatInfo', { silent = true, desc = 'Formatter Info' }) -map('n', 'cir', 'LazyRoot', { silent = true, desc = 'Root' }) -map('n', 'cil', 'check lspconfig', { desc = 'LSP info popup' }) -map({ 'n', 'x' }, 'cs', function() formatter_select() end, { desc = 'Formatter Select' }) +map('n', 'cid', 'LazyDev', { silent = true, desc = '开发信息' }) +map('n', 'cif', 'LazyFormatInfo', { silent = true, desc = '格式化信息' }) +map('n', 'cir', 'LazyRoot', { silent = true, desc = '项目根目录' }) +map('n', 'cil', 'check lspconfig', { desc = 'LSP 信息' }) +map({ 'n', 'x' }, 'cs', function() formatter_select() end, { desc = '选择格式化器' }) -- Start new line from any cursor position in insert-mode -map('i', '', 'o', { desc = 'Start Newline' }) -map('n', ']', ':set pastem`o``:set nopaste', { silent = true, desc = 'Newline' }) -map('n', '[', ':set pastem`O``:set nopaste', { silent = true, desc = 'Newline' }) +map('i', '', 'o', { desc = '插入新行' }) +map('n', ']', ':set pastem`o``:set nopaste', { silent = true, desc = '新建行' }) +map('n', '[', ':set pastem`O``:set nopaste', { silent = true, desc = '新建行' }) -- Drag current line(s) vertically and auto-indent -map('n', 'k', 'move-2==', { silent = true, desc = 'Move line up' }) -map('n', 'j', 'move+==', { silent = true, desc = 'Move line down' }) -map('x', 'k', ":move'<-2gv=gv", { silent = true, desc = 'Move selection up' }) -map('x', 'j', ":move'>+gv=gv", { silent = true, desc = 'Move selection down' }) +map('n', 'k', 'move-2==', { silent = true, desc = '上移一行' }) +map('n', 'j', 'move+==', { silent = true, desc = '下移一行' }) +map('x', 'k', ":move'<-2gv=gv", { silent = true, desc = '上移选区' }) +map('x', 'j', ":move'>+gv=gv", { silent = true, desc = '下移选区' }) -- Duplicate lines without affecting PRIMARY and CLIPBOARD selections. -map('n', 'dd', 'm`""Y""P``', { desc = 'Duplicate line' }) -map('x', 'dd', '""Y""Pgv', { desc = 'Duplicate selection' }) +map('n', 'dd', 'm`""Y""P``', { desc = '复制行' }) +map('x', 'dd', '""Y""Pgv', { desc = '复制选区' }) -- }}} -- Search, substitute, diff {{{ @@ -242,24 +242,24 @@ map('n', 'g*', '*') map('n', '#', 'g#') map('n', 'g#', '#') -map('n', '', 'ciw', { desc = 'Change Inner Word' }) +map('n', '', 'ciw', { desc = '替换单词' }) -- Use backspace key for matching pairs -map({ 'n', 'x' }, '', '%', { remap = true, desc = 'Jump to Paren' }) +map({ 'n', 'x' }, '', '%', { remap = true, desc = '跳转括号' }) -- Toggle diff on all windows in current tab map('n', 'bf', function() vim.cmd('windo diff' .. (vim.wo.diff and 'off' or 'this')) -end, { desc = 'Diff Windows in Tab' }) +end, { desc = '窗口差异对比' }) -- External diff -map('n', 'bF', '!' .. vim.g.diffprg .. ' % #', { desc = 'Diff with' .. vim.g.diffprg }) +map('n', 'bF', '!' .. vim.g.diffprg .. ' % #', { desc = '与外部程序对比' .. vim.g.diffprg }) -- }}} -- Command & History {{{ -- Put vim command output into buffer -map('n', 'g!', ":put=execute('')", { desc = 'Paste Command' }) +map('n', 'g!', ":put=execute('')", { desc = '粘贴命令输出' }) -- Switch history search pairs, matching my bash shell map('c', '', '') @@ -281,21 +281,21 @@ map('n', 'cd', function() vim.cmd.tcd(bufdir) vim.notify(bufdir) end -end, { desc = 'Change Tab Directory' }) +end, { desc = '切换标签页目录' }) -- Fast saving from all modes unmap('n', { 'w', 'wd', 'wm' }) -map('n', 'w', 'write', { desc = 'Save File' }) -map('n', '', 'write', { desc = 'Save File' }) +map('n', 'w', 'write', { desc = '保存文件' }) +map('n', '', 'write', { desc = '保存文件' }) -- }}} -- Editor UI {{{ -- Toggle list windows -map('n', 'xl', function() toggle_list('loclist') end, { desc = 'Toggle Location List' }) -map('n', 'xq', function() toggle_list('quickfix') end, { desc = 'Toggle Quickfix List' }) +map('n', 'xl', function() toggle_list('loclist') end, { desc = '切换位置列表' }) +map('n', 'xq', function() toggle_list('quickfix') end, { desc = '切换快速修复列表' }) -map('n', 'ce', vim.diagnostic.open_float, { desc = 'Line Diagnostics' }) +map('n', 'ce', vim.diagnostic.open_float, { desc = '行诊断' }) -- Set locations with diagnostics and open the list. map('n', 'a', function() @@ -303,45 +303,45 @@ map('n', 'a', function() vim.diagnostic.setloclist({ open = false }) end toggle_list('loclist') -end, { desc = 'Open Location List' }) +end, { desc = '打开位置列表' }) -- }}} -- Plugins & Tools {{{ -- Package-manager -map('n', 'mx', 'LazyExtras', { desc = 'Open Plugin Extras' }) +map('n', 'mx', 'LazyExtras', { desc = '打开插件扩展' }) -- Append mode-line to current buffer -map('n', 'ml', function() append_modeline() end, { desc = 'Append Modeline' }) +map('n', 'ml', function() append_modeline() end, { desc = '添加文件设置行' }) -- Jump entire buffers throughout jumplist -map('n', 'g', function() jump_buffer(1) end, { desc = 'Jump to newer buffer' }) -map('n', 'g', function() jump_buffer(-1) end, { desc = 'Jump to older buffer' }) +map('n', 'g', function() jump_buffer(1) end, { desc = '跳转到较新的缓冲区' }) +map('n', 'g', function() jump_buffer(-1) end, { desc = '跳转到较旧的缓冲区' }) -- Context aware menu. See lua/lib/contextmenu.lua -map('n', '', function() require('rafi.util.contextmenu').show() end, { desc = 'Context-aware menu' }) -map('n', 'c', function() require('rafi.util.contextmenu').show() end, { desc = 'Context-aware menu' }) +map('n', '', function() require('rafi.util.contextmenu').show() end, { desc = '上下文菜单' }) +map('n', 'c', function() require('rafi.util.contextmenu').show() end, { desc = '上下文菜单' }) -- Base64 encode/decode -map('x', '64e', function() base64() end, { desc = 'Base64 Encode' }) -map('x', '64d', function() base64(false) end, { desc = 'Base64 Decode' }) +map('x', '64e', function() base64() end, { desc = 'Base64 编码' }) +map('x', '64d', function() base64(false) end, { desc = 'Base64 解码' }) -- Lazygit if vim.fn.executable('lazygit') == 1 then ---@diagnostic disable-next-line: missing-fields - map('n', 'gt', function() Snacks.lazygit( { cwd = LazyVim.root.git() }) end, { desc = 'Lazygit (Root Dir)' }) - map('n', 'gT', function() Snacks.lazygit() end, { desc = 'Lazygit (cwd)' }) + map('n', 'gt', function() Snacks.lazygit( { cwd = LazyVim.root.git() }) end, { desc = 'Lazygit(根目录)' }) + map('n', 'gT', function() Snacks.lazygit() end, { desc = 'Lazygit(当前目录)' }) end -map('n', 'gm', function() Snacks.picker.git_log_line() end, { desc = 'Git Blame Line' }) -map({ 'n', 'x' }, 'go', function() Snacks.gitbrowse() end, { desc = 'Git Browse' }) +map('n', 'gm', function() Snacks.picker.git_log_line() end, { desc = '查看行责任' }) +map({ 'n', 'x' }, 'go', function() Snacks.gitbrowse() end, { desc = '浏览 Git 链接' }) -- Terminal Mappings -map('t', '', '', { desc = 'Enter Normal Mode' }) +map('t', '', '', { desc = '进入普通模式' }) if vim.fn.has('mac') then -- Open the macOS dictionary on current word - map('n', '?', 'silent !open dict://', { desc = 'Dictionary' }) + map('n', '?', 'silent !open dict://', { desc = '词典查询' }) end -- }}} @@ -390,25 +390,25 @@ if vim.F.if_nil(vim.g.window_q_mapping, false) then vim.cmd[[quit]] end end - end, { desc = 'Close window' }) + end, { desc = '关闭窗口' }) end -map('n', 's', '', { desc = '+screen' }) -map('n', 's]', 'xw', { remap = true, desc = 'Swap adjacent windows' }) -map('n', 'sb', 'buffer#', { desc = 'Alternate buffer' }) -map('n', 'sc', 'close', { desc = 'Close window' }) -map('n', 'sd', 'bdelete', { desc = 'Buffer delete' }) -map('n', 'sv', 'split', { desc = 'Split window horizontally' }) -map('n', 'sg', 'vsplit', { desc = 'Split window vertically' }) -map('n', 'st', 'tabnew', { desc = 'New tab' }) -map('n', 'so', 'only', { desc = 'Close other windows' }) -map('n', 'sq', 'quit', { desc = 'Quit' }) +map('n', 's', '', { desc = '+屏幕操作' }) +map('n', 's]', 'xw', { remap = true, desc = '交换相邻窗口' }) +map('n', 'sb', 'buffer#', { desc = '切换上一个缓冲区' }) +map('n', 'sc', 'close', { desc = '关闭窗口' }) +map('n', 'sd', 'bdelete', { desc = '删除缓冲区' }) +map('n', 'sv', 'split', { desc = '水平分割窗口' }) +map('n', 'sg', 'vsplit', { desc = '垂直分割窗口' }) +map('n', 'st', 'tabnew', { desc = '新建标签页' }) +map('n', 'so', 'only', { desc = '关闭其他窗口' }) +map('n', 'sq', 'quit', { desc = '退出' }) Snacks.toggle.zoom():map('sz') Snacks.toggle.zen():map('sZ') map('n', 'sx', function() Snacks.bufdelete({ wipe = true }) vim.cmd.enew() -end, { desc = 'Delete buffer and open new' }) +end, { desc = '删除缓冲区并新建' }) -- }}} @@ -491,7 +491,7 @@ function _G.append_modeline() -- {{{ end end if not cs then - LazyVim.warn('No commentstring found') + LazyVim.warn('未找到可用的注释格式') return end modeline = string.gsub(cs, '%%s', modeline) @@ -519,7 +519,7 @@ function _G.jump_buffer(direction) -- {{{ local nr = jumplist[i]['bufnr'] if nr ~= cur_buf and vim.fn.bufname(nr):find('^%w+://') == nil then local n = tostring(math.abs(i - curjump)) - vim.notify('Executing ' .. jumpcmd .. ' ' .. n .. ' times') + vim.notify('执行 ' .. jumpcmd .. ' ' .. n .. ' 次') jumpcmd = vim.api.nvim_replace_termcodes(jumpcmd, true, true, true) vim.cmd.normal({ n .. jumpcmd, bang = true }) break @@ -597,7 +597,7 @@ function _G.formatter_select() -- {{{ end LazyVim.try(function() return source.client.format(bufnr) - end, { msg = 'Formatter `' .. source.name .. '` failed' }) + end, { msg = '格式化器 `' .. source.name .. '` 执行失败' }) end if total_sources == 1 then @@ -605,9 +605,9 @@ function _G.formatter_select() -- {{{ elseif total_sources > 1 then -- Display a list of sources to choose from vim.ui.select(sources, { - prompt = 'Select a formatter', + prompt = '选择格式化器', format_item = function(item) - return item.name .. ' (' .. item.kind .. ')' + return item.name .. '(' .. item.kind .. ')' end, }, function(selected) if is_visual then @@ -619,10 +619,7 @@ function _G.formatter_select() -- {{{ apply_source(buf, selected) end) else - vim.notify( - 'No configured formatters for this filetype.', - vim.log.levels.WARN - ) + vim.notify('当前文件类型未配置格式化器。', vim.log.levels.WARN) end end -- }}} diff --git a/lua/rafi/config/lazy.lua b/lua/rafi/config/lazy.lua index 2a4a673e..fc5cf5be 100644 --- a/lua/rafi/config/lazy.lua +++ b/lua/rafi/config/lazy.lua @@ -154,7 +154,7 @@ require('lazy').setup(vim.tbl_extend('keep', user_lazy_opts, { 'zipPlugin', }, }, - }, + } })) -- Enjoy! diff --git a/lua/rafi/config/rootdir.lua b/lua/rafi/config/rootdir.lua new file mode 100644 index 00000000..1df8ff6d --- /dev/null +++ b/lua/rafi/config/rootdir.lua @@ -0,0 +1,41 @@ +-- ~/.config/nvim/lua/config/rootdir.lua + +local root_markers = { ".git", "package.json", "pyproject.toml", "go.mod", "Cargo.toml" } + +-- 判断路径下是否存在 marker 文件或目录 +local function has_marker(path) + for _, marker in ipairs(root_markers) do + local full_path = path .. "/" .. marker + if vim.loop.fs_stat(full_path) then + return true + end + end + return false +end + +-- 从当前目录向上查找项目根 +local function find_root(start_path) + local path = vim.fn.fnamemodify(start_path or vim.fn.getcwd(), ":p") + local last_path = nil + + while path ~= last_path do + if has_marker(path) then + return path + end + last_path = path + path = vim.fn.fnamemodify(path, ":h") -- 上一级目录 + end + + -- 一直没找到,返回起始目录 + return start_path +end + +-- VimEnter 时设置工作目录 +vim.api.nvim_create_autocmd("VimEnter", { + callback = function() + local buf_path = vim.fn.expand("%:p:h") + local start_path = buf_path ~= "" and buf_path or vim.fn.getcwd() + local root = find_root(start_path) + vim.cmd("cd " .. root) + end, +}) diff --git a/lua/rafi/plugins/coding.lua b/lua/rafi/plugins/coding.lua index 2c3955c9..ca075b0c 100644 --- a/lua/rafi/plugins/coding.lua +++ b/lua/rafi/plugins/coding.lua @@ -28,7 +28,7 @@ return { 'conform.nvim', -- stylua: ignore keys = { - { 'cic', 'ConformInfo', silent = true, desc = 'Conform Info' }, + { 'cic', 'ConformInfo', silent = true, desc = '格式化信息' }, }, }, @@ -42,10 +42,23 @@ return { { 'cin', function() - vim.notify(vim.inspect(require('lint').linters[vim.bo.filetype])) + local linters = require('lint').linters[vim.bo.filetype] + if linters then + vim.notify( + vim.inspect(linters), + vim.log.levels.INFO, + { title = '当前检查器' } + ) + else + vim.notify( + '当前文件类型没有配置检查器', + vim.log.levels.WARN, + { title = '当前检查器' } + ) + end end, silent = true, - desc = 'Linter Info', + desc = '检查器信息', }, }, }, @@ -75,8 +88,8 @@ return { dependencies = { 'JoosepAlviste/nvim-ts-context-commentstring' }, -- stylua: ignore keys = { - { 'V', '(comment_toggle_blockwise_current)', mode = 'n', desc = 'Comment' }, - { 'V', '(comment_toggle_blockwise_visual)', mode = 'x', desc = 'Comment' }, + { 'V', '(comment_toggle_blockwise_current)', mode = 'n', desc = '注释' }, + { 'V', '(comment_toggle_blockwise_visual)', mode = 'x', desc = '注释' }, }, opts = function(_, opts) local ok, tcc = @@ -90,11 +103,11 @@ return { ----------------------------------------------------------------------------- -- Split and join arguments { - 'echasnovski/mini.splitjoin', + 'nvim-mini/mini.splitjoin', -- stylua: ignore keys = { - { 'sj', 'lua MiniSplitjoin.join()', mode = { 'n', 'x' }, desc = 'Join arguments' }, - { 'sk', 'lua MiniSplitjoin.split()', mode = { 'n', 'x' }, desc = 'Split arguments' }, + { 'sj', 'lua MiniSplitjoin.join()', mode = { 'n', 'x' }, desc = '合并参数' }, + { 'sk', 'lua MiniSplitjoin.split()', mode = { 'n', 'x' }, desc = '拆分参数' }, }, opts = { mappings = { toggle = '' }, @@ -104,11 +117,11 @@ return { ----------------------------------------------------------------------------- -- Trailing whitespace highlight and remove { - 'echasnovski/mini.trailspace', + 'nvim-mini/mini.trailspace', event = { 'BufReadPost', 'BufNewFile' }, -- stylua: ignore keys = { - { 'cw', 'lua MiniTrailspace.trim()', desc = 'Erase Whitespace' }, + { 'cw', 'lua MiniTrailspace.trim()', desc = '清除空白' }, }, opts = {}, }, @@ -119,10 +132,10 @@ return { 'AndrewRadev/linediff.vim', cmd = { 'Linediff', 'LinediffAdd' }, keys = { - { 'mdf', ':Linediff', mode = 'x', desc = 'Line diff' }, - { 'mda', ':LinediffAdd', mode = 'x', desc = 'Line diff add' }, - { 'mds', 'LinediffShow', desc = 'Line diff show' }, - { 'mdr', 'LinediffReset', desc = 'Line diff reset' }, + { 'mdf', ':Linediff', mode = 'x', desc = '行差异' }, + { 'mda', ':LinediffAdd', mode = 'x', desc = '添加行差异' }, + { 'mds', 'LinediffShow', desc = '显示行差异' }, + { 'mdr', 'LinediffReset', desc = '重置行差异' }, }, }, } diff --git a/lua/rafi/plugins/editor.lua b/lua/rafi/plugins/editor.lua index 1754b833..6d7b4230 100644 --- a/lua/rafi/plugins/editor.lua +++ b/lua/rafi/plugins/editor.lua @@ -36,7 +36,7 @@ return { event = 'VimEnter', -- stylua: ignore keys = { - { 's', "lua require'persistence'.select()", desc = 'Sessions' }, + { 's', "lua require'persistence'.select()", desc = '会话列表' }, }, opts = { branch = false, @@ -91,7 +91,52 @@ return { vim.api.nvim_win_close(win, false) end end - require('persistence').load() + -- Wait for Mason to finish any ongoing installations before loading session + -- This prevents "Package is already installing" errors + local function wait_for_mason(callback, max_wait) + max_wait = max_wait or 5000 -- 5 seconds max + local start_time = vim.loop.now() + local function check() + local ok, registry = pcall(require, 'mason-registry') + if not ok then + -- Mason not loaded yet, proceed + callback() + return + end + local has_installing = false + for _, package in pairs(registry.get_all_packages()) do + if package:is_installing() then + has_installing = true + break + end + end + if not has_installing or (vim.loop.now() - start_time) > max_wait then + -- No packages installing or timeout reached + callback() + else + -- Wait a bit and check again + vim.defer_fn(check, 100) + end + end + check() + end + -- Load session after ensuring Mason is ready + wait_for_mason(function() + -- Use xpcall to catch errors including those in nested callbacks + local function load_session() + require('persistence').load() + end + local function error_handler(err) + local err_str = tostring(err) + -- Silently ignore Mason "already installing" errors + if not err_str:match('already installing') then + vim.notify('Failed to load session: ' .. err_str, vim.log.levels.WARN) + end + -- Return true to prevent error propagation + return true + end + xpcall(load_session, error_handler) + end) end, }) end, @@ -117,7 +162,7 @@ return { keys = { -- Disable LazyVim default 's' keymap, switch to 'ss' { 's', mode = { 'n', 'x', 'o' }, false }, - { 'ss', mode = { 'n', 'x', 'o' }, function() require('flash').jump() end, desc = 'Flash' }, + { 'ss', mode = { 'n', 'x', 'o' }, function() require('flash').jump() end, desc = 'Flash 跳转' }, }, }, @@ -135,7 +180,7 @@ return { function() require('which-key').show({ global = false }) end, - desc = 'Buffer Keymaps (which-key)', + desc = '缓冲区快捷键(which-key)', }, }, -- stylua: ignore @@ -178,9 +223,9 @@ return { { 'cs', false }, { 'cS', false }, - { 'gR', function() require('trouble').open('lsp_references') end, desc = 'LSP References (Trouble)' }, - { 'xs', 'Trouble symbols toggle', desc = 'Symbols (Trouble)' }, - { 'xS', 'Trouble lsp toggle', desc = 'LSP references/definitions/... (Trouble)' }, + { 'gR', function() require('trouble').open('lsp_references') end, desc = 'LSP 引用(Trouble)' }, + { 'xs', 'Trouble symbols toggle', desc = '符号列表(Trouble)' }, + { 'xS', 'Trouble lsp toggle', desc = 'LSP 引用/定义…(Trouble)' }, }, }, @@ -199,7 +244,7 @@ return { 'hedyhli/outline.nvim', cmd = { 'Outline', 'OutlineOpen' }, keys = { - { 'o', 'Outline', desc = 'Toggle outline' }, + { 'o', 'Outline', desc = '切换大纲' }, }, opts = function() local defaults = require('outline.config').defaults @@ -230,7 +275,7 @@ return { 'mbbill/undotree', cmd = 'UndotreeToggle', keys = { - { 'gu', 'UndotreeToggle', desc = 'Undo Tree' }, + { 'gu', 'UndotreeToggle', desc = '撤销树' }, }, }, @@ -259,8 +304,8 @@ return { end local mappings = { - { 'sp', pick_window, desc = 'Pick window' }, - { 'sw', swap_window, desc = 'Swap picked window' }, + { 'sp', pick_window, desc = '选择窗口' }, + { 'sw', swap_window, desc = '交换所选窗口' }, } return vim.list_extend(mappings, keys) end, @@ -285,12 +330,12 @@ return { cmd = 'Glance', -- stylua: ignore keys = { - { 'cg', '', desc = '+glance' }, - { 'cgd', 'Glance definitions', desc = 'Glance Definitions' }, - { 'cgr', 'Glance references', desc = 'Glance References' }, - { 'cgy', 'Glance type_definitions', desc = 'Glance Type Definitions' }, - { 'cgi', 'Glance implementations', desc = 'Glance implementations' }, - { 'cgu', 'Glance resume', desc = 'Glance Resume' }, + { 'cg', '', desc = 'Glance 操作' }, + { 'cgd', 'Glance definitions', desc = 'Glance 定义' }, + { 'cgr', 'Glance references', desc = 'Glance 引用' }, + { 'cgy', 'Glance type_definitions', desc = 'Glance 类型定义' }, + { 'cgi', 'Glance implementations', desc = 'Glance 实现' }, + { 'cgu', 'Glance resume', desc = 'Glance 恢复' }, }, opts = function() local actions = require('glance').actions diff --git a/lua/rafi/plugins/extras/coding/align.lua b/lua/rafi/plugins/extras/coding/align.lua index f6af1cd0..f91ef541 100644 --- a/lua/rafi/plugins/extras/coding/align.lua +++ b/lua/rafi/plugins/extras/coding/align.lua @@ -2,7 +2,7 @@ return { -- Align text interactively { - 'echasnovski/mini.align', + 'nvim-mini/mini.align', opts = { mappings = { start = 'gb', diff --git a/lua/rafi/plugins/extras/coding/debugprint.lua b/lua/rafi/plugins/extras/coding/debugprint.lua index 8474219c..11f34598 100644 --- a/lua/rafi/plugins/extras/coding/debugprint.lua +++ b/lua/rafi/plugins/extras/coding/debugprint.lua @@ -6,12 +6,12 @@ return { version = '*', -- Remove if you DON'T want to use the stable version cmd = { 'ToggleCommentDebugPrints', 'DeleteDebugPrints' }, keys = { - { 'g?o', desc = 'Debug via text-obj below' }, - { 'g?O', desc = 'Debug via text-obj above' }, - { 'g?v', desc = 'Debug variable below' }, - { 'g?V', desc = 'Debug variable above' }, - { 'g?p', desc = 'Debug plain below' }, - { 'g?P', desc = 'Debug plain above' }, + { 'g?o', desc = '在下方通过文本对象调试' }, + { 'g?O', desc = '在上方通过文本对象调试' }, + { 'g?v', desc = '在下方调试变量' }, + { 'g?V', desc = '在上方调试变量' }, + { 'g?p', desc = '在下方调试普通文本' }, + { 'g?P', desc = '在上方调试普通文本' }, }, opts = { keymaps = { diff --git a/lua/rafi/plugins/extras/editor/anyjump.lua b/lua/rafi/plugins/extras/editor/anyjump.lua index 71755b2f..09521199 100644 --- a/lua/rafi/plugins/extras/editor/anyjump.lua +++ b/lua/rafi/plugins/extras/editor/anyjump.lua @@ -5,10 +5,10 @@ return { 'pechorin/any-jump.vim', cmd = { 'AnyJump', 'AnyJumpVisual' }, keys = { - { 'ii', 'AnyJump', desc = 'Any Jump' }, - { 'ii', 'AnyJumpVisual', mode = 'x', desc = 'Any Jump' }, - { 'ib', 'AnyJumpBack', desc = 'Any Jump Back' }, - { 'il', 'AnyJumpLastResults', desc = 'Any Jump Resume' }, + { 'ii', 'AnyJump', desc = '任意跳转' }, + { 'ii', 'AnyJumpVisual', mode = 'x', desc = '任意跳转' }, + { 'ib', 'AnyJumpBack', desc = '任意跳转返回' }, + { 'il', 'AnyJumpLastResults', desc = '任意跳转恢复' }, }, init = function() vim.g.any_jump_disable_default_keybindings = 1 diff --git a/lua/rafi/plugins/extras/editor/flybuf.lua b/lua/rafi/plugins/extras/editor/flybuf.lua index 26e3c247..2c0af2fe 100644 --- a/lua/rafi/plugins/extras/editor/flybuf.lua +++ b/lua/rafi/plugins/extras/editor/flybuf.lua @@ -6,7 +6,7 @@ return { cmd = 'FlyBuf', keys = { -- stylua: ignore - { 'sf', function() require('flybuf').toggle() end, desc = 'Flybuf' }, + { 'sf', function() require('flybuf').toggle() end, desc = '缓冲区列表' }, }, opts = {}, }, diff --git a/lua/rafi/plugins/extras/editor/harpoon2.lua b/lua/rafi/plugins/extras/editor/harpoon2.lua index 6c8181ad..d08cc370 100644 --- a/lua/rafi/plugins/extras/editor/harpoon2.lua +++ b/lua/rafi/plugins/extras/editor/harpoon2.lua @@ -17,16 +17,16 @@ return { { 'h', function() local harpoon = require('harpoon') harpoon.ui:toggle_quick_menu(harpoon:list()) - end, desc = 'List locations' }, - { 'H', function() require('harpoon'):list():add() end, desc = 'Add Location' }, - { 'mr', function() require('harpoon'):list():remove() end, desc = 'Remove Location' }, - { '', function() require('harpoon'):list():next() end, desc = 'Next Location' }, - { '', function() require('harpoon'):list():prev() end, desc = 'Previous Location' }, - { '1', function() require('harpoon'):list():select(1) end, desc = 'Harpoon to File 1' }, - { '2', function() require('harpoon'):list():select(2) end, desc = 'Harpoon to File 2' }, - { '3', function() require('harpoon'):list():select(3) end, desc = 'Harpoon to File 3' }, - { '4', function() require('harpoon'):list():select(4) end, desc = 'Harpoon to File 4' }, - { '5', function() require('harpoon'):list():select(5) end, desc = 'Harpoon to File 5' }, + end, desc = '列出位置' }, + { 'H', function() require('harpoon'):list():add() end, desc = '添加位置' }, + { 'mr', function() require('harpoon'):list():remove() end, desc = '移除位置' }, + { '', function() require('harpoon'):list():next() end, desc = '下一个位置' }, + { '', function() require('harpoon'):list():prev() end, desc = '上一个位置' }, + { '1', function() require('harpoon'):list():select(1) end, desc = '跳转到文件 1' }, + { '2', function() require('harpoon'):list():select(2) end, desc = '跳转到文件 2' }, + { '3', function() require('harpoon'):list():select(3) end, desc = '跳转到文件 3' }, + { '4', function() require('harpoon'):list():select(4) end, desc = '跳转到文件 4' }, + { '5', function() require('harpoon'):list():select(5) end, desc = '跳转到文件 5' }, }, }, } diff --git a/lua/rafi/plugins/extras/editor/mini-visits.lua b/lua/rafi/plugins/extras/editor/mini-visits.lua index dc991808..c9eb3337 100644 --- a/lua/rafi/plugins/extras/editor/mini-visits.lua +++ b/lua/rafi/plugins/extras/editor/mini-visits.lua @@ -2,7 +2,7 @@ return { -- Track and reuse file system visits { - 'echasnovski/mini.visits', + 'nvim-mini/mini.visits', event = 'VeryLazy', opts = {}, -- stylua: ignore diff --git a/lua/rafi/plugins/extras/editor/rest.lua b/lua/rafi/plugins/extras/editor/rest.lua index ce356d53..5dd11789 100644 --- a/lua/rafi/plugins/extras/editor/rest.lua +++ b/lua/rafi/plugins/extras/editor/rest.lua @@ -7,7 +7,7 @@ return { ft = 'http', cmd = 'Rest', keys = { - { 'ch', 'Rest run', desc = 'Execute HTTP request' }, + { 'ch', 'Rest run', desc = '执行 HTTP 请求' }, }, opts = { skip_ssl_verification = true }, }, diff --git a/lua/rafi/plugins/extras/editor/spectre.lua b/lua/rafi/plugins/extras/editor/spectre.lua index be3428e7..e8a30283 100644 --- a/lua/rafi/plugins/extras/editor/spectre.lua +++ b/lua/rafi/plugins/extras/editor/spectre.lua @@ -5,8 +5,8 @@ return { 'nvim-pack/nvim-spectre', -- stylua: ignore keys = { - { 'sp', function() require('spectre').toggle() end, desc = 'Spectre', }, - { 'sp', function() require('spectre').open_visual({ select_word = true }) end, mode = 'x', desc = 'Spectre Word' }, + { 'sp', function() require('spectre').toggle() end, desc = '搜索替换', }, + { 'sp', function() require('spectre').open_visual({ select_word = true }) end, mode = 'x', desc = '搜索替换单词' }, }, opts = { open_cmd = 'noswapfile vnew', @@ -14,7 +14,7 @@ return { ['toggle_gitignore'] = { map = 'tg', cmd = "lua require('spectre').change_options('gitignore')", - desc = 'toggle gitignore', + desc = '切换 gitignore 规则', }, }, find_engine = { @@ -33,7 +33,7 @@ return { ['gitignore'] = { value = '--no-ignore', icon = '[G]', - desc = 'gitignore', + desc = '遵循 gitignore', }, }, }, diff --git a/lua/rafi/plugins/extras/editor/ufo.lua b/lua/rafi/plugins/extras/editor/ufo.lua index 110e9daf..9aa03a29 100644 --- a/lua/rafi/plugins/extras/editor/ufo.lua +++ b/lua/rafi/plugins/extras/editor/ufo.lua @@ -1,19 +1,36 @@ return { + -- { + -- 'neovim/nvim-lspconfig', + -- opts = { + -- capabilities = { + -- textDocument = { + -- foldingRange = { + -- dynamicRegistration = false, + -- lineFoldingOnly = true, + -- }, + -- }, + -- }, + -- }, + -- }, + { - 'neovim/nvim-lspconfig', + "neovim/nvim-lspconfig", opts = { - capabilities = { - textDocument = { - foldingRange = { - dynamicRegistration = false, - lineFoldingOnly = true, + servers = { + ["*"] = { + capabilities = { + textDocument = { + foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true, + }, + }, }, }, }, }, }, - -- Make folds look modern and keep a high performance { 'kevinhwang91/nvim-ufo', diff --git a/lua/rafi/plugins/extras/git/fugitive.lua b/lua/rafi/plugins/extras/git/fugitive.lua index 467527d4..2bdd6fd8 100644 --- a/lua/rafi/plugins/extras/git/fugitive.lua +++ b/lua/rafi/plugins/extras/git/fugitive.lua @@ -6,8 +6,8 @@ return { 'tpope/vim-fugitive', cmd = { 'G', 'Git', 'Gfetch', 'Gpush', 'Gclog', 'Gdiffsplit' }, keys = { - { 'gd', 'Gdiffsplit', desc = 'Git diff' }, - { 'gb', 'Git blame', desc = 'Git blame' }, + { 'gd', 'Gdiffsplit', desc = 'Git 差异' }, + { 'gb', 'Git blame', desc = 'Git 注释' }, }, config = function() vim.api.nvim_create_autocmd('FileType', { @@ -29,7 +29,7 @@ return { dependencies = { 'tpope/vim-fugitive' }, cmd = 'GV', keys = { - { 'gl', 'GV', desc = 'Git log viewer' }, + { 'gl', 'GV', desc = 'Git 日志查看器' }, }, }, } diff --git a/lua/rafi/plugins/extras/lang/ansible.lua b/lua/rafi/plugins/extras/lang/ansible.lua index d7da0717..56d56bbf 100644 --- a/lua/rafi/plugins/extras/lang/ansible.lua +++ b/lua/rafi/plugins/extras/lang/ansible.lua @@ -20,7 +20,7 @@ LazyVim.on_very_lazy(function() end) return { - desc = 'Imports Ansible lang extras and adds more tools.', + desc = '引入 Ansible 语言扩展并提供更多工具。', recommended = function() return LazyVim.extras.wants({ ft = 'yaml.ansible', diff --git a/lua/rafi/plugins/extras/lang/go.lua b/lua/rafi/plugins/extras/lang/go.lua index 182d2597..f1510b07 100644 --- a/lua/rafi/plugins/extras/lang/go.lua +++ b/lua/rafi/plugins/extras/lang/go.lua @@ -2,7 +2,7 @@ -- return { - desc = 'Imports Go lang extras and adds more tools.', + desc = '引入 Go 语言扩展并提供更多工具。', recommended = function() return LazyVim.extras.wants({ ft = { 'go', 'gomod', 'gowork', 'gotmpl' }, @@ -43,15 +43,18 @@ return { }, { - 'williamboman/mason.nvim', + 'mason-org/mason.nvim', opts = { + ui = { + border = 'rounded', + }, ensure_installed = { 'gofumpt', 'goimports-reviser', 'gomodifytags', 'impl', 'json-to-struct', - }, + } }, }, diff --git a/lua/rafi/plugins/extras/lang/helm.lua b/lua/rafi/plugins/extras/lang/helm.lua index bff17b99..7467a049 100644 --- a/lua/rafi/plugins/extras/lang/helm.lua +++ b/lua/rafi/plugins/extras/lang/helm.lua @@ -11,7 +11,7 @@ LazyVim.on_very_lazy(function() end) return { - desc = 'Helm lang extras, common patterns, without towolf/vim-helm.', + desc = '引入 Helm 语言扩展与常用模板,移除 towolf/vim-helm。', recommended = function() return LazyVim.extras.wants({ ft = 'helm', diff --git a/lua/rafi/plugins/extras/lang/kubernetes.lua b/lua/rafi/plugins/extras/lang/kubernetes.lua index 9b880318..6271f0d3 100644 --- a/lua/rafi/plugins/extras/lang/kubernetes.lua +++ b/lua/rafi/plugins/extras/lang/kubernetes.lua @@ -2,7 +2,7 @@ -- return { - desc = 'Imports YAML lang and adds common manifest patterns for schemas.', + desc = '引入 YAML 语言扩展并提供常见清单 Schema 模式。', recommended = function() return LazyVim.extras.wants({ ft = 'yaml' }) end, @@ -14,7 +14,7 @@ return { cmd = { 'Kubectl', 'Kubectx', 'Kubens' }, -- stylua: ignore keys = { - { '8', function() vim.cmd[[tabnew]]; require('kubectl').open() end, desc = 'Kubectl' }, + { '8', function() vim.cmd[[tabnew]]; require('kubectl').open() end, desc = 'Kubectl 控制台' }, }, opts = {}, }, diff --git a/lua/rafi/plugins/extras/lang/markdown.lua b/lua/rafi/plugins/extras/lang/markdown.lua index 9a32c979..642a61db 100644 --- a/lua/rafi/plugins/extras/lang/markdown.lua +++ b/lua/rafi/plugins/extras/lang/markdown.lua @@ -8,7 +8,7 @@ LazyVim.on_very_lazy(function() end) return { - desc = 'Markdown lang extras, without headlines plugin, and toc generator.', + desc = '引入 Markdown 语言扩展,移除 headlines 插件并启用目录生成器。', recommended = function() return LazyVim.extras.wants({ ft = { 'markdown', 'markdown.mdx' }, @@ -25,7 +25,7 @@ return { cmd = { 'GenTocGFM', 'GenTocRedcarpet', 'GenTocGitLab', 'UpdateToc' }, ft = 'markdown', keys = { - { 'mo', 'UpdateToc', desc = 'Update table of contents' }, + { 'mo', 'UpdateToc', desc = '更新目录' }, }, init = function() vim.g.vmt_auto_update_on_save = 0 diff --git a/lua/rafi/plugins/extras/lang/python.lua b/lua/rafi/plugins/extras/lang/python.lua index e08cf913..4601cb01 100644 --- a/lua/rafi/plugins/extras/lang/python.lua +++ b/lua/rafi/plugins/extras/lang/python.lua @@ -13,7 +13,7 @@ LazyVim.on_very_lazy(function() end) return { - desc = 'Imports Python lang extras with more patterns and syntaxs.', + desc = '引入 Python 语言扩展并补充更多语法与模板。', recommended = function() return LazyVim.extras.wants({ ft = 'python', diff --git a/lua/rafi/plugins/extras/lang/tmux.lua b/lua/rafi/plugins/extras/lang/tmux.lua index 85ca7167..1b7bacce 100644 --- a/lua/rafi/plugins/extras/lang/tmux.lua +++ b/lua/rafi/plugins/extras/lang/tmux.lua @@ -8,7 +8,7 @@ LazyVim.on_very_lazy(function() end) return { - desc = 'Tmux syntax, navigator (), and completion.', + desc = '提供 Tmux 语法、高级导航()与补全支持。', recommended = function() return vim.env.TMUX ~= nil end, @@ -53,10 +53,10 @@ return { cond = vim.env.TMUX and vim.uv.os_uname().sysname ~= 'Windows_NT', -- stylua: ignore keys = { - { '', 'TmuxNavigateLeft', mode = { 'n', 't' }, silent = true, desc = 'Go to Left Window' }, - { '', 'TmuxNavigateDown', mode = { 'n', 't' }, silent = true, desc = 'Go to Lower Window' }, - { '', 'TmuxNavigateUp', mode = { 'n', 't' }, silent = true, desc = 'Go to Upper Window' }, - { '', 'TmuxNavigateRight', mode = { 'n', 't' }, silent = true, desc = 'Go to Right Window' }, + { '', 'TmuxNavigateLeft', mode = { 'n', 't' }, silent = true, desc = '跳转到左侧窗口' }, + { '', 'TmuxNavigateDown', mode = { 'n', 't' }, silent = true, desc = '跳转到下方窗口' }, + { '', 'TmuxNavigateUp', mode = { 'n', 't' }, silent = true, desc = '跳转到上方窗口' }, + { '', 'TmuxNavigateRight', mode = { 'n', 't' }, silent = true, desc = '跳转到右侧窗口' }, }, init = function() vim.g.tmux_navigator_no_mappings = true diff --git a/lua/rafi/plugins/extras/lsp/gtd.lua b/lua/rafi/plugins/extras/lsp/gtd.lua index e2152085..aa347dd0 100644 --- a/lua/rafi/plugins/extras/lsp/gtd.lua +++ b/lua/rafi/plugins/extras/lsp/gtd.lua @@ -9,7 +9,7 @@ return { { 'gf', function() require('gtd').exec({ command = 'split' }) end, - desc = 'Go to definition or file', + desc = '跳转到定义或文件', }, }, ---@diagnostic disable-next-line: undefined-doc-name diff --git a/lua/rafi/plugins/extras/lsp/yaml-companion.lua b/lua/rafi/plugins/extras/lsp/yaml-companion.lua index 18d3b650..f3f10388 100644 --- a/lua/rafi/plugins/extras/lsp/yaml-companion.lua +++ b/lua/rafi/plugins/extras/lsp/yaml-companion.lua @@ -23,7 +23,7 @@ return { }, -- stylua: ignore keys = { - { 'y', 'Telescope yaml_schema', desc = 'YAML Schema' }, + { 'y', 'Telescope yaml_schema', desc = 'YAML 模式' }, }, opts = {}, config = function(_, _) diff --git a/lua/rafi/plugins/extras/org/kiwi.lua b/lua/rafi/plugins/extras/org/kiwi.lua index 316917d5..2e28f119 100644 --- a/lua/rafi/plugins/extras/org/kiwi.lua +++ b/lua/rafi/plugins/extras/org/kiwi.lua @@ -8,10 +8,10 @@ return { 'serenevoid/kiwi.nvim', -- stylua: ignore keys = { - { 'zo', function() require('kiwi').open_wiki_index() end, desc = 'Open wiki' }, - { 'zd', function() require('kiwi').open_diary_index() end, desc = 'Diary index' }, - { 'zn', function() require('kiwi').open_diary_new() end, desc = 'Diary new' }, - { 'zx', function() require('kiwi').todo.toggle() end, desc = 'Toggle todo' }, + { 'zo', function() require('kiwi').open_wiki_index() end, desc = '打开维基' }, + { 'zd', function() require('kiwi').open_diary_index() end, desc = '日记索引' }, + { 'zn', function() require('kiwi').open_diary_new() end, desc = '新建日记' }, + { 'zx', function() require('kiwi').todo.toggle() end, desc = '切换待办' }, }, }, } diff --git a/lua/rafi/plugins/extras/org/zk.lua b/lua/rafi/plugins/extras/org/zk.lua index 96df0081..8cbaef78 100644 --- a/lua/rafi/plugins/extras/org/zk.lua +++ b/lua/rafi/plugins/extras/org/zk.lua @@ -11,13 +11,13 @@ return { cmd = { 'ZkNew', 'ZkNotes', 'ZkTags', 'ZkMatch' }, -- stylua: ignore keys = { - { 'zn', "ZkNew { title = vim.fn.input('Title: ') }", desc = 'Zk New' }, - { 'zo', "ZkNotes { sort = { 'modified' } }", desc = 'Zk Notes' }, - { 'zt', 'ZkTags', desc = 'Zk Tags' }, - { 'zf', "ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }", desc = 'Zk Search' }, - { 'zg', ":'<,'>ZkMatch", mode = 'x', desc = 'Zk Match' }, - { 'zb', 'ZkBacklinks', desc = 'Zk Backlinks' }, - { 'zl', 'ZkLinks', desc = 'Zk Links' }, + { 'zn', "ZkNew { title = vim.fn.input('标题: ') }", desc = 'Zk 新建' }, + { 'zo', "ZkNotes { sort = { 'modified' } }", desc = 'Zk 笔记' }, + { 'zt', 'ZkTags', desc = 'Zk 标签' }, + { 'zf', "ZkNotes { sort = { 'modified' }, match = { vim.fn.input('搜索: ') } }", desc = 'Zk 搜索' }, + { 'zg', ":'<,'>ZkMatch', mode = 'x', desc = 'Zk 匹配' }, + { 'zb', 'ZkBacklinks', desc = 'Zk 反向链接' }, + { 'zl', 'ZkLinks', desc = 'Zk 链接' }, }, opts = { picker = 'telescope', @@ -33,7 +33,7 @@ return { 'nvim-telescope/telescope.nvim', optional = true, keys = { - { 'w', 'ZkNotes', desc = 'Zk notes' }, + { 'w', 'ZkNotes', desc = 'Zk 笔记' }, }, }, } diff --git a/lua/rafi/plugins/extras/ui/alpha.lua b/lua/rafi/plugins/extras/ui/alpha.lua index fa769be3..5eded7af 100644 --- a/lua/rafi/plugins/extras/ui/alpha.lua +++ b/lua/rafi/plugins/extras/ui/alpha.lua @@ -1,7 +1,7 @@ return { { 'nvimdev/dashboard-nvim', optional = true, enabled = false }, - { 'echasnovski/mini.starter', optional = true, enabled = false }, + { 'nvim-mini/mini.starter', optional = true, enabled = false }, { 'folke/persistence.nvim', opts = { autoload = false }, @@ -24,7 +24,7 @@ return { val = { { type = 'text', - val = 'Recent files', + val = '最近的文件', opts = { hl = 'SpecialComment', shrink_margin = false, @@ -43,19 +43,19 @@ return { }, { type = 'padding', val = 2 }, - { type = 'text', val = 'Quick links', opts = { hl = 'SpecialComment', position = 'center' } }, + { type = 'text', val = '快速链接', opts = { hl = 'SpecialComment', position = 'center' } }, { type = 'padding', val = 1 }, - dashboard.button('f', ' ' .. ' Find file', LazyVim.pick()), - dashboard.button('n', ' ' .. ' New file', [[ ene startinsert ]]), - dashboard.button('r', ' ' .. ' Recent files', LazyVim.pick('oldfiles')), - dashboard.button('g', ' ' .. ' Find text', LazyVim.pick('live_grep')), + dashboard.button('f', ' ' .. ' 查找文件', LazyVim.pick()), + dashboard.button('n', ' ' .. ' 新建文件', [[ ene startinsert ]]), + dashboard.button('r', ' ' .. ' 最近的文件', LazyVim.pick('oldfiles')), + dashboard.button('g', ' ' .. ' 查找文本', LazyVim.pick('live_grep')), { type = 'text', val = '-------', opts = { hl = 'Comment', position = 'center' } }, - dashboard.button('c', ' ' .. ' Config', LazyVim.pick.config_files()), - dashboard.button('s', ' ' .. ' Restore Session', [[ lua require('persistence').load() ]]), - dashboard.button('u', ' ' .. ' Update plugins' , ' Lazy sync '), - dashboard.button('x', ' ' .. ' Lazy Extras', ' LazyExtras '), - dashboard.button('l', '󰒲 ' .. ' Lazy', ' Lazy '), - dashboard.button('q', ' ' .. ' Quit', ' qa '), + dashboard.button('c', ' ' .. ' 配置', LazyVim.pick.config_files()), + dashboard.button('s', ' ' .. ' 恢复会话', [[ lua require('persistence').load() ]]), + dashboard.button('u', ' ' .. ' 更新插件' , ' Lazy sync '), + dashboard.button('x', ' ' .. ' Lazy 扩展', ' LazyExtras '), + dashboard.button('l', '󰒲 ' .. ' Lazy 面板', ' Lazy '), + dashboard.button('q', ' ' .. ' 退出', ' qa '), { type = 'padding', val = 1 }, } for _, button in ipairs(dashboard.section.buttons.val) do @@ -93,13 +93,13 @@ return { callback = function() local stats = require('lazy').stats() local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) - dashboard.section.footer.val = '⚡ Neovim loaded ' + dashboard.section.footer.val = '⚡ Neovim 已加载 ' .. stats.loaded .. '/' .. stats.count - .. ' plugins in ' + .. ' 个插件,用时 ' .. ms - .. 'ms' + .. ' 毫秒' pcall(vim.cmd.AlphaRedraw) end, }) diff --git a/lua/rafi/plugins/extras/ui/barbecue.lua b/lua/rafi/plugins/extras/ui/barbecue.lua index 6b578a0a..dab6f082 100644 --- a/lua/rafi/plugins/extras/ui/barbecue.lua +++ b/lua/rafi/plugins/extras/ui/barbecue.lua @@ -11,7 +11,7 @@ return { local off = vim.b['barbecue_entries'] == nil require('barbecue.ui').toggle(off and true or nil) end, - desc = 'Breadcrumbs toggle', + desc = '切换面包屑导航', }, }, opts = function() diff --git a/lua/rafi/plugins/extras/ui/bookmarks.lua b/lua/rafi/plugins/extras/ui/bookmarks.lua index b062ff0e..6438e902 100644 --- a/lua/rafi/plugins/extras/ui/bookmarks.lua +++ b/lua/rafi/plugins/extras/ui/bookmarks.lua @@ -6,14 +6,14 @@ return { event = 'FileType', -- stylua: ignore keys = { - { 'm', "", desc = '+marks' }, - { 'mm', function() require('bookmarks').bookmark_toggle() end, desc = 'Toggle mark' }, - { 'mi', function() require('bookmarks').bookmark_ann() end, desc = 'Annotate mark' }, - { 'm', function() require('bookmarks').bookmark_clean() end, desc = 'Clean buffer marks' }, - { 'm]', function() require('bookmarks').bookmark_next() end, desc = 'Jump to next mark' }, - { 'm[', function() require('bookmarks').bookmark_prev() end, desc = 'Jump to previous mark' }, - { 'ml', function() require('bookmarks').bookmark_list() end, desc = 'List marks' }, - { 'm', function() require('bookmarks').bookmark_clear_all() end, desc = 'Remove all marks' }, + { 'm', "", desc = '+标记' }, + { 'mm', function() require('bookmarks').bookmark_toggle() end, desc = '切换标记' }, + { 'mi', function() require('bookmarks').bookmark_ann() end, desc = '注释标记' }, + { 'm', function() require('bookmarks').bookmark_clean() end, desc = '清理缓冲区标记' }, + { 'm]', function() require('bookmarks').bookmark_next() end, desc = '跳转到下一个标记' }, + { 'm[', function() require('bookmarks').bookmark_prev() end, desc = '跳转到上一个标记' }, + { 'ml', function() require('bookmarks').bookmark_list() end, desc = '列出标记' }, + { 'm', function() require('bookmarks').bookmark_clear_all() end, desc = '移除所有标记' }, }, opts = { save_file = vim.fn.stdpath('state') .. '/bookmarks.json', diff --git a/lua/rafi/plugins/extras/ui/ccc.lua b/lua/rafi/plugins/extras/ui/ccc.lua index 0d4aef88..2eb58424 100644 --- a/lua/rafi/plugins/extras/ui/ccc.lua +++ b/lua/rafi/plugins/extras/ui/ccc.lua @@ -5,7 +5,7 @@ return { 'uga-rosa/ccc.nvim', event = 'FileType', keys = { - { 'mc', 'CccPick', desc = 'Color-picker' }, + { 'mc', 'CccPick', desc = '颜色选择器' }, }, opts = { highlighter = { diff --git a/lua/rafi/plugins/extras/ui/illuminate.lua b/lua/rafi/plugins/extras/ui/illuminate.lua index 80e0776a..aeee67f8 100644 --- a/lua/rafi/plugins/extras/ui/illuminate.lua +++ b/lua/rafi/plugins/extras/ui/illuminate.lua @@ -29,8 +29,8 @@ return { }, }, keys = { - { ']]', desc = 'Next Reference' }, - { '[[', desc = 'Prev Reference' }, + { ']]', desc = '下一个引用' }, + { '[[', desc = '上一个引用' }, }, config = function(_, opts) require('illuminate').configure(opts) diff --git a/lua/rafi/plugins/extras/ui/marks.lua b/lua/rafi/plugins/extras/ui/marks.lua index 4fcc094d..636d9a1e 100644 --- a/lua/rafi/plugins/extras/ui/marks.lua +++ b/lua/rafi/plugins/extras/ui/marks.lua @@ -6,7 +6,7 @@ return { event = 'FileType', -- stylua: ignore keys = { - { 'm/', 'MarksListAll', desc = 'Marks from all opened buffers' }, + { 'm/', 'MarksListAll', desc = '所有已打开缓冲区的标记' }, }, opts = { sign_priority = { lower = 10, upper = 15, builtin = 8, bookmark = 20 }, diff --git a/lua/rafi/plugins/extras/ui/mini-clue.lua b/lua/rafi/plugins/extras/ui/mini-clue.lua index 72bcb41d..ac51a18a 100644 --- a/lua/rafi/plugins/extras/ui/mini-clue.lua +++ b/lua/rafi/plugins/extras/ui/mini-clue.lua @@ -4,7 +4,7 @@ return { -- Show next key clues { - 'echasnovski/mini.clue', + 'nvim-mini/mini.clue', version = false, event = 'VeryLazy', opts = function(_, opts) diff --git a/lua/rafi/plugins/extras/ui/mini-map.lua b/lua/rafi/plugins/extras/ui/mini-map.lua index d8283d46..2a3b81ea 100644 --- a/lua/rafi/plugins/extras/ui/mini-map.lua +++ b/lua/rafi/plugins/extras/ui/mini-map.lua @@ -2,10 +2,10 @@ return { -- Window with buffer text overview, scrollbar and highlights { - 'echasnovski/mini.map', + 'nvim-mini/mini.map', event = 'LazyFile', keys = { - { 'mn', 'lua MiniMap.toggle()', desc = 'Mini map' }, + { 'mn', 'lua MiniMap.toggle()', desc = '小地图' }, }, opts = function() -- local minimap = require('mini.map') diff --git a/lua/rafi/plugins/extras/ui/quicker.lua b/lua/rafi/plugins/extras/ui/quicker.lua index 84a480ae..c09e6347 100644 --- a/lua/rafi/plugins/extras/ui/quicker.lua +++ b/lua/rafi/plugins/extras/ui/quicker.lua @@ -19,8 +19,8 @@ return { }, -- stylua: ignore keys = { - { '>', function() require('quicker').expand({ before = 2, after = 2, add_to_existing = true }) end, desc = 'Expand quickfix context' }, - { '<', function() require('quicker').collapse() end, desc = 'Collapse quickfix context' }, + { '>', function() require('quicker').expand({ before = 2, after = 2, add_to_existing = true }) end, desc = '展开快速修复上下文' }, + { '<', function() require('quicker').collapse() end, desc = '折叠快速修复上下文' }, }, }, }, diff --git a/lua/rafi/plugins/extras/ui/symbols-outline.lua b/lua/rafi/plugins/extras/ui/symbols-outline.lua index 969d11fb..38dee609 100644 --- a/lua/rafi/plugins/extras/ui/symbols-outline.lua +++ b/lua/rafi/plugins/extras/ui/symbols-outline.lua @@ -5,7 +5,7 @@ return { 'simrat39/symbols-outline.nvim', cmd = { 'SymbolsOutline', 'SymbolsOutlineOpen' }, keys = { - { 'o', 'SymbolsOutline', desc = 'Symbols Outline' }, + { 'o', 'SymbolsOutline', desc = '符号大纲' }, }, opts = function() local defaults = require('symbols-outline.config').defaults diff --git a/lua/rafi/plugins/git.lua b/lua/rafi/plugins/git.lua index a5ba6e07..18cf335c 100644 --- a/lua/rafi/plugins/git.lua +++ b/lua/rafi/plugins/git.lua @@ -15,15 +15,15 @@ return { cond = has_git, -- stylua: ignore keys = { - { ']g', ']h', desc = 'Next Hunk', remap = true }, - { '[g', '[h', desc = 'Previous Hunk', remap = true }, - { 'gs', function() package.loaded.gitsigns.preview_hunk() end, desc = 'Preview hunk' }, - { 'ghtb', function() package.loaded.gitsigns.toggle_current_line_blame() end, desc = 'Toggle Git line blame' }, - { 'ghtd', function() package.loaded.gitsigns.toggle_deleted() end, desc = 'Toggle Git deleted' }, - { 'ghtw', function() package.loaded.gitsigns.toggle_word_diff() end, desc = 'Toggle Git word diff' }, - { 'ghtl', function() package.loaded.gitsigns.toggle_linehl() end, desc = 'Toggle Git line highlight' }, - { 'ghtn', function() package.loaded.gitsigns.toggle_numhl() end, desc = 'Toggle Git number highlight' }, - { 'ghts', function() package.loaded.gitsigns.toggle_signs() end, desc = 'Toggle Git signs' }, + { ']g', ']h', desc = '下一个代码块', remap = true }, + { '[g', '[h', desc = '上一个代码块', remap = true }, + { 'gs', function() package.loaded.gitsigns.preview_hunk() end, desc = '预览代码块' }, + { 'ghtb', function() package.loaded.gitsigns.toggle_current_line_blame() end, desc = '切换 Git 行注释' }, + { 'ghtd', function() package.loaded.gitsigns.toggle_deleted() end, desc = '切换 Git 删除标记' }, + { 'ghtw', function() package.loaded.gitsigns.toggle_word_diff() end, desc = '切换 Git 单词差异' }, + { 'ghtl', function() package.loaded.gitsigns.toggle_linehl() end, desc = '切换 Git 行高亮' }, + { 'ghtn', function() package.loaded.gitsigns.toggle_numhl() end, desc = '切换 Git 行号高亮' }, + { 'ghts', function() package.loaded.gitsigns.toggle_signs() end, desc = '切换 Git 标记' }, }, -- stylua: ignore opts = { @@ -50,8 +50,8 @@ return { cond = has_git, cmd = { 'DiffviewOpen', 'DiffviewFileHistory' }, keys = { - { 'gD', 'DiffviewFileHistory %', desc = 'Diff File' }, - { 'gv', 'DiffviewOpen', desc = 'Diff View' }, + { 'gD', 'DiffviewFileHistory %', desc = '文件差异' }, + { 'gv', 'DiffviewOpen', desc = '差异视图' }, }, opts = function() local actions = require('diffview.actions') @@ -127,8 +127,8 @@ return { cmd = 'ToggleBlame', -- stylua: ignore keys = { - { 'gb', 'BlameToggle virtual', desc = 'Git blame' }, - { 'gB', 'BlameToggle window', desc = 'Git blame (window)' }, + { 'gb', 'BlameToggle virtual', desc = 'Git 注释' }, + { 'gB', 'BlameToggle window', desc = 'Git 注释(窗口)' }, }, opts = { date_format = '%Y-%m-%d %H:%M', diff --git a/lua/rafi/plugins/lsp.lua b/lua/rafi/plugins/lsp.lua index bf40033a..b8dd327c 100644 --- a/lua/rafi/plugins/lsp.lua +++ b/lua/rafi/plugins/lsp.lua @@ -11,18 +11,17 @@ return { { 'nvim-lspconfig', -- stylua: ignore - opts = function() - local keys = require('lazyvim.plugins.lsp.keymaps').get() - vim.list_extend(keys, { + opts = { + keys = { { 'cl', false }, { '', false, mode = 'i' }, - { 'cli', vim.lsp.buf.incoming_calls, desc = 'Incoming calls' }, - { 'clo', vim.lsp.buf.outgoing_calls, desc = 'Outgoing calls' }, - { 'fwa', vim.lsp.buf.add_workspace_folder, desc = 'Show Workspace Folders' }, - { 'fwr', vim.lsp.buf.remove_workspace_folder, desc = 'Remove Workspace Folder' }, - { 'fwl', 'lua =vim.lsp.buf.list_workspace_folders()', desc = 'List Workspace Folders' }, - }) - end, + { 'cli', vim.lsp.buf.incoming_calls, desc = '传入调用' }, + { 'clo', vim.lsp.buf.outgoing_calls, desc = '传出调用' }, + { 'fwa', vim.lsp.buf.add_workspace_folder, desc = '显示工作区文件夹' }, + { 'fwr', vim.lsp.buf.remove_workspace_folder, desc = '移除工作区文件夹' }, + { 'fwl', 'lua =vim.lsp.buf.list_workspace_folders()', desc = '列出工作区文件夹' }, + }, + }, }, ----------------------------------------------------------------------------- @@ -31,10 +30,49 @@ return { -- $XDG_DATA_HOME/nvim/lazy/LazyVim/lua/lazyvim/plugins/lsp/init.lua { 'mason.nvim', + priority = 1000, -- Load early to override install method before LazyVim uses it opts = { ui = { border = 'rounded', }, }, + config = function(plugin, opts) + require('mason').setup(opts) + -- Override Mason's package install method to prevent "already installing" errors + -- This needs to happen after Mason is set up but before LazyVim's LSP initialization + local ok, Package = pcall(require, 'mason-core.package') + if ok and Package and Package.install then + -- Store original install method + local original_install = Package.install + -- Override install method to handle "already installing" gracefully + function Package:install(...) + -- Check if package is already installing + if self:is_installing() then + -- Silently return if already installing + return + end + -- Call original install with error handling + local ok_install, err = pcall(original_install, self, ...) + if not ok_install and err then + -- Silently ignore "already installing" errors + local err_str = tostring(err) + if not err_str:match('already installing') then + -- Re-raise other errors + error(err) + end + end + end + end + end, + }, + + ----------------------------------------------------------------------------- + -- Mason LSP config - Disable automatic installation to prevent conflicts + -- when persistence.nvim loads sessions + { + 'mason-org/mason-lspconfig.nvim', + opts = { + automatic_installation = false, + }, }, } diff --git a/lua/rafi/plugins/neo-tree.lua b/lua/rafi/plugins/neo-tree.lua index ce07bc96..88c87396 100644 --- a/lua/rafi/plugins/neo-tree.lua +++ b/lua/rafi/plugins/neo-tree.lua @@ -17,26 +17,26 @@ return { -- File explorer written in Lua -- NOTE: This extends -- $XDG_DATA_HOME/nvim/lazy/LazyVim/lua/lazyvim/plugins/editor.lua - 'neo-tree.nvim', + 'nvim-neo-tree/neo-tree.nvim', branch = 'v3.x', dependencies = { 'MunifTanjim/nui.nvim' }, -- stylua: ignore keys = { - { 'e', 'fe', desc = 'Explorer Tree (Root Dir)', remap = true }, - { 'E', 'fE', desc = 'Explorer Tree (cwd)', remap = true }, + { 'e', 'fe', desc = '资源管理器树(根目录)', remap = true }, + { 'E', 'fE', desc = '资源管理器树(当前目录)', remap = true }, { 'a', function() require('neo-tree.command').execute({ reveal = true, dir = LazyVim.root() }) end, - desc = 'Reveal in Explorer', + desc = '在资源管理器中显示', }, { 'A', function() require('neo-tree.command').execute({ reveal = true, dir = vim.uv.cwd() }) end, - desc = 'Reveal in Explorer (cwd)', + desc = '在资源管理器中显示(当前目录)', }, }, -- See: https://github.com/nvim-neo-tree/neo-tree.nvim @@ -51,8 +51,8 @@ return { show_scrolled_off_parent_node = true, padding = { left = 1, right = 0 }, sources = { - { source = 'filesystem', display_name = '  Files' }, --       - { source = 'buffers', display_name = '  Buffers' }, --       + { source = 'filesystem', display_name = '  文件' }, --       + { source = 'buffers', display_name = '  缓冲区' }, --       { source = 'git_status', display_name = ' 󰊢 Git' }, -- 󰊢       }, }, @@ -180,7 +180,7 @@ return { local path = node:get_id() vim.fn.setreg('+', path, 'c') end, - desc = 'Copy Path to Clipboard', + desc = '复制路径到剪贴板', }, ['O'] = { @@ -190,7 +190,7 @@ return { { system = true } ) end, - desc = 'Open with System Application', + desc = '用系统应用打开', }, }, }, diff --git a/lua/rafi/plugins/telescope.lua b/lua/rafi/plugins/telescope.lua index c559af3e..68259398 100644 --- a/lua/rafi/plugins/telescope.lua +++ b/lua/rafi/plugins/telescope.lua @@ -75,7 +75,7 @@ local plugin_directories = function(opts) width = 0.65, height = 0.7, }, - prompt_title = '[ Plugin directories ]', + prompt_title = '[ 插件目录 ]', finder = require('telescope.finders').new_table({ results = utils.get_os_command_output(opts.cmd), entry_maker = opts.entry_maker, @@ -159,30 +159,30 @@ return { -- stylua: ignore keys = { { '', false }, - { '', 'Telescope pickers', desc = 'Pickers' }, - { 'u', 'Telescope spell_suggest', desc = 'Spell Suggest' }, - { '/', 'Telescope search_history', desc = 'Search History' }, + { '', 'Telescope pickers', desc = '选择器' }, + { 'u', 'Telescope spell_suggest', desc = '拼写建议' }, + { '/', 'Telescope search_history', desc = '搜索历史' }, -- LSP related - { 'dd', 'Telescope lsp_definitions', desc = 'Definitions' }, - { 'di', 'Telescope lsp_implementations', desc = 'Implementations' }, - { 'dr', 'Telescope lsp_references', desc = 'References' }, - { 'da', 'Telescope lsp_code_actions', desc = 'Code Actions' }, - { 'da', ':Telescope lsp_range_code_actions', mode = 'x', desc = 'Code Actions' }, + { 'dd', 'Telescope lsp_definitions', desc = '定义' }, + { 'di', 'Telescope lsp_implementations', desc = '实现' }, + { 'dr', 'Telescope lsp_references', desc = '引用' }, + { 'da', 'Telescope lsp_code_actions', desc = '代码操作' }, + { 'da', ':Telescope lsp_range_code_actions', mode = 'x', desc = '代码操作' }, -- Plugins - { 'n', plugin_directories, desc = 'Plugins' }, - { 'k', 'Telescope thesaurus lookup', desc = 'Thesaurus' }, + { 'n', plugin_directories, desc = '插件' }, + { 'k', 'Telescope thesaurus lookup', desc = '同义词' }, { 'z', function() require('telescope').extensions.zoxide.list({ - prompt_title = 'Zoxide', + prompt_title = 'Zoxide 常用目录', previewer = false, layout_config = { width = 0.6, height = 0.6 }, }) end, - desc = 'Zoxide (MRU)', + desc = 'Zoxide (最近使用)', }, { 'gf', @@ -191,7 +191,7 @@ return { default_text = vim.fn.expand(''), }) end, - desc = 'Find File', + desc = '查找文件', }, }, opts = function(_, opts) @@ -438,7 +438,7 @@ return { } opts.extensions = { zoxide = { - prompt_title = '[ Zoxide directories ]', + prompt_title = '[ Zoxide 目录 ]', mappings = { default = { action = function(selection) diff --git a/lua/rafi/plugins/treesitter.lua b/lua/rafi/plugins/treesitter.lua index 0ad6b85a..a12a7e42 100644 --- a/lua/rafi/plugins/treesitter.lua +++ b/lua/rafi/plugins/treesitter.lua @@ -58,9 +58,20 @@ return { opts.ensure_installed = LazyVim.dedup(opts.ensure_installed) end if not has_git then - require('nvim-treesitter.install').ensure_installed = function() end + local install = require('nvim-treesitter.install') + if install then + install.ensure_installed = function() end + end + end + -- Try new API (main branch) first, fallback to old API (master branch) for compatibility + local ok, treesitter = pcall(require, 'nvim-treesitter') + if ok and treesitter and treesitter.setup then + -- New API for main branch + treesitter.setup(opts) + else + -- Old API for master branch + require('nvim-treesitter.configs').setup(opts) end - require('nvim-treesitter.configs').setup(opts) end, ---@type TSConfig ---@diagnostic disable: missing-fields diff --git a/lua/rafi/plugins/ui.lua b/lua/rafi/plugins/ui.lua index ae561675..7d5852e8 100644 --- a/lua/rafi/plugins/ui.lua +++ b/lua/rafi/plugins/ui.lua @@ -14,7 +14,7 @@ return { keys = { { '', false }, { '', false }, - { 'tp', 'BufferLinePick', desc = 'Tab Pick' }, + { 'tp', 'BufferLinePick', desc = '选择标签页' }, }, opts = { options = { @@ -39,12 +39,12 @@ return { end, }, offsets = { - { - filetype = 'neo-tree', - text = 'Neo-tree', - highlight = 'Directory', - text_align = 'center', - }, + { + filetype = 'neo-tree', + text = '资源管理器', + highlight = 'Directory', + text_align = 'center', + }, }, }, }, @@ -124,7 +124,7 @@ return { keys = { { 'N', - desc = 'Neovim News', + desc = 'Neovim 新闻', function() ---@diagnostic disable-next-line: missing-fields Snacks.win({ @@ -151,12 +151,12 @@ return { end -- stylua: ignore local mappings = { - { '', function() Snacks.picker() end, mode = { 'n', 'x' }, desc = 'Pickers' }, - { 'i', function() Snacks.picker.icons() end, mode = { 'n', 'x' }, desc = 'Spellcheck' }, - { 'n', function() Snacks.picker.notifications() end, desc = 'Notifications' }, - { 'u', function() Snacks.picker.spelling() end, mode = { 'n', 'x' }, desc = 'Spellcheck' }, - { '/', function() Snacks.picker.search_history() end, mode = { 'n', 'x' }, desc = 'Search History' }, - { 'gF', function() Snacks.picker.files({ pattern = vim.fn.expand('') }) end, desc = 'Find File' }, + { '', function() Snacks.picker() end, mode = { 'n', 'x' }, desc = '选择器' }, + { 'i', function() Snacks.picker.icons() end, mode = { 'n', 'x' }, desc = '拼写检查' }, + { 'n', function() Snacks.picker.notifications() end, desc = '通知' }, + { 'u', function() Snacks.picker.spelling() end, mode = { 'n', 'x' }, desc = '拼写检查' }, + { '/', function() Snacks.picker.search_history() end, mode = { 'n', 'x' }, desc = '搜索历史' }, + { 'gF', function() Snacks.picker.files({ pattern = vim.fn.expand('') }) end, desc = '查找文件' }, { 'z', mode = { 'n', 'x' }, @@ -232,7 +232,7 @@ return { 't9md/vim-quickhl', -- stylua: ignore keys = { - { 'mt', '(quickhl-manual-this)', mode = { 'n', 'x' }, desc = 'Highlight word' }, + { 'mt', '(quickhl-manual-this)', mode = { 'n', 'x' }, desc = '高亮单词' }, }, }, } diff --git a/lua/rafi/util/contextmenu.lua b/lua/rafi/util/contextmenu.lua index ec548426..42b996f8 100644 --- a/lua/rafi/util/contextmenu.lua +++ b/lua/rafi/util/contextmenu.lua @@ -21,7 +21,7 @@ M.show = function() vim.notify( 'You must be running Neovim ≥9.0', vim.log.levels.WARN, - { title = 'Contextmenu' } + { title = '上下文菜单' } ) return end diff --git a/lua/rafi/util/init.lua b/lua/rafi/util/init.lua index ab604e3c..99e8992b 100644 --- a/lua/rafi/util/init.lua +++ b/lua/rafi/util/init.lua @@ -39,8 +39,8 @@ setmetatable(M, { }) function M.deprecate(old, new) - M.warn(('`%s` is deprecated. Please use `%s` instead'):format(old, new), { - title = 'Rafi', + M.warn(('`%s` 已被弃用,请改用 `%s`'):format(old, new), { + title = 'Rafi 提示', once = true, stacktrace = true, stacklevel = 6,