VIM - Vi IMproved

!vim

@lemmy.sdf.org
Create post
I'm curious: how do you say "VI"?

I'm curious: how do you say "VI"?

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?

My quest to find a simple, unobtrusive autocompletion solution is finally successful

My quest to find a simple, unobtrusive autocompletion solution is finally successful

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.

Is it possible to alter the appearance or hide but show a red/yellow line for vim-lsp

Is it possible to alter the appearance or hide but show a red/yellow line for vim-lsp

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.

Default omni completion

Default omni completion

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?

Vim9Script Types Help

Vim9Script Types Help

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>> {...}
Vim 9.1.0 tagged

Vim 9.1.0 tagged

Open link in next tab

Release v9.1.0 · vim/vim

https://github.com/vim/vim/releases/tag/v9.1.0

v9.1.0

Release v9.1.0 · vim/vim
What's your auto-complete setup?

What's your auto-complete setup?

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?

How can I let to variable a path with other env variable in it in init.vim?

How can I let to variable a path with other env variable in it in init.vim?

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