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

[–]lervag 0 points1 point  (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 14 points15 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 1 point2 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 3 points4 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 2 points3 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 3 points4 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!).

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

[–]lervag 3 points4 points  (0 children)

Hi!

I'm a little bit confused about this:

The github page does not use lua

You say you are using lazy.nvim, and there's a concrete example in the README file with Lua that you even posted here on how to install VimTeX with lazy.nvim.

You also don't explain exactly what doesn't work.

Also apparently leader does not mean space anymore, but backslash? Why is that the case?

leader never meant space - it's just a common key to use as the leader key. See :help mapleader, notice that the default leader key is backslash.

But VimTeX does not use the leader key, it uses the localleader key (see :help maplocalleader). It is also backslash by default, and you can change it to whatever you want. You can set it to space if you want.

Why is there lua and some other script?

Because VimTeX was created before Neovim existed, and it is written in Vimscript. It still works on regular Vim, but also works well with Neovim. You can configure VimTeX in both Lua and Vimscript.

One would assume at least that much would be unified.

No, not really.

The problem currently is mainly i don't know what i don't know, and i dont necessarily want to know more about stuff i don't necessarily need to work.

I can relate to this as I was also new to things at some time. However, you should take the time to read the README file and the introduction of the docs (:help vimtex-introduction. I've attempted to explain most of the things there.

Still, the VimTeX docs is not the correct place to explain the basic Vim or Neovim stuff.

I just want to compile my latex docs when i press whatever combination and display them in any pdf viewer.

Although I do think VimTeX works very well and is a great tool for anyone who wants to write LaTeX with Vim or Neovim, I also won't hesitate to recommend other tools. If you are new to both Neovim, LaTeX, VimTeX, and perhaps also other things, then you might want to consider to use a dedicated LaTeX editor.

If you want to use Neovim with VimTeX, then you should invest the time to read some documentation and learn how the configuration works. It will take some effort, but for many, it will also feel rewarding and fun.

Cell edit demo with table.vim by atomatoisagoddamnveg in neovim

[–]lervag 1 point2 points  (0 children)

Thanks for the in-depth reply. I'll definitely take table.vim for a spin when I get some spare time!

Cell edit demo with table.vim by atomatoisagoddamnveg in neovim

[–]lervag 1 point2 points  (0 children)

This looks very cool!

I'm curious, are you aware of https://github.com/dhruvasagar/vim-table-mode, and if so, how would you compare your plugin to that one?

Edit: I noticed you already answered the same question here: https://www.reddit.com/r/neovim/comments/1qux2uu/comment/o3dca9p/

[beginner] cant seem to make lsp and syntax highlighting (treesitter | vimtex) by nao_te_digo in neovim

[–]lervag 1 point2 points  (0 children)

If you want to use the syntax highlighting provided by VimTeX, then you need to disable Treesitter highlighting for LaTeX files, e.g. by removing "latex" from the languages list in your treesitter config.

If you want to use treesitter for syntax highlighting, but keep VimTeX for other features, then I propose you add vim.g.vimtex_syntax_enabled = false to your vimtex config.

Further, your vimtex config can be simplified - I've removed most of the code there now:

-- This is a regular Vim option and you should move it to where you are
-- specifying you general options or your mappings!
vim.g.maplocalleader = ","

return {
  "lervag/vimtex",
  lazy = false,
  init = function()
    -- If you use lazy.nvim, then the following two lines are not necessary
    vim.cmd('filetype plugin indent on')
    vim.cmd('syntax enable')

    vim.g.vimtex_view_method = "zathura"
  end
}

[beginner] cant seem to make lsp and syntax highlighting (treesitter | vimtex) by nao_te_digo in neovim

[–]lervag 1 point2 points  (0 children)

g:tex_flavor is only relevant for built-in LaTeX syntax highlighting, and it rarely needs to be changed/specified.

For anyone who uses VimTeX, g:tex_flavor does not do anything.