VIM - Vi IMproved

1050 readers
2 users here now

For Vim enthusiasts and anyone interested in Vim/Neovim!

"VIM is the greatest editor since the stone chisel." - Dr. Jose Unpingco

#HJKL

founded 1 year ago
MODERATORS
1
 
 

Hey guys, I just wanted to say that Vim is charityware. This means that if you like the software and want to pay for it, you can donate to charity instead of to the developers of Vim. Vim recommends donating to ICCF Holland to pay for the software. ICCF Holland is a charity that focuses on supporting Ugandan children whose parents have passed from HIV. They provide healthcare and education to children who need it. Donation is critical to keep this organization active. There are a few different ways to help this organization, from directly donating money to sponsoring a child, by paying monthly for them to go to school and receive medical care. Work is all volunteer, so your money goes strictly to children. Your donation can make a difference in a kid's life. You can donate at Vim's website or ICCF Holland

2
24
submitted 3 months ago* (last edited 3 months ago) by [email protected] to c/[email protected]
 
 

When I was a student a few decades ago, everybody I knew pronounced it as "vee-eye". Then in the late nineties / early aughts, I heard the first people pronounced it as "vie" in a different city I had found employment in. It sounded odd to me, and it seemed to come from people who in fact didn't use it much. But the pronounciation I was used to still applied, mostly.

Nowadays, I almost never talk about VI to anyone anymore, nor do I hear anyone say the name. It's become mostly a typed thing for me. But - coincidence? - this week I heard three people talk about it (younger, non VI users) and they all said "vie".

And now I'm watching this video from the reasonably famous and definitely not young and not VI newbie NCommander and he too says "vie" in the video.

I'm beginning to worry that I'm the one who's been saying it wrong all this time because of my misguided college buddies and teachers way back when 🙂

So I'm curious: how do YOU say it? VEE-EYE or VIE?

3
 
 

So I'm very happy with vim, and have been for the past quarter century (I used Elvis before that. Remember Elvis? It was awesome! - But I digress...)

I have to admit though, while I pity the fools in my company who use VSCode and mock me for using vim in the terminal, yet in fact produce code much slower than I do, I envy their IDE that suggests function and variable names in other project files.

So I've been looking for a nice, easy-to-install solution to get some of that goodness in vim. Nothing fancy, just autocomplete suggestions to avoid having to grep names I forgot or having to yank/put text manually to prevent typos. And mostly easy, because for some reason, I'm properly allergic to any sort of vi configuration - be it vim or any other vi flavor.

So I gave Neovim a shot. My plan was to ensure Neovim was at least as good as Vim, then try to install Treesitter. But that plan immediately went south, then kept on being a proper pain in the ass until I finally realized this was going nowhere fast and I didn't want to spend countless hours configuring that awful thing, so I gave up. I wasn't asking for much but Neovim totally failed to deliver.

And then I found the solution I was looking for all along: YouCompleteMe. It's as simple as installing the handy vim-youcompleteme .deb for my distro (Linux Mint), running vam to install it and voila: a working autocompleter that actually works in 3 minutes flat and doesn't get in my way.

4
5
 
 

cross-posted from: https://lemmy.world/post/16310027

Help disabling "Possible spelling mistake found" in vimtex

Hi everyone,
could someone help a desperate student to turn off the 'Possible spelling mistake found' in LaTeX files with the vimtex plugin. It's been 3h now and I still dont have any idea on how to turn this off (or at least change the language, but knowing how to do both would be really cool). I tried everything I could, still don't kow where this is from.
Help would be really appreciated.
Thanks in advance.

6
 
 

I've been using vim-lsp, it's great for the most part. Only thing I'd like to be able to do is change the default view of errors and warnings to be hidden except for a red or yellow line under the affected text that I can expand using :LspHover or something. Is this a possibility at all?

The docs only mention about turning of diagnostics completely.

7
 
 

Hello!

I like experimenting with vim's features and one of those is omni completion. This type of completion can be fed by plugins but vim also comes shipped with some included omni completion functions. Those are documented in compl-omni-filetypes, the according scripts are found in $VIMRUNTIME/autoload/.

One of the included scripts is for C which I tried the most. But I was never really satisfied with it. It requires the usage of ctags which is fine as I also need this for using tags to navigate.

