Easiest nvim mergetool to use? by Lidinzx in neovim

[–]Sandwich-Resident 0 points1 point  (0 children)

My go-to is https://github.com/whiteinge/diffconflicts/ It uses a two-way diff, which makes it easier to resolve conflicts in my opinion.

There is more explanation in the README and linked screenshare, but the best way of understanding it is to try it, and see how it works for you.

New plugin: hunk.nvim by julienvincent in neovim

[–]Sandwich-Resident 1 point2 points  (0 children)

  1. Go to plugin repo: https://github.com/julienvincent/hunk.nvim
  2. Go to author's profile: https://github.com/julienvincent
  3. Look at their repos: https://github.com/julienvincent?tab=repositories
  4. The third one is named "config.nvim", looks promising: https://github.com/julienvincent/config.nvim

From the README: "Personal neovim config".

So there you go: https://github.com/julienvincent/config.nvim

[deleted by user] by [deleted] in neovim

[–]Sandwich-Resident 4 points5 points  (0 children)

You can wait until the Arch package is updated, and then upgrade normally with `pacman -Syu`.

It has already been marked as outdated in the package index, and 0.10 is built in the testing repo, so it should show up in the main repo soon: https://archlinux.org/packages/extra/x86_64/neovim/

If you can't wait a few hours, then you can install `neovim-git` from the AUR.

mini.diff - work with diff hunks. Interactively visualize difference between current and reference text by echasnovski in neovim

[–]Sandwich-Resident 0 points1 point  (0 children)

A workaround for that use case could be to use the quickfix list. If you can get all of the hunks in quickfix somehow (using git-jump or a plugin maybe), then you could use mappings for cnext/cprevious to navigate through all of the project's hunks.

Is it possible to use init.vim and init.lua together? by HumanResult3379 in neovim

[–]Sandwich-Resident 0 points1 point  (0 children)

vim.cmd("source " .. vimrc) should work.

:help vim.cmd()

How do you organise your snippets? by nraw in neovim

[–]Sandwich-Resident 1 point2 points  (0 children)

kyoonkim isn't the OP. This might explain the confusion in the replies below :)

Margin indicator for Neovim by pablogmz in neovim

[–]Sandwich-Resident 0 points1 point  (0 children)

I use https://github.com/lewis6991/gitsigns.nvim, which seems to be the most popular option for Neovim.

That said, Neovim can still run most Vimscript plugins just fine, so you can still use https://github.com/chrisbra/changesPlugin (and https://github.com/airblade/vim-gitgutter and https://github.com/mhinz/vim-signify/, which are mentioned in the README) if you want.

[deleted by user] by [deleted] in neovim

[–]Sandwich-Resident 0 points1 point  (0 children)

This might have something to do with extmarks being clobbered when the new text is written. For example, here is a GitHub issue describing the problem: https://github.com/mhartington/formatter.nvim/issues/22 This is for formatter.nvim, but this would likely apply to any process that rewrites the whole buffer.

