vimrc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. " Default configuration file for Vim
  2. " Written by Aron Griffis <agriffis@gentoo.org>
  3. " Modified by Ryan Phillips <rphillips@gentoo.org>
  4. " Added Redhat's vimrc info by Seemant Kulleen <seemant@gentoo.org>
  5. " Added some enhancements by A. Murat Eren <meren@uludag.org.tr>
  6. " Tidy up by Onur Küçük <onur@pardus.org.tr>
  7. " The following are some sensible defaults for Vim for most users.
  8. " We attempt to change as little as possible from Vim's defaults,
  9. " deviating only where it makes sense
  10. set nocompatible " Turn off compability mode with Vi, makes Vim more powerful
  11. set backspace=2 " same as :set backspace=indent,eol,start
  12. set autoindent " Always set auto-indenting on
  13. set viminfo='20,\"50 " Read/write a .viminfo file -- limit to only 50
  14. set history=100 " Keep 100 lines of command history
  15. set ruler " Show the cursor position all the time
  16. set showmode " Show current mode
  17. " Always enable syntax & last search highlighting
  18. syntax enable
  19. set shiftwidth=4 " Number of spaces to use for each step of (auto)indentF
  20. set wrap " wrap long lines to windows width
  21. set linebreak
  22. set laststatus=2
  23. set showcmd
  24. set wildmenu
  25. set incsearch " shows the match while typing
  26. set hlsearch " highlight found searches
  27. set background=dark
  28. set modelines=0
  29. " Vi is cooler with these settings :)
  30. set ts=4
  31. set sta
  32. set sts=4
  33. set expandtab
  34. if v:lang =~ "^ko"
  35. set fileencodings=euc-kr
  36. set guifontset=-*-*-medium-r-normal--16-*-*-*-*-*-*-*
  37. elseif v:lang =~ "^ja_JP"
  38. set fileencodings=euc-jp
  39. set guifontset=-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*
  40. elseif v:lang =~ "^zh_TW"
  41. set fileencodings=big5
  42. set guifontset=-sony-fixed-medium-r-normal--16-150-75-75-c-80-iso8859-1,-taipei-fixed-medium-r-normal--16-150-75-75-c-160-big5-0
  43. elseif v:lang =~ "^zh_CN"
  44. set fileencodings=gb2312
  45. set guifontset=*-r-*
  46. endif
  47. if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
  48. set fileencodings=utf-8,latin1
  49. endif
  50. " Only do this part when compiled with support for autocommands
  51. if has("autocmd")
  52. " In text files, always limit the width of text to 78 characters
  53. autocmd BufRead *.txt set tw=78
  54. " When editing a file, always jump to the last cursor position
  55. autocmd BufReadPost *
  56. \ if line("'\"") > 0 && line ("'\"") <= line("$") |
  57. \ exe "normal g'\"" |
  58. \ endif
  59. endif
  60. " Don't use Ex mode, use Q for formatting
  61. map Q gq
  62. if &term=="xterm"
  63. set t_RV= " don't check terminal version
  64. set t_Co=8
  65. set t_Sb=^[4%dm
  66. set t_Sf=^[3%dm
  67. endif
  68. " some extra commands for HTML editing
  69. nmap ,mh wbgueyei<<ESC>ea></<ESC>pa><ESC>bba
  70. nmap ,h1 _i<h1><ESC>A</h1><ESC>
  71. nmap ,h2 _i<h2><ESC>A</h2><ESC>
  72. nmap ,h3 _i<h3><ESC>A</h3><ESC>
  73. nmap ,h4 _i<h4><ESC>A</h4><ESC>
  74. nmap ,h5 _i<h5><ESC>A</h5><ESC>
  75. nmap ,h6 _i<h6><ESC>A</h6><ESC>
  76. nmap ,hb wbi<b><ESC>ea</b><ESC>bb
  77. nmap ,he wbi<em><ESC>ea</em><ESC>bb
  78. nmap ,hi wbi<i><ESC>ea</i><ESC>bb
  79. nmap ,hu wbi<u><ESC>ea</i><ESC>bb
  80. nmap ,hs wbi<strong><ESC>ea</strong><ESC>bb
  81. nmap ,ht wbi<tt><ESC>ea</tt><ESC>bb
  82. nmap ,hx wbF<df>f<df>
  83. " Enable this to automatically put extra space after ([ and before ])
  84. " This comes from kde-devel-vim.vim plugin
  85. " let EnableSmartParens=1
  86. nmap <C-N><C-N> :set invnumber <CR>
  87. nmap <C-T> :Tlist <CR>
  88. " Enables to move upward/downward at long lines
  89. map <UP> gk
  90. map <DOWN> gj
  91. map k gk
  92. map j gj
  93. " Taglist defaults
  94. let Tlist_Use_Right_Window=1
  95. let Tlist_WinWidth=40
  96. let Tlist_Exit_OnlyWindow=1
  97. let Tlist_File_Fold_Auto_Close=1
  98. " Enable filetype stuff
  99. filetype plugin indent on