官术网_书友最值得收藏!

Plugin spotlight – Vinegar

Tim Pope's vinegar.vim is a simple plugin that addresses the difficulty of using project drawers with Vim split window functionality. Plugins such as NERDTree become rather disorienting to work with when you have more than one window open in a split.

In the following example, three windows are open (and a fourth NERDTree window on the left): 

 When pressing Enter with the cursor in the NERDTree window, which window will the new file be opened in?

Hint: it's the bottom left one—but you don't have a way of knowing that. NERDTree opens files in the last created window.

Tim Pope solves this problem with a small plugin called Vinegar, which makes using Netrw a more seamless experience. It's available over at https://github.com/tpope/vim-vinegar (see Installing plugins for installation instructions). 

If you have NERDTree installed when using Vinegar, you'll get a NERDTree window instead of Netrw. To avoid NERDTree replacing Netrw (and to make commands like - work), set   let NERDTreeHijackNetrw = 0 in your .vimrc  file.

Vinegar adds a handy new mapping: - (dash) to open Netrw in a current directory. Try it out:

The plugin hides Netrw's help bar, which might be confusing at first. Hit I (uppercase i) to bring it back. Another shortcut, Shift ~ key, takes you to your home directory, which is often where you'll store your projects.

主站蜘蛛池模板: 花莲市| 太白县| 台北县| 南通市| 滁州市| 南安市| 上虞市| 迭部县| 营山县| 东海县| 垫江县| 东明县| 江源县| 东乡| 老河口市| 寿阳县| 扎囊县| 宁夏| 靖州| 龙陵县| 大庆市| 清镇市| 磐石市| 南城县| 榆中县| 革吉县| 任丘市| 台州市| 毕节市| 江油市| 新平| 门源| 淳化县| 福贡县| 黄陵县| 琼海市| 东兴市| 临澧县| 彭州市| 庆元县| 海口市|