mastodontech.de ist einer von vielen unabhängigen Mastodon-Servern, mit dem du dich im Fediverse beteiligen kannst.
Offen für alle (über 16) und bereitgestellt von Markus'Blog

Serverstatistik:

1,5 Tsd.
aktive Profile

#vimscript

0 Beiträge0 Beteiligte0 Beiträge heute

#helix vs #neovim. spot the differences!

the main one isn't really visible, though: helix has a built-in #treesitter, and it does a great job at highlighting #rust out of the box, with zero configuration and dependencies!

this way, i don't have 20 plugins in #lua and/or #vimscript running in the background and autoupdating from #github - awesome! 🌈🦄 config is plain #toml - no need to write it in turing-complete languages which i only know poorly

shout out @bobulous 🙌 bobulous.org.uk/coding/Helix-c

I think any large interesting program you might write could well have an embedded language within it, in which the user can write stuff that is just as good, and just as deep as built-in functionality. You want this. It’s a thing that makes programs compelling.

In #Vim, that embedded language is #VimScript. In #emacs, that’s #elisp (which in fact, I think the whole thing is written in). In a #smalltalk environment, you control the entire environment with Smalltalk, just as elisp applies to Emacs. For many, many things, that language is #lua ( #NeoVim, many games, #pandoc, #redis, this list goes on).

I used to think there were really two reasonable mainstream languages you could use here: #Python or #javascript. Between those two, for a long time I felt that JavaScript was the winner. I think that has changed as Python has gotten faster, more powerful, and better known. But also, I think the answer might actually not be either of these two. It might be Lua. Lua is simpler and faster than either JavaScript or Python. It’s more embeddable. It’s designed specifically for this purpose. It’s in much wider use as an embedded scripting language. I don’t want Lua to be the answer. I like Python better. But I think Lua actually is the right answer.

#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?

@Brahn @xgranade @Canageek I recommend #neovim because it's a drop-in replacement and allows for way more customization without having to learn esotheric #VimScript but allowing one to use #Lua...

So it doesn't take away stuff for #vim users but adds options down the line...
youtube.com/watch?v=c4OyfL5o7D

Kinda like how every AR-15 & AR-18 nowadays has a flat-top upper and maybe some flip-up iron sights instead of that carry-handle + gas block stuff...

does anyone know how to create mappings such that after i delete text with the d key in neovim (or ideally, anytime i finish an edit to a file), the file is written? i can figure out inoremap <esc> to <esc><cmd>w<cr>, but i’m not sure how to make this work for deletions, as d:w<cr> would not be quite what i want.
#neovim #vim #vimscript

I'm looking to do a certain thing in #vim, automatically decoding/encoding #Kubernetes secrets when using kubectl edit.

These files seem to be always opened at
/tmp/kubectl-edit-*.yaml, and always contain the line kind: Secret. If the path is correct, and this string is found, I want the file to be piped through kubectl secret decode before it shows in vim. When I save this file, I want it to be piped through kubectl secret encode.

Are there any
#vimscript aficionados around who can give me some advice on how to achieve this (seemingly) simple goal?