├── .directory ├── .vimrc ├── Readme.md ├── install.sh ├── myvim.png └── vim-files.tar.gz /.directory: -------------------------------------------------------------------------------- 1 | [Dolphin] 2 | Timestamp=2015,2,1,15,49,48 3 | Version=3 4 | 5 | [Settings] 6 | HiddenFilesShown=true 7 | -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | " my vim files 2 | 3 | "***************************************************************************** 4 | "" Vim-PLug core 5 | "***************************************************************************** 6 | let vimplug_exists=expand('~/.vim/autoload/plug.vim') 7 | 8 | " Vim or NeoVim 9 | let g:vim_bootstrap_langs = "go" 10 | let g:vim_bootstrap_editor = "vim" 11 | 12 | if !filereadable(vimplug_exists) 13 | if !executable("curl") 14 | echoerr "You have to install curl or first install vim-plug yourself!" 15 | execute "q!" 16 | endif 17 | echo "Installing Vim-Plug..." 18 | echo "" 19 | silent exec "!\curl -fLo " . vimplug_exists . " --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" 20 | let g:not_finish_vimplug = "yes" 21 | 22 | autocmd VimEnter * PlugInstall 23 | endif 24 | 25 | " Required: 26 | call plug#begin(expand('~/.vim/plugged')) 27 | 28 | "***************************************************************************** 29 | "" Plug install packages 30 | "***************************************************************************** 31 | Plug 'scrooloose/nerdtree' 32 | Plug 'jistr/vim-nerdtree-tabs' 33 | Plug 'tpope/vim-commentary' 34 | Plug 'tpope/vim-fugitive' 35 | Plug 'vim-airline/vim-airline' 36 | Plug 'vim-airline/vim-airline-themes' 37 | Plug 'airblade/vim-gitgutter' 38 | Plug 'vim-scripts/grep.vim' 39 | Plug 'vim-scripts/CSApprox' 40 | Plug 'Raimondi/delimitMate' 41 | Plug 'majutsushi/tagbar' 42 | Plug 'w0rp/ale' 43 | Plug 'Yggdroot/indentLine' 44 | Plug 'avelino/vim-bootstrap-updater' 45 | Plug 'sheerun/vim-polyglot' 46 | Plug 'tpope/vim-rhubarb' " required by fugitive to :Gbrowse 47 | Plug 'kien/ctrlp.vim' 48 | Plug 'mileszs/ack.vim' 49 | Plug 'shougo/neocomplete.vim' 50 | 51 | if isdirectory('/usr/local/opt/fzf') 52 | Plug '/usr/local/opt/fzf' | Plug 'junegunn/fzf.vim' 53 | else 54 | Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' } 55 | Plug 'junegunn/fzf.vim' 56 | endif 57 | let g:make = 'gmake' 58 | if exists('make') 59 | let g:make = 'make' 60 | endif 61 | Plug 'Shougo/vimproc.vim', {'do': g:make} 62 | 63 | 64 | "" No paste 65 | map :set paste! 66 | 67 | "" Undo and history 68 | set history=1000 69 | set undolevels=1000 70 | 71 | " **************************************************************************************************** 72 | "" Neocomplete shougo 73 | " **************************************************************************************************** 74 | 75 | " Disable AutoComplPop. 76 | let g:acp_enableAtStartup = 1 77 | " Use neocomplete. 78 | let g:neocomplete#enable_at_startup = 1 79 | " Use smartcase. 80 | let g:neocomplete#enable_smart_case = 1 81 | " Set minimum syntax keyword length. 82 | let g:neocomplete#sources#syntax#min_keyword_length = 3 83 | 84 | 85 | "" Vim-Session 86 | Plug 'xolox/vim-misc' 87 | Plug 'xolox/vim-session' 88 | 89 | "" Snippets 90 | Plug 'SirVer/ultisnips' 91 | Plug 'honza/vim-snippets' 92 | 93 | "" Theme color 94 | Plug 'morhetz/gruvbox' 95 | 96 | "" Mark currenty line 97 | set cul 98 | 99 | "Ag/ack 100 | map :CtrlPTag 101 | 102 | "***************************************************************************** 103 | "" Custom bundles 104 | "***************************************************************************** 105 | 106 | " go 107 | "" Go Lang Bundle 108 | Plug 'fatih/vim-go', {'do': ':GoInstallBinaries'} 109 | 110 | 111 | "***************************************************************************** 112 | "***************************************************************************** 113 | 114 | "" Include user's extra bundle 115 | if filereadable(expand("~/.vimrc.local.bundles")) 116 | source ~/.vimrc.local.bundles 117 | endif 118 | 119 | call plug#end() 120 | 121 | " Required: 122 | filetype plugin indent on 123 | 124 | 125 | "***************************************************************************** 126 | "" Basic Setup 127 | "*****************************************************************************" 128 | "" Encoding 129 | set encoding=utf-8 130 | set fileencoding=utf-8 131 | set fileencodings=utf-8 132 | set ttyfast 133 | 134 | "" Fix backspace indent 135 | set backspace=indent,eol,start 136 | 137 | "" Tabs. May be overridden by autocmd rules 138 | set tabstop=4 139 | set softtabstop=0 140 | set shiftwidth=4 141 | set expandtab 142 | 143 | "" Map leader to , 144 | let mapleader=',' 145 | 146 | "" Enable hidden buffers 147 | set hidden 148 | 149 | "" Searching 150 | set hlsearch 151 | set incsearch 152 | set ignorecase 153 | set smartcase 154 | 155 | set fileformats=unix,dos,mac 156 | 157 | if exists('$SHELL') 158 | set shell=$SHELL 159 | else 160 | set shell=/bin/sh 161 | endif 162 | 163 | " session management 164 | let g:session_directory = "~/.vim/session" 165 | let g:session_autoload = "no" 166 | let g:session_autosave = "no" 167 | let g:session_command_aliases = 1 168 | 169 | "***************************************************************************** 170 | "" Visual Settings 171 | "***************************************************************************** 172 | syntax on 173 | set ruler 174 | set number 175 | 176 | let no_buffers_menu=1 177 | silent! colorscheme gruvbox 178 | 179 | " Fixing colors in gruvbox 180 | if !has("gui_running") 181 | let g:gruvbox_italic=0 182 | endif 183 | 184 | set background=dark " dark background 185 | 186 | set mousemodel=popup 187 | set t_Co=256 188 | set guioptions=egmrti 189 | set gfn=Monospace\ 10 190 | 191 | if has("gui_running") 192 | if has("gui_mac") || has("gui_macvim") 193 | set guifont=Monaco\ Bold\ 11 194 | set transparency=7 195 | endif 196 | else 197 | let g:CSApprox_loaded = 1 198 | 199 | " IndentLine 200 | let g:indentLine_enabled = 1 201 | let g:indentLine_concealcursor = 0 202 | let g:indentLine_char = '┆' 203 | let g:indentLine_faster = 1 204 | 205 | 206 | if $COLORTERM == 'gnome-terminal' 207 | set term=gnome-256color 208 | else 209 | if $TERM == 'xterm' 210 | set term=xterm-256color 211 | endif 212 | endif 213 | 214 | endif 215 | 216 | 217 | if &term =~ '256color' 218 | set t_ut= 219 | endif 220 | 221 | 222 | "" Disable the blinking cursor. 223 | set gcr=a:blinkon0 224 | set scrolloff=3 225 | 226 | "" Status bar 227 | set laststatus=2 228 | 229 | "" Use modeline overrides 230 | set modeline 231 | set modelines=10 232 | 233 | set title 234 | set titleold="Terminal" 235 | set titlestring=%F 236 | 237 | set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\ 238 | 239 | " Search mappings: These will make it so that going to the next one in a 240 | " search will center on the line it's found in. 241 | nnoremap n nzzzv 242 | nnoremap N Nzzzv 243 | 244 | if exists("*fugitive#statusline") 245 | set statusline+=%{fugitive#statusline()} 246 | endif 247 | 248 | " vim-airline 249 | let g:airline_theme = 'powerlineish' 250 | let g:airline#extensions#branch#enabled = 1 251 | let g:airline#extensions#ale#enabled = 1 252 | let g:airline#extensions#tabline#enabled = 1 253 | let g:airline#extensions#tagbar#enabled = 1 254 | let g:airline_skip_empty_sections = 1 255 | 256 | "***************************************************************************** 257 | "" Abbreviations 258 | "***************************************************************************** 259 | "" no one is really happy until you have this shortcuts 260 | cnoreabbrev W! w! 261 | cnoreabbrev Q! q! 262 | cnoreabbrev Qall! qall! 263 | cnoreabbrev Wq wq 264 | cnoreabbrev Wa wa 265 | cnoreabbrev wQ wq 266 | cnoreabbrev WQ wq 267 | cnoreabbrev W w 268 | cnoreabbrev Q q 269 | cnoreabbrev Qall qall 270 | 271 | "" NERDTree configuration 272 | let g:NERDTreeChDirMode=2 273 | let g:NERDTreeIgnore=['\.rbc$', '\~$', '\.pyc$', '\.db$', '\.sqlite$', '__pycache__'] 274 | let g:NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\.bak$', '\~$'] 275 | let g:NERDTreeShowBookmarks=1 276 | let g:nerdtree_tabs_focus_on_files=1 277 | let g:NERDTreeMapOpenInTabSilent = '' 278 | let g:NERDTreeWinSize = 30 279 | set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.db,*.sqlite 280 | nnoremap :NERDTreeFind 281 | nnoremap :NERDTreeToggle 282 | 283 | " grep.vim 284 | nnoremap f :Rgrep 285 | let Grep_Default_Options = '-IR' 286 | let Grep_Skip_Files = '*.log *.db' 287 | let Grep_Skip_Dirs = '.git node_modules' 288 | 289 | " terminal emulation 290 | nnoremap sh :terminal 291 | 292 | 293 | "***************************************************************************** 294 | "" Commands 295 | "***************************************************************************** 296 | " remove trailing whitespaces 297 | command! FixWhitespace :%s/\s\+$//e 298 | 299 | "***************************************************************************** 300 | "" Functions 301 | "***************************************************************************** 302 | if !exists('*s:setupWrapping') 303 | function s:setupWrapping() 304 | set wrap 305 | set wm=2 306 | set textwidth=79 307 | endfunction 308 | endif 309 | 310 | "***************************************************************************** 311 | "" Autocmd Rules 312 | "***************************************************************************** 313 | "" The PC is fast enough, do syntax highlight syncing from start unless 200 lines 314 | augroup vimrc-sync-fromstart 315 | autocmd! 316 | autocmd BufEnter * :syntax sync maxlines=200 317 | augroup END 318 | 319 | "" Remember cursor position 320 | augroup vimrc-remember-cursor-position 321 | autocmd! 322 | autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif 323 | augroup END 324 | 325 | "" txt 326 | augroup vimrc-wrapping 327 | autocmd! 328 | autocmd BufRead,BufNewFile *.txt call s:setupWrapping() 329 | augroup END 330 | 331 | "" make/cmake 332 | augroup vimrc-make-cmake 333 | autocmd! 334 | autocmd FileType make setlocal noexpandtab 335 | autocmd BufNewFile,BufRead CMakeLists.txt setlocal filetype=cmake 336 | augroup END 337 | 338 | set autoread 339 | 340 | "***************************************************************************** 341 | "" Mappings 342 | "***************************************************************************** 343 | 344 | "" Split 345 | noremap h :split 346 | noremap v :vsplit 347 | 348 | "" Git 349 | noremap ga :Gwrite 350 | noremap gc :Gcommit 351 | noremap gsh :Gpush 352 | noremap gll :Gpull 353 | noremap gs :Gstatus 354 | noremap gb :Gblame 355 | noremap gd :Gvdiff 356 | noremap gr :Gremove 357 | 358 | " session management 359 | nnoremap so :OpenSession 360 | nnoremap ss :SaveSession 361 | nnoremap sd :DeleteSession 362 | nnoremap sc :CloseSession 363 | 364 | "" Tabs 365 | nnoremap gt 366 | nnoremap gT 367 | nnoremap :tabnew 368 | 369 | "" Set working directory 370 | nnoremap . :lcd %:p:h 371 | 372 | "" Opens an edit command with the path of the currently edited file filled in 373 | noremap e :e =expand("%:p:h") . "/" 374 | 375 | "" Opens a tab edit command with the path of the currently edited file filled 376 | noremap te :tabe =expand("%:p:h") . "/" 377 | 378 | "" fzf.vim 379 | set wildmode=list:longest,list:full 380 | set wildignore+=*.o,*.obj,.git,*.rbc,*.pyc,__pycache__ 381 | let $FZF_DEFAULT_COMMAND = "find * -path '*/\.*' -prune -o -path 'node_modules/**' -prune -o -path 'target/**' -prune -o -path 'dist/**' -prune -o -type f -print -o -type l -print 2> /dev/null" 382 | 383 | " The Silver Searcher 384 | if executable('ag') 385 | let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -g ""' 386 | set grepprg=ag\ --nogroup\ --nocolor 387 | endif 388 | 389 | " ripgrep 390 | if executable('rg') 391 | let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --follow --glob "!.git/*"' 392 | set grepprg=rg\ --vimgrep 393 | command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --glob "!.git/*" --color "always" '.shellescape().'| tr -d "\017"', 1, 0) 394 | endif 395 | 396 | cnoremap =expand("%:p:h") . "/" 397 | nnoremap b :Buffers 398 | nnoremap e :FZF -m 399 | 400 | "Recovery commands from history through FZF 401 | nmap y :History: 402 | 403 | " snippets 404 | let g:UltiSnipsExpandTrigger="" 405 | let g:UltiSnipsJumpForwardTrigger="" 406 | let g:UltiSnipsJumpBackwardTrigger="" 407 | let g:UltiSnipsEditSplit="vertical" 408 | 409 | " ale 410 | let g:ale_linters = {} 411 | 412 | " Tagbar 413 | 414 | nmap :TagbarToggle 415 | 416 | let g:tagbar_autofocus = 1 417 | let g:tagbar_width=30 418 | 419 | " Disable visualbell 420 | set noerrorbells visualbell t_vb= 421 | if has('autocmd') 422 | autocmd GUIEnter * set visualbell t_vb= 423 | endif 424 | 425 | "" Copy/Paste/Cut 426 | if has('unnamedplus') 427 | set clipboard=unnamed,unnamedplus 428 | endif 429 | 430 | noremap YY "+y 431 | noremap p "+gP 432 | noremap XX "+x 433 | 434 | if has('macunix') 435 | " pbcopy for OSX copy/paste 436 | vmap :!pbcopy 437 | vmap :w !pbcopy 438 | endif 439 | 440 | "" Buffer nav 441 | noremap z :bp 442 | noremap q :bp 443 | noremap x :bn 444 | noremap w :bn 445 | 446 | "" Close buffer 447 | noremap c :bd 448 | 449 | "" Clean search (highlight) 450 | nnoremap :noh 451 | 452 | "" Switching windows 453 | noremap j 454 | noremap k 455 | noremap l 456 | noremap h 457 | 458 | "" Vmap for maintain Visual Mode after shifting > and < 459 | vmap < >gv 461 | 462 | "" Move visual block 463 | vnoremap J :m '>+1gv=gv 464 | vnoremap K :m '<-2gv=gv 465 | 466 | "" Open current line on GitHub 467 | nnoremap o :.Gbrowse 468 | 469 | "***************************************************************************** 470 | "" Custom configs 471 | "***************************************************************************** 472 | 473 | " go 474 | " vim-go 475 | " run :GoBuild or :GoTestCompile based on the go file 476 | function! s:build_go_files() 477 | let l:file = expand('%') 478 | if l:file =~# '^\f\+_test\.go$' 479 | call go#test#Test(0, 1) 480 | elseif l:file =~# '^\f\+\.go$' 481 | call go#cmd#Build(0) 482 | endif 483 | endfunction 484 | 485 | let g:go_list_type = "quickfix" 486 | let g:go_fmt_command = "goimports" 487 | let g:go_fmt_fail_silently = 1 488 | 489 | let g:go_highlight_types = 1 490 | let g:go_highlight_fields = 1 491 | let g:go_highlight_functions = 1 492 | let g:go_highlight_methods = 1 493 | let g:go_highlight_operators = 1 494 | let g:go_highlight_build_constraints = 1 495 | let g:go_highlight_structs = 1 496 | let g:go_highlight_generate_tags = 1 497 | let g:go_highlight_space_tab_error = 0 498 | let g:go_highlight_array_whitespace_error = 0 499 | let g:go_highlight_trailing_whitespace_error = 0 500 | let g:go_highlight_extra_types = 1 501 | 502 | autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 503 | 504 | augroup completion_preview_close 505 | autocmd! 506 | if v:version > 703 || v:version == 703 && has('patch598') 507 | autocmd CompleteDone * if !&previewwindow && &completeopt =~ 'preview' | silent! pclose | endif 508 | endif 509 | augroup END 510 | 511 | augroup go 512 | 513 | au! 514 | au Filetype go command! -bang A call go#alternate#Switch(0, 'edit') 515 | au Filetype go command! -bang AV call go#alternate#Switch(0, 'vsplit') 516 | au Filetype go command! -bang AS call go#alternate#Switch(0, 'split') 517 | au Filetype go command! -bang AT call go#alternate#Switch(0, 'tabe') 518 | 519 | au FileType go nmap dd (go-def-vertical) 520 | au FileType go nmap dv (go-doc-vertical) 521 | au FileType go nmap db (go-doc-browser) 522 | 523 | au FileType go nmap r (go-run) 524 | au FileType go nmap t (go-test) 525 | au FileType go nmap gt (go-coverage-toggle) 526 | au FileType go nmap i (go-info) 527 | au FileType go nmap l (go-metalinter) 528 | au FileType go nmap :GoDecls 529 | au FileType go nmap dr :GoDeclsDir 530 | au FileType go imap :GoDecls 531 | au FileType go imap dr :GoDeclsDir 532 | au FileType go nmap rb :call build_go_files() 533 | 534 | augroup END 535 | 536 | " ale 537 | :call extend(g:ale_linters, { 538 | \"go": ['golint', 'go vet'], }) 539 | 540 | 541 | 542 | "***************************************************************************** 543 | " Personal config file at /home 544 | "***************************************************************************** 545 | 546 | "" Include user's local vim config 547 | if filereadable(expand("~/.vimrc.local")) 548 | source ~/.vimrc.local 549 | endif 550 | 551 | 552 | "***************************************************************************** 553 | "" CtrlP 554 | "***************************************************************************** 555 | 556 | set runtimepath^=~/.vim/bundle/ctrlp.vim 557 | set wildignore+=*/tmp/*,*.so,*.o,*.a,*.obj,*.swp,*.zip,*.pyc,*.pyo,*.class,.DS_Store " MacOSX/Linux 558 | let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$' 559 | 560 | 561 | "***************************************************************************** 562 | "" Convenience variables 563 | "***************************************************************************** 564 | 565 | " vim-airline 566 | if !exists('g:airline_symbols') 567 | let g:airline_symbols = {} 568 | endif 569 | 570 | if !exists('g:airline_powerline_fonts') 571 | let g:airline#extensions#tabline#left_sep = ' ' 572 | let g:airline#extensions#tabline#left_alt_sep = '|' 573 | let g:airline_left_sep = '▶' 574 | let g:airline_left_alt_sep = '»' 575 | let g:airline_right_sep = '◀' 576 | let g:airline_right_alt_sep = '«' 577 | let g:airline#extensions#branch#prefix = '⤴' "➔, ➥, ⎇ 578 | let g:airline#extensions#readonly#symbol = '⊘' 579 | let g:airline#extensions#linecolumn#prefix = '¶' 580 | let g:airline#extensions#paste#symbol = 'ρ' 581 | let g:airline_symbols.linenr = '␊' 582 | let g:airline_symbols.branch = '⎇' 583 | let g:airline_symbols.paste = 'ρ' 584 | let g:airline_symbols.paste = 'Þ' 585 | let g:airline_symbols.paste = '∥' 586 | let g:airline_symbols.whitespace = 'Ξ' 587 | else 588 | let g:airline#extensions#tabline#left_sep = '' 589 | let g:airline#extensions#tabline#left_alt_sep = '' 590 | 591 | " powerline symbols 592 | let g:airline_left_sep = '' 593 | let g:airline_left_alt_sep = '' 594 | let g:airline_right_sep = '' 595 | let g:airline_right_alt_sep = '' 596 | let g:airline_symbols.branch = '' 597 | let g:airline_symbols.readonly = '' 598 | let g:airline_symbols.linenr = '' 599 | endif 600 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | ``` 2 | _ __ _ _ 3 | (_) / _(_) | 4 | __ ___ _ __ ___ | |_ _| | ___ ___ 5 | \ \ / / | '_ ` _ \| _| | |/ _ \/ __| 6 | \ V /| | | | | | | | | | | __/\__ \ 7 | \_/ |_|_| |_| |_|_| |_|_|\___||___/ 8 | 9 | ``` 10 | 11 | * **http://lobocode.github.io** 12 | * **E-mail: lobocode@gmail.com** 13 | 14 | 15 |

16 | 17 | # Plugins pack # 18 | 19 | 20 | * NERDTree - File explorer 21 | * Commentary - Commenting 22 | * Fugitive - Git 23 | * airline - Status bar 24 | * githutter - Git gutter 25 | * grep - Grep 26 | * CSApprox - Color scheme 27 | * tagbar - Tagbar (ctags) 28 | * ale - Asynchronous Lint Engine 29 | * indent line - Indent line (for python) 30 | * bootstrap-updater - Bootstrap updater 31 | * polyglot - Syntax highlight 32 | * rhubarb - Github pull request 33 | * ctrlp - Fuzzy file, buffer, mru, tag, etc finder 34 | * ack - Ack (grep) 35 | * theme gruvbox - Theme gruvbox (dark) 36 | 37 | ### How to install 38 | ```bash 39 | $ git clone https://github.com/lobocode/vimfiles 40 | $ cd vimfiles 41 | $ ./install.sh 42 | ``` 43 | 44 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!bin/bash 2 | 3 | # descompact tar.gz 4 | tar -xvzf vim-files.tar.gz 5 | 6 | # cria diretorio 7 | mkdir ~/.vim 8 | 9 | # copia arquivos para o diretorio 10 | cp -a vim-files/* ~/.vim/ 11 | -------------------------------------------------------------------------------- /myvim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scovl/vimfiles/018b808ca0410678457b407c8b3e4e624e87d73f/myvim.png -------------------------------------------------------------------------------- /vim-files.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scovl/vimfiles/018b808ca0410678457b407c8b3e4e624e87d73f/vim-files.tar.gz --------------------------------------------------------------------------------