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

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.

主站蜘蛛池模板: 离岛区| 鹤壁市| 墨竹工卡县| 高平市| 临沧市| 黄浦区| 康乐县| 抚远县| 闽侯县| 三穗县| 沙河市| 忻州市| 乡城县| 永登县| 静安区| 新郑市| 安多县| 永平县| 宜良县| 新宁县| 湘乡市| 沅陵县| 恩施市| 汝南县| 泰兴市| 定州市| 三门县| 辽阳县| 华坪县| 庆云县| 剑河县| 滕州市| 高雄县| 双牌县| 伊宁市| 本溪| 织金县| 宣威市| 友谊县| 若尔盖县| 诸暨市|