Commit f63f30f3 authored by adam j hartz's avatar adam j hartz

bookmark: add tab completion

parent 8ff2d512
......@@ -69,3 +69,23 @@ PLUGIN_SETTINGS.aliases['bgo'] = _follow_bookmark
PLUGIN_SETTINGS.aliases['bwrite'] = _write_bookmarks
PLUGIN_SETTINGS.aliases['bload'] = _load_bookmarks
PLUGIN_SETTINGS.aliases['blist'] = _list_bookmarks
def complete_bookmark_commands(prefix, line, start, end, ctx):
args = line.split(' ')
if len(args) == 0:
return None
curix = args.index(prefix)
all_bmarks = {i for i in PLUGIN_SETTINGS.data if i.startswith(prefix) and not i.startswith('_')}
if args[0] == 'bmark':
if curix == 1:
return all_bmarks
if curix == 2:
return __tako_completers__['path'](prefix, line, start, end, ctx)
elif args[0] == 'bgo':
if curix == 1:
return all_bmarks
from takoshell.completers._aliases import _add_one_completer
_add_one_completer('bookmark_plugin', complete_bookmark_commands, '<completer')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment