This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-31
Channels
- # announcements (3)
- # aws-lambda (1)
- # babashka (122)
- # beginners (241)
- # calva (28)
- # cider (7)
- # clara (7)
- # clj-kondo (43)
- # clojars (5)
- # clojure (326)
- # clojure-europe (60)
- # clojure-italy (2)
- # clojure-nl (4)
- # clojure-spec (21)
- # clojure-uk (4)
- # clojurescript (162)
- # cursive (30)
- # datomic (3)
- # editors (5)
- # emacs (4)
- # figwheel-main (1)
- # fulcro (24)
- # gratitude (3)
- # helix (7)
- # honeysql (20)
- # improve-getting-started (1)
- # introduce-yourself (11)
- # jobs (3)
- # joker (2)
- # kaocha (15)
- # lsp (21)
- # lumo (2)
- # meander (3)
- # off-topic (34)
- # re-frame (6)
- # reagent (1)
- # releases (4)
- # rum (2)
- # shadow-cljs (37)
- # spacemacs (16)
- # tools-deps (16)
- # vim (23)
- # xtdb (32)
Anyone has some good function to format e.g. log-output as json-string or edn-string to pretty-formatted? I found something with jet at some point but somehow lost it again
I use python -m json.tool
to format JSON, and jet for EDN:
• https://github.com/walterl/dotfiles/blob/master/_config/nvim/init.vim#L533
• https://github.com/daveyarwood/dotfiles/blob/master/vim/custom/300-filetypes.vim#L63-L77
Is anyone aware of some way to have function definitions open in a predefined window?
The long story: I find that I'm often carefully studying one specific function f, and want to study definitions of functions called by f. What I currently do is :vsplit<CR>gd
, but this has a lot of window management/navigation overhead.
What I'd like to have is, while staying in f's window, some command/mapping I can trigger to jump to a definition in a predefined window.
Kind of like vim-fireplace's :Source
, but with a specified (normal) window as a target.
@clojurians-slack100 not really addressing your main issue here, but a small improvement is using :vert gd
- vert splits then runs your command in the new split, there's also tab
for doing the same thing but in a new tab instead of a split
there's also lefta
etc. for opening the split in a specific relative direction
@clojurians-slack100 you might be able to use "the preview window" for what you want - I haven't used this feature in anger
awesome, glad I could help (and I just found it by doc browsing, so TIL pedit too haha)
and then you can use
nope, that's a tag stack specific thing 😦:pp
to rewind to the previous thing you looked up
if your source lookup uses the tag system, then :ptag
has the kind of behavior you describe
using a dedicated window (the preview window) and replacing the last thing you looked up
Hmmm. Possibly. But this is where a caveat comes in: I often need to go another level deeper, or edit, or otherwise navigate around from the definition I jumped to. Preview windows often don't work great for that level of interactivity. (That's why I mentioned "(normal) window" 😛)
it has a stack you can pop
hmm...
@clojurians-slack100 when I used :pedit
it's a normal buffer display window, it's just special in that the next :pedit
always replaces contents of that window
it's not a "preview" like "just read it, vim commands don't work"
Meh. Looks like this is also bumping up against the limits of coc.nvim: it doesn't seem to use/support tags
more things should use / leverage the tag system, so many vim commands work on tags...
:call CocActionAsync('jumpDefinition', 'pedit')
🎉