Skip to content

Instantly share code, notes, and snippets.

@bfrg
bfrg / hipopup.vim
Created April 13, 2020 16:24
Display the output of :highlight in a popup window
" ==============================================================================
" Display the output of :highlight in a popup window
"
" Command:
"
" :Highlight [{args}...]
"
" {args} is an optional list of highlight groups (partial names are supported)
"
" Examples:
@bfrg
bfrg / msgpopup.vim
Last active April 13, 2020 15:56
Like :messages but instead display the output in a popup window
" ==============================================================================
" Display the output of :messages in a popup window
"
" Commands:
" :Messages
"
" Popup Mappings:
" j/k - scroll down/up one line
" d/u - scroll down/up one half page
" f/b - scroll down/up one full page
@bfrg
bfrg / qfhistory.vim
Last active June 6, 2022 13:23
Print the quickfix (or location-list) history and switch to selected list
vim9script
# Print the quickfix (or location-list) history and switch to the selected list
# Alternative: https://github.com/bfrg/vim-qf-history
def Errorlists(loclist: bool)
const Xgetlist = loclist ? function('getloclist', [0]) : function('getqflist')
const nr: number = Xgetlist({nr: '$'}).nr
if !nr
echomsg 'No entries'
@bfrg
bfrg / verbose2qf.vim
Last active April 1, 2023 07:46
Redirect the output of ":verbose {cmd}" to a quickfix list
" ==============================================================================
" Redirect the output of ':verbose {cmd}' to a quickfix list
"
" Commands:
" :Verbose {cmd}
" Add items to new quickfix list
"
" :VerboseAdd {cmd}
" Append items to current quickfix list
"
@bfrg
bfrg / dotfiles.vim
Last active July 21, 2019 19:09
Commands to quickly edit my dotfiles (supports wildmenu tab-completion and accepts partial matches)
" ==============================================================================
" Quickly edit my dotfiles
"
" Commands:
" Edit the dotfile 'foo' ...
" :DotE foo ... in current window
" :DotS foo ... in new split window
" :DotV foo ... in new vertical split
" :DotT foo ... in new tab page
"
@bfrg
bfrg / packdir.vim
Last active February 20, 2020 00:28
Quickly open the root directory of a plugin under ~/.vim/pack using the default file explorer
" ==============================================================================
" Quickly open the root directory of a plugin under ~/.vim/pack using your
" default file explorer (dirvish, netrw, etc.)
"
" Commands:
" Open root directory of plugin <plug> ...
" :PackE {plug} ...in current window
" :PackS {plug} ...in new split
" :PackV {plug} ...in new vertical split
" :PackT {plug} ...in new tab page