if exists('g:loaded_zoxide') finish endif let g:loaded_zoxide = 1 let s:save_cpo = &cpo set cpo&vim let s:z_cmd = substitute(get(g:, 'zoxide_prefix', 'z'), '\A', '', 'g') let s:z_cmd_cap = toupper(s:z_cmd[0]) .. strcharpart(s:z_cmd, 1) " Z " Lz " Tz execute 'command! -nargs=* -complete=dir ' .. s:z_cmd_cap .. ' call zoxide#z("cd", )' execute 'command! -nargs=* -complete=dir L' .. s:z_cmd .. ' call zoxide#z("lcd", )' execute 'command! -nargs=* -complete=dir T' .. s:z_cmd .. ' call zoxide#z("tcd", )' " Zi " Lzi " Tzi execute 'command! -nargs=* -bang ' .. s:z_cmd_cap .. 'i call zoxide#zi("cd", 0, )' execute 'command! -nargs=* -bang L' .. s:z_cmd .. 'i call zoxide#zi("lcd", 0, )' execute 'command! -nargs=* -bang T' .. s:z_cmd .. 'i call zoxide#zi("tcd", 0, )' if get(g:, 'zoxide_hook', 'none') ==# 'pwd' if has('nvim') augroup zoxide_cd autocmd! autocmd DirChanged window,tab,tabpage,global if !v:event['changed_window'] | call zoxide#exec(['add'], [v:event['cwd']]) | endif augroup END else augroup zoxide_cd autocmd! autocmd DirChanged window,tabpage,global call zoxide#exec(['add'], [expand('')]) augroup END endif endif let &cpo = s:save_cpo unlet s:save_cpo