Fork me on GitHub
#vim
<
2018-04-13
>
dominicm06:04:50

@devth probably easier to debug pprint with you here. What are you trying, what are you seeing?

devth15:04:34

@dominicm hey! i'm doing cpp as usual. seeing the old style non-pretty data structure

devth15:04:33

git log on my vim plugin, verifies i have your changes:

thartman at 17:50:13 in ~/.config/nvim/repos/github.com/tpope/vim-fireplace on master
± g log --oneline
a315268 (HEAD -> master, origin/master, origin/HEAD) Add pprint support to :Eval
d745b00 Clean up msg mutating code in nrepl adapter
9b9a808 Add pprint to cpp [#262]
...

devth15:04:57

cpp on

(into {} (map #(vector % (str (rand-int 100))) (range 10)))
gives:
{0 "35", 7 "19", 1 "33", 4 "74", 6 "58", 3 "63", 2 "57", 9 "48", 5 "70", 8 "97"}
expected:
{0 "26",
 7 "91",
 1 "77",
 4 "54",
 6 "70",
 3 "57",
 2 "67",
 9 "79",
 5 "24",
 8 "29"}

dominicm15:04:42

@devth in the source code, the width is set to the screen width by default, I think this is a terrible default, try setting it to 80

dominicm15:04:50

I can't recall the variable name

devth15:04:58

thanks. i'll look it up

dominicm15:04:21

I also recommend changing the pretty printer, but do that after

devth16:04:10

would it be g:fireplace_print_length?

devth16:04:03

tried resizing my terminal pretty narrow in above

dave16:04:11

whoa -- so is fireplace supposed to pretty-print results by default now?

dave16:04:52

that's a killer feature -- thanks for submitting that, @dominicm

devth16:04:59

agreed. 💯

dave16:04:54

i can't count the number of times i've run :Last, copy-pasted the result into my buffer, and manually added line breaks, just so i could read it

devth16:04:06

same here 😂

dave16:04:12

glad i'm not alone

devth16:04:56

there have been a few projects made to address this problem - visualizing large structures. can't remember what they were. usually made for emacs first, vim later

dave16:04:50

oh yeah, i've seen some things like that

dave16:04:49

nice, it's working for me out of the box!

dave16:04:32

i'm sure it has something to do with screen width

dave16:04:49

i've got vim open in a huge window on my external monitor

devth16:04:08

i tried it super wide and narrow. neovim inside tmux inside iterm2 on macos

dave16:04:20

hmm, could be OS-specific in some obscure way

devth16:04:34

you use cider too?

dave16:04:35

i'm using neovim inside tmux as well, but in roxterm on ubuntu 16.04

markwoodhall16:04:54

Similar setup and it's all working on the box for me too.

dave16:04:09

do i use cider, like in emacs? i don't have emacs set up

devth16:04:22

cider lein plugin. fireplace recommends it

dave16:04:53

oh, like the nrepl middleware? i have that in my profile.boot

dave16:04:02

i haven't tried this on a lein project yet

eraserhd16:04:10

@dominicm That's nice!! (pprint)

markwoodhall16:04:15

It's working ok for me on a lein project with cider.

devth16:04:03

ah i messed with some of my existing fireplace / clojure settings in init.vim and it started working. narrowing down which setting it was :thinking_face:

devth16:04:53

hm now i can't repro it not working. seemed to start working after several vim restarts. anyway, this is awesome now that it's working. nice work @dominicm!

devth16:04:18

particularly awesome is that it shows up pretty printed in :Last. so useful

dominicm16:04:27

@devth can you confirm your cider version? There's a bug in 0.15.0 that means it only works every 50% of JVM restarts.

devth17:04:54

i was using 0.16.0

devth17:04:32

(i had upgraded immediately after the first try that didn't work. still didn't work after upgrade until many vim and nrepl restarts later)

eraserhd18:04:39

OK, I should ask this here. I use Ctrl+P on my project, and it's kinda sluggish. I actually moved to it from something that was more sluggish (I forget what). Should I be using it or something else, or is there some obvious config I'm missing?

eraserhd18:04:16

I mean, tell me I don't need to rewrite it in rust, ok? I'm begging... 😄

dominicm18:04:50

Fzf is quite good, for fast.

eraserhd18:04:52

Oh. I remember Gary Bernhard has vimrc for using his selecta.

dominicm18:04:08

@devth let me know if you trace it back to anything in particular.

4
dave19:04:54

i'll +1 fzf. it's incredible

dave19:04:24

apparently https://github.com/jhawthorn/fzy is even better, but i'm so satisfied with fzf, i doubt i'll ever try it 😛

eraserhd19:04:42

Hmm. This is neat.

schmee19:04:50

I’ve used Command-T for a long time and it’s been great, super fast, no problems whatsoever

eraserhd19:04:47

Ahhh... That's what I used to use. I wonder why I stopped.

schmee19:04:14

the one downside I’ve experienced is that it has a dependency on Ruby

schmee19:04:28

so it can be tricky to install if you don’t know how that works

eraserhd19:04:33

hmmm.... Oh, I did have Ruby dependency madness with my Vim at one point.

defndaines19:04:37

Yeah, I was fiddling with Command-T the other day, and dropped it for fear it would mess up too many other things just to set it up.

dominicm19:04:29

fzf is pretty good largely from a documentation perspective.

dave20:04:51

yeah, i found fzf very easy to set up and integrate into my workflow