2020-09-23
vim-plugin-used

列一下,我有用到的 vim plugin,還有常用到的 設定 or keymap (key binding)

plugin (package) 管理工具

跟 auto-complete 相關

跟 folder 結構有關

之前用 vim 時,會不喜歡多一個 window 顯示 folder,隨著對 window 的熟悉,有開一個 folder 的側邊也滿好的

  • preservim/nerdtree - A tree explorer plugin for vim
  • 設定 ctrl-n 為 toogle nerdtree 的出現
  • 在 nerdtree 中,按下 t 時,會將檔案開在新的 tab

file search tool

  • ctrlpvim/ctrlp.vim * 滿強大的 file search 工具
    • 可以用 :CtrlP 或是 或是 <c-p> 呼叫 CtrlP fuzzy find 的功能
    • 在 CtrlP 的模式下
      • Press <c-f> and <c-b> to cycle between modes.
      • Press <c-d> to switch to filename only search instead of full path.
      • Press <c-r> to switch to regexp mode.
      • Use <c-j>, <c-k> or the arrow keys to navigate the result list.

comment

vim tab movement

1
2
3
" easier moving between tabs
map <Leader>n <esc>:tabprevious<CR>
map <Leader>m <esc>:tabnext<CR>

vim window movement

1
2
3
4
5
"""""" windows split shortcut
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>

Reference

Read More