This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-11
Channels
- # announcements (16)
- # aws (17)
- # babashka (25)
- # beginners (60)
- # calva (40)
- # cider (3)
- # clara (4)
- # clj-kondo (24)
- # clojure (16)
- # clojure-austin (3)
- # clojure-dev (23)
- # clojure-europe (33)
- # clojure-nl (2)
- # clojure-norway (7)
- # clojure-uk (4)
- # clojurescript (39)
- # clr (108)
- # conjure (10)
- # cursive (12)
- # datalevin (7)
- # editors (2)
- # events (1)
- # fulcro (24)
- # graalvm (3)
- # introduce-yourself (8)
- # london-clojurians (2)
- # malli (18)
- # meander (6)
- # missionary (10)
- # nbb (16)
- # off-topic (19)
- # polylith (1)
- # portal (4)
- # rdf (1)
- # reitit (4)
- # remote-jobs (3)
- # shadow-cljs (10)
- # xtdb (12)
Hi - I’ve started to use https://github.com/AckslD/nvim-FeMaco.lua with conjure to evaluate in markdown code blocks with all the normal lsp+diags+completion for that language. I’m currently using for clojure and python at the moment; Anyone else using/configured this ?
That's REALLY cool, thanks for sharing. Exactly what I hoped someone would make one day so Conjure would just work inside markdown files.
It’s really quite cool where you can have different languages blocks and evaluate e.g. python in one and then clojure in another. With the floating code block window I don’t get a HUD. Maybe you can give it a spin and see if there are some improvements to make them work better together ?
Can this run in my init.vim
so that I could edit Lua inside of it?
lua << EOF
--
EOF
yes - just tried this and conure evals as expected
lua << EOF
print("lua")
EOF
I think my treesitter config may be off 😕 I'll need to find how to configure it properly. For me running of that command doesn't give neither the popup, neither the error :thinking_face:
I also have it working in split window rather than floating so that you get the HUD as well.
require('femaco').setup({
-- should prepare a new buffer and return the winid
-- by default opens a floating window
-- provide a different callback to change this behaviour
-- @param opts: the return value from float_opts
prepare_buffer = function(opts)
local bufnr = vim.api.nvim_create_buf(false, false)
vim.cmd'split'
vim.cmd(string.format('buffer %d', bufnr))
return vim.api.nvim_get_current_win()
-- local buf = vim.api.nvim_create_buf(false, false)
-- return vim.api.nvim_open_win(buf, true, opts)
end,
-- should return options passed to nvim_open_win
-- @param code_block: data about the code-block with the keys
-- * range
-- * lines
-- * lang
float_opts = function(code_block)
return {
}
end,
-- return filetype to use for a given lang
-- lang can be nil
ft_from_lang = function(lang)
return lang
end,
-- what to do after opening the float
post_open_float = function(winnr)
vim.wo.signcolumn = 'no'
end,
-- create the path to a temporary file
create_tmp_filepath = function(filetype)
return os.tmpname()
end,
-- if a newline should always be used, useful for multiline injections
-- which separators needs to be on separate lines such as markdown, neorg etc
-- @param base_filetype: The filetype which FeMaco is called from, not the
-- filetype of the injected language (this is the current buffer so you can
-- get it from vim.bo.filetyp).
ensure_newline = function(base_filetype)
return false
end,
})
I can't run the basic example. Something is broken in my config.
require'nvim-treesitter.configs'.setup {
}
require('femaco').setup()
I don't know what it is. I also have installed the markdown treesitter module and so on. I don't know.@U028ART884X it’s probably more than you need but this is my treesitter config https://github.com/thecontinium/vim-config/blob/master/lua/local-plugins/treesitter.lua
I think it's too much 😄 I have this config:
require'nvim-treesitter.configs'.setup {
highlight = {
enable = true,
--
disable = { "clojure" },
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
-- additional_vim_regex_highlighting = true,
},
-- -- require"nvim-treesitter.highlight".set_custom_captures {
-- -- -- Highlight the @foo.bar capture group with the "Identifier" highlight group.
-- -- --["function.macro"] = "Identifier",
-- -- --["keyword.function"] = "TSKeywordFunction",
-- -- --["text.strong"] = "TSText",
--
-- -- -- doesn't work:
-- -- --["clojureNs"] = "clojureCharacter",
-- -- --["clojureNsSep"] = "Normal"
-- -- }
}
I don't want to specify every possible server and dependency. It's too much.