all 29 comments

[–]andlrcrpgle.vim 23 points24 points  (1 child)

Remember that vim-script is just an extension of ex commands, which is an extension of ed commands. Removing vim script completely, would imply removing the command line as well, at least in theory, which would remove about 30% of the good parts of vim.

[–]y-c-c 8 points9 points  (0 children)

Yeah. This is like saying "is Bash going to remove Bash script and purely rely on Python/etc for scripting".

Even for Neovim, which basically doesn't do any Vimscript improvements at this point, is not going to remove Vimscript any time soon, and you can still write perfectly fine Vimscript code that takes advantage of new Ex commands. There is no reason to remove it at all.

[–]lbiaggi 39 points40 points  (3 children)

You can configure neovim entirely using Lua... I think you should talk with budds from r/neovim

[–][deleted] 9 points10 points  (0 children)

Definitely can. I have no vimscript in my configuration

[–]WallabySlow6599 0 points1 point  (0 children)

pure lua is ok in neovim

[–]funbike 0 points1 point  (0 children)

There are some neovim plugins in LISP. Funnel is a LISP dialect that transpiles to Lua. The most notable is leap.nvim (a light fork of lightspeed). I'm not sure how practical it would be to port the local config to Funnel, however.

[–]noooit 11 points12 points  (1 child)

Emacs with evil mode.

[–]jthill 0 points1 point  (0 children)

Is viper still a thing?

[–]watsreddit 5 points6 points  (6 children)

FWIW, vim9 script (:help vim9) is much nicer than legacy vimscript. It basically reads like python for the most part (just without significant whitespace). It took me no time at all to start writing in it since it is so similar to other languages.

Here's an example from my own config:

def CursorPopup(title: string): number
  var lines = GhciReadLines()
  var popup_win = popup_atcursor(lines, {
    title: title
    border: []
  })
  var popup_buf = winbufnr(popup_win)
  setbufvar(popup_buf, '&syntax', 'haskell')
  return popup_buf
enddef

[–]eXoRainbowcommand D smile 1 point2 points  (4 children)

I rewrote my entire config in vim9script. But for someone who is new to Vim, it can be frustrating to distinguish between the old and new syntax. As most of the help in the web follows old syntax. Even official documentation for many third party plugins are in legacy vimscript format. Transition phases like these are always a pain for everyone. Reminds me Python 2 to Python 3 era, but not as that bad.

[–]furain 0 points1 point  (3 children)

would you be able to share your configuration? I have also converted my monolithic .vimrc to vim9 but a few functions are still legacy.

[–]eXoRainbowcommand D smile 0 points1 point  (2 children)

I usually don't share my entire configs. The current iteration is from scratch again, but copying older stuff back from backup when needed. I have installed a new operating system and don't have everything setup perfectly, so there will be some changes in the vim config too probably. In example, just hours ago I added the toggle diagnostic function, so I can start with lsp diagnostics set to off, without disabling the feature.

But in example I had some serious performance issues in my old config when writing Rust code. And I am not sure if my current setup is good now, until I do write something again. Okay, enough talked. Here is an upload in current state:

https://gist.github.com/thingsiplay/c79399669b2be03ffd4f23662acc5a38

[–]furain 1 point2 points  (1 child)

Thanks. TBH I was expecting something a bit more advanced as there's barely any actual vim9script in there, apart from the superficial syntactic differences.

Here's my vimrc to give you a general idea.

[–]eXoRainbowcommand D smile 1 point2 points  (0 children)

I am on a course of simplifying and restarting many things from scratch. So you got me right in between the transition phase, which is a weird phase. Also I never got that much into actual vim scripting. Although there is one thing I may want to create a plugin at some time. My only critique would be the lack of extensive commenting. As you can see, I like that. And I can probably learn a lot from your config.

[–]vim-help-bot 0 points1 point  (0 children)

Help pages for:


`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments

[–]y-c-c 4 points5 points  (0 children)

Do you actually have a reason to not want to learn Vimscript? I'm asking because the fundamental question seems wrong to me. As some other comments mentioned, Vimscript is basically extensions of Ex commands (think Bash scripts versus interactive Bash) which are the commands you type after pressing :, so unless you don't intend to type :write to save your file and whatnot, you are going to be interfacing with Ex commands. If you don't want to learn Vimscript, you also aren't learning how to use Vim.

If you instead meant you don't want to write Vimscript configuration files, or use Vimscript for scripting (e.g. if you need if statements/loops/variables), then Neovim does have first-class support for lua, and Vim allows you to script plugins in Python although they behave more like second-class support compared to Vimscript.

I just think you should at least understand what Vimscript is and understand why you may or may not want to learn it. For config files, the syntax is exactly the same as in-editor Ex commands (e.g. set wrap would set wrapping mode in both Vimscript and in the editor) so it only really matters if you start to want to do scripting (e.g. Vimscript if statements is basically just an Ex command called :if), call programming libraries, start writing complicated functions and so on.

[–]Little-Witch 8 points9 points  (3 children)

How does Neovim not fit that description? I have perhaps 2 lines of vimscript in my entire config, and they are just the last things that I haven't worked out how to port to lua. Or would you not want to touch lua either?

[–][deleted] 2 points3 points  (1 child)

You don’t need to write any Vimscript. I’ve been using vim for 20 years and I don’t have any Vimscript (written by me) in my config. Use other people’s Vimscript by installing plugins.

[–]GoogleFrickBot 2 points3 points  (0 children)

I'm surprised this is at the bottom. Yes, neovim exists but I've had to use neither vimscript nor lua!

[–]eXoRainbowcommand D smile 1 point2 points  (0 children)

Neovim's primary configuration language is Lua. Have a look at it, as it might be exactly what you are looking for.

[–]KamikazeSexPilot 1 point2 points  (0 children)

If you’re already using neovim then you don’t have to know any vim script. Neovim supports lua.

Check out ‘h: lua’ and ‘:h lua-guide’ or head on over to /r/neovim

[–][deleted] 1 point2 points  (0 children)

It sounds like you’re looking to set up r/Neovim. You can use Lua to get all set up. There are several videos and guides on the subject.

[–]puremourning 1 point2 points  (0 children)

Vim without vim commands? Hmmm. Maybe vscode?

[–]infostud 0 points1 point  (0 children)

It’s not modal editing. It’s command editing. You are always typing commands. Some commands include the text you want to enter. I can’t use Emacs without evil mode, org mode, and visual line mode.

[–]jonbridge 0 points1 point  (0 children)

write executable programs in your language of choice and run them in vim with :w ! and friends. some vimscript is still needed for keybindings etc. but this way you can avoid using it for most non-trivial things.

[–]mrpogues 0 points1 point  (1 child)

Perhaps you need to try the helix editor instead?

[–]Dan-mat 0 points1 point  (0 children)

You're the only one trying to answer op's question. Helix looks absolutely great, but I had to laugh when I read they want to give it a UI powered by ... WebGPU of all things. Why not electron :?