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.

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