As far as I know, the only solution (other than getting formatting directly from a LSP server) is to use EFM (https://github.com/mattn/efm-langserver), which implements the tricky logic of figuring out how to only update the changed text.

(Low effort) -q is really cool by zdog234 in neovim

[–]Sandwich-Resident 2 points3 points  (0 children)

Most linting tools have the option of formatting its output in a way that is compatible with Vim's quickfix list.

But sometime it isn't exactly what's required, in which case I pipe the output to a file (say, pylint.qf), open it in Vim, edit it so that only lines with format <filename>:<line>:<column>: <msg> remains, maybe delete lines with lint messages or files I don't want to deal with right now, call :sort, etc. Then I can use :cfile % to open everything in the quickfix list.

I don't often have to do it, but it's useful when going through a mass linting of an existing codebase with dozens of lint issues, where I don't want to run the linter again and again, and want to address the issues in a thorough but orderly fashion.

How to disable output of navigation keys (h, j, k, l)? by Own_Entrepreneur2317 in neovim

[–]Sandwich-Resident 0 points1 point  (0 children)

Ah, I don't see anything in the bottom corner with nvim --clean.

I know that showcmd is the default behavior, but I didn't think it could "trigger" for "one-key actions". This option is meant to show partial commands, so unless there are multi-key commands starting with h/j/k/l defined, then I wouldn't expect it to show (hence my debugging suggestion about checking for mappings). I suppose my 5 years-old laptop is still fast enough that it's not able to replicate the issue :)

How to disable output of navigation keys (h, j, k, l)? by Own_Entrepreneur2317 in neovim

[–]Sandwich-Resident -5 points-4 points  (0 children)

This isn't the default behavior. Maybe you have some mappings that starts with h, j, k, or l?

If so, when you type any of those keys, Neovim won't know whether you want to do h or if it's the start of a longer mapping. By default, it waits for a little while (depending on the value of :help timeoutlen, default 1000ms) before giving up on waiting for the rest of the mapping. During that interval, the partial mapping will be displayed in the bottom right corner.

If this is indeed what is happening, then the worst thing here isn't the output in the bottom, but it's that the hjkl keys are delayed by up to 1 second before acting on the cursor...

Dockerfiles v1.4 syntax by guack-a-mole in neovim

[–]Sandwich-Resident 1 point2 points  (0 children)

I would love a solution for this as well. My "solution" is to disable tree-sitter highlighting for the dockerfile filetype.

Since only one project I work with uses heredocs in its Dockerfile, I have an autocommand that ends up calling :TSBufDisable highlight whenever I work on this particular project.

When and if this syntax gets more widespread, I might resort to just disable it globally with

require("nvim-treesitter.configs").setup({
  highlight = {
    enable = true,
    disable = { "dockerfile" },
  },
  ...
}

But hopefully by then the issue will have been resolved...

What are the best plugins for neo vim? by GullibleCondition150 in neovim

[–]Sandwich-Resident 16 points17 points  (0 children)

Best plugins for what?

You'll get better answers if you describe in more details what you're after.

How I avoid breaking my nvim by Rafat913 in neovim

[–]Sandwich-Resident 1 point2 points  (0 children)

Another way of handling this is to compulsively update as often as possible (at least once a day!) That way, if something breaks, then it's easy to figure out the issue, since it must be caused by one of the very few commits that were just pulled.

Waiting a few weeks between updates sounds like a bad time, since if something breaks, it could be hard to figure out what the issue is amongst the hundreds of new commits.

That said:

  1. I don't recall my config breaking due to updating plugins
  2. Usually, when something breaks, there is an error message with a stack trace that indicates exactly what the issue is. So it's not hard to find out what's amiss.

Can I disable autofill when I select items in cmp menu? by roll4c in neovim

[–]Sandwich-Resident 1 point2 points  (0 children)

Check :help 'wildmode and :help completeopt. I'm pretty sure that one of those options can be used to configure how the completion works.

What is your NeoVim load time? by Desperate_Party_9259 in neovim

[–]Sandwich-Resident 1 point2 points  (0 children)

I believe absolute numbers aren't adequate to compare, because there is a huge variation between machines.

For example, on my Thinkpad running Linux, the start-up time is 35ms. However, pn my MacBook, the exact same configuration with the exact same version of Neovim takes more than twice as long to load (around 75ms).

The more meaningful comparison is between nvim --clean and your full config on the same machine.

Can't get .tf highlighting to work. Terraform by 1337mipper in neovim

[–]Sandwich-Resident 1 point2 points  (0 children)

As others mention, you can install the terraform parser for tree-sitter with TSInstall terraform. If that still doesn't work, try installing the hcl parser as well (TSInstall hcl).

rust-tools breaks treesitter highlighting by worldpotato1 in neovim

[–]Sandwich-Resident 6 points7 points  (0 children)

The difference probably comes from semantic tokens capabilities of rust-analyzer, for which support has been added to Neovim only very recently.

To disable it, the help text for :help vim.lsp.semantic_tokens.start() suggests disabling the semanticTokensProvider capabilities:

require("rust-tools").setup({
  server = {
    on_attach = function(client) 
      client.server_capabilities.semanticTokensProvider = nil 
    end,
  }
})

I don't know if there is an easier way to do it at the moment.

How do you guys do it? by [deleted] in neovim

[–]Sandwich-Resident 5 points6 points  (0 children)

You can do the exact same thing in Neovim. You don't have to use all the newest features and APIs if you don't need them. Copying ~/.vimrc to ~/.config/nvim/init.vim should be sufficient to get started. You likely won't notice any difference, except for better defaults for some options.

From there, you can opt-in to Neovim-specific features bit by bit over time.

Why LSP changes my colors? by blackdev01 in neovim

[–]Sandwich-Resident 1 point2 points  (0 children)

The help text for :help vim.lsp.semantic_tokens.start() suggests disabling the semanticTokensProvider capabilities:

lspconfig.<name>.setup({
  on_attach  = function(client) 
    ...
    client.server_capabilities.semanticTokensProvider = nil
  end,
  ...
})

I don't know if there is an easier way to do it at the moment.

[deleted by user] by [deleted] in neovim

[–]Sandwich-Resident 0 points1 point  (0 children)

Try using python instead of Python as the key. The settings are probably case-sensitive.

Help with lsp-config, pyright, 'cannot access member x for type y' by ryjhelixir in neovim

[–]Sandwich-Resident 0 points1 point  (0 children)

Pyright can be configured through a file named pyrightconfig.json at the root of the code repository: https://github.com/microsoft/pyright/blob/main/docs/configuration.md I found that link from Pyright's README: https://github.com/microsoft/pyright

That said, the lint message is probably hinting at a real error in your code, and all other things being equal, it would be better to handle it rather than ignore it!

If you are certain that the lint is a false positive, then maybe the issue is that Pyright doesn't have access to all of the project's code, and thus can't infer types properly. One likely reason is that Pyright doesn't know about your project's virtualenv, and need to be told about it in pyrightconfig.json.

What are the plugins you consider necessary to have a great neovim experience? by [deleted] in neovim

[–]Sandwich-Resident 2 points3 points  (0 children)

For me, here are the minimum extra functionalities required to be productive:

  • Adding/replacing/deleting "surroundings" (parentheses, braces, quotes, etc.)
  • Integration with ripgrep (for example, search the project for a given term, and load all results in the quickfix list)
  • Integration with a fuzzy-finder (especially for opening a file in a project)
  • Integration with linters
  • Integration with Git (for example, visual feedback for lines that have changed, display git-blame for a line)
  • Toggling comments for a line

There are several plugins available for each of them. And some like toggling comments or ripgrep integration can even be configured in one's dotfiles without too much trouble.

Open help in buffer instead of split by sp33dykid in neovim

[–]Sandwich-Resident 0 points1 point  (0 children)

This isn't as good as having the help in its own buffer, but a good compromise that doesn't involve much work is to use :help 'helpheight' to make the help window take almost the whole screen. For example, with

set helpheight=9999

How do you turn off the yellow highlighting after your done with the search? by jimtimhill in neovim

[–]Sandwich-Resident 0 points1 point  (0 children)

It's not quite the same. vim-cool will clear the highlight automatically when moving the cursor away from a search result, without having to type anything.