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.

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