Guest User

Untitled

a guest
Oct 18th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.48 KB | None | 0 0
  1. set encoding=utf-8
  2. set nocompatible " be iMproved
  3. filetype off " required!
  4.  
  5. set rtp+=~/.vim/bundle/vundle/
  6. call vundle#rc()
  7.  
  8. " let Vundle manage Vundle
  9. Bundle 'gmarik/vundle'
  10.  
  11. " Vundle help
  12. """"""""""""""
  13. " :BundleList - list configured bundles
  14. " :BundleInstall(!) - install(update) bundles
  15. " :BundleSearch(!) foo - search(or refresh cache first) for foo
  16. " :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
  17.  
  18.  
  19. " VCS
  20. Bundle 'tpope/vim-fugitive'
  21.  
  22. " System
  23. Bundle 'scrooloose/nerdtree'
  24. Bundle 'vim-scripts/Gist.vim'
  25. Bundle 'majutsushi/tagbar'
  26. Bundle 'mileszs/ack.vim'
  27. Bundle 'scrooloose/nerdcommenter'
  28. Bundle 'tpope/vim-surround'
  29. Bundle 'scrooloose/syntastic'
  30. Bundle 'ervandew/supertab'
  31. Bundle 'Raimondi/delimitMate'
  32. Bundle 'kien/rainbow_parentheses.vim'
  33. Bundle 'sophacles/vim-bundle-sparkup'
  34.  
  35. " Syntaxes and such.
  36. Bundle 'tpope/vim-cucumber'
  37. Bundle 'leshill/vim-json'
  38. Bundle 'tpope/vim-liquid'
  39. Bundle 'rodjek/vim-puppet'
  40. Bundle 'tpope/vim-haml'
  41. Bundle 'kchmck/vim-coffee-script'
  42. Bundle 'plasticboy/vim-markdown'
  43. Bundle 'groenewege/vim-less'
  44. Bundle 'jcf/vim-latex'
  45.  
  46. " Python bundles
  47. "Bundle 'kevinw/pyflakes-vim'
  48. Bundle 'fs111/pydoc.vim'
  49. "Bundle 'vim-scripts/pep8'
  50. Bundle 'atourino/jinja.vim'
  51. Bundle 'vim-scripts/python_match.vim'
  52.  
  53. " Ruby specific
  54. Bundle "vim-ruby/vim-ruby"
  55. Bundle 'tpope/vim-endwise'
  56.  
  57. " Non-github repos
  58. Bundle 'git://git.wincent.com/command-t.git'
  59.  
  60. " Fun, but not useful
  61. Bundle 'altercation/vim-colors-solarized'
  62. Bundle 'skammer/vim-css-color'
  63. Bundle 'mgutz/vim-colors'
  64. Bundle 'ehamberg/vim-cute-python'
  65. Bundle 'tpope/vim-speeddating'
  66. Bundle 'Lokaltog/vim-powerline'
  67.  
  68. filetype plugin indent on " required!
  69.  
  70. " Configurations
  71. """"""""""""""""
  72. if has('gui_running')
  73. set background=light
  74. else
  75. set background=dark
  76. endif
  77.  
  78. " Wildmenu completion
  79. """""""""""""""""""""
  80. set wildmenu
  81. set wildmode=list:longest
  82. set wildignore+=.hg,.git,.svn " Version control
  83. set wildignore+=*.aux,*.out,*.toc " LaTeX intermediate files
  84. set wildignore+=*.jpg,*.bmp,*.gif,*.png,*.jpeg " binary images
  85. set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest " compiled object files
  86. set wildignore+=*.spl " compiled spelling word lists
  87. set wildignore+=*.sw? " Vim swap files
  88. set wildignore+=*.DS_Store " OSX bullshit
  89. set wildignore+=*.luac " Lua byte code
  90. set wildignore+=*.pyc " Python byte code
  91. set wildignore+=**.class " Cursed Java class files
  92.  
  93. " Save when losing focus
  94. set autowriteall " Auto-save files when switching buffers or leaving vim.
  95. au FocusLost * silent! :wa
  96. au TabLeave * silent! :wa
  97.  
  98. " Resize splits when the window is resized
  99. au VimResized * exe "normal! \<c-w>="
  100.  
  101.  
  102. " Colours
  103. colorscheme chance-of-storm
  104.  
  105. " Basic
  106. syntax enable
  107. set number " always show line numbers
  108. set hidden " Allow un-saved buffers in background
  109. set clipboard=unnamed " Share system clipboard.
  110. set backspace=indent,eol,start " Make backspace behave normally.
  111. set directory=/tmp// " swap files
  112. set backupskip=/tmp/*,/private/tmp/*
  113. set ffs=unix,dos,mac "Default file types
  114. set nowrap " don't wrap lines
  115. set showmatch " set show matching parenthesis
  116. set ignorecase " ignore case when searching
  117. set smartcase " ignore case if search pattern is all lowercase,
  118. " case-sensitive otherwise
  119. set hlsearch " highlight search terms
  120. set incsearch " show search matches as you type
  121. set history=1000 " remember more commands and search history
  122. set undolevels=1000 " use many muchos levels of undo
  123. set title " change the terminal's title
  124. set visualbell " don't beep
  125. set noerrorbells " don't beep
  126.  
  127. " Remove the toolbar if we're running under a GUI (e.g. MacVIM).
  128. if has("gui_running")
  129. set guioptions=-t
  130. endif
  131.  
  132. " Special characters for hilighting non-priting spaces/tabs/etc.
  133. set list listchars=tab:โ†’\ ,trail:ยท
  134.  
  135. " Tabs & spaces
  136. set tabstop=2 " a tab is four spaces
  137. set shiftwidth=2 " number of spaces to use for autoindenting
  138. set softtabstop=2
  139. set noexpandtab
  140. set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
  141. set smarttab " insert tabs on the start of a line according to
  142. " shiftwidth, not tabstop
  143. set autoindent " always set autoindenting on
  144. set copyindent " copy the previous indentation on autoindenting
  145.  
  146. " General Code Folding
  147. """"""""""""""""""""""
  148. set foldmethod=indent
  149. set foldlevel=99
  150.  
  151. " Highlight VCS conflict markers
  152. """"""""""""""""""""""""""""""""
  153. match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$'
  154.  
  155. " I CAN HAZ NORMAL REGEXES?
  156. """""""""""""""""""""""""""
  157. nnoremap / /\v
  158. vnoremap / /\v
  159.  
  160.  
  161. " General auto-commands
  162. """""""""""""""""""""""
  163. autocmd FileType * setlocal colorcolumn=0
  164. autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
  165.  
  166. " Get rid of trailing whitespace highlighting in mutt.
  167. autocmd FileType mail highlight clear ExtraWhitespace
  168. autocmd FileType mail setlocal listchars=
  169.  
  170. " Crontab auto-commands
  171. """""""""""""""""""""""
  172. autocmd FileType crontab setlocal backupcopy=yes
  173.  
  174. " Markdown auto-commands
  175. """"""""""""""""""""""""
  176. autocmd FileType markdown setlocal wrap linebreak nolist
  177.  
  178. " Ruby Configurations
  179. """""""""""""""""""""
  180. autocmd filetype ruby set shiftwidth=2 tabstop=2
  181.  
  182. " PHP Configurations
  183. """"""""""""""""""""
  184. autocmd FileType php setlocal colorcolumn=100
  185.  
  186. " Python configurations
  187. """""""""""""""""""""""
  188. au BufNewFile,BufReadPost python setlocal shiftwidth=4 tabstop=4 softtabstop=4 expandtab
  189. autocmd FileType python setlocal colorcolumn=80
  190. autocmd FileType python let g:pep8_map='<F4>'
  191.  
  192. " Coffeescript configurations
  193. """""""""""""""""""""""""""""
  194. au BufNewFile,BufReadPost *.coffee setlocal foldmethod=indent
  195. au BufNewFile,BufReadPost *.coffee setlocal shiftwidth=2 expandtab
  196.  
  197. " Javascript configurations
  198. """""""""""""""""""""""""""
  199. au BufNewFile,BufReadPost *.js setlocal shiftwidth=2 expandtab
  200.  
  201. " Get jinja filetype selection working correctly for *.jinja.html files.
  202. au BufNewFile,BufReadPost *.jinja.html setlocal filetype=htmljinja
  203.  
  204. " Make sure we hilight extra whitespace in the most annoying way possible.
  205. highlight ExtraWhitespace ctermbg=red guibg=red
  206. match ExtraWhitespace /\s\+$/
  207. autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
  208. autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
  209. autocmd InsertLeave * match ExtraWhitespace /\s\+$/
  210.  
  211. " Custom mappings
  212. """"""""""""""""""
  213.  
  214. " Genral
  215. noremap <silent> <F3> :QFix<CR>
  216.  
  217.  
  218. " Change leader
  219. let mapleader = ","
  220. let g:mapleader = ","
  221.  
  222. " Get rid of search hilighting with ,/
  223. nnoremap <silent> <leader>/ :nohlsearch<CR>
  224.  
  225. " Fix those pesky situations where you edit & need sudo to save
  226. cmap w!! w !sudo tee % >/dev/null
  227.  
  228.  
  229. " Plugin configurations
  230. """"""""""""""""""""""""
  231.  
  232. " Gist
  233. let g:gist_clip_command = 'pbcopy'
  234. let g:gist_detect_filetype = 2
  235. let g:gist_show_privates = 1
  236.  
  237. " TaskList
  238. "map <leader>l <Plug>TaskList
  239.  
  240. " TagBar
  241. nnoremap <silent> <F2> :TagbarToggle<CR>
  242. let g:tagbar_ctags_bin = '/usr/local/bin/ctags'
  243. let g:tagbar_autoshowtag = 1
  244.  
  245. " Command-T
  246. nnoremap <Leader>t :CommandT<CR>
  247.  
  248. " NERDTree
  249. nnoremap <Leader>g :NERDTreeToggle<CR>
  250.  
  251. " SnipMate
  252. let g:snippets_dir = "~/.vim/bundle/snipmate-snippets"
  253.  
  254. " Sparkup
  255. let g:sparkupExecuteMapping = '<c-y>'
  256. let g:sparkupNextMapping = '<c-k>'
  257.  
  258. " Double rainbow - What does it mean!?
  259. au VimEnter * RainbowParenthesesToggle
  260. au Syntax * RainbowParenthesesLoadRound
  261. au Syntax * RainbowParenthesesLoadSquare
  262. au Syntax * RainbowParenthesesLoadBraces
  263.  
  264. set laststatus=2
  265. let g:syntastic_enable_signs=1
  266. let g:syntastic_auto_jump=0
Add Comment
Please, Sign In to add comment