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.

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