Files
tmux-complete.vim-mirror/rplugin/python3/deoplete/sources/tmuxcomplete.py
Anagh Kumar Baranwal b054ba1230 Fixes deoplete import
Signed-off-by: Anagh Kumar Baranwal <6824881+darthShadow@users.noreply.github.com>
2019-11-10 17:27:55 +05:30

19 lines
519 B
Python

from subprocess import check_output
from deoplete.base.source import Base
class Source(Base):
def __init__(self, vim):
Base.__init__(self, vim)
self.name = 'tmux-complete'
self.kind = 'keyword'
self.mark = '[tmux]'
self.rank = 4
def gather_candidates(self, context):
command = self.vim.call('tmuxcomplete#getcommand', '', 'words')
words = check_output(['sh', '-c', command]).decode('utf-8').splitlines()
return [{ 'word': x } for x in words]