Neovim

2169 readers
3 users here now

founded 1 year ago
MODERATORS
51
 
 

When im using the edit mode with nvchad, sometimes (especially when i press the space or enter keys) an error apear saying Multiple different client offset_encodings detected, this is not supported yet, any idea why does this happen?

52
53
38
submitted 6 months ago* (last edited 6 months ago) by [email protected] to c/neovim
 
 

I was looking for a good generalist set of keybindings for my Steam Deck's onboard controls that bound all the letter keys and also the necessary commands to navigate web pages and manipulate files. There isn't any obvious layout to bind all the gamepad buttons, joysticks and touchpads to letter keys and keyboard commands/command chords, and further it feels like whatever solution you came up with would be impossible to memorize anyways.

Kind of a silly endeavor perhaps, but... touchscreen keyboards take up wayyyyy too much screen real estate on the Steam Deck, and further the pop up software keyboard sometimes doesn't behave right with software that isn't expecting a pop up touchscreen keyboard (i.e., not like a mobile app designed to handle one).

Then I randomly thought about Qutebrowser and vim keybindings... and I had an evil idea.....

I want to try using this with neovim as well, and I thought y'all might get a kick out of it lol!

edit errr, oooff I don't know how to get lemmy not to dump the text from my linked post completely unformated into this post

54
 
 

Siddharta Govindaraj writes:

As I blogged about in the previous two articles, I recently updated my NeoVim configuration for the fourth time. Although it might sound like a lot of config updates, keep in mind that it happened over a period of four years.

  • The first version was a port of my existing Vim configuration. Because NeoVim is backward compatible with Vim, you can just move the configuration over and it will work
  • In the second version, I migrated my plugin manager to Packer. This config was a mix of old style Vim config and the newer NeoVim style with some plugins migrated to Lua equivalents
  • Then I decided to go 100% Lua config and started using Kickstart.nvim and LazyVim.
  • This fourth time around I used Kickstart and LazyVim as guides to write my own from scratch.

You can find my NeoVim configuration on Github.

In this article I am going to go through and explain my configuration step-by-step. I have a terrible memory, so this post will also serve as a guide when I inevitably need to look through this file in the future.

Read Configuring NeoVim as a Python IDE (2023)

55
28
submitted 7 months ago* (last edited 7 months ago) by ericjmorey to c/neovim
 
 

btw.nvim

Show "I use Neovim (BTW)" when neovim opens. That's all you need.


Why bother with mini.starter, vim-startify, dashboard-nvim, or any of those distractions? I know you, my friend. Forget about all that noise – all you truly need is I use Neovim (BTW). Embrace it proudly, and let your ego shine!

Features

  • Instant Ego Boost: Get greeted with "I use neovim (BTW)" on launch.
  • I use Neovim (BTW): Show your ego to the world.

56
57
18
submitted 7 months ago* (last edited 7 months ago) by [email protected] to c/neovim
 
 

im switching to colemak-dh and i need some advice.

im writing this with colemak-dh, beleive me its hard. whats even harder is the hjkl navigation. so should i remap it to neio? you can consider me a long run guy, so your answers can be based on that.

thanks in advance.

58
59
60
61
62
 
 

Really enjoying nvim-dap-ui lately, but I always have to adjust the sizes of the windows. The docs have left me high and dry so far, but maybe one of you have a good solution for a consistent layout when you first attach to a file?

63
 
 

Looking for a way to migrate from Arduino IDE to get everything in NeoVim, but I get lost in the weeds without a working example or reference. I'm wondering if this is actually practical and more than a novelty for anyone here.

64
65
12
Help with snippets? (lemmy.sdf.org)
submitted 8 months ago* (last edited 8 months ago) by [email protected] to c/neovim
 
 

My goal is to automatically close the environment while editing a tex file. There was an issue for vimtex asking for basically what I want to achieve. They achieve it using snippets as mentioned there.

The problem is, I have no idea how to set it up. I've never used snippets in nvim. I have vim-vsnip and cmp-vsnip installed as it was needed for another plugin to work. Is it possible to implement this using those?

