From 90c655e8e4d2cf8b4edc752f687cc03385264ff5 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 29 Jan 2026 14:50:27 -0500 Subject: [PATCH] update docs --- .config/nvim/README.md | 57 ++++++++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/.config/nvim/README.md b/.config/nvim/README.md index 05aaa2c..83934a8 100644 --- a/.config/nvim/README.md +++ b/.config/nvim/README.md @@ -52,20 +52,20 @@ Instead of editing text character-by-character, Lisp programmers edit **structur **Example - Slurping:** ```clojure -;; Before: cursor on the (+ 1 2) form -(let [x (+ 1 2)] 3) +;; Before: cursor inside the (+ 1 2) form +(foo (+ 1 2) 3 4) -;; After pressing >) (slurp forward) -(let [x (+ 1 2) 3]) +;; After pressing >) (slurp forward) - pulls 3 into the form +(foo (+ 1 2 3) 4) ``` **Example - Barfing:** ```clojure -;; Before -(let [x (+ 1 2 3)]) +;; Before: cursor inside the (+ 1 2 3) form +(foo (+ 1 2 3) 4) -;; After pressing <) (barf forward) on the + form -(let [x (+ 1 2) 3]) +;; After pressing <) (barf forward) - pushes 3 out of the form +(foo (+ 1 2) 3 4) ``` ### Interactive Development (REPL) @@ -174,7 +174,6 @@ Results appear in a floating HUD window. To interact with the full log: | Key | Action | |-----|--------| | `K` | Show documentation for symbol under cursor | -| `Space e d` | Describe form under cursor | ### Tip: Learn Interactively @@ -212,9 +211,9 @@ Move by **elements** (atoms or forms) rather than words: | `<)` | Barf forward (push last element out) | | `>(` | Barf backward (push first element out) | -**Visual example:** +**Visual example - forward operations:** ```clojure -;; Cursor on inner form: (+ 1 2) +;; Cursor inside: (+ 1 2) (foo (+ 1 2) 3 4) ;; >) slurp forward - pull 3 into the form @@ -227,6 +226,18 @@ Move by **elements** (atoms or forms) rather than words: (foo (+ 1 2 3) 4) ``` +**Visual example - backward operations:** +```clojure +;; Cursor inside: (+ 1 2) +(a b (+ 1 2)) + +;; <( slurp backward - pull b into the form +(a (b + 1 2)) + +;; >( barf backward - push b back out +(a b (+ 1 2)) +``` + ### Dragging Elements Move elements/forms left and right within their parent: @@ -238,6 +249,15 @@ Move elements/forms left and right within their parent: | `>f` | Drag form right | | `e drag element right - swap a and b +(foo b a c) +``` + ### Wrapping Wrap an element in delimiters: @@ -259,17 +279,28 @@ Wrap an element in delimiters: ;; Before (cursor inside the when form) (when true (println "hello")) -;; dsf - splice, removing the when form -true (println "hello") +;; dsf - splice, removing the surrounding parens +when true (println "hello") ``` ### Raise +Replace the parent form with the current form/element: + | Key | Action | |-----|--------| | `Space o` | Raise form (replace parent with current form) | | `Space O` | Raise element (replace parent with current element) | +**Example:** +```clojure +;; Before: cursor on (inner value) +(outer (inner value)) + +;; Space o - raise form, replacing parent with current form +(inner value) +``` + ### Text Objects Use with operators like `d`, `c`, `y`, `v`: