Skip to content

Commit

Permalink
Update the check for fzf installed via homebrew
Browse files Browse the repository at this point in the history
* Update the check for fzf installed via homebrew

* The existing check for fzf installed via homebrew doesn't work form
  Apple silicon macs, nor does it work for those who use homebrew of Linux.
* Add brew_fzf_path variable to get the brew prefixed path
* Update the isdirectory conditional to check this variable and use it
  for the Plug function call if it is a directory.
* Closes #681

Co-authored-by: Daniel Nolan <danielnolan@thoughtbot.com>
  • Loading branch information
rtaibah and danielnolan committed Jun 4, 2023
1 parent 5b40626 commit e14f5a3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions vimrc.bundles
Expand Up @@ -19,8 +19,12 @@ Plug 'christoomey/vim-run-interactive'

" If fzf has already been installed via Homebrew, use the existing fzf
" Otherwise, install fzf. The `--all` flag makes fzf accessible outside of vim
if isdirectory("/usr/local/opt/fzf")
Plug '/usr/local/opt/fzf'
if executable("brew")
let g:brew_fzf_path = trim(system("brew --prefix fzf"))
endif

if exists("g:brew_fzf_path") && isdirectory(g:brew_fzf_path)
Plug g:brew_fzf_path
else
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
endif
Expand Down

0 comments on commit e14f5a3

Please sign in to comment.