Basic operations in vim mode and basic operations in vim ModeAuthor: fengxueting Source: http://www.cnblogs.com/fengxueting-px/
Preface
Although Emacs can complete most editing operations, vim is sometimes used for convenience. Therefore, a simple vim operation is recorded. You only need to get started.
This document b
,=1s,:1s "sets the specific indentation for C + + language
Set backspace=2 setting backspace key available
Set Showmatch "sets match mode, showing matching parentheses
Set linebreak "Whole word wrapping."
Set whichwrap=b,s,"Set hidden" Hide buffers when they are abandoned
Set mouse=a "Enable mouse usage (all modes)" using the mouse
Set Number "Enable Line No."
"Set Previewwindow" identifies the preview window
Set history=50 "set command history to 50"
Vim environment variable configuration, background color configuration, and vim environment variable background color
When we use vi or vim, if we want to display the row number, we may do this: switch to the command mode, enter set nu, and then press the Enter key to display it; in addition, when programming, sometimes we want to press the Enter key, the cursor
Vimdiff --- VIM comparison and merge tool, vimdiff --- vim merge
This article comes from the IBMDW http://www.ibm.com/developerworks/cn/linux/l-vimdiff/
Comparing and merging source program files (usually plain text files) has always been an important part of software development. Many powerful dedicated comparison and merge tools on the market, such as BeyondCompare. Many IDE or software configuration mana
1. Vim Common copy and Paste commandVim's copy-paste command is undoubtedly y (Yank), p (paster), plus yy,pPs:Vim has a very interesting convention (I think it is a convention), that is, the case of a command is to achieve a certain function, but the direction is different, such as:W Jump to the next word,w: Jump to the last WORDF a line forward to find and jump F: Reverse ....Then some double-written letters have line operations:YY Copy line dd
One, vim repeat command 1. Repeat the last commandIn normal mode . (decimal point) means the last command operation is repeatedCopy test files to a local directory$ cp /etc/protocols .Open a file for editing$ vim protocolsNormal mode input x , delete the first character, the input . (decimal point) will be deleted again a character, in addition to also can be repeated dd delete operation2. Execute commands
Basic VIM operations in CentOS
There are many text editors, including gedit and kwrite in graphic mode, vi, vim (enhanced version of vi), and nano in text mode. Vi and vim are the most commonly used editors in Linux. Someone once said that there are three kinds of people in the world: Vi, Emacs, and Third.
(1) initial personalized configuration of your
programming projects, large projects or the best use of the IDE, if you want to remotely connect a server that does not have a graphical interface to write large projects, it is best to build a code warehouse on the server; Reason: Vim does not have good project management function, VIM's auto-completion is only based on text match, There is no semantic analysis function for program language. 2. The conten
Download list of various resources developed by J2EE, the most comprehensive IT resources in history, personal favorites summary! Vim replacement and batch Modification 1 simple replacement expression: % sfour4g "%" range prefix indicates replacement in all rows. The last "g" Mark replaces all matching points in the row. If you only operate on the current row, you only need to remove %.
Download list of various resources developed by J2EE, the most co
Vim shortcut keys and vim common shortcut keys
# Vim filename
: Scriptname// View scripts loaded by vim
: Set nu// Set the row number
: Set tabstop = 4// Set a tab to 4 spaces
: Set ai// Set Automatic indent
Space key// Move one cell to the right
X// Delete the subsequent characters (in command mode)
X// Delete the fir
Vim Advanced Skills-use vim to compare two files: 1: Use vim-d file1 file2 to directly open two files or: Use vim file1 to open the first file, use vert diffsplit file2 to open the second file for comparison. (vert indicates the Vertical Split Window, which is the horizontal split window by default.) 2: directly compar
The following prompt appears during installation:There are no packages available for Vim now, but it is referenced by other packages.This may mean that the missing package may have been discarded,Or can only be found in other publishing sourcesE: Package vim is not available for installation candidateWorkaround:First step: sudo apt-get updateStep two: sudo apt-get install vimubuntu12.04 when installing
V1. the default character encoding is utf8. To open a file encoded with gb2312, all Chinese characters are garbled. How can I restore the normal display?Enter edit ++ ENC = cp936
V2. how to execute commands in the vim system?Enter! CMD
V3. use Vim to open and edit the. * GZ File Without decompression, reading, editing, and compression.The support for compressed files is through pluginVim ls-lrR.tx
Linux learning notes (10) Text Editor vim, learning notes vim
Vim is a powerful full-screen text editor, the most common text editor for Linux/Unix. It is used to create, edit, and display text files. Vim features no menus and only commands.
Vim mainly has three working mode
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:
, list of options that match)Set Wildmode=list:longestSet history=1000"Better backup, swap and undos storageSet directory=~/.vim/dirs/tmp "directory to place swap files inSet backup "Make Backup Files"Set Backupdir=~/.vim/dirs/backups "Where to put backup filesSet Undofile "Persistent Undos-undo after you re-open the fileSet Undodir=~/.
complete text editing tasks.
Haina baichuan has a high capacity. Emacs and Vim cannot match the scalability of other editors and constantly absorb the wisdom of users, which is one of the reasons they can become "artifacts.
2. Maverick charm
2.1 scalability brings you into the soul
Once you realize the power of Vim or Emacs, you will embark on a long journey to
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.