feat: more nvim keymap
parent
5cffdc47c7
commit
5a454cb886
|
@ -113,7 +113,8 @@
|
||||||
<p>Keymap for plugin (sync with dotfiles):</p>
|
<p>Keymap for plugin (sync with dotfiles):</p>
|
||||||
<div class="highlight highlight-source-lua">
|
<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>)
|
<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><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>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>)
|
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>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
With
|
With
|
||||||
<a
|
<a href="https://github.com/nvim-tree/nvim-tree.lua"
|
||||||
href="https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-comment.md"
|
>nvim-tree/nvim-tree.lua</a
|
||||||
>echasnovski/mini.nvim mini-comment</a
|
>, inside nvim-tree:
|
||||||
>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>gcc</code>: comment/uncomment current line</li>
|
<li><code>d</code>: delete</li>
|
||||||
<li><code>gc</code>: comment/uncomment selected lines</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>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
With
|
With
|
||||||
<a
|
<a href="https://github.com/lewis6991/gitsigns.nvim"
|
||||||
href="https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-bracketed.md"
|
>lewis6991/gitsigns.nvim</a
|
||||||
>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
|
|
||||||
>:
|
>:
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>]c</code>, <code>[c</code>: next/previous git change</li>
|
<li><code>]c</code>, <code>[c</code>: next/previous git change</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</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>
|
</ul>
|
||||||
<h2>
|
<h2>
|
||||||
<a
|
<a
|
||||||
|
|
|
@ -45,7 +45,8 @@ Keymap for plugin (sync with dotfiles):
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
vim.keymap.set("n", "<leader>f", ":FZF<CR>")
|
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", "<C-n>", ":NvimTreeToggle<CR>")
|
||||||
vim.keymap.set("n", "<leader>n", ":NvimTreeFindFile<CR>")
|
vim.keymap.set("n", "<leader>n", ":NvimTreeFindFile<CR>")
|
||||||
vim.keymap.set("n", "<leader>tr", ":lua MiniTrailspace.trim()<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>")
|
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)
|
- With [nvim-tree/nvim-tree.lua](https://github.com/nvim-tree/nvim-tree.lua), inside nvim-tree:
|
||||||
- `gcc`: comment/uncomment current line
|
- `d`: delete
|
||||||
- `gc`: comment/uncomment selected lines
|
- `r`: rename
|
||||||
- With [echasnovski/mini.nvim mini-bracketed](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-bracketed.md)
|
- `x`: cut
|
||||||
- `[b`, `]b`: buffer backward/forward
|
- `c`: copy
|
||||||
- `[T`, `]T`, `[t`, `]t`: tree-sitter backward/forward
|
- `p`: paste
|
||||||
- Support more languages with [nvim-treesitter/nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
|
- With [lewis6991/gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim):
|
||||||
- With [airblade/vim-gitgutter](https://github.com/airblade/vim-gitgutter):
|
|
||||||
- `]c`, `[c`: next/previous git change
|
- `]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
|
## Reference
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue