Skip to content

Instantly share code, notes, and snippets.

@bkono
Last active May 26, 2022 22:17
Show Gist options
  • Save bkono/7c7a5c1f30a54d80c751d0782be82f6e to your computer and use it in GitHub Desktop.
Save bkono/7c7a5c1f30a54d80c751d0782be82f6e to your computer and use it in GitHub Desktop.

Revisions

  1. bkono revised this gist May 26, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fl.fish
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    function fl -d "Fuzz-search through git log"
    function fl -d "Fuzzy-search through git log"
    _fzf_search_git_log
    end
  2. bkono revised this gist May 26, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion f.fish
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    function f -d "Fuzzy-find and open a file in current directory"
    set file (fzf-tmux --height 40% --info inline --border --reverse --preview 'bat {}')
    set file (fzf --height 40% --info inline --border --reverse --preview 'bat {}')
    if test -n "$file"
    nvim $file
    end
  3. bkono revised this gist May 26, 2022. 2 changed files with 1 addition and 12 deletions.
    11 changes: 0 additions & 11 deletions b.fish
    Original file line number Diff line number Diff line change
    @@ -1,11 +0,0 @@
    function fb -d "Fuzzy-find and checkout a branch"
    git rev-parse HEAD > /dev/null 2>&1 || return
    git branch --all --sort=-committerdate | grep -v HEAD | string trim | fzf -d 15 --reverse | read -l result
    if test -n "$result"
    if string match "remotes/*" "$result"
    git checkout -t "$result"
    else
    git checkout "$result"
    end
    end
    end
    2 changes: 1 addition & 1 deletion fb.fish
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    function fb -d "Fuzzy-find and checkout a branch"
    git rev-parse HEAD > /dev/null 2>&1 || return
    git branch --all --sort=-committerdate | grep -v HEAD | string trim | fzf -d 15 --reverse | read -l result
    git branch --all --sort=-committerdate | grep -v HEAD | string trim | fzf -d 15 --reverse --preview='git show --color=always --stat --patch {1}' | read -l result
    if test -n "$result"
    if string match "remotes/*" "$result"
    git checkout -t "$result"
  4. bkono revised this gist May 26, 2022. No changes.
  5. bkono created this gist May 26, 2022.
    11 changes: 11 additions & 0 deletions b.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    function fb -d "Fuzzy-find and checkout a branch"
    git rev-parse HEAD > /dev/null 2>&1 || return
    git branch --all --sort=-committerdate | grep -v HEAD | string trim | fzf -d 15 --reverse | read -l result
    if test -n "$result"
    if string match "remotes/*" "$result"
    git checkout -t "$result"
    else
    git checkout "$result"
    end
    end
    end
    6 changes: 6 additions & 0 deletions f.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    function f -d "Fuzzy-find and open a file in current directory"
    set file (fzf-tmux --height 40% --info inline --border --reverse --preview 'bat {}')
    if test -n "$file"
    nvim $file
    end
    end
    11 changes: 11 additions & 0 deletions fb.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    function fb -d "Fuzzy-find and checkout a branch"
    git rev-parse HEAD > /dev/null 2>&1 || return
    git branch --all --sort=-committerdate | grep -v HEAD | string trim | fzf -d 15 --reverse | read -l result
    if test -n "$result"
    if string match "remotes/*" "$result"
    git checkout -t "$result"
    else
    git checkout "$result"
    end
    end
    end
    3 changes: 3 additions & 0 deletions fl.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    function fl -d "Fuzz-search through git log"
    _fzf_search_git_log
    end
    3 changes: 3 additions & 0 deletions fs.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    function fs -d "Switch tmux session"
    tmux list-sessions -F "#{session_name}" | fzf | read -l result; and tmux switch-client -t "$result"
    end