====== fzf ====== * https://github.com/junegunn/fzf * [[linux:peco|peco]] 와 유사함 * [[linux:fd|fd]]와 주로 조합 * [[linux:ripgrep|ripgrep]] 과 조합 * [[linux:bat|bat (cat clone)]] 고 조합 * [[vim:fzf|fzf.vim]] ===== Shell 자동완성 ===== * ''T'' : 파일 찾기 완성 * ''R'' : 명령 히스토리 완성 * ''C'' : 디렉토리 이동 * ''cd %%**%%'', ''cd ~/github/fzf%%**%%'' 디렉토리 이동할 곳 자동완성 * ''vim %%**%%'', ''vim ../%%**%%'' : 편집할 파일 자동완성 * ''kill -9 '' : kill 할 process ID 찾아줌 * ''ssh %%**%%'', ''telnet %%**%%'' : ''/etc/hosts'', ''~/.ssh/config'' 등에서 접속이력이 있는 Host 찾아줌 * ''unset %%**%%'', ''export %%**%%'', ''unalias %%**%%'' : 환경변수 자동완성 ===== 검색 옵션 ===== * ''^music mp3$ | wav$ | flac$'' : ''music'' 으로 시작하고 ''mp3,wav,flac'' 으로 끝나는 내용만 검색됨 * '''Exactmatch'' : 보통은 fuzzy match (글자가 띄엄띄엄 일치해도 검색)되지만 맨 앞에 홑따옴표(''''')를 두면 정확히 일치하는 것만 검색됨. * ''!music'', ''!^music'' : ''!'' 은 해당 문자열을 제외한 결과만 보여준다. ===== 단축키 ===== * ''Enter'' : 선택 적용 * 다중선택(''-m'' 옵션으로 실행시)일 경우 '''', '''' 으로 다중 선택. * ''J/K/N/P'' 로 이동 * ''C/G'', ''ESC'' : 취소 * 단축키 변경 export FZF_DEFAULT_OPTS='--bind alt-j:down,alt-k:up' ===== Command Failed ===== * ''export FZF_DEFAULT_COMMAND="fd blah... blah..."'' 형태로 지정했는데 ''fzf'' 명령을 내리거나, ''gvim'' 등에서 실행하면 ''Command Failed: fd'' 오류가 발생한다. * ''$PATH'' 환경 변수를 설정하는 곳을 못 읽거나, ''fd'' 명령을 Ubuntu 에서 원래 ''fdfind'' 인 것을 alias 로 만든 것이라서 그렇다. * 명확하게 ''fd'' 명령의 경로를 지정해주거나, alias 가 아닌 진짜 파일명(''fdfind'')로 지정한다. ===== custom fuzzy completion ===== * [[https://github.com/junegunn/fzf/wiki/Examples-(completion)|Examples (completion) · junegunn/fzf Wiki]] ===== 관련 프로젝트 ===== * [[https://github.com/junegunn/fzf/wiki/Related-projects|Related projects · junegunn/fzf Wiki]] * 이 목록을 보면 다양한 fzf 확장 기능들을 찾을 수 있다. * https://github.com/lincheney/fzf-tab-completion ===== fzf over bash / zsh complete ===== * [[https://github.com/rockandska/fzf-obc|rockandska/fzf-obc: fzf over bash complete]] * [[https://github.com/lincheney/fzf-tab-completion|lincheney/fzf-tab-completion: Tab completion using fzf]] * [[https://github.com/Aloxaf/fzf-tab|Aloxaf/fzf-tab: Replace zsh's default completion selection menu with fzf!]] * bash completion 으로 작동하는 것들에 대해 fzf 로 필터링 가능하게 만들어준다. ===== git & fzf ===== * https://github.com/bigH/git-fuzzy * https://github.com/wfxr/forgit * https://spin.atomicobject.com/2018/04/05/fuzzy-find-git-add/ * [[https://github.com/at-ishikawa/git-fzf|at-ishikawa/git-fzf: Git plugin with fzf]] * [[https://im-designloper.tistory.com/50|[ Git ] Git을 단축어로 사용 ! alias 정리 ( with. fzf , tig )]] * [[https://www.mimul.com/blog/gui-free-tips-git-command/|Git 커맨드라인 환경에서 GUI 부럽지 않게 사용할 수 있는 몇가지 팁 | Mimul Tech log]] ===== 참조 ===== * https://www.youtube.com/watch?v=qgG5Jhi_Els * [[http://owen.cymru/fzf-ripgrep-navigate-with-bash-faster-than-ever-before/|FZF & RipGrep - Navigate with bash faster than ever before]] * [[http://www.kwangsiklee.com/2019/03/fzf%EB%A5%BC-vim-%ED%94%8C%EB%9F%AC%EA%B7%B8%EC%9D%B8%EC%9C%BC%EB%A1%9C-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0/|FZF를 VIM 플러그인으로 사용하기 | KWANGSIK LEE's log]] * [[https://engineering.huiseoul.com/fzf-%EC%A2%8B%EC%9C%BC%EB%8B%A4-76fa97578794|fzf 좋으다 - Huiseoul Engineering]] * [[http://snowdeer.github.io/mac-os/2018/11/04/how-to-use-fzf/|유용한 탐색 프로그램 fzf 사용하기 · snowdeer's Code Holic]] * [[https://medium.com/@sidneyliebrand/how-fzf-and-ripgrep-improved-my-workflow-61c7ca212861|How FZF and ripgrep improved my workflow | by Sidney Liebrand | Medium]] * [[https://medium.com/better-programming/boost-your-command-line-productivity-with-fuzzy-finder-985aa162ba5d|Boost Your Command-Line Productivity With Fuzzy Finder | by Vinicius De Antoni | Better Programming | Medium]] : 매우 다양한 방법이 소개됨. * [[https://www.youtube.com/channel/UCSBUwLT9zXhUalKfJrc2q2A|#fzf - FuZzy Finder Tutorial - YouTube]] * [[https://www.baeldung.com/linux/fzf-command|git log --oneline | fzf --preview 'git show --name-only {1}']] * [[https://www.freecodecamp.org/news/fzf-a-command-line-fuzzy-finder-missing-demo-a7de312403ff/|Why you should be using fzf, the command line fuzzy finder]] * [[https://engineering.hybridtheory.com/aws/devops/2018/08/15/fzf-autocompletions/|SSH autocompletion for EC2 instances]] * [[https://developpaper.com/full-guide-to-using-fuzzy-finder-fzf-vim/|Full guide to using fuzzy Finder (FZF + VIM) | Develop Paper]] * [[https://dev.to/iggredible/how-to-search-faster-in-vim-with-fzf-vim-36ko|How to search faster in Vim with FZF.vim - DEV Community]] * [[https://betterprogramming.pub/boost-your-command-line-productivity-with-fuzzy-finder-985aa162ba5d|Boost Your Command-Line Productivity With Fuzzy Finder | by Vinicius De Antoni | Better Programming]] * [[https://sidneyliebrand.medium.com/how-fzf-and-ripgrep-improved-my-workflow-61c7ca212861|How FZF and ripgrep improved my workflow | by Sidney Liebrand | Medium]]