This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-22
Channels
- # announcements (7)
- # babashka (1)
- # beginners (87)
- # boot (1)
- # cider (1)
- # clj-kondo (33)
- # cljfx (1)
- # cljs-dev (8)
- # clojars (3)
- # clojure (105)
- # clojure-austin (3)
- # clojure-europe (74)
- # clojure-finland (1)
- # clojure-korea (4)
- # clojure-nl (1)
- # clojure-uk (6)
- # clojurescript (10)
- # conjure (9)
- # cursive (29)
- # datalog (6)
- # datomic (13)
- # emacs (3)
- # events (4)
- # figwheel-main (1)
- # gratitude (1)
- # humbleui (6)
- # introduce-yourself (7)
- # jackdaw (1)
- # jobs (1)
- # lsp (29)
- # malli (3)
- # nbb (2)
- # podcasts-discuss (1)
- # portal (5)
- # re-frame (4)
- # reitit (28)
- # remote-jobs (5)
- # shadow-cljs (38)
- # tools-deps (46)
- # vim (6)
- # xtdb (24)
How can I set the comment character for clojure to be ;;
rather than ;
, this is the clojure comment string which tpope/vim-comentary seems to be picking up? Which means it wont toggle any of my existing commented code that all uses ;;
I’m using Neovim 0.7.0 and have a fennel configuration that includes Conjure
It seems commentstring
value needs to be set in the context of the Clojure FileType (while that makes sense, I havent found how to do it yet, at least nothing that works in the fennel config.)
I have this in my vimrc:
augroup commentary_config
autocmd!
autocmd FileType lisp,clojure,racket setlocal commentstring=;;\ %s
augroup END
Yes, a lua or fennel version of that should do the trick… I wonder if its something along the lines of this syntax
(nvim.ex.autocmd "FocusGained,BufEnter" "*" ":checktime")
Or maybe something like this in lua (although I think I’ll make sure everything is backed up before trying this…)
vim.api.nvim_create_autocmd("FileType", {
group = "clojure,lisp,fennel,racket",
command = "setlocal commentstring=;; ",
})
Nope, that gives an invalid augroupIf I understand correctly that is the prefix used when specifically evaluating an expression to a comment. That setting will over-ride what is set for the FileType but I got the impression it doesnt change the commentstring for the actual FileType (i.e. clojure). I’ll give the config a try though, as I found an example of how to add that to the fennel configuration.
I got a very nice code example in the #vim channel https://clojurians.slack.com/archives/C0DF8R51A/p1655927529563829 Thanks for taking a look and suggesting ideas (this was a very tricky one to figure out myself)