Óɲ©¿ÍÔ°mingaixin´¦ÕûÀíËùµÃ
1.vimͬʱ´ò¿ª¶à¸öÎļþ½øÐбà¼
ÔÚAÎļþÖÐÓÃ:tabedit B ¾Í´ò¿ªÁËBÎļþ£¬È»ºóÓÃgtÀ´Çл»½øÈëA »òBÎļþÖУ» Èç¹û´ò¿ª¶à¸ö£¬¾ÍÓà 1gt ,2gtÀ´Çл»ÖÁ²»Í¬µÄÎļþ£»·µ»ØÉÏÒ»¸öÎļþÓÃgT
2.vim×Ô¶¯Ìøתµ½ÒýÓõĺ¯Êý
°²×°£º yum install ctags
ÔÚÄã´úÂëµÄ¸ùĿ¼ÏÂÖ´ÐУº±ÈÈç/data/www/test/trunk
ctags -R *
´ò¿ªÎļþÖ»ÄÜÔÚ¸ùĿ¼Ï´ò¿ª¾Í¿ÉÒÔ,±ÈÈç
vim application/controller/index.php
ctrl+] ²é¿´
ctrl+t ·µ»Ø
3.linuxÖÐvimÖÐÎÄÏÔʾÂÒÂë
ÕâÀïËù˵µÄ¶¼ÊÇÈ«¾ÖÉ趨£¬´ò¿ªvimrcÎļþºó£¬Ö»ÐèÒªÔÚÎļþ×îºóÌí¼ÓÒÔÏ´úÂë¾Í¿ÉÒÔÁË£º
set fileencodings=utf-8,gb2312,gbk,gb18030
set termencoding=utf-8
set fileformats=unix
set encoding=prc
ÕâÑù£¬ÄãµÄvimÖÐÎÄÂÒÂëÎÊÌâ¾Í½â¾öÁË£¡
4.vimÖдúÂë¿é×óÓÒÒƶ¯µÄÃüÁî
ʹÓÿéÑ¡ÔñÃüÁî v(Сд)£¬V(´óд) £¬ctrl+v Ñ¡ÔñÐèÒªÒƶ¯µÄ´úÂ룬 È»ºó ×óÒƶ¯(<) ,ÓÒÒƶ¯(>)
5.vim ¶àÆÁ±à¼
·ÖÆÁÆô¶¯vim
1). ʹÓôóдµÄO²ÎÊýÀ´´¹Ö±·ÖÆÁ
vim -On file1 file2 ...
2). ʹÓÃСдµÄo²ÎÊýÀ´Ë®Æ½·ÖÆÁ
vim -on file1 file2 ...
×¢ÊÍ£ºnÊÇÊý×Ö£¬±íʾ·Ö³É¼¸¸öÆÁ
¹Ø±Õ·ÖÆÁ
1). ¹Ø±Õµ±Ç°´°¿Ú
ͬʱ°´£ºctrl + shift + w£¬È»ºó°´£ºc
·ÖÆÁ
1). ÉÏÏ·ָǰ´ò¿ªµÄij¸öÎļþ
ͬʱ°´£ºctrl + shift + w£¬È»ºó°´£ºs
2). ÉÏÏ·ָ´ò¿ªÒ»¸öеÄÎļþ
:sp filename
3). ×óÓҷָǰ´ò¿ªµÄij¸öÎļþ
ͬʱ°´£ºctrl + shift + w£¬È»ºó°´£ºv
4). ×óÓҷָ´ò¿ªÒ»¸öеÄÎļþ
:vsp filename
ͬʱ°´£ºctrl + shift + w£¬È»ºó°´£ºv
ÆÁÄ»³ß´ç
1). ÈÃËùÓеÄÆÁ¶¼ÓÐÒ»ÑùµÄ¸ß¶È
ͬʱ°´£ºctrl + shift + w£¬È»ºó°´£º=
6.LinuxÏÂncÃüÀ´ÊµÏÖÎļþ´«Êä
·¢ËͶˣº
cat test.txt | nc -l -p 6666
»òÕßnc -l -p 6666 < test.txt ÓÐЩ°æ±¾²»ÒªÔÚ -p
¡¾¼àÌý6666¶Ë¿Ú£¬µÈ´ýÁ¬½Ó¡¿£¨Éè·¢ËͶËIPΪ10.20.133.152£©
½ÓÊնˣº
nc 10.20.133.152 6666 > test1.txt
ÈçÉÏÃæµÄ²Ù×÷£¬¼´¿É½«Îļþtest.txt´Ó·¢ËͶ˴«Ë͵½½ÓÊնˣ¬±£´æΪtest1.txt
7.vimÕÛµþÉèÖÃ
vim ÕÛµþÉèÖÃ
set foldmethod=indent "set default foldmethod, foldmethod¿ÉÒÔËõдΪfdm"
zi ´ò¿ª¹Ø±ÕÕÛµþ
zv ²é¿´´ËÐÐ
zm ¹Ø±ÕÕÛµþ
zM ¹Ø±ÕËùÓÐ
zr ´ò¿ª
zR ´ò¿ªËùÓÐ
zc ÕÛµþµ±Ç°ÐÐ
zo ´ò¿ªµ±Ç°ÕÛµþ
zd ɾ³ýÕÛµþ
zD ɾ³ýËùÓÐÕÛµþ
ÒÔÉÏÃüÁÊÇÔÚ£¨normal ģʽ£© ÖнøÐвÙ×÷µÄ
8.vimÉèÖÃ
SecureCRTÖÐÈÃvim¸ßÁÁÏÔʾ
linuxµÄ¿ØÖÆ̨ÑÕÉ«ºÜºÃÉèÖãºOptions ->Session Options -> Terminal -> Emulation ÖÐTerminalÑ¡ÔñANSI or linux or xterm,±ØÐë¹³ÉÏ ANSI Colour
ÔÚÖÕ¶ËÏÂʹÓÃvim½øÐбà¼Ê±£¬Ä¬ÈÏÇé¿öÏ£¬±à¼µÄ½çÃæÉÏÊÇûÓÐÏÔʾÐкš¢Óï·¨¸ßÁÁ¶ÈÏÔʾ¡¢ÖÇÄÜËõ½øµÈ¹¦Äܵġ£ÎªÁ˸üºÃµÄÔÚvimϽøÐй¤×÷£¬ÐèÒªÊÖ¶¯ÉèÖÃÒ»¸öÅäÖÃÎļþ£º.vimrc¡£
ÔÚÆô¶¯vimʱ£¬µ±Ç°Óû§¸ùĿ¼ÏµÄ.vimrcÎļþ»á±»×Ô¶¯¶ÁÈ¡£¬¸ÃÎļþ¿ÉÒÔ°üº¬Ò»Ð©ÉèÖÃÉõÖÁ½Å±¾£¬
vim .vimrc ½«ÏÂÃæµÄÄÚÈÝ¿½±´½øÈ¥
"Ë«ÒýºÅ¿ªÊ¼µÄÐÐΪעÊÍÐУ¬ÏÂͬ
""È¥µôÌÖÑáµÄÓйØviÒ»ÖÂÐÔģʽ£¬±ÜÃâÒÔÇ°°æ±¾µÄһЩbugºÍ¾ÖÏÞ
set nocompatible
"ÏÔʾÐкÅ
"set number
""¼ì²âÎļþµÄÀàÐÍ
filetype on
"¼Ç¼ÀúÊ·µÄÐÐÊý
"set history=1000
""±³¾°Ê¹ÓúÚÉ«
set background=dark
"Óï·¨¸ßÁÁ¶ÈÏÔʾ
syntax on
""ÏÂÃæÁ½ÐÐÔÚ½øÐбàд´úÂëʱ£¬ÔÚ¸ñʽ¶ÔÆðÉϺÜÓÐÓã»
"µÚÒ»ÐУ¬vimʹÓÃ×Ô¶¯¶ÔÆð£¬Ò²¾ÍÊǰѵ±Ç°ÐеĶÔÆð¸ñʽӦÓõ½ÏÂÒ»ÐУ»
""µÚ¶þÐУ¬ÒÀ¾ÝÉÏÃæµÄ¶ÔÆð¸ñʽ£¬ÖÇÄܵÄÑ¡Ôñ¶ÔÆð·½Ê½£¬¶ÔÓÚÀàËÆCÓïÑÔ±à
"дÉϺÜÓÐÓÃ
set autoindent
set smartindent
""µÚÒ»ÐÐÉèÖÃtab¼üΪ4¸ö¿Õ¸ñ£¬µÚ¶þÐÐÉèÖõ±ÐÐÖ®¼ä½»´íʱʹÓÃ4¸ö¿Õ¸ñ
set tabstop=4
set shiftwidth=4
"ÕÛµþÉèÖÃ
set fdm=indent
"ÉèÖÃÆ¥Åäģʽ£¬ÀàËƵ±ÊäÈëÒ»¸ö×óÀ¨ºÅʱ»áÆ¥ÅäÏàÓ¦µÄÄǸöÓÒÀ¨ºÅ
set showmatch
""È¥³ývimµÄGUI°æ±¾ÖеÄtoolbar
set guioptions=T
"µ±vim½øÐбà¼Ê±£¬Èç¹ûÃüÁî´íÎ󣬻ᷢ³öÒ»¸öÏìÉù£¬¸ÃÉèÖÃÈ¥µôÏìÉù
"set vb t_vb=
""Ôڱ༹ý³ÌÖУ¬ÔÚÓÒϽÇÏÔʾ¹â±êλÖõÄ״̬ÐÐ
set ruler
"ĬÈÏÇé¿öÏ£¬Ñ°ÕÒÆ¥ÅäÊǸßÁÁ¶ÈÏÔʾµÄ£¬¸ÃÉèÖùرոßÁÁÏÔʾ
"set nohls
""²éѯʱ·Ç³£·½±ã£¬ÈçÒª²éÕÒbookµ¥´Ê£¬µ±ÊäÈëµ½/bʱ£¬»á×Ô¶¯ÕÒµ½µÚÒ»
"¸öb¿ªÍ·µÄµ¥´Ê£¬µ±ÊäÈëµ½/boʱ£¬»á×Ô¶¯ÕÒµ½µÚÒ»¸öbo¿ªÍ·µÄµ¥´Ê£¬ÒÀ
""´ÎÀàÍÆ£¬½øÐвéÕÒʱ£¬Ê¹ÓôËÉèÖûá¿ìËÙÕÒµ½´ð°¸£¬µ±ÄãÕÒҪƥÅäµÄµ¥´Ê
"ʱ£¬±ðÍü¼Ç»Ø³µ
set incsearch
""ÐÞ¸ÄÒ»¸öÎļþºó£¬×Ô¶¯½øÐб¸·Ý£¬±¸·ÝµÄÎļþÃûΪÔÎļþÃû¼Ó"~"ºó׺
if has("vms") "×¢ÒâË«ÒýºÅÒªÓðë½ÇµÄÒýºÅ"¡¡"
set nobackup
else
set backup
endif