- Mastering Vim
- Ruslan Osipov
- 258字
- 2021-06-10 18:51:27
Installing plugins
This chapter will start by introducing Vim plugins. Plugin management is a rather broad subject (and it's covered in Chapter 3, Follow the Leader - Plugin Management, as well), but we're starting out with just a few plugins, so we won't have to worry ourselves with that topic yet.
First, let's go through the one-time set up:
- You'll need to create a directory to store plugins. Execute the following on the command line:
$ mkdir -p ~/.vim/pack/plugins/start
If you're using GVim under Windows, you'll have to create the vimfiles directory under your user folder (usually C:\Users\<username>), and then create pack\plugins\start folders inside of it.
- You'll want to tell Vim to load documentation for each plugin, as it doesn't do so automatically. For that, add the following lines to your ~/.vimrc file:
packloadall " Load all plugins.
silent! helptags ALL " Load help files for all plugins.
Now, every time you want to add a plugin, you'll have to:
- Find your plugin on GitHub. For example, let's install https://github.com/scrooloose/nerdtree. If you have Git installed, find the Git repository URL (in this case, it's https://github.com/scrooloose/nerdtree.git) and run the following:
$ git clone https://github.com/scrooloose/nerdtree.git ~/.vim/pack/plugins/start/nerdtree
If you don't have Git installed, or if you're installing a plugin for GVim under Windows, navigate to the plugin's GitHub page, and find a Clone or download button. Download the ZIP archive and unpack it into .vim/pack/plugins/start/nerdtree in Linux or vimfiles/pack/plugins/start/nerdtree in Windows.
- Restart Vim, and the plugin should be available to use.
推薦閱讀
- 新一代通用視頻編碼H.266/VVC:原理、標(biāo)準(zhǔn)與實(shí)現(xiàn)
- Java性能權(quán)威指南(第2版)
- Learning Data Mining with R
- Learning Python Design Patterns
- 劍指Java:核心原理與應(yīng)用實(shí)踐
- Learning Laravel's Eloquent
- Access 2010中文版項(xiàng)目教程
- Python開發(fā)基礎(chǔ)
- ROS機(jī)器人編程實(shí)戰(zhàn)
- Mastering XenApp?
- Java程序設(shè)計(jì)
- C語言從入門到精通(視頻實(shí)戰(zhàn)版)
- HTML5+CSS3+jQuery Mobile+Bootstrap開發(fā)APP從入門到精通(視頻教學(xué)版)
- Docker on Windows
- Java Web程序開發(fā)參考手冊