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.

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