Madiyar

.vimrc

Jan 14th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 3.16 KB | None | 0 0
  1. syntax on           " syntax highlighting
  2. set winwidth=80     " characters per line - this is used when gq (autowrap)
  3. "set number
  4. set autoindent
  5. set ruler           " shows position in status bar
  6. set ignorecase      " when searching
  7. set smartcase       " case matters when seach pattern has upper case
  8. set hlsearch        " highlights found string on search
  9. set incsearch       " search while typing
  10. filetype plugin indent on " this plugin is used for many more per-filetype plugins
  11. set ts=4            " tab stop - how many spaces will a tab character take (normally you should NOT have tab characters in your code)
  12. set sw=4            " shifts width - (un)indent amount
  13. set sts=4           " smart tab stop - handy with backspace (deletes four chars at once)
  14. set expandtab       " use spaces instead of tabs
  15. color elflord       " nice theme with dark background
  16. " you may find some of the following useful
  17. " set guioptions-=m  " no menus
  18. " set guioptions-=T  " no icons
  19. " set guioptions+=c  " console dialog (vs popup)
  20. " set guioptions-=r  " no left / right scrollbar
  21. " set guioptions-=l
  22. " set guioptions-=R
  23. " set guioptions-=L
  24. set guioptions=aci   " autoselect, cui dialogs, icon <- for the console addicted
  25. if has('gui_running')
  26.     set showtabline=2   " always show tab line - for some reason gvim will resize and go beyond desktop size when you create a new tab - with this option it always has the tab line
  27.     set guifont=Monospace\ 9 " this font fits 4 buffers next to each other on 30' monitor
  28. endif
  29. set laststatus=2    " always show status line
  30. set mousefocus     " focus follows mouse
  31. set mouse=a         " mouse click and select behaves good in console vi(m)
  32. set formatoptions=1 " connected with the next one
  33. set lbr             " word wrap (on word, not screen)
  34. set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<   " how to see special (whitespace) characters - activate with "set list", deactivate with "set nolist"
  35. ":au BufWinEnter * let w:m1=matchadd('Search', '\%<81v.\%>77v', -1)
  36. :au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1) " make everything above 80 chars appear RED - very annoying so you'll never have > 80 char lines :)
  37.  
  38. " This makes the completion of commands complete only longest possible prefix (like bash), not to first possible (like zsh, vi default)
  39. " It also shows a menu so you can pick an option with the arrows
  40. set wildmode=longest:full
  41. set wildmenu
  42.  
  43. imap <C-v> <Esc>pa
  44. " Easily move between many windows with alt + arrow keys / vi move keys
  45. nmap  <M-Right>     <C-W><Right>
  46. nmap  <M-Left>      <C-W><Left>
  47. nmap  <M-Down>      <C-W><Down>
  48. nmap  <M-Up>        <C-W><Up>
  49. nmap  <M-l>         <C-W><Right>
  50. nmap  <M-h>         <C-W><Left>
  51. nmap  <M-j>         <C-W><Down>
  52. nmap  <M-k>         <C-W><Up>
  53.  
  54.  
  55. " for javascript smartindent uses cindent, which indents all lines with colon (:) at the 0th column (because it thinks they are labels)
  56. " this is extremely annoying when defining  objects in javascript - so disable smartindent for javascript    
  57. au FileType javascript set nocindent
  58. " Default sass sw is 2, and from time to time it autoindents - ANNOYING. This fixes it.
  59. au FileType sass set sw=4
  60.  
  61. call pathogen#infect()
Advertisement
Add Comment
Please, Sign In to add comment