Skip to content

Frequently asked questions

John Practicalli edited this page Jun 1, 2023 · 12 revisions

The HUD window background colour makes the text unreadable, how can I change it?

Since the HUD is just a regular floating window you can alter the colours with the NormalFloat group. Conjure doesn’t pick the colours for you, so some themes may use hard to read contrasts, especially when it comes to comments.

:highlight NormalFloat ctermbg=<colour> guibg=<colour>

I used to suggest setting the Pmenu group but I think NormalFloat is more specific.

Can I add another language client?

Yes! By design Conjure supports language modules from inside this repository or in your own plugins. All a language client needs to be is a Lua module with a set of values and functions exposed, you can read all about that in :help conjure-clients.

You can learn a lot by having a read through the existing clients in fnl/conjure/client. Your client doesn’t have to be written in Fennel if it’s in your own repository but I’d highly recommend it. You’ll just have to get to grips with Aniseed.

Feel free to have a chat with me (Olical) about what you’d like to add and how you want to go about doing it. We can work out if it should be a 3rd party plugin or a fork of this repository until it’s time for wider release.

Can I write plugins that hook into Conjure?

Yep! Although what’s available isn’t documented right now so you’ll just have to read through Conjure’s source code and have a play. Some modules you may be interested in are conjure.eval, conjure.client and conjure.extract for example, you can require them from any Fennel or Lua file within Neovim if Conjure is installed.

Have a look through fnl/conjure/**.fnl for what’s available, not an awful lot is private so you’re more than welcome to hook into function calls at your own risk. There’s a chance they could change until I have some sort of stable proxy API.

Why Neovim? Will you ever support Vim?

I’m not a huge fan of VimL despite spending years trying to get semi-decent at it and I think it adds a huge amount of overhead to any Vim based project. I have never felt that I could attempt something ambitious with it because I’ll get tangled up in my own code in no time. The syntax and semantics are just not good enough to build complex software, in my opinion.

As you may be aware, I’m obsessed with Lisps (mostly Clojure, but still), and there’s a myriad of ways to compile nice Lispy languages to Lua. Neovim has wholeheartedly embraced Lua by embedding LuaJIT (an incredibly fast runtime) and gone down the path of turning VimL into a compatibility layer from a bygone era. The goal is to make Lua the first class language in Neovim while automatically compiling VimL to Lua for you.

This means Lua support and tooling in Neovim will only get better, I feel that Conjure is ahead of the Lua plugin curve and you’ll start to see more Lua than VimL plugins in the near future.

So that’s the main reason and why I won’t be able to support Vim 8+, they just haven’t embraced Lua and the the subsequent APIs in the same way making porting almost impossible at this point. The other key reason is that Neovim will embrace tree-sitter at some point soon which will allow me to simplify my form extraction logic immensely and supply Conjure support to non-Lisp languages such as Python and JavaScript.

One more reason: Floating windows. Although I think Vim has an answer to that, I really like the Neovim approach.

TL;DR:

  • Embracing Lua as 1st class over VimL.

  • Deep tree-sitter integration.

  • Floating windows and other neat UI innovations.

What does (Unknown) mean in the log when connecting to a Clojure nREPL?

You’ll see an "unknown" REPL environment when the Clojure client asks the nREPL server to elaborate on a particular nREPL session. We try to check if it’s a ClojureScript or Clojure environment (among others) and if this fails or times out we end up with an unknown environment. This is totally fine and expected if the nREPL is a little overloaded at startup, for example.

You can always list the sessions at a later time and get the type printed if it was just too slow to respond in the first place.

My log buffer is full of diagnostic warnings and errors / a plugin is running in the log buffer and I don’t want it to

In older versions of Conjure there was a bug (of sorts) that meant that only some of the normal auto commands fired when the log buffer was created. This meant that we had syntax highlighting in the log and HUD but no extra plugins loaded for the relevant buffer filetype. So you’d have highlighting, but no Language Server Protocol linting, for example.

Neovim introduce a change at some point that meant this partial buffer initialisation no longer loaded the syntax highlighting, so the buffer just became plain text after a Neovim update.

A PR was opened that fixed this, fully loaded the buffer, fixing the bug and returning the colour to the window. This also had the side effect of actually triggering the right auto commands (as it should have in the first place) and loading things like linters and LSP plugins.

If you would like to turn off certain plugins for the log you can do so through auto commands as shown by @walterl in issue #427. This example just disables the vim diagnostics, hiding the warnings and errors. You may want to call something else if you’re having trouble with other similar plugins.

autocmd BufNewFile conjure-log-* lua vim.diagnostic.disable(0)

For Neovim, a Lua version of autocmd to disable LSP diagnostics

      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",
      })
Clone this wiki locally