Skip to main content
added 1327 characters in body
Source Link
abo-abo
  • 14.3k
  • 1
  • 32
  • 44

In the case of active region, h in lispy will do what you want. See my recent intro post.

In the first case, you need to M-m h.

update: all options that you have with lispy

Starting with:

(defn foo [x] (+ x ~42|))

Here, ~ denotes the mark (the start of the region), and | denotes the point (the end of the region).

  1. With h you get:

     (defn foo [x] |(+ x 42)~)
    
  2. With l you get:

     (defn foo [x] ~(+ x 42)|)
    
  3. With k you get (undoable with j):

     (defn foo [x] (+ ~x| 42))
    
  4. With 2k or kk you get :

     (defn foo [x] (~+| x 42))
    
  5. With d you get:

     (defn foo [x] (+ x |42~))
    
  6. With d> you get (undoable with <):

     (defn foo [x] (+ |x 42~))
    
  7. With d2> or d>> you get:

     (defn foo [x] (|+ x 42~))
    
  8. With m you get:

     (defn foo [x] (+ x 42|))
    

Just to summarize, when region is active, h, j, k, l are the arrows that move the region. > grows the region by one semantic unit in the direction of the point. < shrinks the region by one semantic unit in the direction of the point. m deactivates the mark. i selects the first element of the region, and d exchanges point and mark.

In the case of active region, h in lispy will do what you want. See my recent intro post.

In the first case, you need to M-m h.

In the case of active region, h in lispy will do what you want. See my recent intro post.

In the first case, you need to M-m h.

update: all options that you have with lispy

Starting with:

(defn foo [x] (+ x ~42|))

Here, ~ denotes the mark (the start of the region), and | denotes the point (the end of the region).

  1. With h you get:

     (defn foo [x] |(+ x 42)~)
    
  2. With l you get:

     (defn foo [x] ~(+ x 42)|)
    
  3. With k you get (undoable with j):

     (defn foo [x] (+ ~x| 42))
    
  4. With 2k or kk you get :

     (defn foo [x] (~+| x 42))
    
  5. With d you get:

     (defn foo [x] (+ x |42~))
    
  6. With d> you get (undoable with <):

     (defn foo [x] (+ |x 42~))
    
  7. With d2> or d>> you get:

     (defn foo [x] (|+ x 42~))
    
  8. With m you get:

     (defn foo [x] (+ x 42|))
    

Just to summarize, when region is active, h, j, k, l are the arrows that move the region. > grows the region by one semantic unit in the direction of the point. < shrinks the region by one semantic unit in the direction of the point. m deactivates the mark. i selects the first element of the region, and d exchanges point and mark.

Source Link
abo-abo
  • 14.3k
  • 1
  • 32
  • 44

In the case of active region, h in lispy will do what you want. See my recent intro post.

In the first case, you need to M-m h.