mirror of
https://github.com/wellle/tmux-complete.vim.git
synced 2025-12-16 12:00:09 +01:00
19 lines
519 B
Python
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]
|