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内置文件浏览框NetRW
g:netrw_browse_split是重要的选项,直接影响体验:
*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键。
经过测试,原生支持很多种语言。
在Insert编辑模式时,输入某个词,然后:
- 按
Ctrl+X
再按Ctrl+l
,就会显示出一个提示列表。 - 按
Ctrl+n
或Ctrl+p
上下选择。
当然,这样按键太麻烦,我们要做键盘映射了:
" 按Ctrl+d显示自动补全 inoremap <C-d> <C-x><C-l>
相关推荐
lerdor 2020-10-14
linzb 2020-09-22
HeronLinuxampARM 2020-09-14
CoderMannul 2020-09-07
lerdor 2020-08-31
ZZBAIFFA 2020-08-31
yonggeno 2020-08-18
yhuihon 2020-08-17
涅磐 2020-08-11
yhuihon 2020-08-09
zhangxl0 2020-07-28
yhuihon 2020-07-26
想个标题偏头痛 2020-07-19
老甘的可读区 2020-07-18
linzb 2020-07-18
xlb 2020-07-12
老甘的可读区 2020-07-09
極愛 2020-07-06