From 560a40492e1954d19f4528d58c2f45b07379cff5 Mon Sep 17 00:00:00 2001 From: Akshay Date: Wed, 8 May 2024 11:40:31 +0100 Subject: new post: snip snap --- docs/posts/auto-currying_rust_functions/index.html | 2 +- docs/posts/bash_harder_with_vim/index.html | 2 +- docs/posts/call_to_ARMs/index.html | 2 +- docs/posts/color_conundrum/index.html | 2 +- docs/posts/font_size_fallacies/index.html | 2 +- docs/posts/index.html | 41 ++++-- docs/posts/lightweight_linting/index.html | 4 +- docs/posts/my_setup/index.html | 2 +- docs/posts/pixel_art_in_GIMP/index.html | 2 +- docs/posts/plain_text_journaling/index.html | 2 +- docs/posts/rapid_refactoring_with_vim/index.html | 2 +- docs/posts/snip_snap/index.html | 140 +++++++++++++++++++++ docs/posts/static_sites_with_bash/index.html | 2 +- docs/posts/termux_tandem/index.html | 2 +- docs/posts/turing_complete_type_systems/index.html | 2 +- 15 files changed, 183 insertions(+), 26 deletions(-) create mode 100644 docs/posts/snip_snap/index.html (limited to 'docs/posts') diff --git a/docs/posts/auto-currying_rust_functions/index.html b/docs/posts/auto-currying_rust_functions/index.html index 83e5c86..49b4c79 100644 --- a/docs/posts/auto-currying_rust_functions/index.html +++ b/docs/posts/auto-currying_rust_functions/index.html @@ -25,7 +25,7 @@ ">View Raw
- 09/05 — 2020 + 08/05 — 2020
356.44 diff --git a/docs/posts/bash_harder_with_vim/index.html b/docs/posts/bash_harder_with_vim/index.html index e62f1aa..db81097 100644 --- a/docs/posts/bash_harder_with_vim/index.html +++ b/docs/posts/bash_harder_with_vim/index.html @@ -25,7 +25,7 @@ ">View Raw
- 31/07 — 2019 + 30/07 — 2019
24.38 diff --git a/docs/posts/call_to_ARMs/index.html b/docs/posts/call_to_ARMs/index.html index 3b5e780..6aae1d8 100644 --- a/docs/posts/call_to_ARMs/index.html +++ b/docs/posts/call_to_ARMs/index.html @@ -25,7 +25,7 @@ ">View Raw
- 08/02 — 2020 + 07/02 — 2020
33.57 diff --git a/docs/posts/color_conundrum/index.html b/docs/posts/color_conundrum/index.html index 3178da8..aef6081 100644 --- a/docs/posts/color_conundrum/index.html +++ b/docs/posts/color_conundrum/index.html @@ -25,7 +25,7 @@ ">View Raw
- 31/12 — 2019 + 30/12 — 2019
14.39 diff --git a/docs/posts/font_size_fallacies/index.html b/docs/posts/font_size_fallacies/index.html index bebec46..513b1ef 100644 --- a/docs/posts/font_size_fallacies/index.html +++ b/docs/posts/font_size_fallacies/index.html @@ -25,7 +25,7 @@ ">View Raw
- 17/03 — 2020 + 16/03 — 2020
32.37 diff --git a/docs/posts/index.html b/docs/posts/index.html index 2a7c1a3..f048493 100644 --- a/docs/posts/index.html +++ b/docs/posts/index.html @@ -27,7 +27,24 @@
- 19/06 — 2023 + 08/05 — 2024 +
+ + Snip Snap + + + + + 2.1 + + min + + + + + +
+ 18/06 — 2023
Plain Text Journaling @@ -214,7 +231,7 @@
- 18/06 — 2020 + 17/06 — 2020
Turing Complete Type Systems @@ -231,7 +248,7 @@
- 09/05 — 2020 + 08/05 — 2020
Auto-currying Rust Functions @@ -248,7 +265,7 @@
- 09/04 — 2020 + 08/04 — 2020
Pixel Art In GIMP @@ -265,7 +282,7 @@
- 01/04 — 2020 + 31/03 — 2020
Rapid Refactoring With Vim @@ -282,7 +299,7 @@
- 17/03 — 2020 + 16/03 — 2020
Font Size Fallacies @@ -299,7 +316,7 @@
- 08/03 — 2020 + 07/03 — 2020
Termux Tandem @@ -316,7 +333,7 @@
- 08/02 — 2020 + 07/02 — 2020
Call To ARMs @@ -333,7 +350,7 @@
- 31/12 — 2019 + 30/12 — 2019
Color Conundrum @@ -350,7 +367,7 @@
- 23/11 — 2019 + 22/11 — 2019
Static Sites With Bash @@ -367,7 +384,7 @@
- 07/11 — 2019 + 06/11 — 2019
My Setup @@ -435,7 +452,7 @@
- 31/07 — 2019 + 30/07 — 2019
Bash Harder With Vim diff --git a/docs/posts/lightweight_linting/index.html b/docs/posts/lightweight_linting/index.html index 3f9bed6..9982385 100644 --- a/docs/posts/lightweight_linting/index.html +++ b/docs/posts/lightweight_linting/index.html @@ -217,10 +217,10 @@ class="sourceCode bash">
# within Cargo.toml
-[dependencies]
+[dependencies]
 tree-sitter = "0.20"
 
-[dependencies.tree-sitter-rust]
+[dependencies.tree-sitter-rust]
 git = "https://github.com/tree-sitter/tree-sitter-rust"

