├── .gitignore ├── doc └── denite-ghq.txt ├── readme.mkd └── rplugin └── python3 └── denite └── source └── ghq.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.py[cod] 2 | -------------------------------------------------------------------------------- /doc/denite-ghq.txt: -------------------------------------------------------------------------------- 1 | *denite-ghq.txt* denite source: ghq 2 | 3 | Version: 0.1.1 4 | Author: Jagua 5 | License: MIT License (http://opensource.org/licenses/mit-license.php) 6 | 7 | 8 | 9 | ============================================================================== 10 | INTRODUCTION *denite-ghq-introduction* 11 | 12 | |denite-ghq| is a source for |denite| to deal with ghq. You can choose one 13 | from many directories and chdir into it. 14 | 15 | 16 | Requirements: 17 | - Vim or Neovim 18 | - |denite| 19 | - ghq 20 | https://github.com/motemen/ghq 21 | - Python 3.5 or later 22 | 23 | Latest version: 24 | https://github.com/Jagua/vim-denite-ghq 25 | 26 | 27 | 28 | ============================================================================== 29 | SOURCES *denite-ghq-sources* 30 | 31 | ghq Gather directories managing by ghq. *denite-source-ghq* 32 | 33 | 34 | 35 | ============================================================================== 36 | CHANGELOG *denite-ghq-changelog* 37 | 38 | 0.1.1 2018-10-24 39 | - Remove DeniteGhq command. 40 | 41 | 0.1.0 2016-10-10 42 | - Initial version. 43 | 44 | 45 | 46 | ============================================================================== 47 | vim:tw=78:ts=8:sw=2:ft=help:et:norl:fen:fdl=0: 48 | -------------------------------------------------------------------------------- /readme.mkd: -------------------------------------------------------------------------------- 1 | # vim-denite-ghq 2 | 3 | *vim-denite-ghq* is a Vim plugin. This plugin is a source for *denite.nvim* to deal with *ghq*. 4 | 5 | This plugin depends on: 6 | * [denite.nvim](https://github.com/Shougo/denite.nvim) 7 | * [ghq](https://github.com/motemen/ghq) 8 | 9 | Latest: https://github.com/Jagua/vim-denite-ghq 10 | 11 | 12 | ## Usage 13 | 14 | ```vim 15 | :Denite ghq 16 | 17 | ``` 18 | 19 | You can change ghq option as follows example. 20 | 21 | ```vim 22 | " Use vcs option 23 | call denite#custom#var('ghq', 'command', 24 | \ ['ghq', 'list', '--full-path', '--vcs', 'git']) 25 | ``` 26 | -------------------------------------------------------------------------------- /rplugin/python3/denite/source/ghq.py: -------------------------------------------------------------------------------- 1 | from .base import Base 2 | import subprocess 3 | 4 | 5 | class Source(Base): 6 | def __init__(self, vim): 7 | super().__init__(vim) 8 | self.name = 'ghq' 9 | self.kind = 'directory' 10 | self.vars = { 11 | 'command': [] 12 | } 13 | 14 | def on_init(self, context): 15 | if not self.vars['command']: 16 | self.vars['command'] = ['ghq', 'list', '--full-path'] 17 | 18 | def gather_candidates(self, context): 19 | return [{'word': path, 'action__path': path} 20 | for path 21 | in subprocess.run(self.vars['command'], 22 | check=True, 23 | universal_newlines=True, 24 | stdout=subprocess.PIPE 25 | ).stdout.split()] 26 | --------------------------------------------------------------------------------