Fork me on GitHub
#vim
<
2016-12-13
>
dominicm12:12:01

Post went live! https://juxt.pro/blog/posts/vim-1.html 😟 First blog post, bit nervous. You guys wanna catch out my errors first? 😄

mikepjb13:12:57

@dominicm having a read a now, will be sure to let you know! cheers

Jarrod Taylor (Clojure team)14:12:25

@dominicm I think the link to nvim-parinfer.js is incorrect. Currently seems to point back to the blog post.

mikepjb14:12:12

@dominicm how often do you use refactoring tools when working with clojure?

mikepjb14:12:29

@dominicm @jarrodctaylor same with the follow parinfer link in the same paragraph

jebberjeb14:12:29

@dominicm good quote from Case Nelson

jebberjeb14:12:02

Hrm, should I be using vim-sexp instead of paredit?

dominicm14:12:04

@jarrodctaylor @mikepjb Thanks for that! Fixed those links.

dominicm14:12:16

@mikepjb RE refactoring, not as often as I'd like. I have a rough idea of what's available though, and the rename-symbol stuff is just excellent.

dominicm14:12:59

I figure it will eventually become ingrained. Though, I probably have targetted the wrong ones for regular usage.

dominicm14:12:15

I regularly use crcn (Clean namespace) actually, so that's one that's ingrained pretty well.

dominicm14:12:46

I also think that magic require would be pretty cool to get setup.

mikepjb14:12:51

Using neovim with set ft=clojure and call Parengage() or whatever to setup vim-sexp is pretty neat do you use this in your setup?

mikepjb14:12:24

so you end up with a repl with paren balancing and syntax highlighting like emacs

dominicm15:12:40

What is Parengage()?

dominicm15:12:13

@jebberjeb I think vim-sexp is less... intrusive than paredit. Paredit breaks repeat (`.`) and changed dd in a way that didn't consistently balance.

mikepjb15:12:24

paredit/vim-sexp but very much a WIP

mikepjb15:12:48

the last commit adds paren balancing for nvim in terminal mode

dominicm15:12:08

That's pretty cool.

dominicm15:12:38

Is that your motivation for writing this?

mikepjb15:12:35

I wanted a less buggy paredit

mikepjb15:12:27

the nvim stuff just came about when trying boot/lein repl in terminal mode

mikepjb15:12:44

which was as simple as copy pasting inoremaps to tnoremaps

dominicm15:12:13

heh. I would be interested to see a truly less buggy paredit.

mikepjb15:12:35

haha I’m using vader.vim to unit test the movements

dominicm15:12:25

It'd be nice to have vim-sexp + dd that understood. That may be possible soon with the neovim api. But I don't want dd rebound, I want the TextChangedEvent to say "oh, this area is gone... ))))). Okay, we're good" And I think you need a shadow buffer for that. I might be wrong.

mikepjb15:12:21

what’s a shadow buffer?

dominicm15:12:48

It's a way of keeping a replica of a buffer, to do transformations, there was also mention of gofmt.

dominicm15:12:52

Oh, so TextChanged is probably good enough for this?

dominicm15:12:04

Oh, except you don't have a delta.

dominicm15:12:12

I seem to say Oh a lot..

mikepjb15:12:12

good enough for what?

mikepjb15:12:45

vim-sexp + dd?

dominicm15:12:52

Doing a generic balance, instead of hardcoding dd

mikepjb15:12:51

not sure I understand how the generic balance works

mikepjb15:12:14

(defn serve-pdf
  "Takes an encrypted data string, requests a pdf from s3 and watermarks it. Outputs the pdf"
  [http-request]
  (println (str "Request for " (get http-request :uri))))

mikepjb15:12:31

say your cursor in on the capital R in request on the last line

mikepjb15:12:37

if you dd would the text become

mikepjb15:12:17

(defn serve-pdf
  "Takes an encrypted data string, requests a pdf from s3 and watermarks it. Outputs the pdf"
  [http-request]
  )

dominicm15:12:47

Yeah. It would have to figure out which bit changed, and what is now unbalanced because of it.

dominicm15:12:26

The key part for me is that it wouldn't override dd though, just respond to the text changing. So that plugins which delete lines for me don't break (for example)

mikepjb15:12:36

I don’t know if smart-parens is any better but there’s plenty of behaviour where paredit misbehaves - like pasting unbalanced text into your document

mikepjb15:12:23

anyway it’s good to vimscript every once in a while!

dominicm15:12:16

Absolutely!

snoe17:12:50

you can get the changed area froma textchanged event most of the time with registers. it's not perfect though.

dominicm19:12:53

> it's not perfect though For me, vimscript in a nutshell

ndrluis19:12:48

@dominicm the acid link redirects to the blog post instead of acid repository

dominicm20:12:36

@ndrluis I thought I'd fixed that. Which section is the link in?

ndrluis20:12:01

@dominicm “Future adventures” section

dominicm21:12:56

@ndrluis hmm, thought I'd fixed that section. I'll take a look.

jebberjeb21:12:34

@dominicm maybe an addition for the future adventures section: https://github.com/maitria/avi

dominicm22:12:01

@jebberjeb must admit, not decided which vim clone takes my interest currently. Kakoune looks good on it's own way. Neovim seems most committed to extensibility though.