It can be noted that in vimtex, an environment can be closed by typing ]] which is a mapping of vimtex-delim-close. I basically want to emulate the behavior in VS Code using LaTeX Workshop. It auto-closes the environment, adds an indented line in the middle, and moves the cursor there.

If anyone has any other ideas about doing this without snippets, that's welcome too.

66
 
 

Hi I've been looking at nyoom.nvim and it alters the UI of telescope (see screenshot) I was just wondering how this is possible? I looked d through the codebase but couldn't find anything other than the setting of colours?

Here is the repo: https://github.com/nyoom-engineering/nyoom.nvim

67
 
 

cross-posted from: https://discuss.online/post/5797974

TJ has a walkthrough of installing NeoVim and his Kickstart.nvim package for people new to NeoVim. He explains what is going on so you can then further customize your NeoVim setup.

I used NeoVim with Kickstart.nvim to get my NeoVim setup initialized. It's great.

68
12
submitted 8 months ago* (last edited 8 months ago) by [email protected] to c/neovim
 
 

I'd like a treesitter query that matches a Rust struct together with all of its attributes. For example,

#[derive(Debug)]
#[serde(rename_all = "camel_case")]
pub struct MyType {
    pub foo: i32,
}

The lines beginning with # are attributes that are logically connected to the struct declaration. But the treesitter grammar for Rust parses attributes as adjacent nodes, not as children of the struct declaration:

  (attribute_item ; [27, 0] - [27, 16]
    (attribute ; [27, 2] - [27, 15]
      (identifier) ; [27, 2] - [27, 8]
      arguments: (token_tree ; [27, 8] - [27, 15]
        (identifier)))) ; [27, 9] - [27, 14]
  (attribute_item ; [28, 0] - [28, 35]
    (attribute ; [28, 2] - [28, 34]
      (identifier) ; [28, 2] - [28, 7]
      arguments: (token_tree ; [28, 7] - [28, 34]
        (identifier) ; [28, 8] - [28, 18]
        (string_literal)))) ; [28, 21] - [28, 33]
  (struct_item ; [29, 0] - [31, 1]
    (visibility_modifier) ; [29, 0] - [29, 3]
    name: (type_identifier) ; [29, 11] - [29, 17]
    body: (field_declaration_list ; [29, 18] - [31, 1]
      (field_declaration ; [30, 4] - [30, 16]
        (visibility_modifier) ; [30, 4] - [30, 7]
        name: (field_identifier) ; [30, 8] - [30, 11]
        type: (primitive_type)))) ; [30, 13] - [30, 16]

How can I get produce a query that I can use in mini.ai that matches the struct, and all attributes?

I've tried this query using Neovim's new built-in :EditQuery command:

((attribute_item)* . (struct_item)) @custom_capture.outer

It looks like it does what I want. But when I try using @custom_capture.outer in mini.ai it matches the struct declaration, but not the attributes.

I tried using #make-range! like this,

