VIM editor Usage Details, vim editor details
The Vim text editor is installed on all Linux operating systems by default. It is a very useful editor.Three Modes
It has three modes: Command mode and last line mode.
Command mode: controls the movement of the cursor to copy, paste, delete, and search the text.
Input mode: normal text input.
Last line mode: Save or ex
Vim shortcut, vim1. vim Environment Settings
Vim behavior record file path ~ /. Viminfo
Set the file path in the vim environment ~ /. Vimrc
In ~ /. Manually write the following content in vimrc (double quotation marks "indicate comments ):
Set nohlsearch "highlightSet backspace = 2 "deleted with backkeySet autoindent "
VI/Vim is one of the most powerful and popular text editors in the liux system. Learn Vim while reading learning the VI and VIM editor, and write simple notes for future queries.Before reading this book, we often used Vim to edit some simple files and some basic simple commands. But while reading the book, I found that
[vim] with sudo permission to save vim open readonly file
The following command is to be stated in this article:
: W! sudo tee% >/dev/null
In the Linux configuration, you will change to read-only files, such as/etc/profile
$ ls-al/etc/profile-rw-r–r–1 root root 1139 Mar 17:30/etc/profile
Use VIM to open the file/etc/profile modified, save will be wrong:
: WE45:
Use Vim, vimMode
ESC \ Ctrl + c: Exit edit mode
ZZ \ wq: Save and exit in command mode
Edit
I: Enter the editing mode.
I: Go to the beginning of the line to start editing
S: deletes the current character and enters the editing mode.
A: edit the current character
A: edit A non-null character from the end of the current row.
Mobile
H j k l: bottom left, top right
0: zero number, to the line Header
^: The first place in the line that is not
Configuration file path:/ETC/VIM/VIMRC
SYN on; syntax highlighting
Set tabstop=4 tab width
Set shiftwidth=4, line indent width
Set backspace=2, setting backspace available
Set Incsearch Search Auto-complement
Set ai! ; Set Automatic indentation
Set nu! ; Show line Numbers
Make VI compatible with Windows Chinese
Set fencs=utf-8,ucs-bom,euc-jp,gb18030,gbk,gb2312,cp936
CTRL + N automatically search for complement functions or variable
I still recommend all new vim friends first go to use vimtutor practice, and then go to see Vim's help document, write very carefully, and can immediately combat, effective quickly, many of the following are the examples of VIM help document, I feel very good, took out.The reason why vim is efficient is because it has a high-efficiency mobile mechanism, as a lear
Enable Vim syntax highlighting settings in SSH Secure Shell Client
The related settings on the SSH Secure Shell client are: Setting --> profile setting --> connection --> terminal, select ANSI or xterm.
====================================When you use Vim to edit a terminal, by default, the editing interface does not display line numbers, syntax High Brightness Display, smart indentation, and other functio
Vim/Vi practical skills (version 2) and vim Practical SkillsVim/Vi Practical Skills
1. Import files
: R [file name] # import to the currently edited File
For example, r/etc/inittab
The upper part of the file is the/etc/services file, and the lower part is the/etc/inittab file.
2. Run the command [do not exit vi]
:! [Command]
:! Ls-l/home/hadoop
Extended-import the command execution result to the current
[Vim] vim learning notes-open, switch, and close multiple filesOne case is to use vim in shell to open multiple files, and the other case is to open multiple files in the vim editor.Open multiple files at the same timeVim file1 file2Open the file and display vim-o file1 file
Vim learning notes series (preface) and vim learning notes
This morning, we saw that the great gods were using vim for programming. The screen was intuitive and the speed was very fast. The operation only needed a command character.
Therefore, it can be inferred that the vim command operators are complex, so the le
Improve Efficiency Emmet. vim and emmet. vimImprove Efficiency Emmet. vim
Reprinted please indicate the source: http://blog.csdn.net/hpu_zyh/article/details/48069159Blog homepage | simplified book | zhihu | Weibo | github
Emmet-The essential toolkit for web-developers EmmetWith powerfulVimIt's no longer beautiful.HeardEmmentAndVimBetter configuration (haha, the more correct this is)
It can also be use
Vim cursor positioning, vimVim cursor Positioning
* Locate the specified row n:Enter "nG ".Or enter "ngg ".Or enter ": n"Here, n is the row number of the specified row. Note that sometimes G = gg.* Jump to the top of the screen:Enter "H ".This is the first non-empty character. Adding a number N indicates the number of rows (such as the N row of the 'nh 'positive number) from the top of the window)* Jump to the bottom of the screen:Enter "L ".This is t
Vim's DIY preference configuration under Mac"First execute:"CP/USR/SHARE/VIM/VIMRC ~/.VIMRC"Copy the default configuration file, and then execute:"Vim ~/.VIMRC"Edit the file at the end of the file to add"Syntax on"Save to exit"========================== below is the configuration content =================="Configuration file for VimSet Modelines=0 "cve-2007-2438"Normally we use
first of all, it is worth mentioning that my Vim tutorial PDF version has been finished, you can download, here is csdn: csdn download , if the left side of the hanging off, you can also enter below the browser to download the following address: http://download.csdn.net/detail/xinguimeng/7714213, of course, if you are a loyal user of Baidu network disk, Can also rely on Baidu network disk, I also synchronized to Baidu Network disk, as follows: Baidu n
1. You cannot see the tab key in the tab key file. To display it: set list now displays the tab key as ^ I, while $ is at the end of each line, so that you can find the spaces that may be ignored. One disadvantage of this is that it looks ugly when there are many tabs. If you use a color terminal or GUI mode, VIM can highlight spaces and tabs. Use the 'listchars' option: Set listchars = tab:>-, trail:-now, the tab is displayed as ">-", and the extra b
[Craftsman Avenue] Some Vim commands that are not common but very powerful (constantly updating), vim constantly updating
Common vim commands such as moving and editing are not described in detail. Here, we will mainly record some uncommon but very powerful commands, so that you can instantly feel the spirit of the commands.
1.: Tlist
1) this command is used
Download Vim and vim
From song4
Vim helps you complete text editing in a almost natural language.
You just need to get familiar with a few simple syntaxes, and then you will sit on the rotating seat and turn around, and feel the wonderful life is back.
Okay, let's get started.
Vim helps you complete text editing in a a
Xin Xing is playing with you to learn about the operation text in vim section 4. Xin Xing vim
It is worth mentioning that the pdf version of my vim tutorial has been completed. You can download it. Here is the download of csdn: csdn. If the download fails on the left, you can also enter the following address in the browser to download: http://download.csdn.net/de
Download vim and vimVim
Vim-related knowledge is accumulated and is continuously updated.Common Key Mode
n1,n2s/word1/word2/gSearch for word1 between line n1 and line n2 and replace it with word2.
1,$s/word1/word2/gSearch for word1 from the first row to the last row and replace it with word2.
N[Enter]Move n rows down
0: Move to the last character of the row
$: Move to the first character of the row
G
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.