26
6
submitted 1 year ago by pipoprods@lemmy.ml to c/neovim@sopuli.xyz

I'm using Nightfox theme and treesitter parser for syntax highlight.

My code blocks in markdown files get displayed in italic, which is quite unreadable…

How could I configure nvim to displayed them as normal characters?

27
42
This week in Neovim (dotfyle.com)
submitted 1 year ago by mrmanager@lemmy.today to c/neovim@sopuli.xyz

Just sharing this on Lemmy as well for all you amazing neovim users. :)

28
10
This week in neovim (www.reddit.com)
submitted 1 year ago by mrmanager@lemmy.today to c/neovim@sopuli.xyz

Just sharing this on Lemmy as well.

29
2
submitted 1 year ago by _calm_bomb_@lemmy.ml to c/neovim@sopuli.xyz

So, I've been using nvim on macos for almost two months and didn't have issues, but after the last update I'm seeing this:

Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: ...ocal/Cellar/neovim/0.9.1/share/nvim/runtime/filetype.lua:21: Error executing lua: ...ocal/Cellar/neovim/0.9.1/shar
e/nvim/runtime/filetype.lua:22: BufReadPost Autocommands for "*"..FileType Autocommands for "*": Vim(append):Error executing lua callback: vim/load
er.lua:0: EACCES: permission denied: /Users/clmbmb/.cache/nvim/luac/%Users%clmbmb%.local%share%nvim%lazy%null-ls.nvim%lua%null-ls%rpc.luac
...

This happens (for now) only when trying to open .lua files.

From what I gather there's something related to some filesystem security flags in macos. I'm new to macos, so I have no idea what happens.

Any hints/solutions to this?

30
11
submitted 1 year ago by rjooske@lemmy.world to c/neovim@sopuli.xyz

Is there a way to avoid opening a nested neovim instance inside a terminal buffer and instead open it as a new buffer inside the already running instance? I'm thinking something like what Fugitive does, but more general and that works for any shell commands.

31
3
submitted 1 year ago* (last edited 1 year ago) by CjkOvPDwQW@lemmy.pt to c/neovim@sopuli.xyz

Hi everyone long time vim/neovim user, currently for my latex I have in ~/.config/nvim/after/ftplugin.lua the following line:

vim.opt_local.makeprg="pdflatex -output-format pdf -output-directory /tmp %"

I am now working in a latex project that has a makefile, is it possible to create something in the lines of:

if ! makefile_exists then
  vim.opt_local.makeprg="pdflatex -output-format pdf -output-directory /tmp %"
end

Ended up with this and it seems to work fine:

~/.config/nvim/after/ftplugin/tex.lua

local makefile_exists = vim.fs.find('makefile', {
  upward = true,
  stop = vim.uv.os_homedir(),
  path = vim.fs.dirname(vim.api.nvim_buf_get_name(0)),
})

if #makefile_exists == 0 then
	vim.opt_local.makeprg = "pdflatex -output-format pdf -output-directory /tmp %"
end
32
1
submitted 1 year ago* (last edited 1 year ago) by Agility0971@lemmy.world to c/neovim@sopuli.xyz

I'm using NvChad and in ~/.config/nvim/lua/core/mappings.lua there is a keybinding for LSP code action:

  ["<leader>ca"] = {
    function()
      vim.lsp.buf.code_action()
      -- TODO: write buffer to file
    end,
    "LSP code action",
},

this keybinding applies the code action, but does not write to file. I want to write changes to file as soon as I've applied the code action.

How can I use the documentation at https://neovim.io/doc/ to find the correct function? I've tried looking for a write() function but I could not find anything I can call from lua.

33
5
TWiN is back (dotfyle.com)
submitted 1 year ago by doomkernel@sopuli.xyz to c/neovim@sopuli.xyz

We got TWiN back! No RSS for now but good to see someone stepping in and keep to project alive.

34
4
submitted 1 year ago by dlanm2u@sopuli.xyz to c/neovim@sopuli.xyz

out of curiousity, since I feel like most of the time I touch any vi derivative it’s because I need a text editor on a command line, not because I really really wanna use it

35
2
submitted 1 year ago* (last edited 1 year ago) by may_pretender@feddit.ro to c/neovim@sopuli.xyz

So, I've been a Neovim user for a few years now. I started as most of you (I assume) with vim, and just kept on using and expanding that config file over the years.

I only recently realized there's quite a split between the Vim and Neovim plugins and that the Neovim community is pushing Lua as a better development platform. From what I can see, some users are switching their configs from Vimscript to Lua. To be honest all I know about Lua is that it means moon in Portuguese...

Should I too? What would the advantages be? What would the disadvantages be? For those who did switch, why did you switch and what was your experience? For those who didn't why did you not?

p.s. review (roast) my dotfiles

edit: thank you all for your input! I will consider slowly switching to lua by modifying only some parts of the config as some of you suggested.

36
1
submitted 1 year ago by dlvhdr@lemmy.world to c/neovim@sopuli.xyz

