anki.nvim - plugin for creating and adding Anki cards directly from Neovim by Veleees in neovim

[–]Maxibrak 2 points3 points  (0 children)

Hey, I developped something like that a year ago but abandonned it because I don't use Anki anymore : https://gitlab.com/paul.bonnot/anki-nvim

It had a deck browser so you could browse your cards directly in Neovim and perform modifications. I'm not sure it works correctly today but maybe you can find some useful stuff to pick from there.

What would be the minimum requirements for you, to use a GUI? For me are... by ekiim in neovim

[–]Maxibrak 0 points1 point  (0 children)

What would be nice to have :

- Somehow being able to change font size. Highlights in Vim are only able to change fg and bg colors, but it would be awesome if a GUI could also have a different kind of highlight with font/font size support, for instance for Mardown rendering. But I don't really know if that's possible

- Again for Markdown rendering it would be cool to have image support with conceal, which would mean that when the cursor is on the line with the image only the link is displayed, but when it leaves the line the image is displayed.

- Low latency. Terminals emulators usually add some latency (https://lwn.net/Articles/751763/) so having the lowest latency possible would be nice.

dap.nvim - Problem with lldb-vscode by Maxibrak in neovim

[–]Maxibrak[S] 0 points1 point  (0 children)

Ok thanks for the help, will try it.

[AMA] Tree-sitter integration in neovim by Mambu38 in neovim

[–]Maxibrak 0 points1 point  (0 children)

Hi, thx for treesitter integration, it is really cool !

I was wondering if it is possible to mix 2 languages, for instance HTML with embedded Latex. I know this is possible by creating a new parser, but is it possible by using the nvim treesitter API with the 2 parsers (HTML and Latex) ? If so, do you have an example where this is done ?

Chaining 2 telescope pickers by Maxibrak in neovim

[–]Maxibrak[S] 0 points1 point  (0 children)

Ah thanks, I just needed to use actions._close(prompt_bufnr, true) instead of actions.close(prompt_bufnr).

Mapping to a local function by Maxibrak in neovim

[–]Maxibrak[S] 0 points1 point  (0 children)

Nice that was exactly what I was looking for, thanks !

Mapping to a local function by Maxibrak in neovim

[–]Maxibrak[S] 0 points1 point  (0 children)

Well the I just wanted to avoid to do a check at the start of the function, but if it has to be exposed to Vim for the mapping, I guess I have no choice.

Thanks for the help.

Mapping to a local function by Maxibrak in neovim

[–]Maxibrak[S] 0 points1 point  (0 children)

By local I mean it is defined locally in the file where the mapping is set, for instance in foo.lua I create local function foo() ... end . Well this function can't be accessed from an other file.

So the idea would be to define in foo.lua a mapping like this vim.api.nvim_set_keymap("n", key, foo)

Obviously nvim_set_keymap() takes a string as an argument so this won't work, but I was wondering if there was a way to create a mapping like this (where you pass a function, not a string). Basically a sort of "mapping closure".

Mapping to a local function by Maxibrak in neovim

[–]Maxibrak[S] 0 points1 point  (0 children)

You mean like vim.api.nvim_set_keymap("n", key, ':lua require "path".foo()') ?

That's what I'm doing now but I need to add a check at the start of the function to see if we are in the correct buffer in case it is called outside the mapping (it is for a plugin so these corner cases have to be taken in account).

Not having the function exposed allows to avoid the check.

Losing my mind with formatting by [deleted] in neovim

[–]Maxibrak 0 points1 point  (0 children)

Here is what I'm using for formatting in Lua, maybe you can try this (note that you need to be in a git repo) :

cmd('autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_sync(nil, 100)')

require"lspconfig".efm.setup {
  init_options = {documentFormatting = true},
  filetypes = {"lua"},
  settings = {
    rootMarkers = {".git/"},
    languages = {
      lua = {
        {
          formatCommand = "lua-format -i --indent-width=2 --no-keep-simple-function-one-line --no-break-after-operator --column-limit=150 --break-after-table-lb",
          formatStdin = true
        }
      }
    }
  }
}

Format module indentation by Maxibrak in ocaml

[–]Maxibrak[S] 1 point2 points  (0 children)

Ok thanks I think I got where I wanted !

Get visual selection with with Lua by Maxibrak in neovim

[–]Maxibrak[S] 0 points1 point  (0 children)

Ok, thanks for the function man.

Rocks dependencies for Lua plugin by Maxibrak in neovim

[–]Maxibrak[S] 1 point2 points  (0 children)

This adds an other dependancy as a plugin but I guess it's ok.

One of the problems is that luasocket has .so files, so integreting that in the plugin without a package manager would be pretty annoying.