Searching yarn

Twts matching #vim
Sort by: Newest, Oldest, Most Relevant
In-reply-to » Every now and then, I think that I have carefully proof-read my message enough times and hit the "Add message" button in tt. But then, in the message tree, I spot another missed typo. My process is then to go to my twtxt.txt and fix it by hand. However, I still have to clean up tt's cache. This is rather tidious:

Getting the vim key bindings to work for focus switching in this modal dialog took me forever. Only cursors and (Shift+)Tab are supported out of the box. I absolutely understand that, it’s fine. I installed an input handler on the dialog, but the focus always stayed the same.

After two wasted hours, I was in despair to copy the tview.Modal into my own code base. Of course, I had to fix all the private tview field accesses first. But even installing the input handler directly on the buttons themselves did not work. Even though, the handler was definitely executed, the focus did not shift. Forcing redraws as a last resort also did not work.

Looking through all the messy chained input handling, I eventually stumbled across another place in the tview.Form, which is internally used by tview.Modal. This messed around with app focus receptions and input handlers. This gave me the idea to make the tview.Application refocus my modal dialog after I told the modal dialog which button to select. And would you look at that, this did the trick! I haven’t completely figured out what is going on exactly, but I could get rid of my Modal clone again.

I always go through hell with focus handling in tview. Each and every time. It just does not feel natural to me. Complete brainfuck to wrap my head around. The Urwid API felt sooo much more refined, it never was an issue. It just works. In fact, I cannot think of any other TUI library that has remotely the same pain level when it comes to focusing widgets as tview.

Now I’m curious how movwin deals with that. ;-)

⤋ Read More
In-reply-to » @lyse By the way, which site generator are you using? I kind of miss having code blocks with syntax highlighting and that generic yellow highlighting thing is pretty cool, too.

@lyse@lyse.isobeef.org Ah, I almost thought so (that you wrote it by hand), but then I looked at the source code and saw the TOC and I was like: “Naah, probably not. I would be way too lazy to do that manually.” 😅 And indeed … ha.

Oh god, yeah, that’s a lot of <span>. 🤔 Can’t really avoid that, I guess, especially if you want to do syntax highlighting of code blocks.

You wrote your own site generator, didn’t you?

In parts. I write everything in Markdown (it’s online, even: https://movq.de/blog/postings/2026-05-29/0/POSTING-en.md), plus a few Vim shortcuts (to generate thumbnails, for example), and then python-markdown renders it: https://pypi.org/project/Markdown/ This process is wrapped in a shell script, like “re-render every page if the .md file is newer than the .html file” and that’s mostly it. And the Atom feed generator is completely custom. 🤔

⤋ Read More
In-reply-to » @lyse By the way, which site generator are you using? I kind of miss having code blocks with syntax highlighting and that generic yellow highlighting thing is pretty cool, too.

@movq@www.uninformativ.de It’s the “Lyse types the entire HTML by hand” generator. Yes, no kidding. I write articles so rarely, that I can do that once in a while. It’s fun to some degree, but also not.

After some time, I finally recorded some Vim macros to insert <b>…</b>, <var>…</var>, <span class=s>…</span> etc. around the tokens. This helped a little bit. But I was still questioning my mental state doing it like that. I also had to fix a bunch of the end tags by hand, because the word movement wasn’t enough or the end movement went too far. Quite the annoying process for sure.

But I think the HTML looks a wee bit nicer and is maybe even semantically a little bit better than having only <span>s everywhere. I find the <span class="whatever"> just soo awfully long. Of course, I never look at the code again, but knowing, that e.g. there is a <b> and it saves so many bytes in comparison, makes me happy. It is a more elegant solution in my opinion. Not by much, but better nonetheless. It’s a matter of simplicity. Admittedly, even I can’t avoid the <span>s alltogether. Oh well. On the other hand, I’m sure that this does not make any difference whatsoever. I bet, nobody and nothing, like a screenreader, analyzes the HTML for that, where this would be truly useful.

Oh! Maybe text browsers, though. It just occurred to me while composing this reply. :-) Haha, I lost my bet quickly. w3m picks up at least the <b> for keywords and builtin types, <u> for filenames and <i> for comments. Yey. No different styles for <var> and <mark>, unfortunately. elinks only renders the bold. It’s cool that I had the right intuition right from the beginning, despite being unable to pinpoint it. :-)

All the <span> hell with common syntax highlighters is a downer for me that keeps me from looking more into them. If I wrote more articles, I might rig something up with Pygments. At least that’s somehow positively connotated in my brain. Not sure if it actually deserves it, but I dealt with that in some loose form (can’t even remember) years and years ago. Apparently, it wasn’t too terrible.

To prepare the table of contents, I used grep and sed with some manual intervention in the end. The entire process can be improved. Absolutely.

You wrote your own site generator, didn’t you?

⤋ Read More

@tftp@tilde.town mentioning in here requires he whole shebang. With jenny, if using vim, there is a key combination:

