Skip to content

Instantly share code, notes, and snippets.

@eduardoarandah
Last active August 18, 2021 07:03
Show Gist options
  • Save eduardoarandah/11fe747c328ddf1ebeb3da40c98d3646 to your computer and use it in GitHub Desktop.
Save eduardoarandah/11fe747c328ddf1ebeb3da40c98d3646 to your computer and use it in GitHub Desktop.
How to debug vim plugins or mappings

Create a file tmpvimrc with the following content

Add relevant plugins or mappings before or after plugins.

set nocompatible hidden laststatus=2

""""""""""""""""""""""""""""""""""
" PUT HERE YOUR MAPPINGS
""""""""""""""""""""""""""""""""""

" this loads vim-plug
if !filereadable('/tmp/plug.vim')
  silent !curl --insecure -fLo /tmp/plug.vim
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif

source /tmp/plug.vim
call plug#begin('/tmp/plugged')

""""""""""""""""""""""""""""""""""
" PUT HERE YOUR PLUGINS, HERE'S A COUPLE EXAMPLES:
""""""""""""""""""""""""""""""""""

Plug 'junegunn/fzf', { 'do': './install --bin' }
Plug 'junegunn/fzf.vim'

" end of plugins
call plug#end()

" download and install plugins
autocmd VimEnter * PlugClean! | PlugUpdate --sync

""""""""""""""""""""""""""""""""""
" PUT HERE MAPPINGS DEPENDANT ON PLUGINS
""""""""""""""""""""""""""""""""""

Launch vim using this temporary vimrc

This will load vim ignoring your global .vimrc

vim -Nu tmpvimrc

Now you have a reproducible vimrc

You can share it to help others reproduce your problem.

  • Add the result of :version command

  • Share your tmpvimrc with others, here's some useful sites:

https://paste.rs/web

https://gist.github.com/

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