This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-10
Channels
- # asami (41)
- # babashka (24)
- # beginners (48)
- # calva (41)
- # cider (10)
- # clj-commons (20)
- # clj-kondo (2)
- # cljdoc (8)
- # clojure (131)
- # clojure-australia (4)
- # clojure-europe (17)
- # clojure-hungary (2)
- # clojure-india (2)
- # clojure-nl (3)
- # clojure-uk (1)
- # clojurescript (12)
- # community-development (6)
- # core-logic (4)
- # cursive (11)
- # datomic (22)
- # emacs (25)
- # events (1)
- # exercism (2)
- # fulcro (30)
- # helix (5)
- # honeysql (6)
- # hugsql (3)
- # integrant (12)
- # introduce-yourself (4)
- # lsp (5)
- # malli (5)
- # nextjournal (31)
- # off-topic (4)
- # pedestal (3)
- # portal (51)
- # reitit (33)
- # remote-jobs (1)
- # shadow-cljs (12)
- # sql (10)
- # vim (7)
- # xtdb (37)
Vimming Clojurians! Do you know a smooth way to copy the current namespace + currently hovered function name to the clipboard (/any register)? So if you've got:
(ns some.namespace
(:require [...]))
(defn my-function [])
How do you put some.namespace/my-function
in your clipboard, without polluting your location list etc?
(I'm using neovim, so Lua / Fennel suggestions are welcome too 🙂)I've tried in conjure :ConjureEval (symbol (var my-fuction))
evals to full name of function with namespace. Then conjure stores result of last evaluation in some register (by default c
).
you can create a mapping to grab symbol name of word under cursor like this :nmap ts :execute "ConjureEval (symbol (var " . expand("<cword>") . "))"<cr>
Dude, awesome! I opened my laptop to check if someone had answered, and a few seconds later you post the solution. Thanks!
Hi @U076FM90B, great solution there. Do you have a mapping for pasting the result at the end of the evaluation? I’m currently paste it to the next line but it’ll break the code if the eval is more than 1 line.
I don't have a mapping. The result of evaluation is in a register (by default c
), you can paste it whenever you need. "cp
pastes content of register c
in normal mode and <C-R>c
in insert mode. You can compose one of those with movement to the position you want to paste, like $
to end of line or o
to the next line.
Just dropping by to thank @U076FM90B, this <C-R>c
is amazing. TIL that conjure puts results on the c
register.