I actually tried out Packer and converted my neovim-only plugins from Plugger to Packer. It's not bad!
And so I ended up with two competing plugin managers in my text editor 😅
One thing I didn't initially understand is that #Neovim's built-in LSP client isn't enough to get autocmpletion!
First, you need to configure which Language Server should be spawned for each file type you open. For this, there's nvim-lspconfig, which is maintained by the Neovim devs as a separate project:
But wait! The LSP configuration needs to be configured... in Lua, of course! And don't forget to define some mappings for "Go To Definition" etc...
Do we have #Rust completion yet? Not so fast!
You see, #Neovim has builtin completion, but what you really want for programming is *autocompletion*, which requires an external plugin:
It says nvim-cmp is the recommended plugin, so it will be easy to integrate, right?
Easy peasy! My nvim-cmp configuration is only... 73 lines of #Lua config!
I copy-pasted most of the config, and when it breaks I'm not quite sure how to debug it.
In fact, it's not working right now. If I open a Rust project and start typing, I get plenty of useless snippets instead of the semantic completion. I see rust-analyzer running and eating CPU time... I even see inline errors... so why?
Hey, it seems I gave up too fast!
My semantic completions were already in the menu, just BELOW the useless snippets...
I guess I just I need to tweak my config to reorder them... and also use TAB to complete (instead of Enter)...
...and also figure out how to theme the menu so I don't get flashes of shocking pink while I'm trying to focus on the code 😂
@codewiz I should get off my lazy ass and actually see if I can figure out how to get the screenreader to read the vim properly. If I press h, j, k, l nothing is read, but the arrow keys read things just fine.
vi started off as a visual frontend for the UNIX line editor "ed". This is where vim's ":" prompt comes from, and the motion commands are still the same.
vim today still supports an "ex" mode, which is an extended version of ed.
And I bet a non-visual editor integrates better with screen readers... but you tell me.
By the way, ed was surprisingly powerful: Ken Thompson and Dennis Ritchie wrote all of UNIX and its C compiler on a tty. Not the modern vt100 terminals with a CRT - I mean the real paper typewriter thing!
This explains why C and the UNIX shell had to be so terse... 😂
But are there screen readers for programmers that do a good job reading C and Bash aloud?
@codewiz Orca does a decent job in the GUI, with fenrir being an awesome CLI screenreader. I tried the Ex mode, and as I move the lines it says only the line number. I wonder if it is passing the arrow through to the operating system.
@sektor I've never really used ex, but I think you can't just move around with the cursor keys...
It prints lines when you type a line number, and I haven't figured out how to print a range of lines 😅
@sektor Ah, well, it uses comma, just like vi:
@codewiz Yes! I use packer and the experience was really good for me. Since I use neovim as a ~ IDE and vim as a simple text editor, I did not want to share the configuration between both, so I kept one simple and one complex.
This is in my *.anyshrc
@codewiz Adding on to the default plugins, I have lervag/vimtex, github/copilot.vim, and hashivim/vim-terraform
@codewiz I would also consider https://nvchad.github.io/getting-started/learn-lua as an interesting and useful resource for anyone new to the world of lua 😄
PmenuSbar xxx ctermbg=248 guibg=#353b45
PmenuThumb xxx ctermbg=15 guibg=#81A1C1
btw, that probably uses my also favorite One Dark Theme, and would probably look like this
(PS: thats github copilot with the suggestions)
@srevinsaju Oh, you probably have termguicolors set. I had to disable it because it made the text selection light gray. How did you override it?
@codewiz right now, I have nvchad doing the theming for me, because when I tried manually theming every component myself, I started breaking a lot of UI stuff 😅
@eriol Thank you so much for sharing!
In spite of all the sarcasm, I _do_ believe that #neovim is on the right path... we need to get rid of the awful VimL and give plugin writers a solid base to work on.
Perhaps better integration will come in time... but we also need the developers to pick good defaults to avoid the paradox of choice.
@eriol Hmm... I already had nvim_lsp as first entry in cmp.config.sources, so it must be something else.
One difference between my configuration and yours is that I used vsnip instead of luasnip. I'll try switching, since I only really care about semantic completion with nvim_lsp at this time.
By the way, your nvim config is *neat*! I can't believe you've been using it nly for 3 weeks.
@eriol Ah, after tweaking the menu appearance to show the completion source, I found out that those snippets were actually coming from rust-analyzer! 🤦
I still need to figure out how to remove them, but that's prograss...
This is how I added the cool icons:
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!