Vim 9.0 Released (vim.org) 81
After many years of gradual improvement Vim now takes a big step with a major release. Besides many small additions the spotlight is on a new incarnation of the Vim script language: Vim9 script. Why Vim9 script:
A new script language, what is that needed for? Vim script has been growing over time, while preserving backwards compatibility. That means bad choices from the past often can't be changed and compatibility with Vi restricts possible solutions. Execution is quite slow, each line is parsed every time it is executed.
The main goal of Vim9 script is to drastically improve performance. This is accomplished by compiling commands into instructions that can be efficiently executed. An increase in execution speed of 10 to 100 times can be expected. A secondary goal is to avoid Vim-specific constructs and get closer to commonly used programming languages, such as JavaScript, TypeScript and Java.
The performance improvements can only be achieved by not being 100% backwards compatible. For example, making function arguments available by creating an "a:" dictionary involves quite a lot of overhead. In a Vim9 function this dictionary is not available. Other differences are more subtle, such as how errors are handled. For those with a large collection of legacy scripts: Not to worry! They will keep working as before. There are no plans to drop support for legacy script. No drama like with the deprecation of Python 2.
The main goal of Vim9 script is to drastically improve performance. This is accomplished by compiling commands into instructions that can be efficiently executed. An increase in execution speed of 10 to 100 times can be expected. A secondary goal is to avoid Vim-specific constructs and get closer to commonly used programming languages, such as JavaScript, TypeScript and Java.
The performance improvements can only be achieved by not being 100% backwards compatible. For example, making function arguments available by creating an "a:" dictionary involves quite a lot of overhead. In a Vim9 function this dictionary is not available. Other differences are more subtle, such as how errors are handled. For those with a large collection of legacy scripts: Not to worry! They will keep working as before. There are no plans to drop support for legacy script. No drama like with the deprecation of Python 2.
CTRL-C (Score:3)
Re: CTRL-C (Score:4, Insightful)
:q :wq is write (save) and quit :q! force quit, not saving changes
Re: (Score:2)
You forgot to mention, he has to hit ESC first. Then :q / :wq / :q!
Re: (Score:2)
:cq is also great. It will quit without saving with an abnormal exit code. Great if you have vim set as your git editor and you change you mind about committing halfway through writing the commit message. Git will abort the commit if it receives a non-0 exit code from the editor.
Re: (Score:2)
Wow, that is actually a nice hint.
What is the "c" standing for?
Re: (Score:2)
A new one for me too. Doing a :help :cq shows it is its own command (cquit) rather than c and q together. It doesn't say explicitly but is probably "(error) code quit".
Re: (Score:2)
Could be. Interesting to know anyway! Old fox never learns out :D
Re: CTRL-C (Score:5, Informative)
Re: CTRL-C (Score:5, Informative)
Not enough people seem to know of :x (which is save and quit, the same as :wq).
Close, but not exactly the same. :x is even better, because :wq will force a write no matter what, and :x will only write if the document has changed.
Re: CTRL-C (Score:5, Informative)
Re: (Score:2)
I have this in muscle memory, I have used it for so long. Bonus points it works on VI as well.
Re: (Score:2)
I've been doing it all for so long, my fingers just go to the right places. Don't ask me how I do half of what I've done in vim over the last 20+ years.
Re: (Score:2)
Re:CTRL-C (Score:5, Funny)
Re: (Score:1)
If some retard who set the default editor doesn't know how to spell emacs.
I'm not sure if you're aware, but it seems you've misspelled pico with its advanced per-li
ne wrapping based on character limit. If allows you to have your code ruined by just sav
ing your file after a quick edit. It inserts a full CRLF for every line!
Re:CTRL-C (Score:5, Funny)
Why would you need to exit Vi?
So you can edit .viimrc with nano to put vim into emacs mode.
Re: (Score:3)
Well, if you're a masochist, whatever floats your boat.
Re: (Score:2)
It doesn't float my boat. I dropped emacs shortly after college and I've been vimming it for 30 years.
Does it support eMacs ? (Score:2)
By default ?
Close your terminal. Problem solved. (Score:3)
The sadistic tendencies of Linux users still amazes me.
Anything as ridiculous as Midnight Commanders mcedit does make one's life a breeze compared to the vim/vi.
Re: (Score:3)
s/sadistic/masochistic
This release is actually "news for nerds" though, I'll give it that.
Re: (Score:2, Informative)
Same way you've exited every other previous version. And if you don't know that then maybe RTFM before using something.
Bravo (Score:5, Informative)
Re: (Score:2)
Shame the only way to quit is to hit the reset button on your PC.
Catching Up (Score:2, Insightful)
The main goal of Vim9 script is to drastically improve performance. This is accomplished by compiling commands into instructions that can be efficiently executed. An increase in execution speed of 10 to 100 times can be expected.
Well this should get it at least 20% of the way to equaling Emacs Lisp from 20 years ago! :-)
making function arguments available by creating an "a:" dictionary involves quite a lot of overhead. In a Vim9 function this dictionary is not available.
I've done very lightweight VI script
Re: (Score:1)
Catching up indeed. I think Emacs is already emulating Vim 10.2 ... :-)
Awww yeah (Score:5, Funny)
Only a couple more steps away from VimOS.
Then it'll be much like EMACS--great operating system, but terrible text editor.
Re: (Score:3)
Or maybe not so great at either job.
Re:Awww yeah (Score:4, Funny)
Emacs has a text editor?
*rimshot*
Re: (Score:3)
They're calling this one... (Score:2)
Vim 9.0 "raku".
Re: (Score:2)
In very tangently related news (Score:5, Informative)
That is sad! (Score:1)
Wow, I had no idea either! Since thy hadn't really updated for a long time I stopped visiting, kind of a loss to have all those comics vanish though...
All I could find about shutting down was this very brief notice [archive.org] which doens't say why they shut the site down... maybe just too much money to run. :-(
Re: (Score:3)
That's really sad. Too bad it couldn't have just been kept up as a read only archive. It feels like a big piece of Internet history is lost. Regardless of how one felt about the actual humor, UF was a pretty big deal 20+ years ago.
Then I tried to find a Something Awful JeffK joke about User Friendly, and I realized that Lowtax was dead and Somethingawful is defunct.
I guess this is what growing older is like.
In terms of webcomics from the early days of the web, Penny Arcade and Megatokyo (shockingly) are sti
Re: (Score:1)
Wow didn't know Something Awful is gone as well!
Pretty happy that Penny Arcade has managed to keep going, and even growing all this time... it helps that they circle around gaming though, so it keeps things fresher over time than purely original content I imagine.
Re:That is sad! (Score:4, Informative)
It was read-only for the longest time - basically it ended around 2010 or so. But regular new comics stopped earlier, so much so that they published a complete archive book called 10 Years of User Friendly.org, which was 1000 pages comtaining every strip. However it was published in 2008, which while it had basically every strip, there were maybe a handful of new strips published over 2008, 2009 and 2010 before they went on permanent rerun mode.
The sad thing is, that was the last book published, so now that book is probably the most complete collection of strips, but is still missing maybe 30-50 strips that were published since then.
And now those strips are no longer available.
Re:That is sad! (Score:5, Informative)
And now those strips are no longer available.
last archived feb 26, 2022 [archive.org]
How do people keep forgetting the internet archive? I guess this is why it's so slow, nobody remembers, so nobody donates.
Re: (Score:2)
It's on Wayback (link in grandfather comment). The navigation links didn't work for me, but by clicking around I got to the full archive.
Re: That is sad! (Score:1)
Where did it come from? (Score:2)
Programmers are also human (Score:3)
Interview with a VIM Enthusiast 2022
Re: (Score:2)
Thank goodness! (Score:2, Interesting)
The main goal of Vim9 script is to drastically improve performance.
It's amazing how slow Vim has become on my latest Intel Linux box - six 4.0 GHz CPUs and 32 Gigs of RAM and 1TB NVMe drive for storage, and STILL I sit around like a mope, constantly waiting for Vim to simply do what I want to do, amirite?
Vi(m)was fine 35 years ago when five other college students and I were pounding away on serial terminals connected to a multi-user 68000 box in the late 80s, why must we endure 'upgrades' that do little more than whittle down the list of differences between Vim and emacs?
h [flickr.com]
Re: (Score:2)
I still see vim a lot, it's the default in Linux and BSD distributions whereas Emacs is usally an add-on. Though some strange distributions use nano, without even an ed, vi, or emacs to be seen, pretty radical for unix. But I still have vi muscle memory, and on rare occasions when I have to ssh into a remote server I can still use it.
Thing is, I learned vi back in college when you weren't taught about how to use tools, you just picked it up on your own. Our class instruction for it was a handout of a one
Re: (Score:2)
That's pretty interesting as I totally agree with what you are saying about defaults, random systems I wouldn't have an emacs config and like you say the defaults for vi were usable. (though emacs defaults are also OK enough I still prefer that if it's there).
I didn't realize VIM had defaults that were any different than vi though...
Re: (Score:3)
>constantly waiting for Vim to simply do what I want to do, amirite?
Stop using the GUI. This isn't win95.
Re: (Score:2)
Wooosh!
You need to get your sarcasm detector checked...
Re: (Score:2)
Re: (Score:2)
>Wooosh!
Oh dear.
Re: (Score:2)
Speaking of GUI, I have a friend devoted to Wordperfect. Editing in Reveal Codes was a pleasure, that much is true, and the function keys were sensible. MS Word made everything difficult.
On Unix terminal I just use vi. The text files I edit are simple enough, and the commands haven't changed. Yank!
Re: (Score:2)
Reveal Codes are no substitute for a WYSIWYG editor. WP5.1 would let you do accurate previews, but there's a reason actual DTP software slaughtered it, and it's WYSIWYG.
A real WP freak can still bang out a really shitty office door sign faster, but for anything real, you want some real software. Pagemaker was literally a WP contemporary. That's why WP for DOS died.
Re: (Score:2)
Where are you seeing the slowdowns? I ask because in my experience, on a budget Wintel laptop, I'm not noticing any slowdown with gvim or vim.
He sed. She sed. (Score:2)
Re: (Score:2)
(goo='He sed'; echo -e $goo ; sed -e 's/He/She/g' $goo)
Re: (Score:2)
$ goo='He sed'; echo -e $goo ; sed -e 's/He/She/g' $goo
He sed
sed: can't read He: No such file or directory
sed: can't read sed: No such file or directory
Perhaps you wanted to do this instead:
goo='He sed' ; echo -e $goo ; echo -e $goo | sed -e 's/He/She/g'
$ goo='He sed' ; echo -e $goo ; echo -e $goo | sed -e 's/He/She/g' He sed She sed
Re: (Score:2)
Nope it works, I forgot slashdot likes to eat < unless you quote it. #PilotError
Bash 5.1.16, Sed 4.8
(goo='He sed'; echo -e $goo ; sed -e 's/He/She/g' <<< $goo)
He sed
She sed
This comment editor has needed an update for 20 years.
--
Why would you need a new VimL ? (Score:1)
Lua (Score:2)
So this has nothing to do with the fact that Neovim's Lua showed how much better Vim scripting could be?
Re: (Score:2)
Re: (Score:2)
I really feels like LUA was mostly a failure. Unless you are a nvim developer, their seems to be no explanation on how you would ever use it. Hell most mods/guides still tell you to add this line to your ~/.vimrc.
Like theoretically, presumably, I could have a ~/.config/nvim/init.lua file, but no one will tell you what to put in it.
Still trying to out-Emacs Emacs? (Score:2)
Sublime? (Score:2)
It runs on Linux, Windows etc. There's still Emacs out there for the diehard fans, what's next Notepad+ will now get scripting too?
Sometimes you just want to edit the file quickly and get on with life.
Re: (Score:2)
If you don't want any of this stuff and just want to edit a file, you can run vim-tiny. You can install vim-tiny as vi and full vim as vim. Or you can build vim with exactly the options you want.
Beards fallen off (Score:1)
Ah the horrenduus disaster editor that was originally designed for teletype writer terminals and fundamentally operates as if that is the platform. The editor that no-one in their right mind knows how to quit after mistakenly opening it. The editor so hideously unusable that you'd rather use ed or se. The editor only used by "professionals" so old their beards have actually fallen off, or alternatively by unprofessional young beginners trying to seem hip and deep by using an unusable editor.
Yours,
A dedic
Re: (Score:2)
Someone already responded to a post like your - you use Apple sheets.
Re: (Score:3)
The line printer mode of vi is a holdover from "ex", as vi was the "visual" display of line oriented "ex". And "ex" derived after a few steps from "ed". Also it was very common for people to start "ed" by mistake and then not know how to quit (other than to open a new terminal and kill it). Newer variants of ed have improved a bit.
Also remember when vi came out, terminal keyboards did not often have arrow keys, or even a number pad. Thus the h/j/k/l move movement, as some keyboards had arrows printed on
It *May* be Too Late... (Score:2)
Over the last year and a half, I've been moving from vanilla Vim to Neovim [neovim.io]. Neovim's initial goals of shedding extremely obsolete legacy support, improving performance, adding native Lua support, and decoupling the UI from the editor backend were what first piqued my interest.
Then I discovered LSP. At the time, the Neovim ecosystem had considerably more mature support than vanilla Vim for talking to language servers which basically beat the stuffing out of ctags and cscope, whose limits I had reached lo
Vimscript is Weird (Score:2)
What they need to do is fix the language, I dont care as much about the speed.
But the whole autocmd/augroup malarkey is just crazy.