欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
Best of VIM Tips (zz)
發(fā)信人: fendy (愛(ài)看浪花飛), 信區: VIM
標  題: Best of VIM Tips (zz)
發(fā)信站: BBS 水木清華站 (Sat May 22 16:42:56 2004), 站內
created:   August 10, 2002 6:05      complexity:   intermediate
author:   zzapper      as of Vim:   5.7
Here‘s a necessarily cryptic list of "MY" Best Vim Tips that I‘ve gleaned
from http://vim.sf.net/  ;& comp.editors  
http://groups.google.com/groups?safe=off&group=comp.editors
updated version at http://www.rayninfo.co.uk/vimtips.html
------------------------------------------------------------------------------
# Absolutely essential
------------------------------------------------------------------------------
vim.sf.net         : Visit frequently
comp.editors    : "VIM" dominated newsgroup
* # g* g#          : find word under cursor (forwards/backwards)
%                   : match brackets {}[]()
matchit.vim      : % now matches tags <tr><td><script> etc
<C-N> <C-P>   : word completion in insert mode
<C-X><C-L>    : Line complete SUPER USEFUL
/<C-R><C-W>   : Pull <cword> onto search/command line
:set ignorecase # you nearly always want this
:syntax on    : colour syntax in Perl,HTML,PHP etc
:h slash<C-D> : type control-D and get a list all help topics containing
                   slash (plus use TAB for Help completion)
------------------------------------------------------------------------------
# MAKE IT EASY TO UPDATE/RELOAD_vimrc
:nmap ,s :source $VIM/_vimrc
:nmap ,v :e $VIM/_vimrc
------------------------------------------------------------------------------
#VISUAL MODE Mappings
:vmap sb "zdi<b><C-R>z</b><ESC> : wrap <b></b> around VISUALLY selected Text
:vmap st "zdi<?= <C-R>z ?><ESC>  : wrap <?=   ?> around VISUALLY selected Text
------------------------------------------------------------------------------
# Exploring
:Ex                             : file explorer note capital Ex
\be                             : builtin buffer explorer
:ls                             : list of buffers(eg following)
:cd ..                          : move to parent directory
------------------------------------------------------------------------------
# Great
guu                             : lowercase line
gUU                             : uppercase line
gf                              : open file name under cursor (SUPER)
ga                              : display hex,ascii value of character under cursor
ggVGg?                          : rot13 whole file
CTRL-A,CTRL-X                   : increment,decerement number under cursor
                                  win32 users must remap CNTRL-A
