This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-21
Channels
- # announcements (13)
- # babashka (29)
- # beginners (52)
- # calva (95)
- # cider (18)
- # clj-commons (7)
- # cljs-dev (42)
- # clojure (121)
- # clojure-australia (1)
- # clojure-dev (39)
- # clojure-europe (36)
- # clojure-france (4)
- # clojure-greece (1)
- # clojure-italy (20)
- # clojure-nl (3)
- # clojure-portugal (1)
- # clojure-uk (7)
- # clojurescript (47)
- # conjure (2)
- # cursive (9)
- # datalevin (5)
- # datascript (8)
- # datomic (66)
- # defnpodcast (2)
- # deps-new (5)
- # fulcro (18)
- # graalvm (21)
- # gratitude (9)
- # jobs (6)
- # jobs-discuss (17)
- # leiningen (3)
- # lsp (80)
- # lumo (1)
- # malli (9)
- # mount (2)
- # off-topic (16)
- # other-languages (8)
- # podcasts (19)
- # reitit (5)
- # remote-jobs (5)
- # shadow-cljs (29)
- # sql (5)
- # tools-deps (13)
- # vim (11)
- # xtdb (19)
How do people typically handle formatting from within nvim? I'd like to set up autoformat on save using something like cljfmt, but without using vim-fireplace
The problem with format-on-write on linux is that it loses your marks, generally. https://github.com/vim-autoformat/vim-autoformat can call out to cljfmt presumably @tylertracey09. As that's likely to be slow, you might want to look at something async like https://github.com/lukas-reineke/format.nvim.
in fennel, but these are the two settings:
(xbufmap :<leader>fa "lua vim.lsp.buf.formatting_sync()")
and
(nvim.ex.autocmd :BufWritePre :<buffer> :lua "vim.lsp.buf.formatting_sync()")
using neovim’s lsp
function _G.lsp_formatexr()
vim.lsp.buf.range_formatting({}, { vim.v.lnum, 0 }, { vim.v.lnum + vim.v.count, 0 })
return 0
end
if client.resolved_capabilities.document_range_formatting then
vim.bo.formatexpr = 'v:lua.lsp_formatexr()'
end
I have this to format using gq
That isn't built in @UF3DZS1DF? Travesty.