Neovim

1604 readers
1 users here now

Neovim is a modal text editor forked off of Vim in 2014. Being modal means that you do not simply type text on screen, but the behavior and functionality of the editor changes entirely depending on the mode.

The most common and most used mode, the "normal mode" for Neovim is to essentially turn your keyboard in to hotkeys with which you can navigate and manipulate text. Several modes exist, but two other most common ones are "insert mode" where you type in text directly as if it was a traditional text editor, and "visual mode" where you select text.

Neovim seeks to enable further community participation in its development and to make drastic changes without turning it in to something that is "not Vim". Neovim also seeks to enable embedding the editor within GUI applications.

The Neovim logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.

founded 3 years ago
MODERATORS
51
 
 

I've been absolutely loving treesitter. It's come a long way and it's been absolutely great for things like folds, motions, highlights of course. Now that I've finally gotten familiar with writing my own queries I can extend the existing plugins. As an example I've added folds to blocks of multiple consecutive comments in JS and Ruby.

What are some of your favorites?

52
24
submitted 1 year ago* (last edited 1 year ago) by lung@lemmy.world to c/neovim@sopuli.xyz
 
 

Hey guys, I'm currently one of the active members the neovim reddit (hugelung), and I'm in full support of migrating to lemmy. I was hoping to be modded here, and helping migrate content / roll people over

53
13
Weekly dotfile review? (sh.itjust.works)
submitted 1 year ago* (last edited 1 year ago) by em_s_h@sh.itjust.works to c/neovim@sopuli.xyz
 
 

What does everyone think about doing a weekly dotfile review thread like r/neovim does.

I personally really like to see different neovim configurations that other people have made.

Edit: my config

Edit 2: I also think that if we are to do these, they should be done on the weekends, since that is the time when people aren't busy with their jobs or school.

54
 
 

Am I the only one who struggle with cmp comparators? I can't make any setup to work like I want it to work.

Like come on, diagramIds is literally on the line above ...

The comparators aren't even documented: https://github.com/hrsh7th/nvim-cmp/issues/883

This is the closest thing I could find to usefull: https://github.com/hrsh7th/nvim-cmp/issues/183 but it didn't help either

How did you manage to cope with this? Is there some reasonable setup for cmp comparators?

55
 
 

Hey all, just a heads up that https://github.com/neovim/neovim/discussions has been reopened in the light of the r***it situation.

56
 
 

Just wondering: how would you characterize the general feel of the different nvim flavours: LazyVim, Chad, Astro, etc.? I'm not thinking functionality, which plugins are included, etc., but the way they feel when one uses them.

I tried out a whole bunch of them, as per Elijah Manor's excellent video about config switching (https://www.youtube.com/watch?v=LkHjJlSgKZY)

I figured out LazyVim is trying its best not to look and feel like vim, with modal windows and fancy graphics and all. I didn't like that. I can't remember why I left Astro behind, but I finally settled on Chad, which at first I disliked because of the name, but eventually I figured out that that was the flavour for me: so many things just worked as expected, and there were so many times when I looked up something, and went: "Hm! That was quite smart, actually!"

So that's where I'm at – and purely for "feel" reasons. So: convince me: what am I missing when I don't use bundle B or config C?

57
 
 

Hey all. I recently made the jump to using neovim as my full-time editor of choice using a modified version of LazyVim. I'm looking for a plugin that shows Markdown preview (preferably within a buffer and not by opening a browser page, if that's possible). This is primarily for taking notes at work, although I don't need the most heavyweight note taking app (for that I usually use Notion, which unfortunately doesn't seem to have a read-write neovim plugin). Do you have any recommendations?

58
 
 

e.g. the builtin live_grep function. Particularly if it has to open a buffer, the cursor is just on line 1, not the line I selected in Telescope. I think it might be to do with folding?

Just wondering if anyone else had this and knew a fix?

59
 
 

The r***it neovim community is fab and taking part in the go-dark outage protest. I think open source communities are better served by open not for profit, decentralized community-apps like this. The corporaate ones always go bad in the end. Reddit and Github both allowed their data to feed the big tech power grab that is LLMs.

60
 
 

So, instead of running to reddit, i'll give this a shot here. I'm in the process of making my own NeoVim Configuration from scratch. One of the tools i use is sidebar-nvim . This allows me to make my own Sections. I'm pretty new to lua and have never dabbled in plugin programming before. Through reading the source of sidebar-nvim and neovim-session-manager I have gotten to a point where i get a list of my sessions in the sidebar.

local session_manager = require("session_manager.utils")
local sessions = session_manager.get_sessions()
local dirs = {}
local filenames = {}

for _, file, _ in pairs(sessions) do
  local directory = session_manager.shorten_path(file.dir)
  table.insert(dirs, directory)
  table.insert(filenames, file.filename)
end

local section = {
  title = "Sessions",
  icon = " ",
  draw = function()
    return dirs
  end,
  bindings = {
    ["l"] = function(line, col)
      local filename = filenames[line]
      session_manager.load_session(filename, false)

    end,
  }
}

return {
  "sidebar-nvim/sidebar.nvim",
  config = function()
    require("sidebar-nvim").setup({
      open = true,
      side = "right",
      sections = {
        "datetime",
        "symbols",
        section,
        "git",
        "todos",
        "diagnostics"
      },
    })
  end
}

The thing that isn't working is the "bindings". session_manager.load_session takes the filename out of the original sessions table. I have no clue how the original structure looks. My attempt currently returns an empty value. Anyone have an idea how to access the data i need to get the session loaded properly?

61
3
time tracking (lemmy.world)
submitted 1 year ago* (last edited 1 year ago) by atomdmac@lemmy.world to c/neovim@sopuli.xyz
 
 

I've been using Wakatime recently and while I like the functionality quite a bit I don't really want to pay $15 per month to use it. It seems a little steep to me so I'm looking for free and open source alternatives. Does anyone here have one that they like?

Edit: I started messing with https://timetagger.app and writing a quick adapter to start/stop the clock from neovim. I've beentestingg it out over the last few days and so far, I really like it

62
9
This Week In Neovim Newsletter (this-week-in-neovim.org)
submitted 1 year ago* (last edited 1 year ago) by ds12@beehaw.org to c/neovim@sopuli.xyz
 
 

Just wanted to share a newsletter that a Neovim community member has been putting out weekly. Content is categorised under Core and Plugin (hopefully self-explanatory). I usually find interesting things to learn about Neovim's core and API, or plugins to explore!

63
64
 
 

I've managed to put this together couple days back and thought I'd share, I expect I'm not the only person out there who likes neovim and switching light/dark modes. Cheers!

65
66
67
68
 
 

For any questions related to configuring Neovim with Lua or migrating over to Lua from Vimscript.

69
 
 

this is my config on moonscript

share your configs on lua, vimscript or on other languages in comments :^)

70
 
 

I gave it a go last night and it is way trickier then I expected. Simple things like setting options are not very convenient at the moment. I also tried to get packer.nvim running but the README was not very helpful.

Looks like I will be sticking with init.vim for some time.