Skip to content

Instantly share code, notes, and snippets.

@ricardofalasca
Last active October 29, 2019 16:58
Show Gist options
  • Save ricardofalasca/781ac88a9643b0a451ca0b90c27c97ed to your computer and use it in GitHub Desktop.
Save ricardofalasca/781ac88a9643b0a451ca0b90c27c97ed to your computer and use it in GitHub Desktop.
My .vimrc
" 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',
" \ }
" syntastic settings
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" Set vertical line at column 80
set colorcolumn=80
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
let g:jedi#use_tabs_not_buffers = 1
let g:jedi#show_call_signatures = 0
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 pdb; pdb.set_trace()
map <Leader>p :call InsertPdb()<CR>
" Python 3.x - shortcut to add import rpdb; rpdb.Rpdb().set_trace()
map <Leader>r :call InsertRpdb()<CR>
function! InsertPdb()
let trace = expand("import pdb; pdb.set_trace()")
execute "normal o".trace
endfunction
function! InsertRpdb()
let trace = expand("import rpdb; rpdb.Rpdb().set_trace()")
execute "normal o".trace
endfunction
let g:multicursor_insert_maps = 1
let g:multicursor_normal_maps = 1
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_vue_checkers = ['eslint']
let local_eslint = finddir('node_modules', '.;') . '/.bin/eslint'
if matchstr(local_eslint, "^\/\\w") == ''
let local_eslint = getcwd() . "/" . local_eslint
endif
if executable(local_eslint)
let g:syntastic_javascript_eslint_exec = local_eslint
let g:syntastic_vue_eslint_exec = local_eslint
endif
" 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
@ricardofalasca
Copy link
Author

ricardofalasca commented Jan 25, 2018

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.vim

ack.vim
Website: https://github.com/mileszs/ack.vim
How to install:
git clone https://github.com/mileszs/ack.vim.git ~/.vim/bundle/ack.vim

ctrp.vim
Website: https://github.com/ctrlpvim/ctrlp.vim
How to install:
git clone https://github.com/ctrlpvim/ctrlp.vim.git ~/.vim/bundle/ctrlp.vim

jedi.vim
Website: https://github.com/davidhalter/jedi-vim
How to install:
git clone --recursive https://github.com/davidhalter/jedi-vim.git ~/.vim/bundle/jedi-vim

lightline.vim
Website: https://github.com/itchyny/lightline.vim
How to install:
git clone https://github.com/itchyny/lightline.vim ~/.vim/bundle/lightline.vim

onedark.vim - Color theme
Website: https://github.com/joshdick/onedark.vim
How to install: Read the documentation.

syntastic
Website: https://github.com/vim-syntastic/syntastic
How to install:

cd ~/.vim/bundle && \
git clone --depth=1 https://github.com/vim-syntastic/syntastic.git

fugitive.vim
Website: https://github.com/tpope/vim-fugitive
How to install:

cd ~/.vim/bundle
git clone https://github.com/tpope/vim-fugitive.git
vim -u NONE -c "helptags vim-fugitive/doc" -c q

vim-gitgutter
Website: https://github.com/airblade/vim-gitgutter
How to install:

cd ~/.vim/bundle
git clone git://github.com/airblade/vim-gitgutter.git

vim-multiple-cursors
Website: https://github.com/terryma/vim-multiple-cursors
How to install: Read the documentation.

vim-polyglot
Website: https://github.com/sheerun/vim-polyglot
How to install:

mkdir -p ~/.vim/pack/default/start
git clone https://github.com/sheerun/vim-polyglot ~/.vim/pack/default/start/vim-polyglot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment