vimrc 1.9 KB

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