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

Vim

Vim (http://www.vim.org) is, of course, still a mainstay for text file editing. It has a very long history in the Unix world, and it's a very lightweight command-line text editor. Vim is just about as raw a text editor as you can get. It can be used as a lightning fast and efficient IDE if you have the memory and patience to learn the myriad keyboard commands. My advice is to start out with a few basic commands, and make an effort to pick up a few more each time you use Vim.

You can pimp your Vim and make it better suited for editing Puppet manifests. Let's take a look at that, assuming you've just grabbed a fresh Vim installation, and you have Git installed.

Move to your home directory and clone the given repository with the following commands:

cd ~
git clone https://github.com/ricciocri/vimrc .vim
cd .vim
git pull && git submodule init && git submodule update && git submodule status
cd ~
ln -s .vim/.vimrc

Cloning the repository into your home directory's .vim directory will configure your Vim settings for you. The repository contains several submodules containing the following:

  • Pathogen (https://github.com/tpope/vim-pathogen) is Vim guru Tim Pope's general-purpose add-on that allows you to manage your Vim runtimepath with ease and install Vim plugins and runtime files each in their own private directories, rather than having file collisions.
  • Vim-puppet (https://github.com/rodjek/vim-puppet) is the original Vim plugin written by Tim Sharpe, making Vim much more Puppet-friendly.
  • snipmate.vim (https://github.com/msanders/snipmate.vim) is a Vim script that implements some of TextMate's snippet features for Vim.
  • Syntastic (https://github.com/vim-syntastic/syntastic) is a syntax-checking plugin that runs files through external syntax checkers and displays any resulting errors. This can be done from the command line with the pdk validate command, or automatically as files are saved.
  • Tabular (https://github.com/godlygeek/tabular) is used to line up your fat arrows (=>) according to the Puppet Style Guide, so that it will pass running the pdk validate command. (We will cover the pdk validate command in full later.)
  • vim-fugitive (https://github.com/tpope/vim-fugitive) provides deep Git integration for Vim.

I can't promise this will be a perfect Vim setup for your own personal Vim style, but it will certainly get you on the right path, and you will have Pathogen installed, so you can further tweak your Vim settings until you have it just how you like it.

 You might also want to fork this repository in GitHub, so you can keep all your settings and share them with your team.

主站蜘蛛池模板: 文安县| 南丰县| 滦南县| 甘孜| 砀山县| 临湘市| 米脂县| 黔南| 英吉沙县| 休宁县| 横峰县| 颍上县| 河曲县| 成安县| 湘西| 禄丰县| 千阳县| 阆中市| 孙吴县| 兴隆县| 仪征市| 拜泉县| 洪洞县| 毕节市| 建宁县| 太保市| 鄱阳县| 哈巴河县| 上杭县| 曲靖市| 黔东| 霍邱县| 府谷县| 呼和浩特市| 灯塔市| 鄂温| 齐齐哈尔市| 裕民县| 定陶县| 雅安市| 酉阳|