Advertisement
alexs77

.vimrc

Dec 30th, 2011
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 7.62 KB | None | 0 0
  1. scriptencoding utf-8
  2. " ^^ Please leave the above line at the start of the file.
  3.  
  4. " Default configuration file for Vim
  5. " $Header: /var/cvsroot/gentoo-x86/app-editors/vim-core/files/vimrc-r3,v 1.1 2006/03/25 20:26:27 genstef Exp $
  6.  
  7. " Written by Aron Griffis <agriffis@gentoo.org>
  8. " Modified by Ryan Phillips <rphillips@gentoo.org>
  9. " Modified some more by Ciaran McCreesh <ciaranm@gentoo.org>
  10. " Added Redhat's vimrc info by Seemant Kulleen <seemant@gentoo.org>
  11.  
  12. " You can override any of these settings on a global basis via the
  13. " "/etc/vim/vimrc.local" file, and on a per-user basis via "~/.vimrc". You may
  14. " need to create these.
  15.  
  16. " {{{ General settings
  17. " The following are some sensible defaults for Vim for most users.
  18. " We attempt to change as little as possible from Vim's defaults,
  19. " deviating only where it makes sense
  20. set nocompatible        " Use Vim defaults (much better!)
  21. set bs=2                " Allow backspacing over everything in insert mode
  22. set ai                  " Always set auto-indenting on
  23. set history=50          " keep 50 lines of command history
  24. set ruler               " Show the cursor position all the time
  25.  
  26. set viminfo='20,\"500   " Keep a .viminfo file.
  27.  
  28. " Don't use Ex mode, use Q for formatting
  29. map Q gq
  30.  
  31. " When doing tab completion, give the following files lower priority. You may
  32. " wish to set 'wildignore' to completely ignore files, and 'wildmenu' to enable
  33. " enhanced tab completion. These can be done in the user vimrc file.
  34. set suffixes+=.info,.aux,.log,.dvi,.bbl,.out,.o,.lo
  35.  
  36. " When displaying line numbers, don't use an annoyingly wide number column. This
  37. " doesn't enable line numbers -- :set number will do that. The value given is a
  38. " minimum width to use for the number column, not a fixed size.
  39. if v:version >= 700
  40.   set numberwidth=3
  41. endif
  42. " }}}
  43.  
  44. " {{{ Modeline settings
  45. " We don't allow modelines by default. See bug #14088 and bug #73715.
  46. " If you're not concerned about these, you can enable them on a per-user
  47. " basis by adding "set modeline" to your ~/.vimrc file.
  48. set nomodeline
  49. " }}}
  50.  
  51. " {{{ Locale settings
  52. " Try to come up with some nice sane GUI fonts. Also try to set a sensible
  53. " value for fileencodings based upon locale. These can all be overridden in
  54. " the user vimrc file.
  55. if v:lang =~? "^ko"
  56.   set fileencodings=euc-kr
  57.   set guifontset=-*-*-medium-r-normal--16-*-*-*-*-*-*-*
  58. elseif v:lang =~? "^ja_JP"
  59.   set fileencodings=euc-jp
  60.   set guifontset=-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*
  61. elseif v:lang =~? "^zh_TW"
  62.   set fileencodings=big5
  63.   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
  64. elseif v:lang =~? "^zh_CN"
  65.   set fileencodings=gb2312
  66.   set guifontset=*-r-*
  67. endif
  68.  
  69. " If we have a BOM, always honour that rather than trying to guess.
  70. if &fileencodings !~? "ucs-bom"
  71.   set fileencodings^=ucs-bom
  72. endif
  73.  
  74. " Always check for UTF-8 when trying to determine encodings.
  75. if &fileencodings !~? "utf-8"
  76.   set fileencodings+=utf-8
  77. endif
  78.  
  79. " Make sure we have a sane fallback for encoding detection
  80. set fileencodings+=default
  81. " }}}
  82.  
  83. " {{{ Syntax highlighting settings
  84. " Switch syntax highlighting on, when the terminal has colors
  85. " Also switch on highlighting the last used search pattern.
  86. if &t_Co > 2 || has("gui_running")
  87.   syntax on
  88.   set hlsearch
  89. endif
  90. " }}}
  91.  
  92. " {{{ Terminal fixes
  93. if &term ==? "xterm"
  94.   set t_Sb=^[4%dm
  95.   set t_Sf=^[3%dm
  96.   set ttymouse=xterm2
  97. endif
  98.  
  99. if &term ==? "gnome" && has("eval")
  100.   " Set useful keys that vim doesn't discover via termcap but are in the
  101.   " builtin xterm termcap. See bug #122562. We use exec to avoid having to
  102.   " include raw escapes in the file.
  103.   exec "set <C-Left>=\eO5D"
  104.   exec "set <C-Right>=\eO5C"
  105. endif
  106. " }}}
  107.  
  108. " {{{ Filetype plugin settings
  109. " Enable plugin-provided filetype settings, but only if the ftplugin
  110. " directory exists (which it won't on livecds, for example).
  111. if isdirectory(expand("$VIMRUNTIME/ftplugin"))
  112.   filetype plugin on
  113.  
  114.   " Uncomment the next line (or copy to your ~/.vimrc) for plugin-provided
  115.   " indent settings. Some people don't like these, so we won't turn them on by
  116.   " default.
  117.   " filetype indent on
  118. endif
  119. " }}}
  120.  
  121. " {{{ Fix &shell, see bug #101665.
  122. if "" == &shell
  123.   if executable("/bin/bash")
  124.     set shell=/bin/bash
  125.   elseif executable("/bin/sh")
  126.     set shell=/bin/sh
  127.   endif
  128. endif
  129. "}}}
  130.  
  131. " {{{ Our default /bin/sh is bash, not ksh, so syntax highlighting for .sh
  132. " files should default to bash. See :help sh-syntax and bug #101819.
  133. if has("eval")
  134.   let is_bash=1
  135. endif
  136. " }}}
  137.  
  138. " {{{ Autocommands
  139. if has("autocmd")
  140.  
  141. augroup gentoo
  142.   au!
  143.  
  144.   " Gentoo-specific settings for ebuilds.  These are the federally-mandated
  145.   " required tab settings.  See the following for more information:
  146.   " http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml
  147.   " Note that the rules below are very minimal and don't cover everything.
  148.   " Better to emerge app-vim/gentoo-syntax, which provides full syntax,
  149.   " filetype and indent settings for all things Gentoo.
  150.   au BufRead,BufNewFile *.e{build,class} let is_bash=1|setfiletype sh
  151.   au BufRead,BufNewFile *.e{build,class} set ts=4 sw=4 noexpandtab
  152.  
  153.   " In text files, limit the width of text to 78 characters, but be careful
  154.   " that we don't override the user's setting.
  155.   autocmd BufNewFile,BufRead *.txt
  156.         \ if &tw == 0 && ! exists("g:leave_my_textwidth_alone") |
  157.         \     setlocal textwidth=78 |
  158.         \ endif
  159.  
  160.   " When editing a file, always jump to the last cursor position
  161.   autocmd BufReadPost *
  162.         \ if ! exists("g:leave_my_cursor_position_alone") |
  163.         \     if line("'\"") > 0 && line ("'\"") <= line("$") |
  164.         \         exe "normal g'\"" |
  165.         \     endif |
  166.         \ endif
  167.  
  168.   " When editing a crontab file, set backupcopy to yes rather than auto. See
  169.   " :help crontab and bug #53437.
  170.   autocmd FileType crontab set backupcopy=yes
  171.  
  172. augroup END
  173.  
  174. endif " has("autocmd")
  175. " }}}
  176.  
  177. " {{{ vimrc.local
  178. if filereadable("/etc/vim/vimrc.local")
  179.   source /etc/vim/vimrc.local
  180. endif
  181. " }}}
  182.  
  183. " vim: set fenc=utf-8 tw=80 sw=2 sts=2 et foldmethod=marker :
  184.  
  185.  
  186.  
  187. " Meine Einstellungen
  188. " Uebernommen von Mandrake
  189. colorscheme elflord
  190. colorscheme pablo
  191. colorscheme ron
  192. set ruler
  193. set showmatch
  194. set statusline=[%n]\ %<%f%=\ [%1*%M%*%R%H%W%Y]\ %-19(%3l,%02c%03V%)\ %P\ %o\ '%03b'
  195. set laststatus=2
  196. set incsearch
  197. set modeline
  198. set backup
  199.  
  200. set cursorline
  201. "set cursorcolumn
  202.  
  203. """""""""""""""""" Firma
  204. set number showmatch nocompatible
  205. syntax on
  206.  
  207. " from http://stackoverflow.com/questions/65076/how-to-setup-vim-properly-for-editing-python-files-py
  208. " configure expanding of tabs for various file types
  209. au BufRead,BufNewFile *.py set expandtab
  210. au BufRead,BufNewFile *.c set noexpandtab
  211. au BufRead,BufNewFile *.h set noexpandtab
  212. au BufRead,BufNewFile Makefile* set noexpandtab
  213.  
  214. " --------------------------------------------------------------------------------
  215. " configure editor with tabs and nice stuff...
  216. " --------------------------------------------------------------------------------
  217. set expandtab           " enter spaces when tab is pressed
  218. set textwidth=120       " break lines when line length increases
  219. set tabstop=4           " use 4 spaces to represent tab
  220. set softtabstop=4
  221. set shiftwidth=4        " number of spaces to use for auto indent
  222. set autoindent          " copy indent from current line when starting a new line
  223.  
  224. " make backspaces more powerfull
  225. set backspace=indent,eol,start
  226.  
  227. set ruler               " show line and column number
  228. syntax on               " syntax highlighting
  229. set showcmd             " show (partial) command in status line
  230. """""""""""""""""" Firma
  231.  
  232.  
  233. " EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement