Introduction to vim
Vim is developed from a text editor, vi, is an upgraded version of vi, vi It is not only compatible with all instructions, but there are some new features in it.
Simply put, vi is an old-fashioned word processor, but functionality has been very complete, but still have a place to progress. vim can be said to be a procedural tool developers good use. It built a large number of commands, shortcut keys, provide users with convenient. you can
In use it to simple text editor, it can also be used to write the code, or use it as a versatile IDE. Even vim's official website ( http://www.vim.org ) has also said that vim is a program development tool rather than word processing software.
Here comes highly recommended vim tutorial: vimtutor, do not start vim, need only to (the command has a traditional Chinese character version) command line to run the command change
installation
We first need to define the role of two file directory
/ Usr / bin: Storage System Applications
/ Usr / local / bin: to store the user's own installation program
macos itself comes with vim
Execute commands which vim
We have found that the system is of vim, this system comes, can be seen from the path, in the case of vim / usr / bin
How to install your own vim it?
1, install homebrew
2, installation macvim
brew install macvim
3, install the necessary tools ctags and cscope
brew install ctags
brew install cscope
4, the installation is successful, close the command line, re-open a new
5, use the command which vim
At this point of vim found in / usr / local / bin, so the system is enabled by our own installation of vim, after ignoring the following steps, otherwise continue!
6, if it is not, but the system installed / usr / bin, then go / ect / paths in order to modify environment variables.
Can be modified to a variable as shown, the environment variable loading priority order is written, vim there, which then preferably used in which EDITORIAL / usr / bin and / usr / local / bin
Re-open the command line test which vim, the path appears as / usr / local / bin
Configuration
After the installation there will be a vim vimrc file , by default ~ (that is, under their own account directory), as vim startup command file, when executed, we hope VIM a start to the implementation of some of the settings written in this document which, equivalent to the configuration file. hit
Open .vimrc, no new space, which we can write the content to search, is too much that can be set up