Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 824 Bytes

snippets.md

File metadata and controls

50 lines (35 loc) · 824 Bytes

Snippets

This provides a central place for commonly used snippets/commands that can be used across various tools.


Tmux

Merge 2 windows into 1. This will move the 2nd window as a pane to the 1st window. Requires being in the target window (i.e. 1 in this case).

join-pane -s 2 -t 1

Rearrange windows. This swaps the position of window 2 and 1.

swap-window -s 2 -t 1

Vim

Delete up until a character (see :h t)

This deletes up until " character.

dt"

Split on a given character

Ex: Split long line on commas Visual select the line(s) then enter :'<,'>s/,/\r/g

component:a, name:test, other:field

Git

Force create a branch that exists. This resets the target branch and checks it out

git switch -C <branch>
or
git checkout -B <branch>