vimrc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. """"""""
  2. "" General Behaviours
  3. """""""""""""""""""""""""""""""""""""""""""""""""""
  4. set nocompatible "Don't have to try to be compatible with old vi
  5. set autoread "Read a file if it's changed from outside of vim
  6. let mapleader = "," "Leader key lets you make more kinds of shortcuts!
  7. " Source the vimrc file after saving it (courtesy of vimcasts.org!)
  8. if has("autocmd")
  9. autocmd bufwritepost .vimrc source $MYVIMRC
  10. endif
  11. """"""""
  12. "" Tabbing
  13. """"""""""""""""""""""""""""""""""""""""""""""""""""""
  14. set tabstop=4 "actual tab presses
  15. set shiftwidth=4 "for autoindent
  16. set expandtab "change to single spaces
  17. set smarttab
  18. set autoindent "use last line to set next indent
  19. set smartindent "guess harder, based on C-like language
  20. " set wrap "wrap lines of text
  21. """"""""
  22. "" UI - Colours
  23. """"""""""""""""""""""""""""""""""""""""""""""""""""""
  24. hi Comment ctermfg=darkmagenta
  25. syntax on
  26. colorscheme desert
  27. set colorcolumn=120
  28. """"""""
  29. "" UI - Numbering
  30. """"""""""""""""""""""""""""""""""""""""""""""""""""""""
  31. set number "show line numbers
  32. set relativenumber "current line always 0 (requires 7.3 and up)
  33. set ruler "show row,col count in status line
  34. """"""""
  35. "" UI - Search
  36. """"""""""""""""""""""""""""""""""""""""""""""""""""""""
  37. set hlsearch "make searches highlighted
  38. set incsearch "vim will search as you type!
  39. """"""""
  40. "" Shortcuts
  41. """"""""""""""""""""""""""""""""""""""""""""""""""""""""
  42. " More convenient escape
  43. imap ii <Esc>
  44. imap II <Esc>
  45. " Add extra lines up and down
  46. map <leader>j o<Esc>k
  47. map <leader>k O<Esc>j
  48. " window resizing
  49. noremap + <C-w>10+
  50. noremap - <C-w>10-