Skip to main content

Get the Reddit app

Scan this QR code to download the app now
Or check it out in the app stores
andersevenrud u/andersevenrud avatar

andersevenrud

u/andersevenrud

New
Open sort options
Change post view


r/neovim icon

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online
r/neovim

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online

Help with packer and treesitter

andersevenrud
commented

If you want that pcall to work you have to change it to:

local ok, treesitter = pcall(require, "nvim-treesitter.configs")

The comma is important because pcall expects a function followed by the arguments you want to use, and not a regular require statement :)

Also, you don't really need to do this since you're lazy-loading. It should be available when you do the require from the config callback.


r/neovim icon

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online
r/neovim

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online

Integrating plugins with status bars

andersevenrud
commented

AFAIK there's no common interface for adding something to cover all of the status bar plugins. It's usually something like lua/<statusbar-plugin/<component-name>.lua that gets discovered and loaded so that the user can simply put a string with the <component-name> in their configuration.

However, most of these status bar plugins supports referencing a function that returns some arbitrary text. So if you export this from your module and have appropriate documentation for this, it should be fairly easy on the end-user.


r/neovim icon

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online
r/neovim

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online

OS Specific Configuration

andersevenrud
commented

The solutions in this post should have what you need to create some conditions in your config based on os: https://www.reddit.com/r/neovim/comments/pc7in0/detect_os_in_lua/

In your case vim.fn.has('macunix') would suffice if you're using Lua.



r/neovim icon

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online
r/neovim

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online

Install language server locally

andersevenrud
commented

Ah. The installer uses the language package manager behind the scenes. So it effectively runs the npm, etc. commands for you.



r/neovim icon

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online
r/neovim

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online

sourcing /etc/xdg/nvim/sysinit.vim slow?

andersevenrud
replied to kuripaa

Someone might find this handy. I have this set up as an alias so I can get immediate output with nvim-startuptime:

alias nvim-startuptime='rm /tmp/vim.log; vi --startuptime /tmp/vim.log -c "quit" && cat /tmp/vim.log'

r/neovim icon

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online
r/neovim

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online

sourcing /etc/xdg/nvim/sysinit.vim slow?

andersevenrud
commented

I think you might be reading this wrong. The second column is the elapsed time for the given entry, so the sysinit script is loaded in <0.1ms.

Edit: Also, 100ms is just fine. It's literally the blink of an eye :)


r/neovim icon

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online
andersevenrud
commented

r/neovim icon

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online
r/neovim

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online

What's your neovim colorscheme?

andersevenrud
replied to Linupe

Not all that much if you ignore the Lua part. It's based off the same palette, just different picks in some places.






r/neovim icon

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online
r/neovim

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online

have someone managed to make lsp status and typescript work with native LSP

It's a pile of something alright :)

Just thought I'd leave an issue that discusses the topic of tsserver LSP implementation:

https://github.com/microsoft/TypeScript/issues/39459


r/neovim icon

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online
r/neovim

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online

PSA: Plugin developers, please notify your users when adding a dependency that creates a breaking change.

From the docs:

  • 2021-07-28: packer will now highlight commits/plugin names with potentially breaking changes(determined by looking for breaking change or breaking_change, case insensitive, in the update


r/neovim icon

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online
r/neovim

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online

PSA: Plugin developers, please notify your users when adding a dependency that creates a breaking change.

andersevenrud
replied to cdb_11

Well, the problem is that that would only work if the language used was something that actually used `require` for modules and that it happens outside any kind of abstraction. And the user would have to know this.

If the commit message simply explained this, then you would not even have to do a search in the first place. This is the point of commit messages, it should give you the abstract of what happened and some kind of reasoning/explanation if required.


r/neovim icon

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online
r/neovim

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online

PSA: Plugin developers, please notify your users when adding a dependency that creates a breaking change.

andersevenrud
replied to cdb_11

Some sort of "dry run" function surely would be great. But imo this only works if the commit messages contains the information you need in order not to hit some kind of wall.

Having to review and understand the physical changes of commits of all your plugins now turns into code reviews, and not updates :(


r/neovim icon

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online
r/neovim

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online

PSA: Plugin developers, please notify your users when adding a dependency that creates a breaking change.

This brings up a good point. Most of the plugins (at least that I use) doesn't really have any release cycle. Everything mostly goes into the main branch, which requires quite some attention on the end-user to catch everything.

AFAIK any of the vim package managers don't really use semver or anything like that either.

But in the cases where dependencies is not the breaking change, having some sort of leeway / migration path for users and a warning message is definitely a big help.

> I've never encountered issues that couldn't be fixed in less than 5 minutes

Those 5 minutes can be a bit of a pain though... I'd rather it be close to nothing :D


r/neovim icon

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online
r/neovim

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online

PSA: Plugin developers, please notify your users when adding a dependency that creates a breaking change.

andersevenrud
commented

Just wanna add that to notify end-users about breaking changes is as simple as adding "breaking change" in the commit message.

In the case of packer users (or maybe others ?!) this will even highlight the plugin with a (orange in my case) color in the update log which makes it very easy to spot.

Commit messages in general is a mixed bag. In a perfect world everyone would use something like https://www.conventionalcommits.org/en/v1.0.0/ (which has the breaking changes stuff in the spec).





r/neovim icon

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online
r/neovim

Neovim is a hyperextensible Vim-based text editor. Learn more at neovim.io.


Members Online

Missing colours after switching to Packer from vim-plug

andersevenrud
commented

The colorschemes you linked does not seem to have highlighting for the latest neovim specific features. You'll have to look for alternatives like https://github.com/shaunsingh/solarized.nvim and https://github.com/ishan9299/nvim-solarized-lua.

Also, I'm not sure what you mean by "but why does it work with vim-plug then" because you didn't mention what colorscheme you originally used before you tried the ones that you linked.


andersevenrud u/andersevenrud avatar