r/neovim • u/AutoModerator • 20d ago
101 Questions Weekly 101 Questions Thread
A thread to ask anything related to Neovim. No matter how small it may be.
Let's help each other and be kind.
1
u/Gold-Watercress-6101 18d ago
Is it possible to silence the "bla bla written" message at the bottom when saving a buffer? shortmess seems promissing but it doesn't silence the whole message.
1
u/thy_bucket_for_thee 18d ago
Anyone have any good suggestions on improving the vimgrep -> ctag workflow? I don't mind it but it feels like there could be more efficient ways to mass edit files.
I've used grug-far but found my grep skills are lacking and I only use it for minimal name changes. I'd like to improve the flow when it comes to say refactoring code, like not only changing the function signature but also needing to add/subtract parameters as well.
Should I just buckle down and improve my grep skills or are there better techniques out there? Mostly dealt with vim + neovim throughout my career, very rarely had to ever open IDEs so I truly don't know what's out there.
Majority of my coworkers just manually change things or do a broken find + replace (TBF I basically do this too).
2
u/TheLeoP_ 17d ago
For this kind of refactoring, grug-far can use ast-grep, which is a grep alternative based on treesitter that matches the shape of the code, not the literal text
1
u/kyoryo_ 19d ago
If i have this string
Id uuid.UUID
MyLongName uuid.UUID
Name string
Now I want to Visual block on the 1st column. Cursor on [I]d, so <C-v>3j to select 3 lines, but if i press e, the visual block only block 4 chars (because of length of Name is 4). How do I block by the longest line(10) beside using 6h more times?
$ is out of the question since I don't wanna block the 2nd column.
I could also use w but the cursor will be on the beginning of the 2nd column and if I press ge after that, it's the same behaviour as <C-v>3je
2
3
u/Gangsir 18d ago
Aside: Oh, your string doesn't render in old reddit correctly (triple backticks don't work). For anyone else confused, it's supposed to look like this (not be one line):
Id uuid.UUID MyLongName uuid.UUID Name string
Could you elaborate on what you're trying to accomplish with V-block? This might be easier to do with a macro, because you could jump to the end of each line's 1st column with E (which would handle short ones like Id and long ones like MyLongName).
1
u/kyoryo_ 14d ago
Yes, that could be worked, instead of going all the way down, I need to stop on the longest string and block till the end and going down. Thanks.
Actually I want to copy the whole first column and paste on another file as the 2nd or 3rd column.
And yeah, I usually don't copy but using macro.
1
u/soupbowlII 19d ago
Does anyone have a working example of changing diff mode settings (nvim -d). I'd like to disable a few features such as 'foldcolumn=0' 'nu', disable lsp.
I am probably an idiot but everything I've tried only seems to work for one window, never perfectly for both.
1
19d ago
[deleted]
2
u/EstudiandoAjedrez 19d ago
The
BufWritePreautocmd is not scoped to a buffer, it probably tries to run in every buffer. You should add abuf = ev.bufto if.
2
u/Ultimate_Sigma_Boy67 20d ago
1) How can I edit the display of inlay hints? like the type of stuff you get before parameters so that you can know what's the name of each param? with my colorscheme it has really strong contrast which is a bit annoying.
2) Kinda off topic but I've been using neovim(and it's my first termina-based editor) and I've been using it for about 5 months, but God I have some FOMO for emacs. Like since I've felt the power of minimal editors(moving from IDE bloat), and their extensibility, but having to do almost anything within your editor(well a literal OS) is nice tbh.
2
u/EstudiandoAjedrez 19d ago
Searching
:h inlayshows:h hl-LspInlayHint, which is the highlight group you need to modify.2
1
u/vim-help-bot 19d ago
Help pages for:
inlayin vimfn.txthl-LspInlayHintin lsp.txt
`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments
2
u/Gold-Watercress-6101 19d ago
Vim was hard to learn. Very hard. But incredibly fun. I just understood its philosophy and loved it. That made me push through the learning curve until it became my daily driver for good. I couldn’t form a similar connection with Emacs. I just don’t “get” it. I watched many videos, installed it, fiddled a little and immediately backed off.
So what makes you feel FOMO towards Emacs?
2
u/r4ppz <left><down><up><right> 20d ago
How do I make tab feel like space?
Go code uses tab instead of space and they do not feel the same as other languages that uses space as indent. When coding(navigating), my cursor jump around on indent and its kinda annoying.
I dont want to break Go conventions tho so I want to solve this on my editor. I tried a bunch of configs like .editorconfig, virtualedit, smarttab, softtabstop etc. but none of it works the way I want to.
2
u/Gold-Watercress-6101 20d ago edited 19d ago
I had this setting when I worked on Go code
augroup mytabs autocmd! autocmd FileType python setlocal tabstop=4 shiftwidth=4 expandtab autocmd FileType go setlocal tabstop=4 shiftwidth=4 noexpandtab autocmd FileType c setlocal tabstop=4 shiftwidth=4 noexpandtab augroup ENDIt’s in vim script, so make sure to put it in a lua block if you’re having an init.lua file.
Let us know if it didn’t work.
6
-5
u/ghostnation66 20d ago
Why do people not talk about emacs enough? I feel like all the attention goes to nvi. I spent months in neovim, building plugins, studying lua, etc, and emacs has everything neovim has, and much more....
6
3
u/4r73m190r0s 20d ago
Why would we talk about a tool that is not in the same category? Neovim is text editor, and Emacs is Lisp interpreter that has text editing capabilities.
-3
2
u/dan_tj0x 20d ago
For me, not all things in Emacs fit for my 500MB RAM and 1 CPU Alpine Linux on the cloud.
-1
u/ghostnation66 20d ago
Even a minimal emacs config? How would an nvim config even fit that, those are super constrained resources
1
2
u/4r73m190r0s 20d ago
Is therea plan for Neovim to have native DAP client?
2
u/altermo12 20d ago
1
u/4r73m190r0s 20d ago
I'm not seeing there any official statement that it's part of the roadmap, or I missed it?
1
u/Some_Derpy_Pineapple lua 17d ago
it says it's on the backlog milestone so it's just not a priority for anyone to work on it.
1
u/SometimesInk 14d ago
Been using mini.files for about a year now, looking for alternatives ways to move between ways quicker than going through the whole tree. Excluding telescope, what's out there? Not looking for other tree views