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.

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