사용자 도구

사이트 도구


linux:fzf

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
linux:fzf [2020/09/26 15:07]
kwon37xi [Shell 자동완성]
linux:fzf [2022/04/25 17:20] (현재)
kwon37xi
줄 1: 줄 1:
 ====== fzf ====== ====== fzf ======
   * https://github.com/junegunn/fzf   * https://github.com/junegunn/fzf
 +  * [[linux:peco|peco]] 와 유사함
 +  * [[linux:fd|fd]]와 주로 조합
   * [[linux:ripgrep|ripgrep]] 과 조합   * [[linux:ripgrep|ripgrep]] 과 조합
 +  * [[linux:bat|bat (cat clone)]] 고 조합
 +
 +  * [[vim:fzf|fzf.vim]]
  
 ===== Shell 자동완성 ===== ===== Shell 자동완성 =====
줄 9: 줄 14:
   * ''cd %%**%%'', ''cd ~/github/fzf%%**%%<TAB>'' 디렉토리 이동할 곳 자동완성   * ''cd %%**%%'', ''cd ~/github/fzf%%**%%<TAB>'' 디렉토리 이동할 곳 자동완성
   * ''vim %%**%%'', ''vim ../%%**%%'' : 편집할 파일 자동완성   * ''vim %%**%%'', ''vim ../%%**%%'' : 편집할 파일 자동완성
 +  * ''kill -9 <TAB>'' : kill 할 process ID 찾아줌
 +  * ''ssh %%**%%<TAB>'', ''telnet %%**%%<TAB>'' : ''/etc/hosts'', ''~/.ssh/config'' 등에서 접속이력이 있는 Host 찾아줌
 +  * ''unset %%**%%<TAB>'', ''export %%**%%<TAB>'', ''unalias %%**%%<TAB>'' : 환경변수 자동완성
 +
 +===== 검색 옵션 =====
 +  * ''^music mp3$ | wav$ | flac$'' : ''music'' 으로 시작하고 ''mp3,wav,flac'' 으로 끝나는 내용만 검색됨
 +  * '''Exactmatch'' : 보통은 fuzzy match (글자가 띄엄띄엄 일치해도 검색)되지만 맨 앞에 홑따옴표(''''')를 두면 정확히 일치하는 것만 검색됨.
 +  * ''!music'', ''!^music'' : ''!'' 은 해당 문자열을 제외한 결과만 보여준다.
 +===== 단축키 =====
 +  * ''Enter'' : 선택 적용
 +  * 다중선택(''-m'' 옵션으로 실행시)일 경우 ''<Tab>'', ''<Shitf><Tab>'' 으로 다중 선택.
 +  * ''<Ctrl>J/K/N/P'' 로 이동
 +  * ''<Ctrl>C/G'', ''ESC'' : 취소
 +  * 단축키 변경
 +<code sh>
 +export FZF_DEFAULT_OPTS='--bind alt-j:down,alt-k:up'
 +</code>
 +===== 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]]
  
 ===== 참조 ===== ===== 참조 =====
줄 17: 줄 65:
   * [[http://snowdeer.github.io/mac-os/2018/11/04/how-to-use-fzf/|유용한 탐색 프로그램 fzf 사용하기 · snowdeer's Code Holic]]   * [[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/@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]]
linux/fzf.1601100434.txt.gz · 마지막으로 수정됨: 2020/09/26 15:07 저자 kwon37xi