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.

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