Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.70 KB | None | 0 0
  1. set nocompatible " be iMproved, required
  2. filetype off " required
  3.  
  4. " set the runtime path to include Vundle and initialize
  5. set rtp+=~/.vim/bundle/Vundle.vim
  6. call vundle#begin()
  7.  
  8. " let Vundle manage Vundle, required
  9. Plugin 'VundleVim/Vundle.vim'
  10.  
  11. Plugin 'FuzzyFinder'
  12. Plugin 'L9'
  13. Plugin 'Raimondi/delimitMate'
  14. Plugin 'Valloric/YouCompleteMe'
  15. Plugin 'airblade/vim-gitgutter'
  16. Plugin 'amiorin/vim-project'
  17. Plugin 'christoomey/vim-tmux-navigator'
  18. Plugin 'ctrlpvim/ctrlp.vim'
  19. Plugin 'itchyny/lightline.vim'
  20. Plugin 'jelera/vim-javascript-syntax'
  21. Plugin 'jiangmiao/auto-pairs'
  22. Plugin 'jlanzarotta/bufexplorer'
  23. Plugin 'kristijanhusak/vim-hybrid-material'
  24. Plugin 'mxw/vim-jsx'
  25. Plugin 'nathanaelkane/vim-indent-guides'
  26. Plugin 'nelstrom/vim-markdown-preview'
  27. Plugin 'pangloss/vim-javascript'
  28. Plugin 'posva/vim-vue'
  29. Plugin 'scrooloose/nerdtree'
  30. Plugin 'scrooloose/syntastic'
  31. Plugin 'terryma/vim-multiple-cursors'
  32. Plugin 'tomtom/tcomment_vim'
  33. Plugin 'tpope/vim-fugitive'
  34. Plugin 'tpope/vim-sensible'
  35. Plugin 'tpope/vim-sleuth'
  36. Plugin 'whatyouhide/vim-gotham'
  37. Plugin 'mtscout6/syntastic-local-eslint.vim'
  38. Plugin 'sbdchd/neoformat'
  39. Plugin 'tpope/vim-surround.git'
  40. Plugin 'tpope/vim-repeat.git'
  41. Plugin 'heavenshell/vim-jsdoc'
  42. Plugin 'gabesoft/vim-ags'
  43. Plugin 'tmhedberg/matchit'
  44. Plugin 'ryanoasis/vim-devicons'
  45. Plugin 'tiagofumo/vim-nerdtree-syntax-highlight'
  46. Plugin 'terryma/vim-expand-region'
  47. Plugin 'svermeulen/vim-easyclip'
  48. Plugin 'easymotion/vim-easymotion'
  49. Plugin 'lepture/vim-jinja'
  50. Plugin 'haya14busa/incsearch.vim'
  51.  
  52. " All of your Plugins must be added before the following line
  53. call vundle#end() " required
  54. filetype plugin indent on " required
  55.  
  56. " Open .vimrc
  57. nnoremap <leader>v :tabedit $MYVIMRC<cr>
  58.  
  59. set shell=/bin/zsh
  60. set background=dark
  61. set guifont=FuraMonoForPowerline\ Nerd\ Font:h13
  62. set linespace=6
  63. colorscheme gotham
  64.  
  65. set macmeta
  66. set t_CO=256
  67. set autoindent
  68. set autoread
  69. set autowrite " Save on buffer switch
  70. set autowriteall " Save *all* buffers on switch
  71. set clipboard=unnamed " Use system clipboard for yanking and pasting
  72. set colorcolumn=+1
  73. set cursorline " Highlight the current cursor's line
  74. set noswapfile
  75. set encoding=utf-8
  76. set expandtab " expand tabs to spaces
  77. set guioptions-=T " Removes top toolbar
  78. set guioptions-=e " We don't want Gui tabs.
  79. set guioptions-=l "Disable Gui scrollbars.
  80. set guioptions-=L
  81. set guioptions-=r
  82. set guioptions-=R
  83. set hidden " Disable Vim's error message when switching edited buffers without saving
  84. set hlsearch
  85. set ignorecase
  86. set incsearch
  87. set laststatus=2
  88. set list " show trailing whitespace
  89. set listchars=tab:โ†’\ ,trail:โ–’,nbsp:ยท
  90. set macligatures " We want pretty symbols, when available.
  91. set mouse=a
  92. set noerrorbells " don't beep
  93. set noshowmode
  94. set nowrap
  95. set numberwidth=1 " Show line numbers
  96. set relativenumber " Show relative line numbers in normal mode
  97. set ruler " show where you are
  98. set scrolloff=10 " show context above/below cursorline
  99. set sidescrolloff=15
  100. set sidescroll=1
  101. set shiftwidth=2 " normal mode indentation commands use 2 spaces
  102. set showcmd
  103. set smartcase " case-sensitive search if any caps
  104. set splitbelow
  105. set splitright
  106. set softtabstop=2 " insert mode tab and backspace use 2 spaces
  107. set tabstop=2 " actual tabs occupy 2 characters
  108. set textwidth=80
  109. set timeout timeoutlen=200 ttimeoutlen=100
  110. set visualbell " don't beep
  111. set wildmenu " show a navigable menu for tab completion
  112.  
  113. let g:netrw_liststyle=3
  114. let g:netrw_banner=0
  115.  
  116. " CtrlP
  117. nnoremap <leader>b :CtrlPBuffer<CR>
  118. nnoremap <leader>t :CtrlP<CR>
  119. nnoremap <leader>e :CtrlPMRUFiles<CR>:CtrlP<CR>
  120. nnoremap <leader>T :CtrlPClearCache<CR>:CtrlP<CR>
  121. nmap <D-e> :CtrlPMRUFiles<CR>
  122. map <D-p> :CtrlP<cr>
  123. let g:ctrlp_max_files=0
  124. let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:15,results:15'
  125. let g:ctrlp_custom_ignore = {
  126. \ 'dir': '\.git$\|\.hg$\|dist\|app.min.js|bundle\|node_modules\|bower_components\|purescript\/output'
  127. \ }
  128. let g:ctrlp_buffer_func = { 'enter': 'BrightHighlightOn', 'exit': 'BrightHighlightOff' }
  129.  
  130. function! BrightHighlightOn()
  131. hi CursorLine guibg=#0a1f2d
  132. endfunction
  133.  
  134. function! BrightHighlightOff()
  135. hi CursorLine guibg=#191919
  136. endfunction
  137.  
  138. " The Silver Searcher
  139. if executable('ag')
  140. let g:ags_no_stats = 1
  141.  
  142. " Use ag over grep
  143. set grepprg=ag\ --nogroup\ --nocolor
  144.  
  145. " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
  146. let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
  147.  
  148. " ag is fast enough that CtrlP doesn't need to cache
  149. let g:ctrlp_use_caching = 0
  150. endif
  151.  
  152. " Indent Guidelines
  153. let g:indent_guides_enable_on_vim_startup=1
  154. set ts=2 sw=2 et
  155. "let g:indent_guides_start_level = 1
  156. let g:indent_guides_guide_size = 1
  157. let g:indent_guides_auto_colors = 0
  158. autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=#1d2329 ctermbg=black
  159. autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=#1d2329 ctermbg=darkgrey
  160.  
  161. "JSX
  162. let g:jsx_ext_required = 0
  163.  
  164. " Comment out lines like Sublime and Atom
  165. map <D-/> :TComment<cr>
  166. vmap <D-/> :TComment<cr>gv
  167.  
  168. " Indent lines with cmd+[ and cmd+]
  169. nmap <D-]> >>
  170. nmap <D-[> <<
  171. vmap <D-[> <gv
  172. vmap <D-]> >gv
  173. map <Tab> >
  174. imap <Tab> <Esc> >
  175. vmap <Tab> >gv
  176. map <S-Tab> <
  177. imap <S-Tab> <Esc> <
  178. vmap <S-Tab> <gv
  179.  
  180. " Move lined with option
  181. nnoremap <M-j> :m .+1<CR>==
  182. nnoremap <M-k> :m .-2<CR>==
  183. inoremap <M-j> <Esc>:m .+1<CR>==gi
  184. inoremap <M-k> <Esc>:m .-2<CR>==gi
  185. vnoremap <M-j> :m '>+1<CR>gv=gv
  186. vnoremap <M-k> :m '<-2<CR>gv=gv
  187.  
  188. " Auto-remove trailing spaces
  189. autocmd BufWritePre *.php :%s/\s\+$//e
  190. autocmd BufWritePre *.js :%s/\s\+$//e
  191.  
  192. " When you close a buffer, open a new blank one (good for NERDTree)
  193. map <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>
  194.  
  195. " NERDTree
  196. nmap <leader>d :NERDTreeToggle<cr>
  197. nmap <d>kb :NERDTreeToggle<cr>
  198. autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
  199. autocmd FileType nerdtree setlocal nolist
  200. let g:NERDTreeHijackNetrw=0
  201. let g:NERDTreeAutoDeleteBuffer=1
  202. let g:NERDTreeMinimalUI=1
  203. let g:NERDTreeChDirMode=2
  204. let g:NERDTreeShowBookmarks=1
  205. let g:NERDTreeShowHidden=1
  206. let g:WebDevIconsNerdTreeAfterGlyphPadding = ''
  207.  
  208. " EasyMotion
  209. let g:EasyMotion_smartcase = 1
  210. let g:EasyMotion_startofline = 0 " keep cursor column when JK motion
  211.  
  212. map <Leader>l <Plug>(easymotion-lineforward)
  213. map <Leader>j <Plug>(easymotion-j)
  214. map <Leader>k <Plug>(easymotion-k)
  215. map <Leader>h <Plug>(easymotion-linebackward)
  216.  
  217. " IncSearch
  218. map / <Plug>(incsearch-forward)
  219. map ? <Plug>(incsearch-backward)
  220. map g/ <Plug>(incsearch-stay)
  221.  
  222. set hlsearch
  223. map ; :noh<CR>
  224. let g:incsearch#auto_nohlsearch = 1
  225. map n <Plug>(incsearch-nohl-n)
  226. map N <Plug>(incsearch-nohl-N)
  227. map * <Plug>(incsearch-nohl-*)
  228. map # <Plug>(incsearch-nohl-#)
  229. map g* <Plug>(incsearch-nohl-g*)
  230. map g# <Plug>(incsearch-nohl-g#)
  231.  
  232. " Lightline
  233. let g:lightline = {
  234. \ 'colorscheme': 'gotham',
  235. \ 'active': {
  236. \ 'left': [ [ 'mode', 'paste' ],
  237. \ [ 'fugitive', 'readonly', 'filename', 'modified' ] ]
  238. \ },
  239. \ 'component': {
  240. \ 'readonly': '%{&filetype=="help"?"":&readonly?"|":""}',
  241. \ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}',
  242. \ 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}'
  243. \ },
  244. \ 'component_visible_condition': {
  245. \ 'readonly': '(&filetype!="help"&& &readonly)',
  246. \ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))',
  247. \ 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())'
  248. \ },
  249. \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" },
  250. \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }
  251. \ }
  252.  
  253. " Syntastic
  254. let g:syntastic_javascript_checkers = ['eslint']
  255. let g:syntastic_always_populate_loc_list = 1
  256. let g:syntastic_auto_loc_list = 0
  257. let g:syntastic_check_on_open = 0
  258. let g:syntastic_check_on_wq = 0
  259. let g:go_list_type = "quickfix"
  260. let g:syntastic_loc_list_height = 5
  261.  
  262. map <leader>f :silent !standard --fix %<CR> :SyntasticReset<CR> :SyntasticCheck<CR>
  263.  
  264. " Make 0 go to the first non-space character in a line (the true beginning of the line)
  265. nmap 0 ^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement