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.

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