VIM替代插件的原生功能合集(持續更新)

How to Do 90% of What Plugins Do (With Just Vim)

This collection is inspired by the youtube video: How to Do 90% of What Plugins Do (With Just Vim)vim

VIM內置文件瀏覽框NetRW

g:netrw_browse_split是重要的選項,直接影響體驗:ide

*g:netrw_browse_split*    when browsing, <cr> will open the file by:
                =0: re-using the same window  (default)
                =1: horizontally splitting the window first
                =2: vertically   splitting the window first
                =3: open file in new tab
                =4: act like "P" (ie. open previous window)
*g:netrw_liststyle*        Set the default listing style:
                                = 0: thin listing (one file per line)
                                = 1: long listing (one file per line with time
                     stamp information and file size)
                = 2: wide listing (multiple files in columns)
                = 3: tree style listing

File Navigation

# Fuzzy recursively search file in current folder & open it
:find *test.py**

# Fuzzy search buffers ever opened & open it
:b *file*

Vim原生補全工具 OmniComplete

用了一天倒騰自動補全插件,實在是崩潰,但凡是有點名氣的都對vim自己的編譯有很麻煩的要求。搜索過程當中才發現Vim實際上是自帶補全功能的,稱爲OmniComplete
輸代碼的過程當中,直接按Ctrl+X而後再按Ctrl+O,就會彈出vim猜想的一系列補全內容。能夠在菜單裏按「上下鍵」選擇,注意是方向上下鍵,不是JK鍵。
通過測試,原生支持不少種語言。工具

image

在Insert編輯模式時,輸入某個詞,而後:測試

  • Ctrl+x再按Ctrl+l,就會顯示出一個提示列表。
  • Ctrl+nCtrl+p上下選擇。

固然,這樣按鍵太麻煩,咱們要作鍵盤映射了:spa

" 按Ctrl+d顯示自動補全
inoremap <C-d> <C-x><C-l>
相關文章
相關標籤/搜索