LoginSignup
15
11

More than 5 years have passed since last update.

uniteからdeniteに移行したメモ

Last updated at Posted at 2018-01-19

Denite.nvim
https://github.com/Shougo/denite.nvim

Dark powered asynchronous unite all interfaces for Neovim/Vim8

vim用の高機能ファイラーです。
NeoVimかVim8で動作します。

インストール

下記参照
http://yellowho.hatenablog.com/entry/2016/11/11/021346

いろいろ書いてありますが、python3とtypingというのを入れたらうごきました。

$ brew install python3
$ pip3 install --upgrade pip setuptools wheel
$ pip3 install typing

vimで下記実行

:echo has('python3')
=> 1が出ればOK

NeoBundleを使用した場合

下記を追記してインストール

NeoBundle 'Shougo/denite.nvim'

vimで下記実行

:NeoBundleInstall

dainを使用した場合

未検証

設定

Unite.vimを使っていた影響で表示などそちらに寄せてます

.vimrc
nnoremap [denite] <Nop>
nmap <C-c> [denite]

"現在開いているファイルのディレクトリ下のファイル一覧。
nnoremap <silent> [denite]f :<C-u>DeniteBufferDir
      \ -direction=topleft -cursor-wrap=true file file:new<CR>
"バッファ一覧
nnoremap <silent> [denite]b :<C-u>Denite -direction=topleft -cursor-wrap=true buffer<CR>
"レジスタ一覧
nnoremap <silent> [denite]r :<C-u>Denite -direction=topleft -cursor-wrap=true -buffer-name=register register<CR>
"最近使用したファイル一覧
nnoremap <silent> [denite]m :<C-u>Denite -direction=topleft -cursor-wrap=true file_mru<CR>
"ブックマーク一覧
nnoremap <silent> [denite]c :<C-u>Denite -direction=topleft -cursor-wrap=true bookmark<CR>
"ブックマークに追加
nnoremap <silent> [denite]a :<C-u>DeniteBookmarkAdd<CR>

".git以下のディレクトリ検索
nnoremap <silent> [denite]k :<C-u>Denite -direction=topleft -cursor-wrap=true
      \ -path=`substitute(finddir('.git', './;'), '.git', '', 'g')`
      \ file_rec/git<CR>

call denite#custom#source('file'    , 'matchers', ['matcher_cpsm', 'matcher_fuzzy'])

call denite#custom#source('buffer'  , 'matchers', ['matcher_regexp'])
call denite#custom#source('file_mru', 'matchers', ['matcher_regexp'])

call denite#custom#alias('source', 'file_rec/git', 'file_rec')
call denite#custom#var('file_rec/git', 'command',
  \ ['git', 'ls-files', '-co', '--exclude-standard'])

call denite#custom#map('insert', '<C-N>', '<denite:move_to_next_line>', 'noremap')
call denite#custom#map('insert', '<C-P>', '<denite:move_to_previous_line>', 'noremap')
call denite#custom#map('insert', '<C-W>', '<denite:move_up_path>', 'noremap')


使い方

下記は上記設定にした場合のキーマップです。
.vimrcをいじると自分の好きなキーにマッピングできます。

Ctrl+c f : 開いているファイルのディレクトリにあるファイル一覧
Ctrl+c b : バッファ一覧
Ctrl+c m : 以前開いていたファイル一覧

課題

ctags検索だけやたら遅くていい方法を探し中

https://qiita.com/hisawa/items/fc5300a526cb926aef08
fzf.vimを使ってます(2019.03.12追記)

15
11
2

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
15
11