Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git and Vim - maximize the joy and fun

Git and Vim - maximize the joy and fun

Follow me through my travel exploring the way to get Vim and Git running in a friendly coexistence.

Matthias Günther

January 23, 2015
Tweet

More Decks by Matthias Günther

Other Decks in Technology

Transcript

  1. Vim and Git

    View Slide

  2. Who Am I
    @wikimatze
    Running vimberlin.de
    Writing padrinobook.com

    View Slide

  3. Workflows

    View Slide

  4. Terminal

    View Slide

  5. External Tool

    View Slide

  6. Vim …

    View Slide

  7. Plugins for Vim
    gitv
    fugitive
    vim-merginal

    View Slide

  8. gitv
    is a fugitive extension
    is a gitk/gitg clone => for
    me it’s a tig clone
    see diffs commits,
    branching, and merging

    View Slide

  9. gitv commands
    :Gitv … opens only gitv
    :Gitv! … opens only
    commits which affects the
    current file
    yc … yanks the SHA of the
    commit
    co … checkout

    View Slide

  10. gitv demo

    View Slide

  11. fugitive
    “best Git wrapper of all time”

    View Slide

  12. fugitive commands I
    :Gstatus … git status
    C-n … go to the next file
    C-p … go to the previous file
    - … git add/git reset depending
    where you are in the windows
    (mark multiple files in visual
    mode)

    View Slide

  13. fugitive commands II
    :Gwrite … stage the current
    file to index
    :Gcommit … git commit
    (press wq for send)
    :Gblame … git blame
    :Gremove … git rm

    View Slide

  14. fugitive commands III
    :Gpush … performs a git
    push
    :Gmove … rename the
    current file and add change
    to index
    :Gdiff … split the window

    View Slide

  15. fugitive demo

    View Slide

  16. Handling branches
    with vim-merginal
    :Merginal … opens the
    extra window
    C … checkout branch under
    the cursor
    A … add a branch from the
    current checked out branch
    under the cursor

    View Slide