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.

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