![]() ![]() It has two versions: the global version and the personal version. Vimrc is the main configuration file of Vim. The location of these configuration files is determined by the installation location of Vim and the operating system. Speaking of configuring Vim, we must first know three configuration files: vimrc, gvimrc and exrc. The latter approach is generally recommended. Here to explain, ~/is the user's home directory, equivalent to/Users/username/. Is also possible Copy the global version of vimrc file to the user's home directory as the user version of vimrc: MACVIM GVIMR PASSWORDSudo sh (you will be prompted to enter the password of the current user) If there is no vimrc file (normally there will be), users can create it in the following ways:įirst create the user version vimrc (the default is not available under Mac), you can create an empty user version vimrc file in the user's home directory: Open if you have it, create if you don't, use : wq! to force save and exit after opening and editing The content of the user configuration file will overwrite the content of the system configuration file, so just edit the user configuration file. :echo $HOME should be under the (/Users/apple is the root directory of the user terminal) under normal circumstances :echo $VIM should be under the (/usr/share/vim) directory under normal circumstances If you don't know which directory $VIM or $HOME is, you can use the following command in vi to view: ![]() User vimrc file: "$HOME/.vimrc" "Note: vimrc user configuration file location" System vimrc file: "$VIM/vimrc" "Note: vimrc system configuration file location" MACVIM GVIMR CODEIf you do not want MacVim attached to the application (Applications) directory, and want the terminal to call mvim, you can edit the /etc/bashrc file ( $ sudo vim/etc/bashrc ), add the following code to the file, : WQ! Forced Save and exit)Īlias mvim='/Volumes/App/App/MacVim.app/Contents/MacOS/MacVim'Įnter in the terminal: $ vi Enter in the vi editor: :version can view the location of vimrc in the system The mvim copied to /usr/bin/ This directory ( $ sudo cp -f mvim/usr/bin/ ) (terminal can pass mvim file name to start MacVim edit files) Put MacVim.app in your application, which is the /Applications directory (must be put in the application directory, otherwise terminal call: mvim will not find the MacVim executable file) There are three files in the decompressed package obtained after downloading (MacVim, mvim, reader.txt) This version can support normal use under 10.10 system, the previous ones may not be opened under 10.10 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |