.vimrc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. """"""""""""""""""""""""""""""""
  2. " General
  3. """"""""""""""""""""""""""""""""
  4. " Use pathogen https://github.com/tpope/vim-pathogen
  5. execute pathogen#infect()
  6. filetype plugin indent on
  7. " Use vim-sensible https://github.com/tpope/vim-sensible
  8. " for default settings.
  9. "set ruler " Enables the ruler
  10. "set autoindent " Add indentation of previous line
  11. "set backspace=indent,eol,start " Use Backspace more intuitively
  12. "set complete-=i " <C-P> <C-N> for previous and next completion
  13. "set smarttab " Tab at the beginning of line adds shiftwidth spaces
  14. "set nrformats-=octal " Don't use octal as nr format
  15. "set ttimeout " Set the timeout for mapped keybindings
  16. "set ttimeoutlen=100 " Set timeout to 100ms
  17. "set incsearch " Don't wait for <CR>, start searching right away.
  18. "nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>
  19. " <C-L> switches off search result highlighting
  20. "set laststatus=2 " Always draw the status line
  21. "set wildmenu " Show expansion candidates in status line
  22. "set scrolloff=2 " Minimum number of lines above and below cursor
  23. "set sidescrolloff=5 " Minimum number of columns to keep (only in nowrap)
  24. "set display+=lastline
  25. "set encoding=utf-8
  26. "set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
  27. "set formatoptions+=j " Delete comment characters when joining lines.
  28. "setglobal tags-=./tags tags-=./tags; tags^=./tags;
  29. "set shell=/bin/bash
  30. "set autoread " When a change is detected, auto reload the file
  31. "set history=1000
  32. "set tabpagemax=50
  33. "set viminfo^=!
  34. "set sessionoptions-=options
  35. "set t_Co=16
  36. "runtime! macros/matchit.vim
  37. "inoremap <C-U> <C-G>u<C-U>
  38. " Use Syntastic https://github.com/vim-syntastic/syntastic
  39. " for syntax checks.
  40. let g:syntastic_javascript_checkers = ['standard']
  41. " JavaScript
  42. " Check syntax on write and fix formatting.
  43. autocmd bufwritepost *.js silent !standard --fix %
  44. " use , as map leader.
  45. let mapleader=","
  46. let g:mapleader=","
  47. " quick save with ,w
  48. nmap <leader>w :w!<cr>
  49. set cmdheight=2
  50. set hid
  51. set whichwrap+=<,>,h,l
  52. """""""""""
  53. " Searching
  54. """""""""""
  55. set hlsearch
  56. " ignore case when searching.
  57. set smartcase
  58. set lazyredraw
  59. set magic
  60. set showmatch
  61. set mat=2
  62. set noerrorbells
  63. set novisualbell
  64. set t_vb=
  65. set tm=500
  66. try
  67. colorscheme desert
  68. catch
  69. endtry
  70. set background=dark
  71. set ffs=unix,dos,mac
  72. set nobackup
  73. set nowb
  74. set noswapfile
  75. set expandtab
  76. set shiftwidth=4
  77. set tabstop=4
  78. set lbr
  79. set tw=500
  80. set smartindent
  81. set wrap
  82. "map <silent> <leader><cr> :noh<cr>
  83. map <leader>l :bnext<cr>
  84. map <leader>h :bprev<cr>
  85. map <leader>tn :tabnew<cr>
  86. map <leader>to :tabonly<cr>
  87. map <leader>tc :tabclose<cr>
  88. map <leader>tm :tabmove
  89. map <leader>t<leader> :tabnext<cr>
  90. set statusline=\ %F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l\ \ Column:\ %c
  91. map 0 ^