VIM-related issues in Ubuntu

Source: Internet
Author: User
Tags command line backup

Today, I would like to share with you my vim configuration, just a personal habit. If you want, you can replace content copy with the contents of ~/.VIMRC:

01.if v:lang =~ "utf8$" | | V:lang =~ "utf-8$"


02. Set Fileencodings=utf-8,latin1


03.endif


04.


05.set tags=./tags,.. /tags,.. /.. /tags,.. /.. /.. /tags,.. /.. /.. /.. /tags,.. /.. /.. /.. /.. /tags,.. /.. /.. /. ./.. /.. /tags,.. /.. /.. /.. /.. /.. /.. /tags,.. /.. /.. /.. /.. /.. /.. /.. /tags,.. /.. /.. /.. /.. /.. /.. /.. / .. /tags


06.


07.set nocompatible "Use Vim defaults (much better!)


08.set Bs=indent,eol,start "Allow backspacing over everything in insert mode


09. " Set AI "always set autoindenting on


10. " Set backup "Keep a backup file


11.set viminfo= ' 20,\ ' read/write A. viminfo file, don ' t store more


12. "than lines of registers


13.set history=50 "keep lines of command line history


14.set ruler "show the cursor position all the time


15.


16. " Only does this part is compiled with support for Autocommands


17.if has ("Autocmd")


18. In text files, always limit the width of text to characters


19. Autocmd bufread *.txt Set tw=78


20. Autocmd FileType Java set Expandtab


21. "When editing a file, always jump to the last cursor position


22. Autocmd Bufreadpost *


23. \ If line ("' \") > 0 && Line ("" ") <= Line (" $ ") |


24. \ exe "normal! G ' \ ' "|


25. \ endif


26.endif


27.


28.if has ("Cscope") && filereadable ("/usr/bin/cscope")


29. Set Csprg=/usr/bin/cscope


30. Set Csto=0


31. Set CST


32. Set Nocsverb


Add any database in the current directory


34. If Filereadable ("Cscope.out")


35. CS Add Cscope.out


36. "Else add database pointed to by environment


37. ElseIf $CSCOPE _db!= ""


38. CS Add $CSCOPE _db


39. endif


40. Set Csverb


41.endif


42.


43. " Switch syntax highlighting on, when the terminal has colors


44. " Also switch on highlighting to the last used search pattern.


45.if &t_co > 2 | | Has ("gui_running")


46. Syntax on


47. Set Hlsearch


48.endif


49.


50.filetype plugin on


51.


52.set autoindent


53.set smartindent


54.set tabstop=4


55.set shiftwidth=4


56.set Showmatch


57.set vb t_vb=


58.syntax on


59.set Ruler


60.set Incsearch


61.


62.if has ("VMS")


63. Set Nobackup


64.else


65. Set Backup


66.endif


67.


68.if &term== "Xterm"


69. Set T_co=8


70. Set T_SB=[4%DM


71. Set T_SF=[3%DM


72.endif

Related Article

Contact Us

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.

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.