CTRL-R=5*5                      : insert 25 into text
------------------------------------------------------------------------------
# Makes all other tips superfluous
:h 42                          
:h holy-grail                  
:help!                        
------------------------------------------------------------------------------
# Markers & moving about
‘.               : jump to last modification line (SUPER)
`.               : jump to exact spot in last modification line
<C-O>            : retrace your movements in file (old)
<C-I>            : retrace your movements in file (new)
:ju(mps)
:help jump-motions
:history          : list of all your commands
------------------------------------------------------------------------------
# Abbreviations & maps
:map   <f7>   :‘a(chǎn),‘bw! c:/aaa/x
:map   <f8>   :r c:/aaa/x
:map   <f9>   :w<CR>:!c:/php/php.exe %<CR>
:map   <f11>  :.w! c:/aaa/xr<CR>
:map   <f12>  :r c:/aaa/xr<CR>
:ab php           : list of abbreviations beginning php
:map ,            : list of maps beginning ,
# For use in Maps
<CR>             : carriage Return for maps
<ESC>            : Escape
<LEADER>         : normally \
<BAR>            : | pipe
------------------------------------------------------------------------------
# List your Registers
:reg             : display contents of all registers
"1p....          : retrieve numeric buffers
------------------------------------------------------------------------------
# Useful trick
"ayy@a            : execute "Vim command" in a text file
yy@"              : same thing using unnamed register
------------------------------------------------------------------------------
# Get output from other commands
:r!ls.exe        : reads in output of ls
!!date           : same thing
:%!sort -u       : use an external program to filter content
------------------------------------------------------------------------------
# Multiple Files Management
:wn              : write file and move to next (SUPER)
:bd              : remove file from buffer list (SUPER)
:sav php.html    : Save current file as php.html and "move" to php.html
:sp fred.txt     : open fred.txt into a split
:e!              : return to unmodified file
:w c:/aaa/%      : save file elsewhere
:e #                 : edit alternative file
:e %
:rew                : rewwind to first file in ARGS
:bn                 : next file
:bp                 : next file
:brew
------------------------------------------------------------------------------
# Recording (BEST TIP of ALL)
qq  # record to q
your commands
q
@q to execute
@@ to Repeat
# editing a register/recording
"ap
<you can now see register contents, edit as required>
"add
@a
------------------------------------------------------------------------------
# _vimrc essentials
:set incsearch : jumps to search word as you type (annoying but excellent)
:set wildignore=*.o,*.obj,*.bak,*.exe
:set shiftwidth=3
------------------------------------------------------------------------------
# launching Win IE
:nmap ,f :update<CR>:silent !start c:\progra~1\intern~1\iexplore.exe file://%:p<CR>
:nmap ,i :update<CR>: !start c:\progra~1\intern~1\iexplore.exe <cWORD><CR>
------------------------------------------------------------------------------
# FTPing from VIM
cmap ,r  :Nread ftp://209.51.134.122/public_html/index.html
cmap ,w  :Nwrite ftp://209.51.134.122/public_html/index.html
gvim ftp://209.51.134.122/public_html/index.html
------------------------------------------------------------------------------
# appending to registers (use CAPITAL)
# yank 5 lines into "a" then add a further 5
"a5yy
10j
"A5yy
------------------------------------------------------------------------------
[I     : show lines matching word under cursor <cword>
------------------------------------------------------------------------------
#Conventional Shifting
:‘a(chǎn),‘b>>
# visual shifting (builtin-repeat)
:vnoremap < <gv
:vnoremap > >gv
------------------------------------------------------------------------------
# searching
/^joe.*fred.*bill/ : normal
/^[A-J]\+/         : search for lines beginning A-J followed by at leat 1 A-J
/forum\(\_.\)*pent   search over possible multiple lines
/fred\_s*joe/i    : any whitespace including newline
/fred\|joe        : Search for FRED OR JOE
------------------------------------------------------------------------------
#substitution
:%s/fred/joe/igc            : general substitute command
:%s/\r//g                   : Delete DOS returns ^M
:‘a(chǎn),‘bg/fred/s/dick/joe/gc  : VERY USEFUL
:s/\(.*\):\(.*\)/\2 :  \1/  : reverse fields separated by :
:%s/^.\{-}pdf/new.pdf/  non greedy matching (ie to first pdf)
:s/fred/<c-r>a/g substitute "fred" with contents of register "a"
:%s/^\(.*\)\n\1/\1$/  delete duplicate lines
# non-greedy matching \{-}
:%s/^.\{-}pdf/new.pdf/
:help /\{-}
:s/fred/<c-r>a/g substitute "fred" with contents of register "a"
# multiple commands
:%s/\f\+\.gif\>/\r&\r/g | v/\.gif$/d | %s/gif/jpg/
:%s/suck\|buck/loopy/gc  : ORing
:s/__date__/\=strftime("%c")/ : insert datestring
------------------------------------------------------------------------------
# global command
:g/^\s*$/d       :delete all blank lines
:g!/^dd/d        : delete lines not containing string
:v/^dd/d         : delete lines not containing string
:g/fred/,/joe/d  : not line based
:v/./.,/./-1join : compress empty lines
:‘a(chǎn),‘b g/^Error/ . w >> errors.txt
:g/cmap\|form/p  : ORing
------------------------------------------------------------------------------
# Paste register *
:redir @*   : redirect commands to paste
:redir END
"*yy        : yank to paste
"*p         : insert paste buffer
------------------------------------------------------------------------------
# Formatting text
gq<CR>
gqap  (a is motion p paragraph (visual mode))
------------------------------------------------------------------------------
# Operate command over multiple files
:argdo %s/foo/bar/
:bufdo %s/foo/bar/
:windo %s/foo/bar/
------------------------------------------------------------------------------
# Command line tricks
gvim -h
ls | gvim -   : edit a PIPE!!
# vg.ksh (shell script)
# vi all files in directory containing keyword $1 and jump to $1
gvim.exe -c "/$1"  $(grep -isl "$1" *) &
------------------------------------------------------------------------------

  rate this tip  Life Changing Helpful Unfulfilling   
<<fold braces and javadoc | Open a web-browser with the URL in the current line >>
 
Additional Notes
 y_ellzs@tsmc.com.tw, August 11, 2002 7:36 
test
david@tvis.co.uk, August 14, 2002 13:35 
Just a reminder that this is just my selection,but  there‘s plenty of other good tips
in the vim tip collection
# Vim traps
In regular expressions you must backslash + (match 1 or more)
/fred\+/      : matches fred/freddy but not free
----------------------------------------
# \v or very magic (usually) reduces backslashing
/codes\(\n\|\s\)*where  : normal regexp
/\vcodes(\n|\s)*where   : very magic
----------------------------------------
# pulling objects onto command/search line (SUPER)
CTRL-R CTRL-W Pull word under the cursor into a command line or search
CTRL-R -                : pull small register
CTRL-R [0-9a-z]         : pull named registers
CTRL-R %                : pull file name (also #)
----------------------------------------
# manipulating registers
map   <f11> "qyy:let @q=@q."zzz"
----------------------------------------
# help
:h visual<C-D><tab>     : obtain  list of all visual help topics
                        : Then use tab to step thru them
----------------------------------------
# where was an option set
:verbose set history    : reveals value of history and where set
----------------------------------------
# running file thru an external program (eg php)
map   <f9>   :w<CR>:!c:/php/php.exe %<CR>
----------------------------------------
david@tvis.co.uk, September 13, 2002 1:45 
# Inserting Carriage Returns
:%s/nubian/<C-V><C-M>&/g          :  that‘s what you type
:%s/nubian/<C-Q><C-M>&/g          :  for Win32
:%s/nubian/^M&/g                  :  what you‘ll see where ^M is ONE character
----------------------------------------
# Retrieving last command line command for copy & pasting into text
<c-r>:
# Retrieving last Search Command for copy & pasting into text
<c-r>/
----------------------------------------
# doing things over multiple lines \_ means including newline
/<!--\_p\{-}-->                   : search for multiple line comments
/fred\_s*joe/i                    : any whitespace including newline
/bugs\(\_.\)*bunny                : bugs followed by bunny anywhere in file
:h \_                             : help
----------------------------------------
# more completions
<C-X><C-F>                           :insert name of a file in current directory
----------------------------------------
# help for help
:h visual<C-D><tab>     : obtain  list of all visual help topics
                        : Then use tab to step thru them
:h ctrl<C-D>            : list help of all control keys
:h :r                   : help for :ex command
:h CTRL-R               : normal mode
:h \r                   : what‘s \r in a regexp
:h i_CTRL-R             : help for say <C-R> in insert mode
:h c_CTRL-R             : help for say <C-R> in command mode
:h v_CTRL-V             : visual mode
----------------------------------------
kdr_tech@yahoo.com, November 3, 2002 10:23 
This is an extension to
# pulling objects onto command/search line
If you use
/CTRL-R CTRL-A
it brings the whole word under the cursor including any special characters.
For Ex:
If you are in a HTML page and the cursor is under a keyword <table>
/CTRL-R CTRL-A brings /<table>
/CTRL-R CTRL-W brings /table (depending on what the letter under your cursor is ... table or < or >
-Kdr
 
zzapper@ntlworld.com, December 23, 2002 11:42 
The Buffer Explorer scripts mentioned above (\be \bs) rely on the 2nd most popular VIM script bufexplorer.vim
available at http://www.vim.org/script.php?script_id=42  updated 05-Nov-2002
This is a must have script.
Have recently started to appreciate taglist.vim (the most popular VIM script) it really comes into it‘s own with very long programs containting lots of subroutines/functions as it shows which function/sub you‘re in etc etc
zzapper
wisniewski@frontiernet.net, June 13, 2003 17:28 
#ftping with vim  - great functionality
for ascii file transfers add the following line to your profile
     let g:netrw_ftpmode="ascii"
 
junk4todd@dogbus.org, July 16, 2003 12:06 
If you want to delete multiple duplicate lines in a sorted file:
:%s/^\(.*\)\n\(\1\n\)*/\1<NL>/
where <NL> is the character sequence that represents a return in your file type.  For Windows, the easiest way to get this is to highlight a return character in another program (open a new notepad, hit return once, select all, and copy) and then use Edit -> Paste in VIM to insert it.
shankarpj@yahoo.com, January 11, 2004 21:28 
If you want to number the lines in the file try:
:%! nl -ba
sx7gs7r02@sneakemail.com, February 8, 2004 19:02 
Hi,
I think rot13 of the whole file can be improved by this:
ggg?G
It‘s so much better to read. Saves one byte over ggVGg?
Also, it does not require the overhead of selecting the whole file,
especially if the file is huge.
Arvind
Anonymous, March 4, 2004 12:42 
In the message above by junk4todd about getting the <NL> character, you can get the <NL> character by typing:
<Ctrl-V><CR>
The Ctrl-V character is the "escape"-like character and prints the literal of what the next sequence is (it works in vi, and seems to work in vim, too)
smp@cypress.com, March 19, 2004 16:06 
I‘m confused. I‘m a long time vi/vim user. I‘ve often used ctrl-v to enter escaped characters, but I haven‘t done it in a while. I just tried, and ctrl-v puts me in visual mode block selection... as documented. Well, the docs also make reference to ctrl-v being used as an escape. So which is it? How can ctrl-v be documented to do both things?
Anonymous, March 23, 2004 8:28 
smp@cypress.com: control-V only lets you enter escaped characters when in insert mode...
Anonymous, April 7, 2004 12:24 
Incredible. Before now, I used to consider myself pretty bright. Imagine, all these years of overestimating my mental abilities. I guess this new found dimness explains a few of the blunders in my life.
Anyway, thanks, I don‘t know how I didn‘t realize that I was trying to insert escaped characters when not in insert mode. (I‘ve been using vi/vim for ~11 years)

--
※ 來(lái)源:·BBS 水木清華站 smth.org·[FROM: 210.77.11.*]
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
Monitor | Asterisk
75.Adding Videos
general error c101008a: Failed to save the updated manifest to the file
聽(tīng)峰's Blog -> 最?lèi)?ài)的 vimrc 設置
Drug Master Files (DMF)
SQL中@@ROWCOUNT函數(轉)
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久