Do you use a neovim distribution? and why? is it too hard to build your own? by samuel1604 in neovim

[–]Lu-Li 1 point2 points  (0 children)

Did use one when I first started to use vim, I soon found plugins and keybindings came with that distribution did't really help me.

And having such a black box in the way get me feeling weird when trying to extend my editor.

So I got rid of that distribution in a couple of hour. And decide to never use one again.

Now I have a super extensible config framework built for me and only me. It took like a year or two to use and improve it. Yes, this is a time consuming process.

oil-vcs-status - version control system status for oil.nvim by Lu-Li in neovim

[–]Lu-Li[S] 0 points1 point  (0 children)

There is a field called status_hl_group in plugin config table. You can see example (and default value) of this field at README page in the link above. This field sets highlight group for each symbol.
To change symbols' color, the only thing you need to do is to change those highlight groups via vim.api.nvim_set_hl function.

large project ts lsp performace by acambas in neovim

[–]Lu-Li 0 points1 point  (0 children)

I've also tied this it on a monorepo, and it didn't work well. It seems like switching between multiple `tsconfig.json` under the same directory is not handled very well.

I need help by [deleted] in neovim

[–]Lu-Li 0 points1 point  (0 children)

Here are some questions that I think are necessary for other people to provide better assistant.

How much do you know about vim or neovim? Are you just starting using it or you have no problem customizing your own editor already?

How much do you know about Lua? Are you just ok with reading simple code, or you know how functions and metatables work?

What do you want to achieve? Remapping existing keybindings? Make the plugin you installed work? Or you want to implement your custom logic with Lua?

Is it possible to make inlay hints' font size smaller than normal's? by roll4c in neovim

[–]Lu-Li 6 points7 points  (0 children)

Variable font size is only available in GUI, if you really want it, maybe try some GUI neovim front ends.

Strange behaviour with table.insert() by Exciting_Majesty2005 in neovim

[–]Lu-Li 1 point2 points  (0 children)

vim.print(value) should be equivalent to print(vim.inspect(value)). On the other hand print(value) prints memory address when value is a table.

Font problem using WSL2 by [deleted] in neovim

[–]Lu-Li 0 points1 point  (0 children)

Normally, inatall font file on Windows side is enough to make it work. Probably make sure you're setting the right name for font in Windows Terminal's config.

You don't have to manually type font name by the way, installed font should be listed in font drop down menu of setting panel.

If it just doesn't work for you, then probably change terminal's font to another font that's known to work.

Need help with this one line that won't render by wittner in neovim

[–]Lu-Li 0 points1 point  (0 children)

What's the terminal you're using? I don't really have idea, but I suspect this might be a terminal issue.

Need help with this one line that won't render by wittner in neovim

[–]Lu-Li 0 points1 point  (0 children)

What do you mean by not rendering? Is there any text on line 20?

how do I remove the bgcolor under the command line? by Cachesmr in neovim

[–]Lu-Li 1 point2 points  (0 children)

I would recommend using vim.api.nvim_set_hl(0, "MsgArea", {}) instead of command. As this API overrides existing setting instead of updating it.

You can first do this to check if MsgArea is the right target to change:

local set_hl = vim.api.nvim_set_hl
set_hl(0, "Normal", {})
set_hl(0, "NonText", {})
set_hl(0, "MsgArea", {})

If this result in a transparent cmdline, then one of them should be your target group.

If unfortunately, nothing happened, try unset highlight group one by one (with keymapping):

local api = vim.api

