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.

256 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
  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. "Plug 'posva/vim-vue'
  48. " Go
  49. Plug 'fatih/vim-go', { 'for': [ 'go', 'html', 'gohtmltmpl' ], 'do': ':GoInstallBinaries' } " go support
  50. " LaTeX
  51. Plug 'LaTeX-Box-Team/LaTeX-Box', { 'for': 'tex' }
  52. " Markdown
  53. Plug 'suan/vim-instant-markdown', { 'for': 'markdown' }
  54. Plug 'tpope/vim-markdown', { 'for': 'markdown'}
  55. " Colorschemes
  56. Plug 'altercation/vim-colors-solarized'
  57. " TOML
  58. Plug 'cespare/vim-toml', { 'for': 'toml' }
  59. " Haskell
  60. Plug 'bitc/vim-hdevtools', { 'for': 'haskell' }
  61. Plug 'nbouscal/vim-stylish-haskell', { 'for': 'haskell' }
  62. " C/C++
  63. Plug 'Rip-Rip/clang_complete', { 'for': ['c', 'cpp'], 'do': 'make install' }
  64. let g:clang_library_path='/usr/lib/llvm-4.0/lib/libclang-4.0.so.1'
  65. " C#
  66. Plug 'OmniSharp/omnisharp-vim', { 'for': 'cs' }
  67. let g:OmniSharp_server_type = 'roslyn'
  68. set wildignore+=node_modules
  69. " All of your Plugins must be added before the following line
  70. call plug#end() " required
  71. filetype plugin indent on " required
  72. " To ignore plugin indent changes, instead use:
  73. "filetype plugin on
  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. " Uncomment the following to have Vim jump to the last position when
  108. " reopening a file
  109. if has("autocmd")
  110. au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
  111. \| exe "normal! g'\"" | endif
  112. endif
  113. " P L U G I N S
  114. let NERDTreeShowHidden=1
  115. let g:airline_powerline_fonts = 1
  116. let g:syntastic_always_populate_loc_list = 1
  117. let g:syntastic_auto_loc_list = 1
  118. let g:syntastic_check_on_open = 1
  119. let g:syntastic_check_on_wq = 0
  120. let g:syntastic_aggregate_errors = 1
  121. set statusline+=%#warningmsg#
  122. set statusline+=%{SyntasticStatuslineFlag()}
  123. set statusline+=%*
  124. " M A P P I N G S
  125. let mapleader = ","
  126. " CtrlP for Tags
  127. nnoremap <leader><C-p> :CtrlPTag<cr>
  128. " Toggle NERDTree
  129. nmap <silent> <leader>k :NERDTreeToggle<cr>
  130. " expand to the path of the file in the current buffer
  131. nmap <silent> <leader>y :NERDTreeFind<cr>
  132. " Allow saving of files as sudo when I forgot to start vim using sudo.
  133. cmap w!! w !sudo tee > /dev/null %
  134. "Toggle set paste
  135. nmap <leader>tp :set paste!<cr>
  136. " N E O C O M P L E T E
  137. "Note: This option must be set in .vimrc(_vimrc). NOT IN .gvimrc(_gvimrc)!
  138. " Disable AutoComplPop.
  139. let g:acp_enableAtStartup = 0
  140. " Use neocomplete.
  141. let g:neocomplete#enable_at_startup = 1
  142. " Use smartcase.
  143. let g:neocomplete#enable_smart_case = 1
  144. " Set minimum syntax keyword length.
  145. let g:neocomplete#sources#syntax#min_keyword_length = 3
  146. " Define dictionary.
  147. let g:neocomplete#sources#dictionary#dictionaries = {
  148. \ 'default' : '',
  149. \ 'vimshell' : $HOME.'/.vimshell_hist',
  150. \ 'scheme' : $HOME.'/.gosh_completions'
  151. \ }
  152. " Define keyword.
  153. if !exists('g:neocomplete#keyword_patterns')
  154. let g:neocomplete#keyword_patterns = {}
  155. endif
  156. let g:neocomplete#keyword_patterns['default'] = '\h\w*'
  157. " Plugin key-mappings.
  158. inoremap <expr><C-g> neocomplete#undo_completion()
  159. inoremap <expr><C-l> neocomplete#complete_common_string()
  160. " Recommended key-mappings.
  161. " <CR>: close popup and save indent.
  162. inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
  163. function! s:my_cr_function()
  164. return (pumvisible() ? "\<C-y>" : "" ) . "\<CR>"
  165. " For no inserting <CR> key.
  166. "return pumvisible() ? "\<C-y>" : "\<CR>"
  167. endfunction
  168. " <TAB>: completion.
  169. inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
  170. " <C-h>, <BS>: close popup and delete backword char.
  171. inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
  172. inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
  173. " Close popup by <Space>.
  174. "inoremap <expr><Space> pumvisible() ? "\<C-y>" : "\<Space>"
  175. " AutoComplPop like behavior.
  176. "let g:neocomplete#enable_auto_select = 1
  177. " Shell like behavior(not recommended).
  178. "set completeopt+=longest
  179. "let g:neocomplete#enable_auto_select = 1
  180. "let g:neocomplete#disable_auto_complete = 1
  181. "inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<C-x>\<C-u>"
  182. " Enable omni completion.
  183. autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
  184. autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
  185. autocmd FileType javascript setlocal omnifunc=tern#Complete
  186. autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
  187. autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
  188. " Enable heavy omni completion.
  189. if !exists('g:neocomplete#sources#omni#input_patterns')
  190. let g:neocomplete#sources#omni#input_patterns = {}
  191. endif
  192. "let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
  193. "let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
  194. "let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
  195. " For perlomni.vim setting.
  196. " https://github.com/c9s/perlomni.vim
  197. let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
  198. " Plugin key-mappings.
  199. imap <C-k> <Plug>(neosnippet_expand_or_jump)
  200. smap <C-k> <Plug>(neosnippet_expand_or_jump)
  201. xmap <C-k> <Plug>(neosnippet_expand_target)
  202. " SuperTab like snippets behavior.
  203. "imap <expr><TAB>
  204. " \ pumvisible() ? "\<C-n>" :
  205. " \ neosnippet#expandable_or_jumpable() ?
  206. " \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
  207. smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
  208. \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
  209. " For conceal markers.
  210. if has('conceal')
  211. set conceallevel=2 concealcursor=niv
  212. endif
  213. let g:neosnippet#snippets_directory = '~/.dotfiles/vim/neosnippets'