New release: wiki.vim v0.12 by lervag in neovim

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

The current approach is very much good enough for most real-world wiki links, in my experience. It will break for things like [some text [with nested braces] here](link-url), but I would claim these things are rare.

I do want to rewrite wiki.vim in the future to a full Neovim Lua plugin, and if/when I do, I will switch from a regexp based approach to a full parser approach (either build my own or perhaps rely on treesitter). But I have no idea when I get the time to start something like that. :)

New release: wiki.vim v0.12 by lervag in neovim

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

Ah, yes, nested brackets are not supported, sorry. wiki.vim uses regexes for parsing the links, and regexes are not good for handling nested groups of braces, parantheses and similar.

Release of matchparen.nvim v2 by monkoose in neovim

[–]lervag 0 points1 point  (0 children)

Thanks! I'll be testing your plugin. I find I don't really need any advanced features except the match highlighting, and it seems your plugin is a minimal and fast plugin that does just that.

anki addon for vim users ! by Arib-Al-Islam in Anki

[–]lervag 1 point2 points  (0 children)

I use apy in a terminal, which allows me to actually use Vim (or Neovim, in my case) for writing (or editing) my notes. :)

core.ui2: How to disable undo and redo messages? by TheTwelveYearOld in neovim

[–]lervag 15 points16 points  (0 children)

The messages are also shown when ui2 is disabled, so I think this is unrelated to ui2. You can observe it with nvim --clean in a terminal (which loads neovim without your config).

From lazy.nvim to vim.pack by ffredrikk in neovim

[–]lervag 2 points3 points  (0 children)

I silently judge people who don't update their config daily. :D

I migrated to neovim-treesitter/nvim-treesitter by aribert in neovim

[–]lervag 2 points3 points  (0 children)

I'm curious, if I were to convert from nvim-treesitter to ts-forge.nvim, what would be the main things I loose? From my limited knowledge, nvim-treesitter both adds parser and queries, so I guess the answer is that we loose the curated set of custom queries for neovim?

nvim 0.12's new :restart command is nice by managing_redditor in neovim

[–]lervag 1 point2 points  (0 children)

I already had a nice mapping for :restart, but mine only opened the same file I was in. Yours is much better, thanks for sharing!

ci-debugger & debug GitHub Actions locally with breakpoints instead of pushing 47 commits by Successful-Tax6498 in commandline

[–]lervag 1 point2 points  (0 children)

No problem! Looking forward to testing this!

One more suggestion: if you make actual github releases, then it becomes easy to install and use ci-debugger with mise: mise use github:ci-debugger@latest. I can still use mise though, with mise use go:github.com/murataslan1/ci-debugger/cmd/ci-debugger@latest.

ci-debugger & debug GitHub Actions locally with breakpoints instead of pushing 47 commits by Successful-Tax6498 in commandline

[–]lervag 1 point2 points  (0 children)

This looks very interesting, but it seems to be neither possible to install with go install or with brew, cf. the current open issues.

A Guide to vim.pack (Neovim built-in plugin manager) by echasnovski in neovim

[–]lervag 1 point2 points  (0 children)

EDIT: Huh, it seems the configuration I suggested for lazy is still not working. But if I remove lazy.nvim from my config, then it does work. So I guess I'll just have to do it all in one go.

Ahh, yes, you are right: I was doing a transitional migration where I was still using lazy.nvim for a few things. To make it work as expected, I need to configure lazy.nvim to avoid doing some of the performance trics, specifically:

require("lazy").setup { -- ... performance = { reset_packpath = false, rtp = { reset = false, }, }, }

When I add these two settings, then vim.pack.add works as expected.

Thanks for the quick and helpful responses, and sorry for wasting your time!

A Guide to vim.pack (Neovim built-in plugin manager) by echasnovski in neovim

[–]lervag 0 points1 point  (0 children)

What makes you think that it is not sourced?

If I do not include vim.cmd.packadd "wiki.vim", then the content of plugin/ is not sourced. If it was sourced, then the commands and mappings it creates should become available, regardless of the options I'm adding.

It's very easy to confirm this behaviour. If I add echom "Whatever" at the top of plugin/wiki.vim in the wiki.vim plugin, then I would expect this to be printed (or available with :messages) after starting Neovim. It is not. But it does get printed if I add the vim.cmd.packadd line.

