Qiita Conference 2025

Qiita史上最多!豪華12名のゲストが登壇

特別講演ゲスト(敬称略)

ymrl、成瀬允宣、鹿野壮、伊藤淳一、uhyo、徳丸浩、ミノ駆動、みのるん、桜庭洋之、tenntenn、けんちょん、こにふぁー

11
11

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 5 years have passed since last update.

fzf.vimがいい感じ あとvim-plugも

Last updated at Posted at 2017-01-15

Emacsのidoのあいまいマッチが気に入ったので、pecoの代わりにfzfを使ってみることにした。

fzfの良かった点

  • tmuxとの連携がいい感じ
  • あいまいマッチのため、タイプ数が減って楽になった

tmuxとの連携は、tmuxの中でfzfを起動すると、自動的にペインが分割されて選択できるため、
現在の画面を失わずに選択できる。

Screenshot_2017-01-16_10-00-50.png

fzf.vimがいい感じだった

output.gif

Vimと連携するため、fzf.vimを導入。

vim-plugを推奨しているため、それも導入。

% curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

の後、.vimrcに下記を記述すればOK

.vimrc
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'

キーバインド

<Space>キーを<Leader>に設定して、なんちゃってSpacemacsにした。

.vimrc
" like Spacemacs
let mapleader = "\<Space>"

nnoremap <Leader>b :Buffers<CR>
nnoremap <Leader>x :Commands<CR>
nnoremap <Leader>f :GFiles<CR>
nnoremap <Leader>a :Ag<CR>
nnoremap <Leader>k :bd<CR>
command! FZFMru call fzf#run({
\  'source':  v:oldfiles,
\  'sink':    'e',
\  'options': '-m -x +s',
\  'down':    '40%'})
nnoremap <Leader>r :FZFMru<CR>

例えば、<Space> bでバッファ一覧を開けるので、EmacsでのC-x C-bが代用できる。

バッファ切り替え

Screenshot_2017-01-15_14-46-40.png

Git管理下のファイルを開く

Screenshot_2017-01-15_14-45-41.png

the_silver_searcherの検索結果にジャンプ
やや見づらい

Screenshot_2017-01-15_14-46-15.png

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

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
11
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?