Created
May 2, 2023 17:23
-
-
Save andlrc/77813853c771ebcd5d1e05e664b58487 to your computer and use it in GitHub Desktop.
This file contains 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
vim9script | |
# jump.vim - Calls git-jump and hydrate a qflist | |
# Maintainer: Andreas Louv <andreas@louv.dk> | |
# Last Change: Apr 19, 2023 | |
def Jump(...args: list<string>): string | |
var strargs: string = args->map((key, val) => expand(val))->join(' ') | |
var cmd = 'git jump --stdout ' .. strargs | |
return system(cmd) | |
enddef | |
command! -nargs=+ -complete=file_in_path Jump cexpr Jump(<f-args>) | |
command! -nargs=+ -complete=file_in_path LJump lexpr Jump(<f-args>) | |
cnoreabbrev <expr> jump (getcmdtype() ==# ':' && getcmdline() ==# 'jump') ? 'Jump' : 'jump' | |
cnoreabbrev <expr> ljump (getcmdtype() ==# ':' && getcmdline() ==# 'ljump') ? 'LJump' : 'ljump' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment