vi vim 사용중 가장 기억하지 못하는 것들이 set 옵션들이다.
그래서 갈무리 해 둡니다...
원본 : http://www.yolinux.com/TUTORIALS/LinuxTutorialAdvanced_vi.html
Vi/Vim modes: |
Vi/Vim modes are set using the "set" command and its many options.
:set all - display all mode settings of your editing session.
:set termcap - display terminal settings of your editing session.
:set ic - Change default to ignore case for text searches
Default is changed from noignorecase to ignorecase. (ic is a short form otherwise type set ignorecase)
Common options to set:
See full list of set optionsFull "set" Command Short form Description :set autoindent
:set noautoindent:set ai
:set noai{CR} returns to indent of previous line.
Turn on autoindent: :set ai
Turn off autoindent: :set noai
Set indent width: set shiftwidth=4
Intelligent auto-indent: set smartindent
Toggle autoindent on/off when pasting text (press F2 key to toggle mode after one is in "insert" mode): set pastetoggle=<F2>:set autowrite
:set noautowrite:set aw
:set noawThis tells vim to automatically write the file when switching to edit another file. See tags, editing multiple files (next, rewind) :set backspace=indent,eol,start
:set backspace:set bs=indent,eol,start
:set bsAllow backspacing over an indent, line break (end of line) or start of an insert :set backup=on
:set backup=off:set bk=on
:set bk=offCreate backup file of file changes while editing.
To automatically remove the backup file after the file being edited is written, use the option:set writebackup=on/off
File backup mode settings: :set backupcopy=yes/no/auto:set cryptmethod=zip
:set cryptmethod=blowfishSet file encryption for file save of buffer contents. - zip: pkzip
- blowfish: strong encryption
Vim 7.3+:set errorbells
:set noerrorbells:set eb
:set noebSilence error beep :set flash
:set noflash:set fl
:set noflScreen flashes upon error (for deaf people or when noerrorbells is set) :set tabstop=8 :set ts Tab key displays 8 spaces :set ignorecase
:set noignorecase:set ic
:set noicCase sensitive searches :set number
:set nonumber:set nu
:set nonuDisplay line numbers :set showmatch
:set noshowmatchno abbreviations Cursor shows matching ")" and "}" :set showmode
:set noshowmodeno abbreviations Editor mode is displayed on bottom of screen :set showmatch
:set noshowmatchno abbreviations Cursor shows matching ")" and "}" :set syntax on
:set syntax offno abbreviations Set syntax highlighting and color highlighting for a file type (eg XML, HTML, C++, Java, etc). Also cursor shows matching ")" and "}"
Also can set syntax highlighting explicitly: :set syntax=html
Syntax definition files: /usr/share/vim/vim73/syntax/:set taglength :set tl Default=0. Set significant characters :set closepunct='".,;)]} % key shows matching symbol.
Also see showmatch:set linelimit=1048560 Maximum file size to edit :set wrapscan
:set nowrapscan:set ws
:set nowsBreaks line if too long :set wrapmargin=0
:set wrapmargin=8
:set nowrapmargin:set wm
:set nowmDefine right margin for line wrapping.
Wrap when past 8 characters from the edge of column display (often default 80).:set list
:set nolistDisplay all Tabs and Ends of lines (Dislays these hidden characters). :set bg=dark
:set bg=lightVIM: choose color scheme for "dark" or "light" console background.