Skip to content

Instantly share code, notes, and snippets.

@ravjot28
Forked from idleberg/fish_shell.md
Created March 14, 2019 23:54
Show Gist options
  • Select an option

  • Save ravjot28/32f44befba41b2ec8c7e8c0bf1f2a04a to your computer and use it in GitHub Desktop.

Select an option

Save ravjot28/32f44befba41b2ec8c7e8c0bf1f2a04a to your computer and use it in GitHub Desktop.

Revisions

  1. @idleberg idleberg revised this gist Aug 20, 2018. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions fish_shell.md
    Original file line number Diff line number Diff line change
    @@ -90,12 +90,12 @@ function os
    case Darwin Linux FreeBSD NetBSD DragonFly
    eval command uname -s
    case "*"
    switch (uname -s)
    case Cygwin
    eval command uname -s
    case "*"
    eval echo "undefined"
    end
    switch (uname -s)
    case Cygwin
    eval command uname -s
    case "*"
    eval echo "undefined"
    end
    end
    end
    ```
  2. @idleberg idleberg revised this gist Aug 20, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fish_shell.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@
    ```bash
    brew install fish
    curl -L https://get.oh-my.fish | fish
    sudo echo /usr/local/bin/fish >> /etc/shells
    echo /usr/local/bin/fish >> /etc/shells
    chsh -s /usr/local/bin/fish
    ```

  3. @idleberg idleberg revised this gist Nov 25, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fish_shell.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@

    ```bash
    brew install fish
    curl -L https://github.com/bpinto/oh-my-fish/raw/master/tools/install.fish | fish
    curl -L https://get.oh-my.fish | fish
    sudo echo /usr/local/bin/fish >> /etc/shells
    chsh -s /usr/local/bin/fish
    ```
  4. @idleberg idleberg revised this gist Nov 25, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fish_shell.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # Installation

    1. Install [fish](http://fishshell.com/) via [Brew](http://brew.sh/)
    2. Optionally install [Oh My Fish!](https://github.com/bpinto/oh-my-fish)
    2. Optionally install [Oh My Fish!](https://github.com/oh-my-fish/oh-my-fish)
    3. Add fish to known shells
    4. Set default shell to fish

  5. @idleberg idleberg revised this gist Mar 31, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions fish_shell.md
    Original file line number Diff line number Diff line change
    @@ -77,6 +77,7 @@ function docs
    end
    cd $documents
    end
    end
    ```

    ### os
  6. @idleberg idleberg revised this gist Mar 24, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fish_shell.md
    Original file line number Diff line number Diff line change
    @@ -44,7 +44,7 @@ And how often did you ever type `cd..` instead of `cd ..`? Let's extend our prev

    ```
    function cd..
    .. # or `cd ..`
    cd ..
    end
    ```

  7. @idleberg idleberg revised this gist Mar 24, 2016. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions fish_shell.md
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ chsh -s /usr/local/bin/fish

    Add any the following functions to `~/.config/fish/config.fish`

    ## sudo bang bang
    ### sudo bang bang

    Repeat previous command with administrator rights

    @@ -30,7 +30,7 @@ function sudo
    end
    ```

    ## cd..
    ### cd..

    Shortcut to browse parent directory

    @@ -48,7 +48,7 @@ function cd..
    end
    ```

    # dropbox
    ### dropbox

    Quickly access your DropBox folder

    @@ -59,7 +59,7 @@ function db
    end
    ```

    # docs
    ### docs

    Quickly access your documents folder

    @@ -79,7 +79,7 @@ function docs
    end
    ```

    # os
    ### os

    Return platform name

    @@ -99,7 +99,7 @@ function os
    end
    ```

    # git tag
    ### git tag

    Simplify the creation and deletion of Git tags

    @@ -117,4 +117,4 @@ function tag
    command git push --tags
    end
    end
    ```
    ```
  8. @idleberg idleberg revised this gist Mar 24, 2016. No changes.
  9. @idleberg idleberg renamed this gist Mar 24, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  10. @idleberg idleberg renamed this gist Mar 24, 2016. 1 changed file with 0 additions and 0 deletions.
  11. @idleberg idleberg revised this gist Mar 24, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Install fish shell.md
    Original file line number Diff line number Diff line change
    @@ -83,6 +83,7 @@ function docs

    Return platform name

    ```
    function os
    switch (uname -s)
    case Darwin Linux FreeBSD NetBSD DragonFly
    @@ -96,6 +97,7 @@ function os
    end
    end
    end
    ```

    # git tag

  12. @idleberg idleberg revised this gist Mar 24, 2016. 1 changed file with 18 additions and 0 deletions.
    18 changes: 18 additions & 0 deletions Install fish shell.md
    Original file line number Diff line number Diff line change
    @@ -79,6 +79,24 @@ function docs
    end
    ```

    # os

    Return platform name

    function os
    switch (uname -s)
    case Darwin Linux FreeBSD NetBSD DragonFly
    eval command uname -s
    case "*"
    switch (uname -s)
    case Cygwin
    eval command uname -s
    case "*"
    eval echo "undefined"
    end
    end
    end

    # git tag

    Simplify the creation and deletion of Git tags
  13. @idleberg idleberg revised this gist Mar 24, 2016. No changes.
  14. @idleberg idleberg revised this gist Mar 24, 2016. 1 changed file with 45 additions and 46 deletions.
    91 changes: 45 additions & 46 deletions Install fish shell.md
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ Add any the following functions to `~/.config/fish/config.fish`

    Repeat previous command with administrator rights

    ```bash
    ```
    function sudo
    if test "$argv" = !!
    eval command sudo $history[1]
    @@ -30,72 +30,71 @@ function sudo
    end
    ```

    # cd..
    ## cd..

    Shortcut to browse parent directory

    function ..
    cd ..
    end
    ```
    function ..
    cd ..
    end
    ```

    And how often did you ever type `cd..` instead of `cd ..`? Let's extend our previous function:

    function cd..
    .. # or `cd ..`
    end
    function cd..
    ..
    end
    ```
    function cd..
    .. # or `cd ..`
    end
    ```

    # dropbox

    Quickly access your DropBox
    function db
    set user $HOME
    cd "$HOME/Dropbox"
    end
    # documents
    Quickly access your documents folder
    Quickly access your DropBox folder

    function docs
    ```
    function db
    set user $HOME
    cd "$HOME/Dropbox"
    end
    ```

    switch (uname -s)
    case Darwin Linux FreeBSD NetBSD DragonFly
    set documents $HOME/Documents
    # docs

    case '*'
    set cygwin (eval uname -o)
    Quickly access your documents folder

    ```
    function docs
    switch (uname -s)
    case Darwin Linux FreeBSD NetBSD DragonFly
    set documents $HOME/Documents
    case '*'
    set cygwin (eval uname -o)
    if test $cygwin = "Cygwin"
    set documents (eval cygpath -O)
    end
    return
    end
    cd $documents
    end
    ```

    # git tag

    Simplify the creation and deletion of Git tags

    function tag
    if test $argv[1] = "-d"
    # delete tag if provided
    if test $argv[2]
    eval command git tag -d $argv[2]
    command git push origin :refs/tags/$argv[2]
    end
    else
    # create new tag and push
    eval command git tag -a $argv[1] -m $argv[1]
    command git push --tags
    end
    end
    ```
    function tag
    if test $argv[1] = "-d"
    # delete tag if provided
    if test $argv[2]
    eval command git tag -d $argv[2]
    command git push origin :refs/tags/$argv[2]
    end
    else
    # create new tag and push
    eval command git tag -a $argv[1] -m $argv[1]
    command git push --tags
    end
    end
    ```
  15. @idleberg idleberg revised this gist Mar 24, 2016. 1 changed file with 24 additions and 0 deletions.
    24 changes: 24 additions & 0 deletions Install fish shell.md
    Original file line number Diff line number Diff line change
    @@ -57,6 +57,30 @@ Quickly access your DropBox
    set user $HOME
    cd "$HOME/Dropbox"
    end
    # documents
    Quickly access your documents folder
    function docs
    switch (uname -s)
    case Darwin Linux FreeBSD NetBSD DragonFly
    set documents $HOME/Documents
    case '*'
    set cygwin (eval uname -o)
    if test $cygwin = "Cygwin"
    set documents (eval cygpath -O)
    end
    return
    end
    cd $documents
    end
    # git tag
  16. @idleberg idleberg revised this gist Mar 23, 2016. 1 changed file with 15 additions and 4 deletions.
    19 changes: 15 additions & 4 deletions Install fish shell.md
    Original file line number Diff line number Diff line change
    @@ -32,11 +32,22 @@ end
    # cd..
    How often did you type `cd..` instead of `cd ..`?
    Shortcut to browse parent directory
    function ..
    cd ..
    end
    And how often did you ever type `cd..` instead of `cd ..`? Let's extend our previous function:
    function cd..
    .. # or `cd ..`
    end
    function cd..
    ..
    end
    function cd..
    cd ..
    end
    # dropbox
  17. @idleberg idleberg revised this gist Mar 23, 2016. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions Install fish shell.md
    Original file line number Diff line number Diff line change
    @@ -37,6 +37,15 @@ How often did you type `cd..` instead of `cd ..`?
    function cd..
    cd ..
    end
    # dropbox
    Quickly access your DropBox
    function db
    set user $HOME
    cd "$HOME/Dropbox"
    end
    # git tag
  18. @idleberg idleberg revised this gist Mar 23, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Install fish shell.md
    Original file line number Diff line number Diff line change
    @@ -38,11 +38,11 @@ How often did you type `cd..` instead of `cd ..`?
    cd ..
    end
    # Git release
    # git tag
    Simplify the creation and deletion of Git tags
    function rels
    function tag
    if test $argv[1] = "-d"
    # delete tag if provided
    if test $argv[2]
  19. @idleberg idleberg revised this gist Mar 23, 2016. 1 changed file with 19 additions and 1 deletion.
    20 changes: 19 additions & 1 deletion Install fish shell.md
    Original file line number Diff line number Diff line change
    @@ -36,4 +36,22 @@ How often did you type `cd..` instead of `cd ..`?
    function cd..
    cd ..
    end
    end
    # Git release
    Simplify the creation and deletion of Git tags
    function rels
    if test $argv[1] = "-d"
    # delete tag if provided
    if test $argv[2]
    eval command git tag -d $argv[2]
    command git push origin :refs/tags/$argv[2]
    end
    else
    # create new tag and push
    eval command git tag -a $argv[1] -m $argv[1]
    command git push --tags
    end
    end
  20. @idleberg idleberg revised this gist Oct 9, 2015. 1 changed file with 12 additions and 2 deletions.
    14 changes: 12 additions & 2 deletions Install fish shell.md
    Original file line number Diff line number Diff line change
    @@ -14,9 +14,11 @@ chsh -s /usr/local/bin/fish

    # Functions

    Add any the following functions to `~/.config/fish/config.fish`

    ## sudo bang bang

    For `sudo !!` (“sudo bang bang”), add the following to your `~/.config/fish/config.fish`
    Repeat previous command with administrator rights

    ```bash
    function sudo
    @@ -26,4 +28,12 @@ function sudo
    command sudo $argv
    end
    end
    ```
    ```
    # cd..
    How often did you type `cd..` instead of `cd ..`?
    function cd..
    cd ..
    end
  21. @idleberg idleberg revised this gist Oct 9, 2015. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions Install fish shell.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # Installation

    1. Install [fish](http://fishshell.com/) via [Brew](http://brew.sh/)
    2. Optionally install [Oh My Fish!](https://github.com/bpinto/oh-my-fish)
    3. Add fish to known shells
    @@ -10,6 +12,10 @@ sudo echo /usr/local/bin/fish >> /etc/shells
    chsh -s /usr/local/bin/fish
    ```

    # Functions

    ## sudo bang bang

    For `sudo !!` (“sudo bang bang”), add the following to your `~/.config/fish/config.fish`

    ```bash
  22. @idleberg idleberg revised this gist Sep 26, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Install fish shell.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    3. Add fish to known shells
    4. Set default shell to fish

    ```shell
    ```bash
    brew install fish
    curl -L https://github.com/bpinto/oh-my-fish/raw/master/tools/install.fish | fish
    sudo echo /usr/local/bin/fish >> /etc/shells
    @@ -12,7 +12,7 @@ chsh -s /usr/local/bin/fish

    For `sudo !!` (“sudo bang bang”), add the following to your `~/.config/fish/config.fish`

    ```shell
    ```bash
    function sudo
    if test "$argv" = !!
    eval command sudo $history[1]
  23. @idleberg idleberg revised this gist Sep 26, 2014. 1 changed file with 13 additions and 1 deletion.
    14 changes: 13 additions & 1 deletion Install fish shell.md
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,16 @@ brew install fish
    curl -L https://github.com/bpinto/oh-my-fish/raw/master/tools/install.fish | fish
    sudo echo /usr/local/bin/fish >> /etc/shells
    chsh -s /usr/local/bin/fish
    ```
    ```

    For `sudo !!` (“sudo bang bang”), add the following to your `~/.config/fish/config.fish`

    ```shell
    function sudo
    if test "$argv" = !!
    eval command sudo $history[1]
    else
    command sudo $argv
    end
    end
    ```
  24. @idleberg idleberg renamed this gist Sep 17, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  25. @idleberg idleberg revised this gist Aug 7, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install fish.md
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,6 @@
    ```shell
    brew install fish
    curl -L https://github.com/bpinto/oh-my-fish/raw/master/tools/install.fish | fish
    echo /usr/local/bin/fish >> /etc/shells
    sudo echo /usr/local/bin/fish >> /etc/shells
    chsh -s /usr/local/bin/fish
    ```
  26. @idleberg idleberg renamed this gist Aug 7, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  27. @idleberg idleberg revised this gist Aug 7, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion fish.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    1. Install [fish](http://fishshell.com/) via [Brew](http://brew.sh/)

    2. Optionally install [Oh My Fish!](https://github.com/bpinto/oh-my-fish)
    3. Add fish to known shells
    4. Set default shell to fish

    ```shell
    brew install fish
  28. @idleberg idleberg revised this gist Aug 7, 2014. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions fish.md
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,9 @@

    2. Optionally install [Oh My Fish!](https://github.com/bpinto/oh-my-fish)


    brew install fish
    curl -L https://github.com/bpinto/oh-my-fish/raw/master/tools/install.fish | fish
    echo /usr/local/bin/fish >> /etc/shells
    chsh -s /usr/local/bin/fish
    ```shell
    brew install fish
    curl -L https://github.com/bpinto/oh-my-fish/raw/master/tools/install.fish | fish
    echo /usr/local/bin/fish >> /etc/shells
    chsh -s /usr/local/bin/fish
    ```
  29. @idleberg idleberg revised this gist Aug 7, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fish.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    2. Optionally install [Oh My Fish!](https://github.com/bpinto/oh-my-fish)


    brew install fish
    brew install fish
    curl -L https://github.com/bpinto/oh-my-fish/raw/master/tools/install.fish | fish
    echo /usr/local/bin/fish >> /etc/shells
    chsh -s /usr/local/bin/fish
  30. @idleberg idleberg revised this gist Aug 7, 2014. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions fish.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    1. Install [fish](http://fishshell.com/) via [Brew](http://brew.sh/) `brew install fish`
    1. Install [fish](http://fishshell.com/) via [Brew](http://brew.sh/)

    2. Optionally install [Oh My Fish!](https://github.com/bpinto/oh-my-fish)
    `curl -L https://github.com/bpinto/oh-my-fish/raw/master/tools/install.fish | fish`

    sudo -p
    echo /usr/local/bin/fish >> /etc/shells

    chsh -s /usr/local/bin/fish
    brew install fish
    curl -L https://github.com/bpinto/oh-my-fish/raw/master/tools/install.fish | fish
    echo /usr/local/bin/fish >> /etc/shells
    chsh -s /usr/local/bin/fish