Nick name completions: Allows you to use ^X ^U to turn verbatim nick names into full twtxt mentions. For example, typing “cath” and then pressing ^X ^U will turn “cath” into a full mention, like “@”. (This function will read the contents of your “~/.config/jenny/follow” file.)

See: https://movq.de/git/jenny/file/vim/README.html

⤋ Read More

Via https://github.com/newsboat/newsboat/issues/3220#issuecomment-4198066671 I came across this nice selection on why not to use AI: https://github.com/Vxrpenter/AIMania/blob/main/WHY.md#why

This then lead me to the slopware list: https://codeberg.org/small-hack/open-slopware

Holy shit, there’s even more than I thought. :-O In addition to Vim, the following affects me more or less daily (but hopefully not my ancient versions): curl, VLC, ImageMagick, rsync, Python, systemd and even the Linux Kernel itself. Oh fuck me dead. :‘-(

⤋ Read More

All my newly added test cases failed, that movq thankfully provided in https://git.mills.io/yarnsocial/twtxt.dev/pulls/28#issuecomment-20801 for the draft of the twt hash v2 extension. The first error was easy to see in the diff. The hashes were way too long. You’ve already guessed it, I had cut the hash from the twelfth character towards the end instead of taking the first twelve characters: hash[12:] instead of hash[:12].

After fixing this rookie mistake, the tests still all failed. Hmmm. Did I still cut the wrong twelve characters? :-? I even checked the Go reference implementation in the document itself. But it read basically the same as mine. Strange, what the heck is going on here?

Turns out that my vim replacements to transform the Python code into Go code butchered all the URLs. ;-) The order of operations matters. I first replaced the equals with colons for the subtest struct fields and then wanted to transform the RFC 3339 timestamp strings to time.Date(…) calls. So, I replaced the colons in the time with commas and spaces. Hence, my URLs then also all read https, //example.com/twtxt.txt.

But that was it. All test green. \o/

⤋ Read More

Android shopping list apps disappointed me too many times, so I went back to writing these lists by hand a while ago.

Here’s what’s more fun: Write them in Vim and then print them on the dotmatrix printer. 🥳

And, because I can, I use my own font for that, i.e. ImageMagick renders an image file and then a little tool converts that to ESC/P so I can dump it to /dev/usb/lp0.

(I have so much scrap paper from mail spam lying around that I don’t feel too bad about this. All these sheets would go straight to the bin otherwise.)

⤋ Read More
In-reply-to » @aelaraji tell us all about it, without omitting details!

Just typing twts directly into my twtxt file.

Details:

  • Opening my twtxt file remotely using vim scp://user@remote:port//path/to/twtxt.txt
  • Inserting the date, time and tab part of the twt with :.!echo "$(date -Is)\t"
  • In case I need to add a new line I just Ctrl+Shift+u, type in the 2028 and hit Enter
  • In order to replay, you just steal a twt hash from your favorite Yarn instance.

It looks tedious, but it’s fun to know I can twt no matter where I am, as long as can ssh in.

⤋ Read More

@movq@www.uninformativ.de streamlining jenny.vim?

index adc0db9..cb54abc 100644
--- a/vim/ftdetect/jenny.vim
+++ b/vim/ftdetect/jenny.vim
@@ -1 +1,2 @@
 au BufNewFile,BufRead jenny-posting.eml setl completefunc=jenny#CompleteMentions fo-=t wrap
+au BufRead,BufNewFile jenny-posting.eml normal $

⤋ Read More

Something happened with the frame rate of terminal emulators lately. It looks like there’s a trend to run at a high framerate now? I’m not sure exactly. This can be seen in VTE-based terminals like my xiate or XTerm on Wayland. foot and st, on the other hand, are fine.

My shell prompt and cursor look like this:

$ █

When I keep Enter pressed, I expect to see several lines like so:

$
$
$
$
$
$
$ █

With the affected terminal emulators, the lines actually show up in the following sequence. First, we have the original line:

$ █

Pressing Enter yields this as the next frame:

$
█

And then eventually this:

$
$ █

In other words, you can see the cursor jumping around very quickly, all the time.

Another example: Vim actually shows which key you just pressed in the bottom right corner. Keeping j pressed to scroll through a file means I get to see a j flashing rapidly now.

(I have no idea yet, why exactly XTerm in X11 is fine but flickering in Wayland.)

⤋ Read More

I probably should implement some editing feature in tt. Sure, I can easily edit my feed in vim to fix typos. But then I still have to manually remove the old message from the cache so that the new message is inserted on next reload and I don’t end up with “duplicates” in the message tree.

⤋ Read More
In-reply-to » Ha, I just learned that deleting text in my zsh with Ctrl+U to the front or Ctrl+K to the end puts it in a buffer that can be pasted by pressing Ctrl+Y! That's neat. Even removing the last word with Ctrl+W moves it into this paste buffer.

@lyse@lyse.isobeef.org Ctrl-U in Vim does something similar (“Delete all entered characters before the cursor in the current line”), but it does not put them into the “clipboard”. I sometimes hit Ctrl-U by accident and then my text is gone. 😡😂