((attribute_item)* @_start . (struct_item) @_end
  (#make-range! "custom_capture.outer" @_start @_end))

That matches the struct and the second attribute, but does not get the first attribute. I'm guessing that's because the . specifies that nodes must be adjacent, and the second attribute is the only one that is adjacent to a struct_item. Following that thinking I tried this,

((attribute_item)? @_start . (attribute_item)* . (struct_item) @_end
  (#make-range! "custom_capture.outer" @_start @_end))

That gets the struct and all the attributes, but only if my cursor is on the first attribute line when I use the textobject. If my cursor is on any subsequent line then I get the second attribute and the struct, but the first attribute is missed.

One problem is I'm not clear whether ((attribute_item) . (struct_item)) matches an attribute_item and a struct_item that are adjacent, or matches an attribute_item that precedes a struct_item, but does not also match the struct_item. I tried experimenting with the second interpretation and used this query,

(((attribute_item) 
  . [(attribute_item) (struct_item)])* @_start
  (struct_item) @_end
  (#make-range! "custom_capture.outer" @_start @_end))

That captures what I want, but in some cases if I have two struct declarations and I try to match only the second one the query selects both structs instead.

Is that the way to do a lookahead? Or is there another way?

I've kinda hit a wall looking at documentation, other examples, and running my own experiments. Does anyone have any pointers to help understand these queries on a deeper level?

Edit: It looks like this stuff is in flux, so I should mention that I'm using the latest nightly as of March 2 2024, and I made sure that all of my plugins are up-to-date.

69
11
submitted 8 months ago* (last edited 8 months ago) by [email protected] to c/neovim
 
 

Fairly new neovim user here, so bear with me if I don't get everything.

I'm using neovim with Telescope and I often struggle with the following process: I want to be able to easily save my past yanks and deletions and fuzzily find the one that interest me now. Is there a way to configure Telescope to look into registers for that ?

Also, is there a way to keep the history of deletion as well ? Sometimes I'm deleting A, deleting B, deleting C and want to past A which is no longer accessible (unless I remember to put it in a named register in the first place, which I rarely do).

70
 
 

Hello all, as someone who mainly prefers dark themes but also enjoys black text, I created this semi-light neovim color scheme. https://gitlab.com/sxwpb/halfspace.nvim

The goal was having a theme that uses black text but avoids the eye melting of most light themes. In fact the background color is #808080, which is the midpoint of a monitors brightness. Using such a background comes at a hefty cost of text contrast, thus all chosen syntax colors are kept pretty close to the best possible contrast here which is black text.

Let me know what you think and I know lots of people absolutely despise this type of color combination which I understand, so please be kind in that case.

happy vimming

71
72
73
 
 

kitty-scrollback.nvim v4.0.0 is officially released! Check out the announcement here.

What is kitty-scrollback.nvim?

A Neovim plugin (and Kitty Kitten) that allows you to navigate your Kitty scrollback buffer to quickly search, copy, and execute commands in Neovim.

kitty_scrollback_screencapture_00_kitty_scrollback_nvim

Check out Advanced Configuration Examples for more demos!

What changed?

See Migrating to v4.0.0 for the detailed migration guide.

  • Previously, kitty-scrollback.nvim did not open Neovim with your Neovim configuration by default. This has changed to loading your Neovim configuration by default, with the ability to opt out. If you prefer to continue not loading your Neovim configuration, then follow the steps at No Configuration.
  • If you previously used the flag --no-nvim-args, then delete it from your configuration because it no longer has any effect. The flag --nvim-args remains unchanged and can still be used.
  • ksb_example configurations have been removed and can no longer be referenced by name. If you were previously referencing an example configuration by name, then you can manually copy it from ./tests/example.lua into your kitty-scrollback.nvim configuration. See Plugin Configuration for detailed instructions on configuration kitty-scrollback.nvim.
  • The command KittyScrollbackGenerateKittens and api generate_kittens no longer have an option to generate ksb_example configurations.
    • The command KittyScrollbackGenerateKittens no longer accepts the bang ! modifier
    • The api generate_kittens signature removed the all parameter
  • The reserved global configuration name has been removed and global options are now configured by the first element of the options table without a key. See Global Configuration for more details.
  • The undocumented reserved default configuration name has been removed. kitty-scrollback.nvim defaults to ksb_builtin_get_text_all if no configuration is provided.

Other minor version updates

  • You can now paste and execute commands directly from visual mode! Previously, this could only be done with the paste window that is used for editing commands. Check out the demos in the Features section.

kitty_scrollback_screencapture_03_should_paste_visual_selection_to_kitty

  • The environment variable KITTY_SCROLLBACK_NVIM was added and is set to true while kitty-scrollback.nvim is active. See Environment Variables.
  • Documented the filetype kitty-scrollback and provided an example of using it in an autocmd. See Filetypes.

What's next?

The next feature I plan to work on is adding tmux support (see #155).

If you have any questions, comments, or feedback feel free to create an issue or open a discussion.

74
75
view more: ‹ prev next ›