Advertisement
Guest User

.vimrc

a guest
Jun 16th, 2010
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 2.21 KB | None | 0 0
  1. " This isn't 1980, we don't need to act like plain 'vi'
  2. set nocompatible
  3.  
  4. " Use bash instead of sh
  5. set shell=/bin/bash
  6.  
  7. syntax on
  8. filetype on
  9. filetype indent on
  10. filetype plugin on
  11.  
  12. set number
  13. set cindent
  14. set showmatch
  15. set autoindent
  16. set smartindent
  17.  
  18. " Don't artificially wrap long lines on the screen
  19. set nowrap
  20.  
  21. " For terminal, we'll try elflord
  22. " colorscheme elflord
  23. set background=dark
  24.  
  25. " Show the ruler and 1 line of status all the time
  26. set ruler
  27. set cmdheight=1
  28. set laststatus=2
  29. set statusline=%F%m%r%h%w\ [TYPE=%Y\ %{&ff}]\ [%l/%L\ (%p%%)]
  30.  
  31. " Allow backspacing through newlines
  32. set backspace=indent,eol,start whichwrap+=<,>,[,]
  33.  
  34. " Set 4-space tabs
  35. set tabstop=4
  36. set shiftwidth=4
  37. set softtabstop=4
  38. set expandtab
  39. set number          " line numbers
  40. " Quickly highlight matching braces/parentheses/brackets
  41. set showmatch
  42.  
  43. set showcmd
  44.  
  45. " Keep 5 lines of context when scrolling
  46. set scrolloff=3
  47.  
  48.  
  49. " Enable vim modelines
  50. set modeline
  51.  
  52. " Use the 'global' flag by default in search/replace
  53. set gdefault
  54.  
  55. " Yes, we have a fast terminal
  56. set ttyfast
  57.  
  58. " Make window splitting behave
  59. set noequalalways
  60. set splitbelow
  61. " Don't make backup files (filename.c~)
  62. set nobackup
  63.  
  64. " Enable the mouse - clickity clickity
  65. set mouse=a
  66.  
  67. " Correct typos.
  68. iab erturn     return
  69. iab retrun     return
  70. iab retunr     return
  71. iab seperate   separate
  72. iab truely     truly
  73. iab flase      false
  74. iab fasle      false
  75.  
  76. function! OnlineDoc()
  77.     if &ft =~ "cpp"
  78.         let s:urlTemplate = "http://doc.trolltech.com/4.4/%.html"
  79.     elseif &ft =~ "python"
  80.         let s:urlTemplate = "http://riverbankcomputing.co.uk/static/Docs/PyQt4/html/%.html"
  81.     elseif &ft =~ "ruby"
  82.         let s:urlTemplate = "http://www.ruby-doc.org/core/classes/%.html"
  83.     elseif &ft =~ "perl"
  84.         let s:urlTemplate = "http://perldoc.perl.org/functions/%.html "
  85.     else
  86.         return
  87.     endif
  88.  
  89.     let s:browser = "firefox"
  90.     let s:wordUnderCursor = expand("")
  91.     let s:url = substitute(s:urlTemplate, "%", s:wordUnderCursor, "g")
  92.  
  93.     let s:cmd = "silent !" . s:browser . " " . s:url . "&"
  94.     execute  s:cmd
  95. endfunction
  96.  
  97. " online doc search
  98. map   :call OnlineDoc()
  99. set encoding=utf-8  " Use UTF-8   Go Unicode!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement