Last active
July 31, 2025 21:26
-
-
Save ricardofalasca/781ac88a9643b0a451ca0b90c27c97ed to your computer and use it in GitHub Desktop.
My .vimrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " run pathogen | |
| execute pathogen#infect() | |
| " show line numbers | |
| set nu | |
| " set auto indent | |
| set ai | |
| " enable syntax | |
| syntax on | |
| " open a new tab (control + t) | |
| nmap <C-t> :tabnew<CR> | |
| " go to next tab (control + n) | |
| nmap W :tabn<CR> | |
| " go to previous tab (control + p) | |
| nmap Q :tabp<CR> | |
| " execute netrw Vexplore command to open files | |
| nmap <C-o> :Vexplore<CR> | |
| " enable indent for detected programming languages | |
| filetype plugin indent on | |
| " show status bar | |
| set laststatus=2 | |
| set termencoding=utf8 | |
| set ff=unix | |
| set visualbell t_vb= | |
| set statusline=%t[%{strlen(&fenc)?&fenc:'none'},%{&ff}]%h%m%r%y%=%c,%l/%L\ %P | |
| " enable onedark theme | |
| let g:onedark_termcolors=256 | |
| colorscheme onedark | |
| set shiftwidth=4 | |
| set sts=4 | |
| set tabstop=4 | |
| set backspace=2 | |
| set expandtab | |
| if (empty($TMUX)) | |
| if (has("nvim")) | |
| let $NVIM_TUI_ENABLE_TRUE_COLOR=1 | |
| endif | |
| if (has("termguicolors")) | |
| set termguicolors | |
| endif | |
| endif | |
| " let g:lightline = { | |
| " \ 'colorscheme': 'one', | |
| " \ } | |
| set colorcolumn=99 | |
| let g:netrw_banner = 0 | |
| let g:netrw_liststyle = 3 | |
| let g:netrw_browse_split = 4 | |
| let g:netrw_altv = 1 | |
| let g:netrw_winsize = 15 | |
| autocmd Filetype html setlocal ts=2 sts=2 sw=2 | |
| autocmd Filetype javascript setlocal ts=2 sts=2 sw=2 | |
| autocmd Filetype vue setlocal ts=2 sts=2 sw=2 | |
| let g:javascript_plugin_jsdoc = 1 | |
| let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git|\.pyc|venv' | |
| set mouse=a | |
| " Python 3.x - shortcut to add import breakpoint() | |
| map <Leader>p :call InsertPdb()<CR> | |
| " Python 3.x - shortcut to add import rpdb; rpdb.Rpdb().set_trace() | |
| map <Leader>pr :call InsertRpdb()<CR> | |
| function! InsertPdb() | |
| let trace = expand("breakpoint()") | |
| execute "normal o".trace | |
| endfunction | |
| function! InsertRpdb() | |
| let trace = expand("import remote_pdb; remote_pdb.set_trace(port=4444)") | |
| execute "normal o".trace | |
| endfunction | |
| let g:multicursor_insert_maps = 1 | |
| let g:multicursor_normal_maps = 1 | |
| " coc.vim setup | |
| " Use <Tab> for trigger completion and navigate | |
| inoremap <silent><expr> <TAB> pumvisible() ? "\<C-n>" : "\<TAB>" | |
| inoremap <silent><expr> <S-TAB> pumvisible() ? "\<C-p>" : "\<S-TAB>" | |
| " Coc keybindings | |
| nmap <silent> gd <Plug>(coc-definition) | |
| nmap <silent> gy <Plug>(coc-type-definition) | |
| nmap <silent> gi <Plug>(coc-implementation) | |
| nmap <silent> gr <Plug>(coc-references) | |
| " end of coc.vim setup | |
| " Rename3.vim - Rename a buffer within Vim and on disk. | |
| " Source: https://github.com/aehlke/vim-rename3/blob/master/rename3.vim | |
| " | |
| " Copyright July 2013 by Alex Ehlke <alex.ehlke at gmail.com> | |
| " | |
| " based on Rename2.vim (which couldn't handle spaces in paths) | |
| " Copyright July 2009 by Manni Heumann <vim at lxxi.org> | |
| " | |
| " which is based on Rename.vim | |
| " Copyright June 2007 by Christian J. Robinson <infynity@onewest.net> | |
| " | |
| " Distributed under the terms of the Vim license. See ":help license". | |
| " | |
| " Usage: | |
| " | |
| " :Rename[!] {newname} | |
| command! -nargs=* -complete=file -bang Rename :call Rename("<args>", "<bang>") | |
| function! Rename(name, bang) | |
| let l:curfile = expand("%:p") | |
| let l:curfilepath = expand("%:p:h") | |
| let l:newname = l:curfilepath . "/" . a:name | |
| let v:errmsg = "" | |
| silent! exec "saveas" . a:bang . " " . fnameescape(l:newname) | |
| if v:errmsg =~# '^$\|^E329' | |
| if expand("%:p") !=# l:curfile && filewritable(expand("%:p")) | |
| silent exec "bwipe! " . fnameescape(l:curfile) | |
| if delete(l:curfile) | |
| echoerr "Could not delete " . l:curfile | |
| endif | |
| endif | |
| else | |
| echoerr v:errmsg | |
| endif | |
| endfunction |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Vim plugins:
My preferred vim's plugins. I'm using pathogen to load this plugins.
How to install pathogen:
mkdir -p ~/.vim/autoload ~/.vim/bundle && curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vimack.vimURL: https://github.com/mileszs/ack.vim
How to install:
git clone https://github.com/mileszs/ack.vim.git ~/.vim/bundle/ack.vimctrp.vimURL: https://github.com/ctrlpvim/ctrlp.vim
How to install:
git clone https://github.com/ctrlpvim/ctrlp.vim.git ~/.vim/bundle/ctrlp.vimlightline.vimURL: https://github.com/itchyny/lightline.vim
How to install:
git clone https://github.com/itchyny/lightline.vim ~/.vim/bundle/lightline.vimonedark.vim- Color themeURL: https://github.com/joshdick/onedark.vim
How to install:
Read the documentation.fugitive.vimURL: https://github.com/tpope/vim-fugitive
Install:
vim-gitgutterURL: https://github.com/airblade/vim-gitgutter
How to install:
vim-visual-multiURL: https://github.com/mg979/vim-visual-multi
Install:
coc.vim(requires node)URL: https://github.com/neoclide/coc.nvim
Install:
Configuration:
$ vim
Add - to not show "phantom" hints, it's annoying: