Skip to content

Instantly share code, notes, and snippets.

@cherryramatisdev
Created September 28, 2023 00:19
Show Gist options
  • Save cherryramatisdev/06463e55a01e1e3f5c2e08a0cd8fd86c to your computer and use it in GitHub Desktop.
Save cherryramatisdev/06463e55a01e1e3f5c2e08a0cd8fd86c to your computer and use it in GitHub Desktop.
function! project#Switch(path) abort
if tabpagenr('$') == 1
%bd
endif
execute 'cd ' . a:path
execute 'Dirvish'
endfunction
function! project#ListProjects(arg,cmdline,curpos) abort
let l:repos_dir = expand('~/Repos/*')
let l:directories = extend(systemlist('ls -d ~/Repos/*'), [expand('~/.vim')])
if a:arg->len() > 0
return l:directories->matchfuzzy(a:arg)
else
return l:directories
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment