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.

186 lines
6.5 KiB

8 years ago
8 years ago
8 years ago
8 years ago
  1. set nocompatible " be iMproved, required
  2. filetype off " required
  3. " set the runtime path to include Vundle and initialize
  4. set rtp+=~/.vim/bundle/Vundle.vim
  5. call vundle#begin()
  6. " alternatively, pass a path where Vundle should install plugins
  7. "call vundle#begin('~/some/path/here')
  8. " let Vundle manage Vundle, required
  9. Plugin 'VundleVim/Vundle.vim'
  10. " The following are examples of different formats supported.
  11. " Keep Plugin commands between vundle#begin/end.
  12. " plugin on GitHub repo
  13. Plugin 'tpope/vim-fugitive'
  14. " plugin from http://vim-scripts.org/vim/scripts.html
  15. Plugin 'L9'
  16. " Git plugin not hosted on GitHub
  17. Plugin 'tpope/vim-sensible'
  18. Plugin 'scrooloose/nerdtree'
  19. Plugin 'Xuyuanp/nerdtree-git-plugin'
  20. Plugin 'kien/ctrlp.vim'
  21. Plugin 'scrooloose/nerdcommenter'
  22. "Plugin 'myusuf3/numbers.vim'
  23. Plugin 'Shougo/neocomplete.vim'
  24. Plugin 'Shougo/neosnippet.vim'
  25. Plugin 'easymotion/vim-easymotion'
  26. Plugin 'bling/vim-airline'
  27. Plugin 'tpope/vim-ragtag'
  28. " html / templates
  29. Plugin 'mattn/emmet-vim', { 'for': 'html' } " emmet support for vim - easily create markdup wth CSS-like syntax
  30. Plugin 'gregsexton/MatchTag', { 'for': 'html' } " match tags in html, similar to paren support
  31. Plugin 'othree/html5.vim', { 'for': 'html' } " html5 support
  32. " JavaScript
  33. Plugin 'gavocanov/vim-js-indent', { 'for': 'javascript' } " JavaScript indent support
  34. Plugin 'moll/vim-node', { 'for': 'javascript' } " node support
  35. Plugin 'othree/yajs.vim', { 'for': 'javascript' } " JavaScript syntax plugin
  36. Plugin 'othree/es.next.syntax.vim', { 'for': 'javascript' } " ES6 and beyond syntax
  37. " Go
  38. Plugin 'fatih/vim-go', { 'for': 'go' } " go support
  39. " All of your Plugins must be added before the following line
  40. call vundle#end() " required
  41. filetype plugin indent on " required
  42. " To ignore plugin indent changes, instead use:
  43. "filetype plugin on
  44. "
  45. " Brief help
  46. " :PluginList - lists configured plugins
  47. " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
  48. " :PluginSearch foo - searches for foo; append `!` to refresh local cache
  49. " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
  50. "
  51. " see :h vundle for more details or wiki for FAQ
  52. " Put your non-Plugin stuff after this line
  53. " S E T T I N G S
  54. set number
  55. set autoread
  56. set history=1000
  57. " make comments and HTML attributes italic
  58. highlight Comment cterm=italic
  59. highlight htmlArg cterm=italic
  60. set autoindent " automatically set indent of new line
  61. set smartindent
  62. set tabstop=4
  63. set shiftwidth=4
  64. " toggle invisible characters
  65. set list
  66. set listchars=tab:→\ ,eol,trail:⋅,extends:❯,precedes:❮
  67. set showbreak=
  68. set ttyfast " faster redrawing
  69. set diffopt+=vertical
  70. set laststatus=2 " show the satus line all the time
  71. set so=7 " set 7 lines to the cursors - when moving vertical
  72. set wildmenu " enhanced command line completion
  73. set hidden " current buffer can be put into background
  74. set showcmd " show incomplete commands
  75. " set noshowmode " don't show which mode disabled for PowerLine
  76. set wildmode=list:longest " complete files like a shell
  77. set scrolloff=3 " lines of text around cursor
  78. set shell=$SHELL
  79. set cmdheight=1 " command bar height
  80. set title " set terminal title
  81. " Uncomment the following to have Vim jump to the last position when
  82. " reopening a file
  83. if has("autocmd")
  84. au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
  85. \| exe "normal! g'\"" | endif
  86. endif
  87. let NERDTreeShowHidden=1
  88. " M A P P I N G S
  89. let mapleader = ","
  90. " Toggle NERDTree
  91. nmap <silent> <leader>k :NERDTreeToggle<cr>
  92. " expand to the path of the file in the current buffer
  93. nmap <silent> <leader>y :NERDTreeFind<cr>
  94. " Allow saving of files as sudo when I forgot to start vim using sudo.
  95. cmap w!! w !sudo tee > /dev/null %
  96. " N E O C O M P L E T E
  97. "Note: This option must be set in .vimrc(_vimrc). NOT IN .gvimrc(_gvimrc)!
  98. " Disable AutoComplPop.
  99. let g:acp_enableAtStartup = 0
  100. " Use neocomplete.
  101. let g:neocomplete#enable_at_startup = 1
  102. " Use smartcase.
  103. let g:neocomplete#enable_smart_case = 1
  104. " Set minimum syntax keyword length.
  105. let g:neocomplete#sources#syntax#min_keyword_length = 3
  106. " Define dictionary.
  107. let g:neocomplete#sources#dictionary#dictionaries = {
  108. \ 'default' : '',
  109. \ 'vimshell' : $HOME.'/.vimshell_hist',
  110. \ 'scheme' : $HOME.'/.gosh_completions'
  111. \ }
  112. " Define keyword.
  113. if !exists('g:neocomplete#keyword_patterns')
  114. let g:neocomplete#keyword_patterns = {}
  115. endif
  116. let g:neocomplete#keyword_patterns['default'] = '\h\w*'
  117. " Plugin key-mappings.
  118. inoremap <expr><C-g> neocomplete#undo_completion()
  119. inoremap <expr><C-l> neocomplete#complete_common_string()
  120. " Recommended key-mappings.
  121. " <CR>: close popup and save indent.
  122. inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
  123. function! s:my_cr_function()
  124. return (pumvisible() ? "\<C-y>" : "" ) . "\<CR>"
  125. " For no inserting <CR> key.
  126. "return pumvisible() ? "\<C-y>" : "\<CR>"
  127. endfunction
  128. " <TAB>: completion.
  129. inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
  130. " <C-h>, <BS>: close popup and delete backword char.
  131. inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
  132. inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
  133. " Close popup by <Space>.
  134. "inoremap <expr><Space> pumvisible() ? "\<C-y>" : "\<Space>"
  135. " AutoComplPop like behavior.
  136. "let g:neocomplete#enable_auto_select = 1
  137. " Shell like behavior(not recommended).
  138. "set completeopt+=longest
  139. "let g:neocomplete#enable_auto_select = 1
  140. "let g:neocomplete#disable_auto_complete = 1
  141. "inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<C-x>\<C-u>"
  142. " Enable omni completion.
  143. autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
  144. autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
  145. autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
  146. autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
  147. autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
  148. " Enable heavy omni completion.
  149. if !exists('g:neocomplete#sources#omni#input_patterns')
  150. let g:neocomplete#sources#omni#input_patterns = {}
  151. endif
  152. "let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
  153. "let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
  154. "let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
  155. " For perlomni.vim setting.
  156. " https://github.com/c9s/perlomni.vim
  157. let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::'