But the completion of the fields in structs which would be its most handy feature in C just never seems to work in a satisfying way. Sometimes it just fails entirely and when it does not, it always adds a . after the completed fields even though the completed field is not even a structure. Same applies for [ characters that are completed at times that I do not want them.

Also, the popup that should show some information about the completed object is not really helpful but rather confusing. It shows what kind of object this is, but only with one letter, so you have to guess what that letter means. It always show if it is static using 1 and 0 which I do not find an elegant solution then it prints something like

struct    __anon0d38083b0108

which comes directly from the tags file and contains no information at all that I find useful.

There are also other omni completion functions which I briefly had contact with. It seems like the HTML completion is for HTML 4, which is out of use for more than 10 years now...

The documentation of the JavaScript completion (ft-javascript-omni) states the following:

At the moment (beginning of 2006) there are two main browsers - MS Internet Explorer and Mozilla Firefox. These two applications are covering over 90% of market.

I will let that one speak for itself.

So to sum up I do not find this feature of vim particularly helpful. Especially when we look to the language server based completion options that other editors have built in, but can also be brought to vim with some tinkering.

Do you have a similar or different experience with omni completion?

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

Vim9Script Types Help

I'm trying to add types to a language list in my vimrc file, the variable looks like this:

var languages = {
  'c': ['c', 'h'],
  'shell': ['sh'],
  'python': ['py'],
  'json': ['json'],
  'typescript': ['tsx', 'jsx', 'js', 'ts'],
}

I've tried adding types like this:

var languages: dict<string, list<string>> {...}

Which should work I think but I'm getting this error:

E488: Trailing characters: , list<string>> = {

I can't figure out which characters are trailing and AI has no idea either.

Solution

I was being a moron and defining a type for the key in the dictionary which makes no sense because the key name would always be a string so therefore only the value type is required:

var languages: dict<list<string>> {...}
9
 
 

I'm playing with OpenSCAD, which is a text-based parametric 3D modeler. It comes with its own built-in editor, but you can also open the source file in your favorite editor and when the file is saved, OpenSCAD recompiles and re-renders the model.

I know it's nothing particularly novel, but it's kind of awesome to type :w and see the 3D object immediately show what you just typed. There's even a degree of rendering control from within the editor: for example to highlight a feature, like an subtracted volume, simply type # in front of the corresponding operation, :w and hey-presto, the feature appears in the model.

And sure enough, there is OpenSCAD syntax highlighing for vim. How cool is that!

If someone had told me 40 years ago that I'd be doing 3D modeling in VI one day, I would never have believed it 🙂

10
 
 

The first major version update without Bram.

11
 
 

Recent versions of Vim include a built-in auto-complete feature, and of course there are a half-billion other auto-complete plugins available through GitHub.

What's your setup? Plugins, or vanilla? Suggested tweaks?

12
 
 

crosspostato da: https://lemmy.world/post/8063065

Hi, how can I associate to a var a path with both env variable and text? something like this for example: let trial=$HOME/dir1/dir2/$env1/dir3 I saw that let trial=$HOME works when I echo it, but if I add $HOME/dir1 it doesn't anymore....any help? Thanks

13
 
 

crosspostato da: https://lemmy.world/post/8063065

Hi, how can I associate to a var a path with both env variable and text? something like this for example: let trial=$HOME/dir1/dir2/$env1/dir3 I saw that let trial=$HOME works when I echo it, but if I add $HOME/dir1 it doesn't anymore....any help? Thanks

14
 
 

Vim's core is the amazing command mappings and text objects that allow for countless combinations to define precise edits. Learn how to master the built-in commands, motions, and text objects, and even how to extend the Vim language for even more power!

15
1
Custom tab name? (lemmy.world)
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 
 

I want to assign a name to a new tab where I'v opened the :tab term cmd....I'v looked inside the guide but I need a real example of what I'v to put in vimrc. Thanks

16
5
Custom tab name? (lemmy.world)
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 
 

I want to assign a name to a new tab where I'v opened the :tab term cmd....I'v looked inside the guide but I need a real example of what I'v to put in vimrc. Thanks

17
18
1
[Deleted] (groups.google.com)
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 
 

This post has been deleted.

19
 
 

I received an email from on the vim_announce mailng list that Bram Moolenaar, VIM creator, died August 3 2023. RIP Bram and condolences to his family and friends.

20
 
 

I'm aware that you can "edit" binary files with :%!xxd but seriously, am I the only one to think it's totally pathetic? Vim should be better than that.

I use Hexer myself. It's binary editing done right and it should be merged into vim - as in, type :hex or something and the edition mode switches to that editor's layout.

21
 
 

He didn't say anything, but his email had the telltale :wq from someone with unshakable VI muscle memory at the end :)

22
 
 

cross-posted from: https://latte.isnot.coffee/post/288501

ALE gives me a warning when I use gtk

#include <gtk/gtk.h> /* E: gtk/gtk.h: No such file or directory

This is probably happening because ALE isn't using my compiler flags gcc $( pkg-config --cflags gtk4 ) -o program main.c $( pkg-config --libs gtk4 ) that I stole from the gtk documentation. These compiler flags allow gcc to find gtk/gtk.h even though it is in gtk-4.0/gtk/gtk.h

How do I make ALE aware of my compiler flags?

23
 
 

TJ made a nice video about how to start with neovim and its configuration. I hope that this link is not against the rules since it's about neovim and not about vim .... Personally I find those 2 very very alike and with the features that I need for my daily work, I can use either one of them without noticing any difference.

https://www.youtube.com/watch?v=stqUbv-5u2s

Enjoy !

24
 
 

Hi fellow vimmers (and neo-vimmers).

Since “The Great Reddit Rebellion” I’ve found myself not wanting to go back to Reddit, together with Twitter blocking anonymous scrolling it was the push I needed to finally move to the Fediverse and get rid of corporate social media.

After a few days of being a nomad and trying different instances I found SDF and immediately felt home (I even opened a shell and became an ARPA member).

I am posting this here as I’m an avid (neo-)vimmer myself and the author of a few neovim lua plugins.

Something which irked me a bit on Reddit is the animosity between the vim and neovim subs, doesn’t make a lot of sense IMHO given we’re already a very small and niche community.

Would really love to see this place flourish and become the new home to both vim and neovim reddit refugees.

Content is important, I’m gonna try to do my part, in the meantime I’ve attached a link to a fairly popular vim cheatsheet, being the author I’m a bit biased but it’s pretty pretty good :)

To a decentralized, non-commercial internet, cheers!

25
 
 

Does anyone have experience using GNU Stow for managing dot files? I'm especially interested in using it to build a git repo to include my .vimrc file so I can sync it between hosts.

I know I've seen other methods, such as making your home directory a bare git repo, so you can check-in your config files without moving them. There is also the chezmoi golang project.

How do others sync .vimrc between hosts?

view more: next ›