Let’s load in some Rust code to work with. As an ode to Gödel diff --git a/docs/posts/my_setup/index.html b/docs/posts/my_setup/index.html index 8df18f6..09843b3 100644 --- a/docs/posts/my_setup/index.html +++ b/docs/posts/my_setup/index.html @@ -25,7 +25,7 @@ ">View Raw

- 07/11 — 2019 + 06/11 — 2019
10.39 diff --git a/docs/posts/pixel_art_in_GIMP/index.html b/docs/posts/pixel_art_in_GIMP/index.html index e5be70c..d68ff60 100644 --- a/docs/posts/pixel_art_in_GIMP/index.html +++ b/docs/posts/pixel_art_in_GIMP/index.html @@ -25,7 +25,7 @@ ">View Raw
- 09/04 — 2020 + 08/04 — 2020
55.54 diff --git a/docs/posts/plain_text_journaling/index.html b/docs/posts/plain_text_journaling/index.html index 74faf0c..b96821a 100644 --- a/docs/posts/plain_text_journaling/index.html +++ b/docs/posts/plain_text_journaling/index.html @@ -25,7 +25,7 @@ ">View Raw
- 19/06 — 2023 + 18/06 — 2023
138.66 diff --git a/docs/posts/rapid_refactoring_with_vim/index.html b/docs/posts/rapid_refactoring_with_vim/index.html index 2303878..ac375b3 100644 --- a/docs/posts/rapid_refactoring_with_vim/index.html +++ b/docs/posts/rapid_refactoring_with_vim/index.html @@ -25,7 +25,7 @@ ">View Raw
- 01/04 — 2020 + 31/03 — 2020
79.12 diff --git a/docs/posts/snip_snap/index.html b/docs/posts/snip_snap/index.html new file mode 100644 index 0000000..02fa674 --- /dev/null +++ b/docs/posts/snip_snap/index.html @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + Snip Snap · peppe.rs + +
+
+ Home + / + Posts + / + Snip Snap + View Raw +
+
+ 08/05 — 2024 +
+ + 40.76 + + cm +   + + 2.1 + + min +
+
+

+ Snip Snap +

+
+

I regularly switch between exactly two things while working, a +“current” and an “alternate” item; a lot of tools I use seem to support +this flow.

+

git

+

Pass - to git-checkout to switch to the +previously active branch:

+
$ git branch
+* foo
+  bar
+
+$ git checkout bar
+$ git branch
+  foo
+* bar
+
+$ git checkout -
+$ git branch
+* foo
+  bar
+

bash - cd

+

This may not be exclusive to bash:

+
~/foo $ cd ~/bar
+~/bar $ cd -
+~/foo $
+

This is especially handy in combination with my git-worktree flow:

+
~/main-branch $ gwj feature
+~/feat-branch $ cd -
+~/main-branch $
+

bash - jobs

+

I often suspend multiple vim sessions with +Ctrl-Z:

+
$ jobs
+[1]+  Stopped                 vim transpiler/src/transform.rs
+[2]-  Stopped                 git commit --verbose
+

In the above example: I suspended vim when working on +transform.rs, and then began working on a commit by running +git commit without a message flag (lets you craft a message +in $EDITOR). To bring the current job to the foreground, +you can use fg:

+
$ fg
+

With a job identifier:

+
$ fg %2    # resumes interactive git commit
+

Or switch to “last” job, or the second-most-recently-resumed job:

+
$ fg %-
+$ %-      # shorthand
+

vim

+

Switch to the last active buffer with Ctrl+^. In +command-mode, # refers to the last active buffer, you can +use this as an argument to a few commands:

+
:b#      " switch to alternate buffer (same as Ctrl+^)
+:vsp#    " create a vertical split with the alternate buffer
+:read#   " read contents of alternate buffer into current buffer
+:!wc #   " pass file name of alternate buffer to the command `wc`
+

See :help c_# for more.

+

tmux

+

Switch to the last active tmux session with +<prefix>+shift+L.

+

qutebrowser

+

Switch to the last active tab with g$.

+ +
+ +
+ Hi. + +

I'm Akshay, programmer and pixel-artist.

+

+ I write open-source stuff to pass time. + I also design fonts: + scientifica, + curie. +

+

Send me a mail at nerdy@peppe.rs or a message at np@irc.rizon.net.

+
+ + Home + / + Posts + / + Snip Snap + View Raw +
+
+ + diff --git a/docs/posts/static_sites_with_bash/index.html b/docs/posts/static_sites_with_bash/index.html index c58a324..3123847 100644 --- a/docs/posts/static_sites_with_bash/index.html +++ b/docs/posts/static_sites_with_bash/index.html @@ -25,7 +25,7 @@ ">View Raw
- 23/11 — 2019 + 22/11 — 2019
21.18 diff --git a/docs/posts/termux_tandem/index.html b/docs/posts/termux_tandem/index.html index a5b15ef..5c6a8c6 100644 --- a/docs/posts/termux_tandem/index.html +++ b/docs/posts/termux_tandem/index.html @@ -25,7 +25,7 @@ ">View Raw
- 08/03 — 2020 + 07/03 — 2020
19.18 diff --git a/docs/posts/turing_complete_type_systems/index.html b/docs/posts/turing_complete_type_systems/index.html index 5f2ac60..06e44e6 100644 --- a/docs/posts/turing_complete_type_systems/index.html +++ b/docs/posts/turing_complete_type_systems/index.html @@ -25,7 +25,7 @@ ">View Raw
- 18/06 — 2020 + 17/06 — 2020
9.19 -- cgit v1.2.3