0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Denite + Defx で複数プロジェクトを渡り歩く

Last updated at Posted at 2020-09-23

目的

複数のプロジェクトで作業をしないといけない場合、プロジェクトを切り替えながら渡り歩くのが結構めんどくさかったりします。
そういった場合にDenitedenite#custom#varを使うとプロジェクト間の行き来が少し楽になります。

環境

NVIM v0.5.0-94b7ff730
DeniteDefxが使えることが前提です。

詳細

:help denite#custom#var

設定

以下のように設定すると<Leader>pでプロジェクトの選択肢が表示され、Enterでプロジェクトルートが開きます。

let s:menus = {}
let s:menus.projects = { 'description': 'switch projects' }
let s:menus.projects.command_candidates = [
      \   ['project A', 'Defx ~/path/to/projectARoot'],
      \   ['project B', 'Defx ~/path/to/projectBRoot'],
      \   ['project C', 'Defx ~/path/to/projectCRoot'],
      \ ]
call denite#custom#var('menu', 'menus', s:menus)

nnoremap <silent> <Leader>p :<C-u>Denite menu:projects<CR>

Defx以外のコマンドでも、command_candidatesに追加すれば選択式で使えるので結構便利そう。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?