All of my important config files
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

233 lines
7.7 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. set nocompatible " be iMproved, required
  2. filetype off " required
  3. " Load vim-plug
  4. if empty(glob("~/.vim/autoload/plug.vim"))
  5. execute '!curl -fLo ~/.vim/autoload/plug.vim https://raw.github.com/junegunn/vim-plug/master/plug.vim'
  6. endif
  7. call plug#begin()
  8. " alternatively, pass a path where Vundle should install plugins
  9. "call vundle#begin('~/some/path/here')
  10. " let Vundle manage Vundle, required
  11. Plug 'VundleVim/Vundle.vim'
  12. " The following are examples of different formats supported.
  13. " Keep Plugin commands between vundle#begin/end.
  14. " plugin on GitHub repo
  15. Plug 'tpope/vim-fugitive'
  16. " plugin from http://vim-scripts.org/vim/scripts.html
  17. Plug 'L9'
  18. " Git plugin not hosted on GitHub
  19. Plug 'tpope/vim-sensible'
  20. Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
  21. Plug 'Xuyuanp/nerdtree-git-plugin', { 'on': 'NERDTreeToggle' }
  22. Plug 'kien/ctrlp.vim'
  23. Plug 'scrooloose/nerdcommenter'
  24. "Plug 'myusuf3/numbers.vim'
  25. Plug 'Shougo/neocomplete.vim'
  26. Plug 'Shougo/neosnippet.vim'
  27. Plug 'Shougo/neosnippet-snippets'
  28. Plug 'easymotion/vim-easymotion'
  29. Plug 'bling/vim-airline'
  30. Plug 'tpope/vim-ragtag'
  31. Plug 'surround.vim'
  32. Plug 'tpope/vim-repeat'
  33. Plug 'vim-syntastic/syntastic'
  34. " html / templates
  35. Plug 'mattn/emmet-vim', { 'for': ['html', 'php', 'gohtmltmpl'] } " emmet support for vim - easily create markdup wth CSS-like syntax
  36. Plug 'gregsexton/MatchTag', { 'for': ['html', 'php', 'gohtmltmpl'] } " match tags in html, similar to paren support
  37. Plug 'othree/html5.vim', { 'for': ['html', 'php', 'gohtmltmpl'] } " html5 support
  38. " JavaScript
  39. Plug 'gavocanov/vim-js-indent', { 'for': 'javascript' } " JavaScript indent support
  40. Plug 'moll/vim-node', { 'for': 'javascript' } " node support
  41. Plug 'othree/yajs.vim', { 'for': 'javascript' } " JavaScript syntax plugin
  42. Plug 'othree/es.next.syntax.vim', { 'for': 'javascript' } " ES6 and beyond syntax
  43. " Go
  44. Plug 'fatih/vim-go', { 'for': [ 'go', 'html', 'gohtmltmpl' ] } " go support
  45. " LaTeX
  46. Plug 'LaTeX-Box-Team/LaTeX-Box', { 'for': 'tex' }
  47. " Markdown
  48. Plug 'suan/vim-instant-markdown', { 'for': 'markdown' }
  49. Plug 'tpope/vim-markdown', { 'for': 'markdown'}
  50. " Colorschemes
  51. Plug 'altercation/vim-colors-solarized'
  52. " All of your Plugins must be added before the following line
  53. call plug#end() " required
  54. filetype plugin indent on " required
  55. " To ignore plugin indent changes, instead use:
  56. "filetype plugin on
  57. " T H E M E
  58. colorscheme solarized
  59. set background=dark
  60. " S E T T I N G S
  61. set number
  62. set autoread
  63. set history=1000
  64. " make comments and HTML attributes italic
  65. highlight Comment cterm=italic
  66. highlight htmlArg cterm=italic
  67. set autoindent " automatically set indent of new line
  68. set smartindent
  69. set tabstop=4
  70. set shiftwidth=4
  71. set expandtab
  72. " toggle invisible characters
  73. set list
  74. set listchars=tab:→\ ,eol:¬,trail:⋅,extends:❯,precedes:❮
  75. set showbreak=↪
  76. set ttyfast " faster redrawing
  77. set diffopt+=vertical
  78. set laststatus=2 " show the satus line all the time
  79. set so=7 " set 7 lines to the cursors - when moving vertical
  80. set wildmenu " enhanced command line completion
  81. set hidden " current buffer can be put into background
  82. set showcmd " show incomplete commands
  83. " set noshowmode " don't show which mode disabled for PowerLine
  84. set wildmode=list:longest " complete files like a shell
  85. set scrolloff=3 " lines of text around cursor
  86. set shell=$SHELL
  87. set cmdheight=1 " command bar height
  88. set title " set terminal title
  89. " Uncomment the following to have Vim jump to the last position when
  90. " reopening a file
  91. if has("autocmd")
  92. au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
  93. \| exe "normal! g'\"" | endif
  94. endif
  95. " P L U G I N S
  96. let NERDTreeShowHidden=1
  97. let g:airline_powerline_fonts = 1
  98. let g:syntastic_always_populate_loc_list = 1
  99. let g:syntastic_auto_loc_list = 1
  100. let g:syntastic_check_on_open = 1
  101. let g:syntastic_check_on_wq = 0
  102. let g:syntastic_aggregate_errors = 1
  103. set statusline+=%#warningmsg#
  104. set statusline+=%{SyntasticStatuslineFlag()}
  105. set statusline+=%*
  106. " M A P P I N G S
  107. let mapleader = ","
  108. " CtrlP for Tags
  109. nnoremap <leader><C-p> :CtrlPTag<cr>
  110. " Toggle NERDTree
  111. nmap <silent> <leader>k :NERDTreeToggle<cr>
  112. " expand to the path of the file in the current buffer
  113. nmap <silent> <leader>y :NERDTreeFind<cr>
  114. " Allow saving of files as sudo when I forgot to start vim using sudo.
  115. cmap w!! w !sudo tee > /dev/null %
  116. "Toggle set paste
  117. nmap <leader>tp :set paste!<cr>
  118. " N E O C O M P L E T E
  119. "Note: This option must be set in .vimrc(_vimrc). NOT IN .gvimrc(_gvimrc)!
  120. " Disable AutoComplPop.
  121. let g:acp_enableAtStartup = 0
  122. " Use neocomplete.
  123. let g:neocomplete#enable_at_startup = 1
  124. " Use smartcase.
  125. let g:neocomplete#enable_smart_case = 1
  126. " Set minimum syntax keyword length.
  127. let g:neocomplete#sources#syntax#min_keyword_length = 3
  128. " Define dictionary.
  129. let g:neocomplete#sources#dictionary#dictionaries = {
  130. \ 'default' : '',
  131. \ 'vimshell' : $HOME.'/.vimshell_hist',
  132. \ 'scheme' : $HOME.'/.gosh_completions'
  133. \ }
  134. " Define keyword.
  135. if !exists('g:neocomplete#keyword_patterns')
  136. let g:neocomplete#keyword_patterns = {}
  137. endif
  138. let g:neocomplete#keyword_patterns['default'] = '\h\w*'
  139. " Plugin key-mappings.
  140. inoremap <expr><C-g> neocomplete#undo_completion()
  141. inoremap <expr><C-l> neocomplete#complete_common_string()
  142. " Recommended key-mappings.
  143. " <CR>: close popup and save indent.
  144. inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
  145. function! s:my_cr_function()
  146. return (pumvisible() ? "\<C-y>" : "" ) . "\<CR>"
  147. " For no inserting <CR> key.
  148. "return pumvisible() ? "\<C-y>" : "\<CR>"
  149. endfunction
  150. " <TAB>: completion.
  151. inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
  152. " <C-h>, <BS>: close popup and delete backword char.
  153. inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
  154. inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
  155. " Close popup by <Space>.
  156. "inoremap <expr><Space> pumvisible() ? "\<C-y>" : "\<Space>"
  157. " AutoComplPop like behavior.
  158. "let g:neocomplete#enable_auto_select = 1
  159. " Shell like behavior(not recommended).
  160. "set completeopt+=longest
  161. "let g:neocomplete#enable_auto_select = 1
  162. "let g:neocomplete#disable_auto_complete = 1
  163. "inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<C-x>\<C-u>"
  164. " Enable omni completion.
  165. autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
  166. autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
  167. autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
  168. autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
  169. autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
  170. " Enable heavy omni completion.
  171. if !exists('g:neocomplete#sources#omni#input_patterns')
  172. let g:neocomplete#sources#omni#input_patterns = {}
  173. endif
  174. "let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
  175. "let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
  176. "let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
  177. " For perlomni.vim setting.
  178. " https://github.com/c9s/perlomni.vim
  179. let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
  180. " Plugin key-mappings.
  181. imap <C-k> <Plug>(neosnippet_expand_or_jump)
  182. smap <C-k> <Plug>(neosnippet_expand_or_jump)
  183. xmap <C-k> <Plug>(neosnippet_expand_target)
  184. " SuperTab like snippets behavior.
  185. "imap <expr><TAB>
  186. " \ pumvisible() ? "\<C-n>" :
  187. " \ neosnippet#expandable_or_jumpable() ?
  188. " \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
  189. smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
  190. \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
  191. " For conceal markers.
  192. if has('conceal')
  193. set conceallevel=2 concealcursor=niv
  194. endif
  195. let g:neosnippet#snippets_directory = '~/.dotfiles/vim/neosnippets'