Debian中VI的配置方法簡析

來源:互聯網
上載者:User


剛剛安裝了Debian,卻發現其內建的VI存在問題: 
1)不支援文法高亮提示 2)不支援Backspace鍵的刪除功能 原來Debian中內建的VI是VIM-TINY,程式本身就是不支援文法高亮和Backspace刪除功能。  可以使用以下辦法解決: 1)重新安裝其它版本的VI   apt-get install vim vim-runtime ctags 2)配置~/.vimrc   www.2cto.com    添加syntax onVI常用的配置選項-----------------------set numberset showcmdset incsearchset expandtabset showcmdset history=400set autoreadset ffs=unix,mac,dosset hlsearchset shiftwidth=2set wrapset aiset siset cindentset termencoding=unixset tabstop=2set nocompatibleset showmatchset fileencodings=utf-8,gb2312,18030,gbkset fileformats=unixset ttyfastsyntax onset imcmdlineset previewwindowset showfulltagset cursorlineset ruler" set mouse=a " Close the error bellsset vb t_vb=set nowrapscan " When open a file, it will jump to the last cursor positionif has("autocmd")autocmd BufReadPost * / if line("'/"") > 0 && line ("'/"") <= line("$") | /   exe "normal! g'/"" | / endifendif " For ctagsset tags=tags;set autochdir " For taglistlet Tlist_Show_One_File=1let Tlist_Exit_OnlyWindow=1let Tlist_Auto_Open=1set updatetime=100 " For auto complete '(' and '{'ino ( ()<esc>:let leavechar=")"<cr>iino { {}<esc>:let leavechar="}"<cr>iino ' ''<esc>:let leavechar="'"<cr>iino " ""<esc>:let leavechar='"'<cr>iimap <c-l> <esc>:exec "normal f" . leavechar<cr>a  www.2cto.com  " For comment in C program /**/set comments=s1:/*,mb:*,ex0:/ VI最常用操作-----------------i  進入編輯狀態可在游標處插入內容o  在當前行下方插入空白行並進入編輯狀態O  在當前行上方插入空白行並進入編輯狀態D  刪除當前行游標後的所有內容dd  刪除當前行gg  跳至檔案頂部G  跳至檔案底部0  移至本行開頭$  移至本行末尾x  刪除CTRL+u  向上翻頁CTRL+d  向下翻頁yw  複製游標所在單詞yy  複製當前行p  粘貼至游標後P  粘貼至游標前#  尋找與當前游標相同的單詞或字元並高亮顯示/  尋找字串:sp  以分欄方式開啟另一檔案CTRL+ww  在分欄方式開啟的多個檔案之間跳轉:num  跳至文本的第num行:g/str1/s//str2/  用字串str2替換文本中所有的str1:x  儲存退出:q!  不儲存退出    摘自 邵巍的專欄

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.