⤋ Read More
In-reply-to » Just like we don't write emails by hand anymore (See: #a3adoka), we don’t manually write Twts or update our twtxt.txt feeds. Instead, we use modern Twtxt clients that conform to the specifications at Twtxt.dev for a seamless, automated experience. #Twtxt #Twt #UserExperience

@prologic@twtxt.net Phew, I’m indeed not twtxt.dev, because I sometimes actually do edit my feed with vim like a barbarian.

⤋ Read More

Is there a way to auto-insert a time stamp on vi or vim at the beginning of each line? Like, upon opening like so:

2025-03-20 15:04:03 Blah blah blah blah
2025-03-20 15:04:15 Bleh bleh bleh bleh
2025-03-20 15:04:22 ...

⤋ Read More
In-reply-to » I'm in an article in Quanta Magazine! It's about the bizarre world of algorithms that re-use memory that's already full. https://www.quantamagazine.org/catalytic-computing-taps-the-full-power-of-a-full-hard-drive-20250218/ I'm the one with all the snow in the background.

@falsifian@www.falsifian.org Neat, I got the principle, so mission accomplished. :-)

I have configured my vim to use a tab width of four. So, I noticed that especially https://www.falsifian.org/blog/2021/06/04/catalytic/reachability_with_stack.cc (but also partially the other C++ file) mixes tabs and spaces for indentation. :-)

⤋ Read More
In-reply-to » ROFL 🤣 I've found myself a new insult: :diffoff a vim command...

@prologic@twtxt.net it offends someone with a different opinion? 🤣

No, seriously… :diffoff is used to disable vim’s diff mode that’s usually started running vim -d someFile someOtherFile or by having both files on a split window and applying :diffthis on both panes. (just learned this this morning)

⤋ Read More

I think it’s time I set up jenny for this feed… been echo-ing my twits manually and there came times when it made me feel like a dork xD Plus I don’t have my vim’s :set spell to catch up with the typos

⤋ Read More
In-reply-to » @movq, maybe you can help me with this. I want to place the vim cursor at the end of the first line on replies, and forks. I have tried adding to this to jenny's configuration:

@movq@www.uninformativ.de hmm, I guess I could do that too. I have startinsert set on my .vimrc, so I will either have to take it out, or exit insert, $, then insert again. I think the way you do it would be the way to go.

I tried setting VISUAL to be something like vim -c 'star!', which does the same thing, but no dice. :-/

⤋ Read More

This is a test twt to see if :set formatoptions-=t in vim would stop the annoying line breaking I’ve been having in my twts… And I guess, that’s it! Things are looking OK on my end.

How about if I add in a separate paragraph like this one? Did hit return twice for it. I hope it isn’t breaking anything else.

⤋ Read More
In-reply-to » Well! My 24 hrs without a GUI Web browser was quite of a nice experience. As a matter of fact, and as long as I'm not doing any 3D work, I kind of don't need gui applications as much as it feels like.

@bender@twtxt.net Yeah I’ve been having this problem for quite sometime now. It boils down to Vi/Vim/NeoVim inserting those line breaks automatically when editing an .eml file (if I can remember the file extension correctly) … I think Jenny makes use of those. I had to delete them manually until I was told that the problem was fixed after I added the charset utf-8; to my nginx config file. I’ll try and fix this next…

⤋ Read More
In-reply-to » OK time to put this to the test, I ended up setting my $VISUAL env {-here-} variable, so that jenny can launch neovim instead of plain old vi like {-here-} it is instructed in the code. But as you can see, I still get these {-here-} wired new lines every ~70th character (marked them with {-here-})

I might have found the actual source of my problem.

Jenny uses an .eml file when composing a twt …
and vim kinda auto formats it and inserts in those line breaks every ~70 character.

Then, I stumbled upon this link where Where someone reports that saving a .eml into a .txt might… corrupt the data?

⤋ Read More
In-reply-to » @prologic well, I think OP mother tongue isn’t English, so certainly not an encoding I might be familiar with.

@bender@twtxt.net I’m using both machines in English.

Checked my locale and it spits out:

LANG=en_US.UTF-8
LC_CTYPE=“en_US.UTF-8”
LC_NUMERIC=“en_US.UTF-8”
LC_TIME=“en_US.UTF-8”
LC_COLLATE=“en_US.UTF-8”
LC_MONETARY=“en_US.UTF-8”
LC_MESSAGES=“en_US.UTF-8”
LC_PAPER=“en_US.UTF-8”
LC_NAME=“en_US.UTF-8”
LC_ADDRESS=“en_US.UTF-8”
LC_TELEPHONE=“en_US.UTF-8”
LC_MEASUREMENT=“en_US.UTF-8”
LC_IDENTIFICATION=“en_US.UTF-8”
LC_ALL=

🤷🏽 … and that only happens when vi, vim or nvim are launched by Jenny to compose a twt.

⤋ Read More