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.

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