LoginSignup
11
9

More than 5 years have passed since last update.

treeからpecoで選択したファイルをvimで開く

Last updated at Posted at 2015-04-28
function peco-tree-vim(){
  local SELECTED_FILE=$(tree --charset=o -f | peco | tr -d '\||`|-' | xargs echo)
  BUFFER="vim $SELECTED_FILE"
  zle accept-line
}
bindkey "^t" peco_tree_vim

-fオプションでフルパスを表示しつつ--charsetオプションで罫線に使用する文字を変更して扱いやすくし、pecoで選択した行にある罫線をtrで除去してvimで開く
<Ctrl-t>で起動して便利

vim-tree.gif

11
9
4

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