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.

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