Custom configuration such as the Linux Vim editor color scheme __linux

Source: Internet
Author: User
Tags parent directory git clone


No more nonsense. Directly above:






Operation Process:



1. Use command: Cd/etc/vim Enter configuration directory



2.sudo Vim VIMRC



3. The following lines are set according to your preference






---------------------------------------------------------------------------------



Append: Add alias coupondir= ' cd/usr/share/nginx/html ' to the ~/.BASHRC file



--------------------------------------------------------------------------------------------------------------- ----------------------------------------






View the current color theme in the Vim instance



Open a VIM window and enter the command: Color or: ColorScheme to view the current color theme.



get the VIM sample current color theme



You can see that the current color theme is default.



set a color theme in the Vim instance



Enter the command "ColorScheme topic name" To set the color theme for the current vim instance.



view Vim's running directory



Vim's color theme files are placed under the vim running directory in the color directory, so we first need to know the running directory of Vim.






Enter the command in VIM: Echo $VIMRUNTIME to view vim's running directory.



get Vim's running directory



As you can see from the diagram, Vim's run path is/usr/share/vim/vim73



go to Vim's running directory and view files with ". Vim" in the Color directory



These files are color theme files, and the filename is the subject name.



Modify the Vim profile to change the default color theme



Open the/ETC/VIM/VIMRC file, add a line to the ColorScheme color theme name, and then save the changes.



--------------------------------------------------------------------------------------------------------------- --------------



Download and configure






The official address of the Nerdtree plugin is as follows, you can get the latest version https://github.com/scrooloose/nerdtree download ZIP installation package or use the following website source file installation method



My experimental environment is centos6.6, and other versions may be somewhat different. Installation method is very simple, first download the compressed file, after decompression will be the plugin directory under the Nerd_tree.vim copy ~/.vim/plugin and Doc directory nerd_tree.txt copy to ~/.vim/doc. ~ Represents the directory of the current user, There is no ~/.vim ~/.vim/plugin ~/.vim/doc in my environment and will be created later, if your version has it, that's better.


wget Http://www.vim.org/scripts/download_script.php?src_id=17123-O nerdtree.zip 
unzip nerdtree.zip

mkdir- P ~/.vim/{plugin,doc}

CP plugin/nerd_tree.vim ~/.vim/plugin/
CP doc/nerd_tree.txt ~/.vim/doc/


After installation, the command line input vim, open vim, in vim input: Nerdtree, you can see the effect of nerdtree.



For convenience, we set the shortcut key, add the following content in the ~/.VIMRC file, my centos6.6 still do not have this ~/.VIMRC, it does not matter, create a, direct vim ~/.VIMRC or/ETC/VIM/VIMRC then add "Nmap & Lt F2>: Nerdtree <CR> This opens vim, as long as the F10 on the keyboard can display and hide Nerdtree file browsing.



Will only F10, that also is too no technical content, the following is a wave shortcut key, study it. Shortcuts



Switch workbench and Table of contents


ctrl + w + h cursor focus tree directory on the left
ctrl + w + l cursor focus file display window on the right
ctrl + w + w Cursor switch between left and right windows automatically
ctrl + w + r move the layout position of the current window
o Open a file, directory or bookmark in an existing window and jump to that window
go Open a file, directory, or bookmark in an existing window without jumping to it
t Open selected file / bookmark in new tab and jump to new tab
T Open selected file / bookmark in new tab without jumping to new tab
i split opens a new window with the selected file and jumps to that window
gi split opens a new window without opening the selected file
s vsplit opens a new window with the selected file and jumps to that window
gs vsplit Open a new file in a new window without jumping to it
! Execute the current file
O Recursively open all directories under the selected node
x collapse the parent directory of the selected node
X recursively collapse all directories under the selected node
e Edit the current dif
Double-click equivalent to NERDTree-o
Middle key is equivalent to NERDTree-i for files and NERDTree-e for directories
D Delete the current bookmark
P jumps to the root node
p jump to parent node
K jump to the first node of the same level in the current directory
J jump to the last node of the same level in the current directory
k jump to the previous node of the same level in the current directory
j jump to the next node of the same level in the current directory
C Set the selected directory or the parent directory of the selected file as the root node
u Set the parent directory of the current root node as the root directory, and turn it into the original root node.
U Set the parent directory of the current root node as the root directory, but keep expanding the original root node
r recursively refresh the selected directory
R recursively refresh the root node
m Display the file system menu
cd Make CWD the selected directory
I Toggle whether to show hidden files
f whether to use file filters
F Switch whether to display files
B Toggle whether to show bookmarks
q Close the NerdTree window
? Toggle whether Quick Help is displayed 


Toggle tab Page


: tabnew [++opt options] [+cmd] File      Creates a new tab to the specified file:
tabc   Closes the current tab:
Tabo   closes all other tabs
: Tabs   View all open tab
: TABP   previous tab
: Tabn   after a tab





Standard mode: GT before a tab GT a tab Macvim can also use shortcut keys to complete the tab closure, switch cmd+w Close the current tab cmd+{the previous tab cmd+} after a tab nerdtree in. vimrc The Common configuration


"When Vim starts, the default opens Nerdtree (Autocmd can be abbreviated as AU) autocmd vimenter * nerdtree" press F2 to pull up/hide Nerdtree map:silent! Nerdtreetoggle The Nerdtree window is set to the right of the Vim window (default is left) let nerdtreewinpos= "right" automatically displays the Bookmarks let Nerdt when the Nerdtree window is opened Reeshowbookmarks=1









--------------------------------------------------------------------------------------------------------------New -------------------






The installation method of Vundle is very simple, specific as follows


git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle


Next, add the following in the ~/.VIMRC file:


FileType off
set rtp+=~/.vim/bundle/vundle/call
VUNDLE#RC ()
bundle ' gmarik/vundle ' bundle '
other GitHub position ... '
filetype plugin indent on


Vundle itself is also a plug-in, above the implementation of its own management. The Vundle project is hosted on GitHub, and the specific address is:



Https://github.com/gmarik/vundle



In the configuration file VIMRC, bundle plug-in, https://github.com/this part can not write, need other vim plug-ins directly write the back part of the good.



Next open vim, input: Bundleinstall can complete the installation of Plug-ins.



Follow-up add new Vim plug-in, to VIMRC file in bundle, and then open vim, input: Bundleinstall is good.



Reprint Please specify: Knowledge ant»vim Plug-in management artifact--vundle installation and basic configuration


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.