vimrc 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. " Basic settings.
  2. set nocompatible " Sane mode.
  3. set encoding=utf8 " File encoding.
  4. set history=100 " Command history.
  5. " Disable crap.
  6. set noerrorbells
  7. set novisualbell
  8. " Disable backup and swapfiles.
  9. set nobackup
  10. set nowb
  11. set noswapfile
  12. " Map ',' as leaderkey.
  13. let mapleader = ","
  14. let g:mapleader = ","
  15. " Automatically re-read the file, if it has been changed externally.
  16. set autoread
  17. " Appearance
  18. syntax enable " Syntax highlighting.
  19. set scrolloff=6 " Min lines below/above cursor.
  20. set number " Enable line numbering.
  21. set ruler " Enable line/column ruler.
  22. set cmdheight=1 " Command bar height.
  23. " Searching
  24. set hlsearch " Highlighting
  25. nmap <leader>/ :nohlsearch<cr>
  26. set incsearch " Incremental search.
  27. " Command completion
  28. set wildmenu
  29. set wildmode=longest:full,full
  30. " Backspace handling: No backspace over eol. Use <S-j> instead.
  31. set backspace=indent,start
  32. " Move between windows
  33. map <C-j> <C-W>j
  34. map <C-k> <C-W>k
  35. map <C-h> <C-W>h
  36. map <C-l> <C-W>l
  37. " Move line up/down (normal mode only)
  38. nmap <M-j> mz:m+<cr>`z
  39. nmap <M-k> mz:m-2<cr>`z
  40. " Toggle spell checking
  41. map <leader>s :setlocal spell!<cr>
  42. " Toggle paste mode
  43. map <leader>p :setlocal paste!<cr>
  44. " Indent and tab
  45. set autoindent
  46. "set smartindent
  47. "inoremap # X#
  48. "filetype on " Filetype detection
  49. "filetype plugin off
  50. "filetype indent on
  51. set tabstop=8
  52. set shiftwidth=8
  53. set softtabstop=0
  54. set noexpandtab
  55. set smarttab
  56. map <leader><F2> :set ts=2 sw=2 expandtab<cr>
  57. map <leader>2 :set ts=2 sw=2 noexpandtab<cr>
  58. map <leader><F4> :set ts=4 sw=4 expandtab<cr>
  59. map <leader>4 :set ts=4 sw=4 noexpandtab<cr>
  60. map <leader><F8> :set ts=8 sw=8 expandtab<cr>
  61. map <leader>8 :set ts=8 sw=8 noexpandtab<cr>
  62. map <leader>r :retab<cr>
  63. " colorscheme
  64. colorscheme industry
  65. hi LineNr cterm=NONE ctermfg=DarkGrey gui=NONE guifg=DarkGrey