Old school editor Vim hits version 9 with faster scripting language
(2022/06/30)
- Reference: 1656601152
- News link: https://www.theregister.co.uk/2022/06/30/vim_9_is_here_with/
- Source link:
Old school editor fans, rejoice: some two and a half years after version 8.2, Vim 9 is here with a much faster scripting language.
[1]Vim 9 has only a single big new feature: a new scripting language, [2]Vim9script . The goal is to "drastically" improve the performance of Vim scripts, while also bringing the scripting language more into line with widely used languages such as JavaScript, TypeScript, and Java.
The existing scripting language, Vimscript, remains and will still work. Only scripts beginning with the line vim9script will be handled differently. The syntax changes are relatively modest; the important differences are in things like local versus global variables and functions, and that functions defined with :def will be compiled before they are run. This allows many errors to be caught in advance, but more significantly, compiled functions execute from 10× to 1000× faster.
[3]
Vim is the standard version of the classic vi text editor on most Linux distros, and if there is one xNix editor that every xNix user should know, it's Vi. There are easier editors, from the widely used [4]GNU Nano to the author's [5]personal text-mode favorite Tilde , but if you are connected to an unfamiliar machine, whatever variant of Unix it's running, the one full-screen text editor you can rely on being installed is Vi. (Yes, we know, [6]ed is the standard editor . But ed begat ex , and ex begat vi , and Vim started out as a V i Im itation before it became V i Im proved.)
[7]Gnu Nano releases version 6.0 of text editor, can now hide UI frippery
[8]Fans of original gangster editors, look away now: It's Tilde, a text editor that doesn't work like it's 1976
[9]Running DOS on 64-bit Windows and Linux: Just because you can
[10]Linux Mint adopts Timeshift from overworked original developer
As such, many xNix users favor some variant of Vi above anything else. It is tiny, fast, powerful, and ubiquitous. This being the Unix world, there are of course multiple variants and forks of Vi. Perhaps the main other modernized Vi reimplementation, [11]Elvis , hasn't been updated in nearly two decades.
If modernization sounds suspicious, the original BSD Vi has been updated to create [12]OpenVi , but it doesn't support UTF8, although a descendant of Elvis called [13]nvi offers that. There is also a fork of Vim itself called [14]Neovim .
[15]
However, Vim is the most popular and widely used variant on Linux and on macOS. Making it faster and more powerful should please a lot of people. ®
Bootnote
The Reg FOSS desk has been using Vi and variants since the late 1980s and still hasn't really got the hang of it, but don't worry: we're not Emacs fans either.
Get our [16]Tech Resources
[1] https://www.vim.org/vim90.php
[2] https://vimhelp.org/vim9.txt.html
[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/applications&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2Yr3InqBcuukF@1KdDqPlSwAAAEo&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[4] https://www.theregister.com/2021/12/16/gnu_nano_6_0/
[5] https://www.theregister.com/2021/12/17/tilde_text_editor/
[6] https://www.gnu.org/fun/jokes/ed-msg.en.html
[7] https://www.theregister.com/2021/12/16/gnu_nano_6_0/
[8] https://www.theregister.com/2021/12/17/tilde_text_editor/
[9] https://www.theregister.com/2022/06/28/friday_foss_fest_running_dos/
[10] https://www.theregister.com/2022/06/09/linux_mint_timeshift/
[11] http://elvis.the-little-red-haired-girl.org/
[12] https://github.com/johnsonjh/OpenVi
[13] https://sites.google.com/a/bostic.com/keithbostic/vi/
[14] https://neovim.io/
[15] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/applications&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Yr3InqBcuukF@1KdDqPlSwAAAEo&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[16] https://whitepapers.theregister.com/
[1]Vim 9 has only a single big new feature: a new scripting language, [2]Vim9script . The goal is to "drastically" improve the performance of Vim scripts, while also bringing the scripting language more into line with widely used languages such as JavaScript, TypeScript, and Java.
The existing scripting language, Vimscript, remains and will still work. Only scripts beginning with the line vim9script will be handled differently. The syntax changes are relatively modest; the important differences are in things like local versus global variables and functions, and that functions defined with :def will be compiled before they are run. This allows many errors to be caught in advance, but more significantly, compiled functions execute from 10× to 1000× faster.
[3]
Vim is the standard version of the classic vi text editor on most Linux distros, and if there is one xNix editor that every xNix user should know, it's Vi. There are easier editors, from the widely used [4]GNU Nano to the author's [5]personal text-mode favorite Tilde , but if you are connected to an unfamiliar machine, whatever variant of Unix it's running, the one full-screen text editor you can rely on being installed is Vi. (Yes, we know, [6]ed is the standard editor . But ed begat ex , and ex begat vi , and Vim started out as a V i Im itation before it became V i Im proved.)
[7]Gnu Nano releases version 6.0 of text editor, can now hide UI frippery
[8]Fans of original gangster editors, look away now: It's Tilde, a text editor that doesn't work like it's 1976
[9]Running DOS on 64-bit Windows and Linux: Just because you can
[10]Linux Mint adopts Timeshift from overworked original developer
As such, many xNix users favor some variant of Vi above anything else. It is tiny, fast, powerful, and ubiquitous. This being the Unix world, there are of course multiple variants and forks of Vi. Perhaps the main other modernized Vi reimplementation, [11]Elvis , hasn't been updated in nearly two decades.
If modernization sounds suspicious, the original BSD Vi has been updated to create [12]OpenVi , but it doesn't support UTF8, although a descendant of Elvis called [13]nvi offers that. There is also a fork of Vim itself called [14]Neovim .
[15]
However, Vim is the most popular and widely used variant on Linux and on macOS. Making it faster and more powerful should please a lot of people. ®
Bootnote
The Reg FOSS desk has been using Vi and variants since the late 1980s and still hasn't really got the hang of it, but don't worry: we're not Emacs fans either.
Get our [16]Tech Resources
[1] https://www.vim.org/vim90.php
[2] https://vimhelp.org/vim9.txt.html
[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/applications&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2Yr3InqBcuukF@1KdDqPlSwAAAEo&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[4] https://www.theregister.com/2021/12/16/gnu_nano_6_0/
[5] https://www.theregister.com/2021/12/17/tilde_text_editor/
[6] https://www.gnu.org/fun/jokes/ed-msg.en.html
[7] https://www.theregister.com/2021/12/16/gnu_nano_6_0/
[8] https://www.theregister.com/2021/12/17/tilde_text_editor/
[9] https://www.theregister.com/2022/06/28/friday_foss_fest_running_dos/
[10] https://www.theregister.com/2022/06/09/linux_mint_timeshift/
[11] http://elvis.the-little-red-haired-girl.org/
[12] https://github.com/johnsonjh/OpenVi
[13] https://sites.google.com/a/bostic.com/keithbostic/vi/
[14] https://neovim.io/
[15] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/applications&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Yr3InqBcuukF@1KdDqPlSwAAAEo&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[16] https://whitepapers.theregister.com/
Re: never knew
Yet Another Anonymous coward
The new scripting language just starts up Emacs in the background
Others preferred
Primus Secundus Tertius
Personally, I prefer Geany or Scite, which resemble word processors rather than traditional programmers' editors.
Re: Others preferred
Yet Another Anonymous coward
If you have a totally borked machine you know vi will still run.
Otherwise I use VS code like everyone else.
Although it does confuse the younglings when you fire up vi to edit a config file
never knew
Been using vi since early 90s not sure when I switched to vim assuming ~20 years ago for the most part. Certainly not an expert with it though I use it daily(am mostly comfortable with regular vim too). Never knew it had a scripting language. Unsure as to the purpose, I browsed the linked man page for vim 9 which talks about the scripting language but no indication as to what the purpose of it is. Searching for the text "why" on the manual page indicates perhaps the scripting language may be used for vim plugins? (am unsure if I use any, don't know what might be a plugin vs built in I don't use anything but the defaults). Curious if anyone else can clarify, is it just for plugins or something else too.
On that note want to mention how much I hate the newer vim mouse interfaces, first encountered for me on Ubuntu 20 (which has vim 8), not sure if it is just new to vim 8 or perhaps older, but to disable that crap I always have to put ":set mouse-=a" in my ~/.vimrc (which is the first time I can recall ever using ~/.vimrc). Those new things were driving me insane before I figured out how to turn them off.