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.

252 lines
8.6 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' ] } " 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. set wildignore+=node_modules
  66. " All of your Plugins must be added before the following line
  67. call plug#end() " required
  68. filetype plugin indent on " required
  69. " To ignore plugin indent changes, instead use:
  70. "filetype plugin on
  71. " T H E M E
  72. colorscheme solarized
  73. set background=dark
  74. " S E T T I N G S
  75. set number
  76. set autoread
  77. set colorcolumn=80
  78. set history=1000
  79. " make comments and HTML attributes italic
  80. highlight Comment cterm=italic
  81. highlight htmlArg cterm=italic
  82. set autoindent " automatically set indent of new line
  83. set smartindent
  84. set tabstop=4
  85. set shiftwidth=4
  86. set expandtab
  87. " toggle invisible characters
  88. set list
  89. set listchars=tab:→\ ,eol:¬,trail:⋅,extends:❯,precedes:❮
  90. set showbreak=↪
  91. set ttyfast " faster redrawing
  92. set diffopt+=vertical
  93. set laststatus=2 " show the satus line all the time
  94. set so=7 " set 7 lines to the cursors - when moving vertical
  95. set wildmenu " enhanced command line completion
  96. set hidden " current buffer can be put into background
  97. set showcmd " show incomplete commands
  98. " set noshowmode " don't show which mode disabled for PowerLine
  99. set wildmode=list:longest " complete files like a shell
  100. set scrolloff=3 " lines of text around cursor
  101. set shell=$SHELL
  102. set cmdheight=1 " command bar height
  103. set title " set terminal title
  104. " Uncomment the following to have Vim jump to the last position when
  105. " reopening a file
  106. if has("autocmd")
  107. au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
  108. \| exe "normal! g'\"" | endif
  109. endif
  110. " P L U G I N S
  111. let NERDTreeShowHidden=1
  112. let g:airline_powerline_fonts = 1
  113. let g:syntastic_always_populate_loc_list = 1
  114. let g:syntastic_auto_loc_list = 1
  115. let g:syntastic_check_on_open = 1
  116. let g:syntastic_check_on_wq = 0
  117. let g:syntastic_aggregate_errors = 1
  118. set statusline+=%#warningmsg#
  119. set statusline+=%{SyntasticStatuslineFlag()}
  120. set statusline+=%*
  121. " M A P P I N G S
  122. let mapleader = ","
  123. " CtrlP for Tags
  124. nnoremap <leader><C-p> :CtrlPTag<cr>
  125. " Toggle NERDTree
  126. nmap <silent> <leader>k :NERDTreeToggle<cr>
  127. " expand to the path of the file in the current buffer
  128. nmap <silent> <leader>y :NERDTreeFind<cr>
  129. " Allow saving of files as sudo when I forgot to start vim using sudo.
  130. cmap w!! w !sudo tee > /dev/null %
  131. "Toggle set paste
  132. nmap <leader>tp :set paste!<cr>
  133. " N E O C O M P L E T E
  134. "Note: This option must be set in .vimrc(_vimrc). NOT IN .gvimrc(_gvimrc)!
  135. " Disable AutoComplPop.
  136. let g:acp_enableAtStartup = 0
  137. " Use neocomplete.
  138. let g:neocomplete#enable_at_startup = 1
  139. " Use smartcase.
  140. let g:neocomplete#enable_smart_case = 1
  141. " Set minimum syntax keyword length.
  142. let g:neocomplete#sources#syntax#min_keyword_length = 3
  143. " Define dictionary.
  144. let g:neocomplete#sources#dictionary#dictionaries = {
  145. \ 'default' : '',
  146. \ 'vimshell' : $HOME.'/.vimshell_hist',
  147. \ 'scheme' : $HOME.'/.gosh_completions'
  148. \ }
  149. " Define keyword.
  150. if !exists('g:neocomplete#keyword_patterns')
  151. let g:neocomplete#keyword_patterns = {}
  152. endif
  153. let g:neocomplete#keyword_patterns['default'] = '\h\w*'
  154. " Plugin key-mappings.
  155. inoremap <expr><C-g> neocomplete#undo_completion()
  156. inoremap <expr><C-l> neocomplete#complete_common_string()
  157. " Recommended key-mappings.
  158. " <CR>: close popup and save indent.
  159. inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
  160. function! s:my_cr_function()
  161. return (pumvisible() ? "\<C-y>" : "" ) . "\<CR>"
  162. " For no inserting <CR> key.
  163. "return pumvisible() ? "\<C-y>" : "\<CR>"
  164. endfunction
  165. " <TAB>: completion.
  166. inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
  167. " <C-h>, <BS>: close popup and delete backword char.
  168. inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
  169. inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
  170. " Close popup by <Space>.
  171. "inoremap <expr><Space> pumvisible() ? "\<C-y>" : "\<Space>"
  172. " AutoComplPop like behavior.
  173. "let g:neocomplete#enable_auto_select = 1
  174. " Shell like behavior(not recommended).
  175. "set completeopt+=longest
  176. "let g:neocomplete#enable_auto_select = 1
  177. "let g:neocomplete#disable_auto_complete = 1
  178. "inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<C-x>\<C-u>"
  179. " Enable omni completion.
  180. autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
  181. autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
  182. autocmd FileType javascript setlocal omnifunc=tern#Complete
  183. autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
  184. autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
  185. " Enable heavy omni completion.
  186. if !exists('g:neocomplete#sources#omni#input_patterns')
  187. let g:neocomplete#sources#omni#input_patterns = {}
  188. endif
  189. "let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
  190. "let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
  191. "let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
  192. " For perlomni.vim setting.
  193. " https://github.com/c9s/perlomni.vim
  194. let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
  195. " Plugin key-mappings.
  196. imap <C-k> <Plug>(neosnippet_expand_or_jump)
  197. smap <C-k> <Plug>(neosnippet_expand_or_jump)
  198. xmap <C-k> <Plug>(neosnippet_expand_target)
  199. " SuperTab like snippets behavior.
  200. "imap <expr><TAB>
  201. " \ pumvisible() ? "\<C-n>" :
  202. " \ neosnippet#expandable_or_jumpable() ?
  203. " \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
  204. smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
  205. \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
  206. " For conceal markers.
  207. if has('conceal')
  208. set conceallevel=2 concealcursor=niv
  209. endif
  210. let g:neosnippet#snippets_directory = '~/.dotfiles/vim/neosnippets'