Introduction to vim installation and basic configuration under Ubuntu

  
Installation and basic usage
1. Log in to Ubuntu as root and enter vim from the command line. If not installed, you will get the following prompt:
Programs“vim” In the following packages:
* vim
* vim-gnome
* vim-tiny
* vim-gtk
* vim-nox
Please try:
Code below :
apt-get install <selected packages>
Enter as prompted
Code is as follows:
apt-get install vim
Install.
2. After the installation is complete, enter vim will enter the standard mode of vim, then press the i of the keyboard to enter the insert mode, write something in it.
3. Press Esc to launch the insert mode and enter the standard mode. There are several basic commands to master in this mode.
:wq Save Launch
i Enter Insert Mode
x Delete the current cursor character
dd Delete the current line and save the current line to the clipboard
p Paste
:help < Br> View the help of the command Move the cursor up and down and left and right
4. Enter: w filename Save the file to the current directory.
5.:q Exit the vim page.
6. Next time you type vim filename, you can edit or view this file.
Common plugins:
1.ctags installation
ctags can build an index of the source tree, so that programmers can quickly locate functions, variables, macro definitions, etc. when viewing, to view the original shape
Download and install process of ctags under ubuntu:
Download and install ctags, terminal input command
Copy code
Copyright © Windows knowledge All Rights Reserved