I’ve tried all the surround plugins but what I really want is just the simple flow of: make a selection -> press “, ( etc to surround. Is that not possible with vim?

37
1
submitted 1 year ago by mawkler@lemmy.ml to c/neovim@sopuli.xyz

I saw that null-ls.nvim just added textidote support. Textidote seems to be a spelling/grammar checker that wraps LanguageTool, just like ltex-ls. Does anyone know how they compare?

38
2
submitted 1 year ago by Chocrates@lemmy.world to c/neovim@sopuli.xyz

I am rewriting my ancient vim config into Lua with nvim. I am using Mason to grab lsp language servers and for the most part it works great!

I have this in my remaps so I can <leader>f to format the current file (still need to figure out formatting on save too, but I can't for the life of me get Markdown formatting working.

vim.keymap.set("n", "<leader>f", function()
	vim.lsp.buf.format()
end)

I have markdownlint, marksman, prettier, and prettierd all installed wth Mason (though I haven't written any keymaps or configs for them). Any idea how I can format my Markdown? I write in it all day every day so it's gonna help a ton if I can get it working. Secondly any ideas how I can do the same mapping for the formatting on save? Still pretty new to Lua.

39
1

Hey guys, I'm following the tutorial above, and in his video he doesn't do anything specific to show hidden files, but it works for him. My .config/nvim/after/plugin/telescope.lua file looks like this: I've looked up solutions but they all use a different syntax, and none work for me. Any idea how I can make the find_files command also show hidden files by using this syntax? Thanks!

40
3
submitted 1 year ago by siipale@sopuli.xyz to c/neovim@sopuli.xyz

This is a very simple thing but it can be useful for folks who are still using mostly arrow keys. It finally clicked for me when I started using Tridactyl for Firefox :)

Most of the time you need down and up motions so you rest your index finger on J and middle finger on K. J looks little bit like a down arrow (mnemonics jown and kup don't seem very intuitive to me). So now you have the main arrow keys assigned to your fingers. Naturally you rest your ring finger on the L key and when you occasionally need to move left just move your index finger to the H key.

41
1

Hello !

In my day to day work I often have to write small snippets to illustrate ticket tech strategy.

I was wondering if you guys knew a cool way to have quick scratchpad where I could manipulate the snippet, format it, and have minimal syntax coloration.

This is usually handled by LSP, but sometimes having a full lsp running is not practical, with all the overhead of typescript config for example.

Main formats are JSON, typescript and soon Rust.

Cheers

42
1
submitted 1 year ago* (last edited 1 year ago) by noornee@lemmy.ml to c/neovim@sopuli.xyz

i currently use Iosevka Nerd Font.

the cancel icon (X) looks too big and i want to change it to lowercase (x). i looked through the nvim-web-devicons readme and i also tried printing out all the available icons there

i.e.

local devicons = require("nvim-web-devicons").get_icons()
for _, value in pairs(devicons) do
	for i, v in pairs(value) do
		print(i .. "==>" .. v .. "\n")
	end
end

but i couldnt find an icon with a name that matches X or cancel. what can i do to override this and replace with a custom one?

[edit] i use barbar.nvim for buffers btw.

i just tried akinsho/bufferline and the cancel icon looked normal. i suppose this is a barbar issue

[edit]:

okay turns out it was a barbar issue. just had to read through the README.md properly haha.

M.config = function()
	require("barbar").setup({
		icons = {
			button = "x", -- customize it to anything 
		},
	})
end

43
1
submitted 1 year ago by Nico792@lemmy.ml to c/neovim@sopuli.xyz

Hi, I’m new to neovim so there’s a decent chance this is just a rookie mistake. I wanted to make an autocmd to remap F5 to running the (python) file. I found a stack overflow post on how to do this (https://stackoverflow.com/questions/18948491/running-python-code-in-vim ) but that was for vim. I tried my best to translate if for neovim using some other tutorials I found (and doing my best at understanding docs), what I came up with is this:

local api = vim.api
local RunFile = api.nvim_create_augroup("RunFile", { clear = true })

api.nvim_create_autocmd(
    "FileType",
    {
        callback = "map <buffer> <F5> :w<cr>:exec '!python3' shellescape(@%, 1)<cr>",
        pattern = "python",
        group = RunFile,
    }
)

however when I include the file in my init.lua, not only does it not work (the autocmd doesn’t even show up when looking in :au FileType, let alone run) it also makes the text a boring white and when I try to format, it gives the error [LSP] Format request failed, no matching language servers. while I definitely do have the language server (it works when the autocmd file is not included in init.lua). I’m probably just making some simple mistakes, but I cannot for the life of me find what I’m doing wrong. Does anyone here have any suggestions? For the record, I use lsp zero and treesitter

44
0
Shitpost (lemmy.world)
submitted 1 year ago by santos@lemmy.world to c/neovim@sopuli.xyz
45
2
submitted 1 year ago* (last edited 1 year ago) by sorrybookbroke@sh.itjust.works to c/neovim@sopuli.xyz

Zeioth has created a fantastic plugin for those of you looking to make Neovim more like an IDE. Run the open command, tell it to build, have it compile, execute, and output your code in a really nice looking way all inside neovim.

It's still pretty early but this is looking promising. It's already very customizable with support for a few languages, with more in the works.

Give it a look: https://github.com/Zeioth/Compiler.nvim

46
4
submitted 1 year ago by yads@lemmy.world to c/neovim@sopuli.xyz

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?

47
2
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

48
2
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.

49
1
submitted 1 year ago by catlover@lemmy.world to c/neovim@sopuli.xyz

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?

50
1
submitted 1 year ago by lewis6991@lemmy.world to c/neovim@sopuli.xyz

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

view more: ‹ prev next ›

Neovim

3 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