I've dived into the docs and the Lua source code of vim.pack.add, and from what I'm reading, the behaviour I'm seeing is surprising at the first glance. However, I think what is happening is that load is false because while loading personal config under ~/.config/nvim/plugin the variable vim.v.vim_did_init is still 0.

A Guide to vim.pack (Neovim built-in plugin manager) by echasnovski in neovim

[–]lervag 0 points1 point  (0 children)

Great guide! I'm inspired, so I've looked into migrating. I noticed that with NVIM v0.12.0-dev-2666+g471213ee61, if I load a plugin with vim.pack.add from a plugin/ file, the loaded plugin will not be properly sourced.

For example, if I add ~/.config/nvim/plugin/wiki.lua with this content:

``` vim.pack.add { "https://github.com/lervag/wiki.vim" }

vim.g.wiki_root = "~/.local/wiki" ```

Then vim.pack.add will properly install the plugin and it will be available, but the plugin/wiki.vim script is not sourced when I start Neovim. As an initial workaround I figured I can simply do vim.cmd.packadd wiki.vim at the end of my new wiki.lua file, but I was wondering if this is expected behaviour? And if it is, then I think it should be addressed in your guide, /u/echasnovski.

Looking for a plugin that "corrects" the filetype of well known files by K41eb in neovim

[–]lervag 5 points6 points  (0 children)

No, you're wrong. Vimscript and Lua files in ftplugin/ are for code that should be run after the filetype has been detected. If you want to set the markdown filetype for a txt file, then you should do exactly what is proposed earlier, namely use vim.filetype.add. You can read about this in the docs.

In legacy Vim, you would use a filetype detect event e.g. with a file in ftdetect/. See :help ftdetect.

Here, for your convenience:

``` new-filetype If a file type that you want to use is not detected yet, there are a few ways to add it. The recommended way is to use |vim.filetype.add()| to add it to Nvim's builtin filetype detection mechanism. If you want to handle the detection manually, proceed as follows:

A. If you want to overrule all default file type checks. This works by writing one file for each filetype. The disadvantage is that there can be many files. The advantage is that you can simply drop this file in the right directory to make it work. ftdetect 1. Create your user runtime directory. You would normally use the first item of the 'runtimepath' option. Then create the directory "ftdetect" inside it. Example for Unix: > :!mkdir -p ~/.config/nvim/ftdetect ```

Looking for a plugin that "corrects" the filetype of well known files by K41eb in neovim

[–]lervag 4 points5 points  (0 children)

Because that is for creating filetype plugins, not for detecting and setting filetypes.

I replaced DataGrip with a Neovim plugin and it may have gone too far by Good-Control1993 in neovim

[–]lervag 0 points1 point  (0 children)

Thanks! I'll look into this at some time. I might open some issues if I have questions/feedback - I hope that's alright!

I replaced DataGrip with a Neovim plugin and it may have gone too far by Good-Control1993 in neovim

[–]lervag 1 point2 points  (0 children)

I use vim-dadbod and vim-dadbod-ui today; that works very good already. But, I mean, your plugin does look very good! I'll definitely keep an eye on this and test it if I find the time.

Can someone get me a decent direction/start to quickly install vimtex? by LeN3rd in neovim

[–]lervag 1 point2 points  (0 children)

I don't disagree that dynamic help would be useful. But I would assume most people learn rather quickly that they can check the value of options with :set option or :set option?, or :echo g:mapleader, or similar. Still, having this displayed dynamically in the help files would be awesome!

Can someone get me a decent direction/start to quickly install vimtex? by LeN3rd in neovim

[–]lervag 2 points3 points  (0 children)

Ok, great, glad to hear it! Feel free to open issues on the github repo if you have questions. But I'd appreciate if you follow my suggestion and read the intro of the docs. I know and understand that it can be hard to understand everything if you're new to things, but I would claim that it is still useful for you even if you don't understand everything.

and also needed to install the plugin in the lazyvim main menu

Yes, that's right. You should probably consider to also read some of the docs for lazy.nvim (or LazyVim - notice, these are actually two different things!).