Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.18 KB | None | 0 0
  1. " ConEmu fix for 256 colors in Vim
  2. " and remaps for fixing Windows Vim's weird
  3. " Backspace behavior
  4. if !empty($CONEMUBUILD)
  5. set termencoding=utf8
  6. set encoding=utf8
  7. set term=xterm
  8. set t_Co=256
  9. let &t_AB="\e[48;5;%dm"
  10. let &t_AF="\e[38;5;%dm"
  11. inoremap <Char-0x07F> <BS>
  12. nnoremap <Char-0x07F> <BS>
  13. endif
  14.  
  15. set nocompatible " Required for Vim to be iMproved, turn off for vi-like usage
  16. set ignorecase " Ignores case in search
  17. set smarttab " Improves tabbing
  18. set autoindent " New lines will be indented as well
  19. set noshowmode " Disable showmode since Airline shows modes
  20. set foldmethod=syntax " Set foldmethod for programming
  21. set shiftwidth=4 " Assits code formatting
  22. set laststatus=2 " Set Lightline to appear always
  23. set backspace=2 " Make backspace work like most other apps
  24. set tabstop=4 " Sets tab to 4 instead of vim's crazy 8
  25. set nohlsearch " Disable search highlight
  26. set ttimeoutlen=0 " Solves delay issue when hitting <esc>
  27. filetype plugin indent on " Sets on filetype (Also from plugins)
  28. syntax on " Sets on syntax highlighting
  29.  
  30. " Plug Manager
  31. call plug#begin('C:/Users/GVW/vimfiles/plugged')
  32. Plug 'ctrlpvim/ctrlp.vim' " CtrlP
  33. Plug 'scrooloose/nerdtree' " NERDTree
  34. Plug 'godlygeek/tabular' " Tabular
  35. Plug 'tyrannicaltoucan/vim-deep-space' " Deep-Space Colorscheme
  36. Plug 'tpope/vim-markdown' " Markdown for VIM
  37. Plug 'itchyny/lightline.vim' " Lightline
  38. Plug 'davidhalter/jedi-vim' " Jedi for Python
  39. Plug 'mattn/webapi-vim' | Plug 'mattn/gist-vim' " Gist for Vim + WebAPI
  40. Plug 'freitass/todo.txt-vim' " Vim Todo.txt
  41. Plug 'tpope/vim-surround' " Vim-Surround
  42. Plug 'tpope/vim-repeat' " Repeat plugins actions with dot
  43. Plug 'ervandew/supertab' " Supertab (tab completions)
  44. Plug 'sirver/ultisnips' " UltiSnips
  45. Plug 'raimondi/delimitmate' " Delimitmate for quote completion
  46. Plug 'flazz/vim-colorschemes' " Colorschemes
  47. call plug#end()
  48.  
  49. " Set deep-space colorscheme
  50. colo deep-space
  51.  
  52. " SuperTab
  53. let g:SuperTabDefaultCompletionType = '<C-n>'
  54.  
  55. " UltiSnips
  56. let g:UltiSnipsEditSplit = 'horizontal'
  57. let g:UltiSnipsSnippetDirectories=["C:/Users/GVW/vimfiles/vim-snippets/"]
  58. let g:UltiSnipsUsePythonVersion = 3
  59.  
  60. " Gist
  61. let g:gist_use_password_in_gitconfig = 1
  62.  
  63. " CtrlP
  64. let g:ctrlp_cmd = 'CtrlPBuffer'
  65. let g:ctrlp_by_filename = 1
  66. let g:ctrlp_working_path_mode = 'r'
  67. let g:ctrlp_custom_ignore = {
  68. \ 'dir': '\v[\/](\.(git|hg|svn)|\_site)$',
  69. \ 'file': '\v\.(exe|so|dll|class|png|jpg|jpeg)$',
  70. \}
  71.  
  72. " Lightline
  73. let g:lightline = {
  74. \ 'colorscheme': 'wombat',
  75. \ 'mode_map': {
  76. \ 'n' : 'N',
  77. \ 'i' : 'I',
  78. \ 'R' : 'R',
  79. \ 'v' : 'V',
  80. \ 'V' : 'VL',
  81. \ "\<C-v>": 'VB',
  82. \ 'c' : 'C',
  83. \ 's' : 'S',
  84. \ 'S' : 'SL',
  85. \ "\<C-s>": 'SB',
  86. \ 't': 'TERM',
  87. \ },
  88. \ 'active': {
  89. \ 'left': [['mode', 'paste'], ['filename'], ['ctrlpmark']],
  90. \ 'right': []
  91. \ },
  92. \ 'component_function': {
  93. \ 'readonly': 'LightlineReadonly',
  94. \ 'filename': 'LightlineFilename',
  95. \ 'ctrlpmark': 'CtrlPMark',
  96. \ 'mode': 'LightlineMode',
  97. \ },
  98. \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" },
  99. \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }
  100. \ }
  101.  
  102. function! LightlineFilename()
  103. let fname = expand('%:t')
  104. return fname == 'ControlP' && has_key(g:lightline, 'ctrlp_item') ? g:lightline.ctrlp_item :
  105. \ ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
  106. \ ('' != fname ? fname : '[No Name]') .
  107. \ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
  108. endfunction
  109.  
  110. function! LightlineMode()
  111. let fname = expand('%:t')
  112. return fname == 'ControlP' ? 'CtrlP' :
  113. \ fname =~ 'NERD_tree' ? 'NERDTree' :
  114. \ winwidth(0) > 60 ? lightline#mode() : ''
  115. endfunction
  116.  
  117. function! LightlineModified()
  118. return &ft =~ 'help' ? '' : &modified ? '+' : &modifiable ? '' : '-'
  119. endfunction
  120.  
  121. function! LightlineReadonly()
  122. return &ft !~? 'help' && &readonly ? "\ue0a2" : ''
  123. endfunction
  124.  
  125. function! CtrlPMark()
  126. if expand('%:t') =~ 'ControlP' && has_key(g:lightline, 'ctrlp_item')
  127. call lightline#link('iR'[g:lightline.ctrlp_regex])
  128. return lightline#concatenate([g:lightline.ctrlp_prev, g:lightline.ctrlp_item
  129. \ , g:lightline.ctrlp_next], 0)
  130. else
  131. return ''
  132. endif
  133. endfunction
  134.  
  135. let g:ctrlp_status_func = {
  136. \ 'main': 'CtrlPStatusFunc_1',
  137. \ 'prog': 'CtrlPStatusFunc_2',
  138. \ }
  139.  
  140. function! CtrlPStatusFunc_1(focus, byfname, regex, prev, item, next, marked)
  141. let g:lightline.ctrlp_regex = a:regex
  142. let g:lightline.ctrlp_prev = a:prev
  143. let g:lightline.ctrlp_item = a:item
  144. let g:lightline.ctrlp_next = a:next
  145. return lightline#statusline(0)
  146. endfunction
  147.  
  148. function! CtrlPStatusFunc_2(str)
  149. return lightline#statusline(0)
  150. endfunction
  151.  
  152. " Remappings
  153. nnoremap <C-J> <C-W><C-J>
  154. nnoremap <C-K> <C-W><C-K>
  155. nnoremap <C-L> <C-W><C-L>
  156. nnoremap <C-H> <C-W><C-H>
  157. nnoremap <F2> :NERDTreeToggle<CR>
  158. nnoremap <F3> :Tabularize /"<CR>
  159. nnoremap <F5> :so $MYVIMRC<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement