This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-01
Channels
- # announcements (20)
- # babashka (3)
- # beginners (30)
- # calva (28)
- # cider (3)
- # circleci (4)
- # clerk (27)
- # clj-kondo (72)
- # cljdoc (15)
- # cljs-dev (1)
- # clojure (85)
- # clojure-europe (37)
- # clojure-nl (1)
- # clojure-norway (13)
- # clojure-spec (7)
- # clojurescript (19)
- # clr (1)
- # conjure (11)
- # datahike (2)
- # datomic (11)
- # emacs (26)
- # events (4)
- # hoplon (35)
- # hyperfiddle (41)
- # jobs (7)
- # lsp (10)
- # nrepl (3)
- # off-topic (57)
- # portal (47)
- # practicalli (1)
- # rdf (3)
- # reitit (21)
- # releases (1)
- # testing (6)
- # tools-build (16)
- # wasm (1)
- # xtdb (16)
Hey, guys! Do you know if there is a way to evaluate some mapping only for buffers where conjure is used (fennel, clojure, shceme)?
Hi, you can create file type based autocommand which assigns mappings in the current buffer.
`-- close some filetypes with <q> autocmd("FileType", { group = general, pattern = { "qf", "help", "man", "notify", "lspinfo", "spectre_panel", "startuptime", "tsplayground", "nvim-docs-view", "PlenaryTestPopup", }, callback = function(event) http://vim.bo[event.buf].buflisted = false vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true }) end, desc = "Close by q", })` Here is an example in nvim lua
Hmm I was thinking of recommending the custom autocmds Conjure emits https://github.com/Olical/conjure/blob/1dd96d90f53122225f698e58b50dee9ed760cf2e/doc/conjure.txt#L848-L885 Or even hooks https://github.com/Olical/conjure/blob/1dd96d90f53122225f698e58b50dee9ed760cf2e/doc/conjure.txt#L1122-L1167 But neither of those have things to do with "Conjure loaded for this buffer!" yet. Could be added though, might be a really useful feature. Technically you could hook into the HUD hook since that pops up on first load of a buffer usually (unless you turn it off). But you'd need to ensure your code only ran on the first HUD pop up for each buffer or waste setting up the same mappings over and over.
I think there's an argument to be made here for a new autocmd or hook for this sort of thing.
That's what LSP does with the https://neovim.io/doc/user/lsp.html#lsp-events events. Instead of doing LSP setup per file type, have an autocmd for that event that does LSP maps etc.
I've created a https://github.com/AstroNvim/astrocommunity/pull/248 using Conjure, which works very well once a localleader is mapped (in the AstroNvim user config for now). The AstroNvim maintainer will add a localleader in the next release of AstroNvim, which is nice 😄
Is there a good Lua equivalent of this https://github.com/Olical/conjure/issues/427#issuecomment-1271020140?
autocmd BufNewFile conjure-log-* lua vim.diagnostic.disable(0)
I've got this far.. not sure if its right.. but it seems to work. Any lua tweaks appreciated...
vim.api.nvim_create_autocmd("BufNewFile", {
-- group = vim.api.nvim_create_augroup("conjure_log_disable_lsp", { clear = true }),
pattern = { "conjure-log-*" },
callback = function() vim.diagnostic.disable(0) end,
desc = "Conjure Log disable LSP diagnostics",
})
Not sure if I need an augroup, seems to work without one...That looks good to me! Here's an example of how I define an augroup + autocmd in fennel https://github.com/Olical/conjure/wiki/Integrating-with-Clay-and-data-visualisation-tools
AstroNvim Clojure pack is merged now and the localleader is in the AstroNvim nightly build for the upcoming release. I'm writing up the AstroNvim config and Clojure workflow in https://practical.li/neovim/ over the next few days.