feat: more nvim keymap
parent
5cffdc47c7
commit
5a454cb886
|
@ -113,7 +113,8 @@
|
|||
<p>Keymap for plugin (sync with dotfiles):</p>
|
||||
<div class="highlight highlight-source-lua">
|
||||
<pre>vim.<span class="pl-smi">keymap</span>.<span class="pl-c1">set</span>(<span class="pl-s"><span class="pl-pds">"</span>n<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span><leader>f<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>:FZF<CR><span class="pl-pds">"</span></span>)
|
||||
vim.<span class="pl-smi">keymap</span>.<span class="pl-c1">set</span>(<span class="pl-s"><span class="pl-pds">"</span>n<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span><leader>rg<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>:Rg<CR><span class="pl-pds">"</span></span>)
|
||||
vim.<span class="pl-smi">keymap</span>.<span class="pl-c1">set</span>(<span class="pl-s"><span class="pl-pds">"</span>n<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span><leader>rg<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>:FZFRg<CR><span class="pl-pds">"</span></span>)
|
||||
vim.<span class="pl-smi">keymap</span>.<span class="pl-c1">set</span>(<span class="pl-s"><span class="pl-pds">"</span>n<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span><leader>cm<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>:FZFCommands<CR><span class="pl-pds">"</span></span>)
|
||||
vim.<span class="pl-smi">keymap</span>.<span class="pl-c1">set</span>(<span class="pl-s"><span class="pl-pds">"</span>n<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span><C-n><span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>:NvimTreeToggle<CR><span class="pl-pds">"</span></span>)
|
||||
vim.<span class="pl-smi">keymap</span>.<span class="pl-c1">set</span>(<span class="pl-s"><span class="pl-pds">"</span>n<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span><leader>n<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>:NvimTreeFindFile<CR><span class="pl-pds">"</span></span>)
|
||||
vim.<span class="pl-smi">keymap</span>.<span class="pl-c1">set</span>(<span class="pl-s"><span class="pl-pds">"</span>n<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span><leader>tr<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>:lua MiniTrailspace.trim()<CR><span class="pl-pds">"</span></span>)
|
||||
|
@ -128,46 +129,67 @@ vim.<span class="pl-smi">keymap</span>.<span class="pl-c1">set</span>(<span clas
|
|||
<ul>
|
||||
<li>
|
||||
With
|
||||
<a
|
||||
href="https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-comment.md"
|
||||
>echasnovski/mini.nvim mini-comment</a
|
||||
>
|
||||
<a href="https://github.com/nvim-tree/nvim-tree.lua"
|
||||
>nvim-tree/nvim-tree.lua</a
|
||||
>, inside nvim-tree:
|
||||
<ul>
|
||||
<li><code>gcc</code>: comment/uncomment current line</li>
|
||||
<li><code>gc</code>: comment/uncomment selected lines</li>
|
||||
<li><code>d</code>: delete</li>
|
||||
<li><code>r</code>: rename</li>
|
||||
<li><code>x</code>: cut</li>
|
||||
<li><code>c</code>: copy</li>
|
||||
<li><code>p</code>: paste</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
With
|
||||
<a
|
||||
href="https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-bracketed.md"
|
||||
>echasnovski/mini.nvim mini-bracketed</a
|
||||
>
|
||||
<ul>
|
||||
<li><code>[b</code>, <code>]b</code>: buffer backward/forward</li>
|
||||
<li>
|
||||
<code>[T</code>, <code>]T</code>, <code>[t</code>, <code>]t</code>:
|
||||
tree-sitter backward/forward
|
||||
<ul>
|
||||
<li>
|
||||
Support more languages with
|
||||
<a href="https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
>nvim-treesitter/nvim-treesitter</a
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
With
|
||||
<a href="https://github.com/airblade/vim-gitgutter"
|
||||
>airblade/vim-gitgutter</a
|
||||
<a href="https://github.com/lewis6991/gitsigns.nvim"
|
||||
>lewis6991/gitsigns.nvim</a
|
||||
>:
|
||||
<ul>
|
||||
<li><code>]c</code>, <code>[c</code>: next/previous git change</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
With
|
||||
<a href="https://github.com/echasnovski/mini.nvim"
|
||||
>echasnovski/mini.nvim</a
|
||||
>
|
||||
<ul>
|
||||
<li>
|
||||
With mini-bracketed
|
||||
<ul>
|
||||
<li><code>[b</code>, <code>]b</code>: buffer backward/forward</li>
|
||||
<li>
|
||||
<code>[T</code>, <code>]T</code>, <code>[t</code>,
|
||||
<code>]t</code>: tree-sitter backward/forward
|
||||
<ul>
|
||||
<li>
|
||||
Support more languages with
|
||||
<a href="https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
>nvim-treesitter/nvim-treesitter</a
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
With mini-comment
|
||||
<ul>
|
||||
<li><code>gcc</code>: comment/uncomment current line</li>
|
||||
<li><code>gc</code>: comment/uncomment selected lines</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
With mini-surround
|
||||
<ul>
|
||||
<li><code>sa</code>: add surround</li>
|
||||
<li><code>sd</code>: delete surround</li>
|
||||
<li><code>sr</code>: replace surround</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
<a
|
||||
|
|
|
@ -45,7 +45,8 @@ Keymap for plugin (sync with dotfiles):
|
|||
|
||||
```lua
|
||||
vim.keymap.set("n", "<leader>f", ":FZF<CR>")
|
||||
vim.keymap.set("n", "<leader>rg", ":Rg<CR>")
|
||||
vim.keymap.set("n", "<leader>rg", ":FZFRg<CR>")
|
||||
vim.keymap.set("n", "<leader>cm", ":FZFCommands<CR>")
|
||||
vim.keymap.set("n", "<C-n>", ":NvimTreeToggle<CR>")
|
||||
vim.keymap.set("n", "<leader>n", ":NvimTreeFindFile<CR>")
|
||||
vim.keymap.set("n", "<leader>tr", ":lua MiniTrailspace.trim()<CR>")
|
||||
|
@ -58,15 +59,26 @@ vim.keymap.set("n", "<leader>gcv", ":GoCoverage<CR>")
|
|||
vim.keymap.set("n", "<leader>gdd", ":GoDeclsDir<CR>")
|
||||
```
|
||||
|
||||
- With [echasnovski/mini.nvim mini-comment](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-comment.md)
|
||||
- `gcc`: comment/uncomment current line
|
||||
- `gc`: comment/uncomment selected lines
|
||||
- With [echasnovski/mini.nvim mini-bracketed](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-bracketed.md)
|
||||
- `[b`, `]b`: buffer backward/forward
|
||||
- `[T`, `]T`, `[t`, `]t`: tree-sitter backward/forward
|
||||
- Support more languages with [nvim-treesitter/nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
|
||||
- With [airblade/vim-gitgutter](https://github.com/airblade/vim-gitgutter):
|
||||
- With [nvim-tree/nvim-tree.lua](https://github.com/nvim-tree/nvim-tree.lua), inside nvim-tree:
|
||||
- `d`: delete
|
||||
- `r`: rename
|
||||
- `x`: cut
|
||||
- `c`: copy
|
||||
- `p`: paste
|
||||
- With [lewis6991/gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim):
|
||||
- `]c`, `[c`: next/previous git change
|
||||
- With [echasnovski/mini.nvim](https://github.com/echasnovski/mini.nvim)
|
||||
- With mini-bracketed
|
||||
- `[b`, `]b`: buffer backward/forward
|
||||
- `[T`, `]T`, `[t`, `]t`: tree-sitter backward/forward
|
||||
- Support more languages with [nvim-treesitter/nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
|
||||
- With mini-comment
|
||||
- `gcc`: comment/uncomment current line
|
||||
- `gc`: comment/uncomment selected lines
|
||||
- With mini-surround
|
||||
- `sa`: add surround
|
||||
- `sd`: delete surround
|
||||
- `sr`: replace surround
|
||||
|
||||
## Reference
|
||||
|
||||
|
|
Loading…
Reference in New Issue