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

  • Mastering Puppet 5
  • Ryan Russell Yates Jason Southgate
  • 415字
  • 2021-07-16 17:46:06

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.

主站蜘蛛池模板: 宾川县| 铜鼓县| 怀安县| 大洼县| 霍邱县| 鄄城县| 英山县| 扶风县| 宜良县| 禹州市| 饶河县| 贺兰县| 娄底市| 屏山县| 泸州市| 平定县| 德昌县| 河北区| 财经| 九龙坡区| 苍山县| 宝清县| 邳州市| 三穗县| 铁岭市| 沙坪坝区| 吴川市| 通城县| 共和县| 巴青县| 昌邑市| 茶陵县| 洛浦县| 苗栗县| 京山县| 华容县| 若羌县| 资中县| 岚皋县| 海盐县| 贺兰县|