Fork me on GitHub
#vim
<
2019-10-28
>
walterl14:10:56

@dominicm Kudos for mentioning (in your cljs podcast interview) that one can directly edit the git index with vim-fugitive. 💯 I've yet to find that ability in any other tool, and have been using it for years to create better commits.

dominicm14:10:51

It's a weird feature until you start using it, then it's the best feature ever. It's so natural.

💯 4
dave15:10:35

i don't think i fully understand -- is it like magit?

dave15:10:24

^allows you to stage/unstage changes at the file, hunk, or line level

dave15:10:44

i use vimagit all the time to isolate separate changes into individual commits

dominicm16:10:59

No 🙂 Not quite. Same result, better interface.

walterl16:10:03

vimagit looks great. I'd really like that <C-n> functionality in fugitive. But the fugitive functionality we were talking about goes beyond the line level. That's the cool part. You stage changes in a diff mode between your working copy and the staged area (initialized from the last commit). In effect that gives you a modifiable vim buffer, with all changes written to it being staged automatically.

dominicm16:10:06

(fwiw, that functionality is now in fugitive itself)

dominicm16:10:19

<C-n> is in fugitive! Has been for ages!

orly 4
dominicm16:10:27

(`:Gstatus` and give it a go)

dominicm16:10:43

Something you can do with fugitive you can't do with magit: == to reindent the change you just made because in your local copy you added a wrapping (let), but fixing the typo in the comment shouldn't also be reindented yet.

dominicm16:10:48

(just did this)

walterl16:10:26

Great example!

walterl16:10:30

@dominicm Ah! You first have to "open" a changed file with = (in :Gstatus), then you can <C-n> (or ]c) by hunk, and stage it with -. Pretty neat! #TIL #levelup

dominicm16:10:45

Undocumented: visual selections work too

orly 4
dave18:10:48

@dominicm you mentioned on the podcast that vim-salve gives you some part of the functionality provided by vim-jack-in, but vim-salve is heavyweight. just wanted to throw it out there that i made a "diet" version of salve: https://github.com/daveyarwood/vim-diet-salve

dominicm18:10:17

other way round 🙂 vim-jack-in gives you some of vim-salve

dave18:10:44

ah, that makes sense

dave18:10:10

oh, cool, it looks like salve now has support for clojure CLI as well

dominicm18:10:38

yeah it does.

dominicm18:10:47

I think these might be competing plugins.

dave18:10:08

i remember using both diet-salve and vim-jack-in

dave18:10:15

i'm not totally sure how the two compare

dave18:10:34

i guess one difference is that vim-jack-in does dependency injection, right?

dave18:10:15

it looks like salve injects nrepl middleware. IIRC, vim-jack-in also injects clj-refactor

dominicm18:10:07

Yeah. That's right. I also did it as data rather than as a string.

dave18:10:19

salve seems pretty confusing. like, it actually looks like it only includes the nrepl middleware for deps.edn REPLs. for lein and boot, it just runs lein repl and boot repl, if i'm understanding correctly

dave18:10:25

re-reading the issue i filed ( https://github.com/tpope/vim-salve/issues/18 ), it looks like i was only using salve for its feature where it auto-connects fireplace to the REPL you already have running by reading .nrepl-port