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.

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