This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-09
Channels
- # announcements (1)
- # aws (2)
- # babashka (3)
- # beginners (39)
- # calva (6)
- # chlorine-clover (20)
- # cider (9)
- # clojure (105)
- # clojure-australia (1)
- # clojure-europe (64)
- # clojure-france (2)
- # clojure-gamedev (2)
- # clojure-nl (10)
- # clojure-provo (1)
- # clojure-uk (21)
- # clojuredesign-podcast (1)
- # clojurescript (77)
- # clojurewerkz (2)
- # clojutre (1)
- # community-development (4)
- # conjure (13)
- # data-science (6)
- # datascript (10)
- # datomic (37)
- # fulcro (33)
- # graphql (23)
- # jobs (1)
- # luminus (2)
- # malli (12)
- # meander (2)
- # off-topic (42)
- # pathom (5)
- # re-frame (5)
- # reitit (3)
- # remote-jobs (6)
- # reveal (38)
- # shadow-cljs (2)
- # spacemacs (14)
- # specmonstah (1)
- # sql (8)
- # tools-deps (2)
- # vim (8)
- # xtdb (22)
So <e
and >e
(from tpope/vim-sexp-mappings-for-regular-people) are super useful for moving elements around. Is there something similar for rearranging map items (key with its value) simultaneously? I.e. move elements around, two at a time
👀 3
nmap >p 3>e3B3>e
nmap <p 2<e4E2<e
it is a hack - move each element of *p*air one at a time
does not work if you try to move on the edge of the form❤️ 3
turns out that sexp supports moving around visually selected pairs. I've created a PR for missing mapping https://github.com/tpope/vim-sexp-mappings-for-regular-people/pull/12 . If you have the mapping from the PR than swapping pairs is
nmap >p vaeE>eo<Esc>
nmap <p vaeE<eo<Esc>
selects around current element, moves to the next, visually swaps, moves cursor to the beginning of selection and exists visual mode 3