This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-27
Channels
- # aws (8)
- # beginners (172)
- # boot-dev (4)
- # cider (16)
- # cljs-dev (123)
- # cljsjs (4)
- # clojure (90)
- # clojure-brasil (3)
- # clojure-dev (7)
- # clojure-dusseldorf (1)
- # clojure-finland (1)
- # clojure-italy (59)
- # clojure-russia (3)
- # clojure-seattle (2)
- # clojure-seattle-old (1)
- # clojure-spec (40)
- # clojure-uk (28)
- # clojurescript (327)
- # clojurewerkz (3)
- # code-reviews (8)
- # cursive (4)
- # datomic (24)
- # editors (1)
- # emacs (19)
- # fulcro (147)
- # funcool (1)
- # graphql (1)
- # hoplon (34)
- # jobs-rus (1)
- # lein-figwheel (5)
- # leiningen (20)
- # luminus (14)
- # midje (1)
- # off-topic (8)
- # onyx (7)
- # parinfer (47)
- # pedestal (1)
- # perun (1)
- # portkey (46)
- # re-frame (25)
- # reagent (9)
- # remote-jobs (4)
- # ring-swagger (5)
- # rum (1)
- # shadow-cljs (113)
- # slack-help (8)
- # spacemacs (7)
- # sql (9)
- # tools-deps (23)
- # uncomplicate (3)
- # unrepl (3)
- # yada (6)
TIL you can disable vim-sexp's insert-mode bindings. Which makes it compatible with vim parinfer plugins. And now I'm super happy.
Oh, it inserts close parens for your open parens, and prevents closing parens, moving you to the close of the form, right?
So, here's an interesting problem that I'm not sure what to do with. Certain Vim operations are related to the cursor position, and certain ones aren't. Currently, I send the cursor position in for smart mode when in insert mode. This is kind of nice.
I don't send it for normal mode changes. If I indent a line with >>
for example, the cursor position is not important. I guess, because it's line-wise?
But there are various things in normal mode where it is important. x
to delete a character, for example.
If I send the cursor position when it isn't relevant, smart mode will adjust the indentation of more lines, which I think is bad. For example, with the >>
, I think if I send it, it will also indent successive lines within the form, if the cursor is to the left of the inserted spaces, but not if it is to the right of the inserted spaces.
So far, I'm thinking it should not be sent for linewise commands or ex commands, but everything else. Unfortunately, I don't know how to detect which it is.
@doglooksgood did we have a discussion about parinfer working with other languages? I canโt remember what we decided since the logs are lost: https://twitter.com/DevinRhode2/status/978715648703565824
would be nice if we moved those interesting conversations to our forum for posterity: https://talk.parinfer.io/
@eraserhd do you ever do r<enter>
that's a case where I'm guessing the cursor being "on" would help.
I don't, though there's an a line that looks roughly like if a:is_insert
that you could delete to play around with what it would do.
I tell you what. I think I'm going to send it the cursor all the time, and then fix any cases that come up.
I'm going to demo this tomorrow at a meetup, amongst the rest of my vim setup. Should be interesting.
How would we change the indentation of a single line, then? Hrmm. Well, I'll dogfood it anyway.
@eraserhd is there a :ParinferOn? I want to show vim-sexp first, including the slurp & barf stuff
https://github.com/eraserhd/parinfer-rust/blob/master/plugin/parinfer.vim#L22-L30 ah, looks like :ParinferToggle
will put me in smart mode straight away, cool ๐