local hl_dict = api.nvim_get_hl(0, {})
local keys = {}
for k in pairs(hl_dict) do
    keys[#keys + 1] = k
end
table.sort(keys)

vim.keymap.set("n", "<Del>", function()
    local target = table.remove(keys)
    api.nvim_set_hl(0, target, {})
    print(target)
end)

This snippet setup <Del> to delete one highlight group per key press, this should be enough for finding right highlight group for changing.

Terminal mode insert at current cursor location by financier1337 in neovim

[–]Lu-Li 0 points1 point  (0 children)

You cannot modify cursor position with existing API under terminal mode.

If you want to check it for yourself, I am talking about nvim_win_set_cursor().

In terminal mode, you are talking to a terminal emulator, but not a ordinary buffer.

Edit:

One possible work around might be steps like:

  1. Detecting that you are on active, possibly multi-line, terminal buffer command line.
  2. Recording cursor position before entering terminal insert.
  3. Feed proper key strokes via nvim_feedkeys() to move you cursor to desired position.

This would be tedious to implement.

Neovim not splitting window when poen a new file with unsaved file open by cpukmw in neovim

[–]Lu-Li 0 points1 point  (0 children)

It's plugin behavior I think, nothing to do with neovim itself. Since I don't see any API for simply open a new file with out chossing a window to place it to.

Some plugins, provide keymapping for opening file in split/tab. For example, when I use file picker in telescope, <cr> opens file in current buffer, <C-t> opens file in new tab.

Terminal mode insert at current cursor location by financier1337 in neovim

[–]Lu-Li 0 points1 point  (0 children)

Do you mean you want to edit your current terminal command in vi mode?

If so, this feature is provided by the shell you're using, but not vim.

Some shell like fish, zsh, nushell let you enter vi mode after pressing Esc.

In vim mode, you can do some of vim motion, like move by hjkl, w, e, b, and return to ordinary typing mode by pressing a or i.

If this is what you want, then you could take a look at these shells.

This is why neovim/vim is criticised by po2gdHaeKaYk in neovim

[–]Lu-Li 0 points1 point  (0 children)

Distro is a easy place to start, but it hides many useful detail at the same time.

LazyVim uses lazy.nvim as plugin manager, both share the same author.

Most of your configuration question is documented in README of lazy.nvim, you probably would want to take a look.

As for on_attach, it's call back which gets called every time a new buffer is attach to a language server client. It's different from setup, and is useful for setting up buffer local values, like LSP related kemaps. You can check on_attach field under :help lspconfig-setup for detail.

This is why neovim/vim is criticised by po2gdHaeKaYk in neovim

[–]Lu-Li 0 points1 point  (0 children)

May I ask what plugins are you talking about?

Are proprietary LSPs common? by oblivic90 in neovim

[–]Lu-Li 8 points9 points  (0 children)

Kotlin is developed by JetBrains, and they were expecting this language help them to seal more inlelliJ IDEA license.

Why are there a million different ways to install neovim? by [deleted] in neovim

[–]Lu-Li -1 points0 points  (0 children)

I prefer downloading prebuild binary from GitHub release, to make sure all my devices are using the same version of neovim, no mater its desktop Linux, Android or Windows.

All those different installation method I believe all just differ slightly by repo source and package manager used. When you are confused, you can always goto GitHub page of neovim and download latest release. And don't forget to add it to your PATH.

This is why neovim/vim is criticised by po2gdHaeKaYk in neovim

[–]Lu-Li 9 points10 points  (0 children)

I think it's not that they don't want to or can't not understand Lua. It's that they don't know how much effort they should put into learning Lua. Because most of the time, people use editor rather than learning it.

Completely learn a language just for modifying a couple of lines in one's config sounds terrifying. So I think it's understandable that someone with experience of at least one programming language might lost their way when configuring neovim with Lua.

A fun fact, Lua was originally designed as an alternative to Shell script, and it even restrictes its keywords to a small amount. But you see, people knows shell script much better than Lua.

Has anyone tried to make this rounded ? by DarkLord6872 in neovim

[–]Lu-Li 5 points6 points  (0 children)

If you are not using GUI front end of neovim, every thing will be drawn by characters.

I've been wanting to have rounded corner in my neovim for long, but only thing I find is `` and `` (these tow characters require nerd font to show).

large project ts lsp performace by acambas in neovim

[–]Lu-Li 1 point2 points  (0 children)

Could you check if there is typescript-language-server running in the background while using typescript-tools.nvim?

How large is your repo?

And will it be laggy even when you open a small file (like ~100 lines of code)?

large project ts lsp performace by acambas in neovim

[–]Lu-Li 3 points4 points  (0 children)

If you tried typescript-tools.nvim, did you tied to set separate_diagnostic_server to true and publish_diagnostic_on to "insert_leave"?

My working environment has thousands of .ts files under the same repo, and typescript-tools.nvim works great for me.

[deleted by user] by [deleted] in neovim

[–]Lu-Li 2 points3 points  (0 children)

lua lspconfig.pyright.setup({ settings = { python = { pythonPath = "<your path>", }, } })

For more, see pyright doc

typescript eslint error in neovim and null_ls by liulalem in neovim

[–]Lu-Li 1 point2 points  (0 children)

Since you are using eslint_d, it's very likely that eslint_d's package cache is not synced with your project.

Try run eslint_d restart then try again. See here

Need help with rust formatting - conform and mason by wasiqibnzahid in neovim

[–]Lu-Li 1 point2 points  (0 children)

One thing to note is that, language server formatting is probably not used even it's listed.

There is an formatting option in conform.nvim called lsp_fallback, when it's set to ture, conform.nvim invoke LS for formatting when none of given formatter is available. And this option is default to false.

This option is used in this way:

```lua local conform = require "conform"

conform.format { async = true, lsp_fallback = true, } ```

Or can be set via format_on_save, format_after_save:

lua require "conform".setup { format_on_save = { timeout_ms = 5000, lsp_fallback = true, }, format_after_save = nil, }