#vim9script — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #vim9script, aggregated by home.social.
-
#vimtip Better #man support when editing shell script.
autocmd filetype sh,bash,zsh { g:no_man_maps = 1 g:ft_man_open_mode = 'vert' runtime ftplugin/man.vim setlocal keywordprg=:Man } autocmd Filetype man { nnoremap <buffer> <silent> q :q<CR> setlocal keywordprg=:Man }Pressing
Kloads the man page of word under cursor in a vertical split.qcloses it. See also https://vimhelp.org/filetype.txt.html#manpager.vim -
Vim9script is a statically-typed language, inspired by typescript, but much simpler and more limited.
A recent PR lifts some of those limitations by adding generic functions to the language: https://vimhelp.org/vim9.txt.html#generic-functions
-
At last night’s @mug meeting we looked at a lot of different solutions to #adventofcode day 1 in many different languages. Two that were very interesting to me were #Zig and #haskell. The way these two languages worked was really quite fascinating. After seeing real code in these two languages, I can tell they are not for me; but they were interesting and illuminating nonetheless.
There was a solution entirely in #SQL. Another in #vim9script. Another in #swiftlang #swift (I don’t think that one’s in the repo yet). I wrote several implementations myself. The one I felt most proud of is #Python with the core written in #rustlang #rust tied together with #PyO3. The one I felt was maybe the best tool for the job was entirely based on #pandas. As I said in a previous post, I tried to solve it in #polars, but the API exposed by Polars at least as far as I could tell, made it no better than simple lists in Python. I need to get deeper knowledge here.
The repo lives here: https://github.com/MichiganUnixUserGroup/MUG-2025-03-11-Advent-of-Code.
-
AFAIK, there's only one existing Vim plugin for buffer checksums, and it's quite old, relying heavily on terminal tools. I've developed a newer version using Vim9Script and the V language. Contributions and ideas are welcome. #Vim #VLang #Checksum #Programming #vim9script
https://github.com/sevehub/vchecksum.vim -
#Vim #NeoVim I found what was replacing all my argument lists with underscores: argtextobj.vim. This is one of my favorite plugins. It hasn’t been touched in 15 years, though. Probably something changed in the editor itself that broke it. I could abandon it; I could fix it; or I could rewrite it. I asked my friend what language it should be rewritten in. He said #vim9script of course! I disagreed. That would only work in Vim. #lua would only work in NeoVim. Maybe #vimscript from just before 9. Maybe #Python. Maybe #rustlang. All three of those would run in both. I kinda don’t want to use VimScript, but that’s technically the correct choice.
Of course it would be waaay easier if it used the #lsp. Otherwise you’re parsing patterns and brackets and strings. Not sure such a solution works in plain old Vim.
What does the #fediverse say?
-
If you'd like to convert some of your Vim scripts and configuration to vim9script, this tool could be a useful starting point: https://github.com/ubaldot/vim9-conversion-aid
-
I wrote an emoji plugin for Vim in vim9script.
Check it out:
https://github.com/wolandark/vim-ez-emojiIts nothing fancy, just two compiled functions consist of a load of abbreviations.
Does the job and is pretty quick. -
Read how I create conventional commit messages in #Vim.
#deno #javascript #vim9scripthttps://tessarinseve.pythonanywhere.com/nws/2023-04-14.wiki.html
-
A simple #vim9script #Netrw filetype plugin that lets you preview files with #w3m text browser.
#vimhttps://tessarinseve.pythonanywhere.com/nws/2023-03-30.wiki.html
-
Open the #msys2 #bash shell right below your #VIM buffer with this #vim9script plugin.
https://bitbucket.org/sevepy/vim-mterminals -
#vim9script plugin
Tig #git browser
https://youtu.be/aFwnhLUSXfI via @YouTube -
I am finishing up a new #vim plugin entirely in #vim9script. It seems really fast.