Log in
Seblog.nl

Kort

Ik geloof dat ik mijn Apple Watch vaker gebruik om te kijken hoe warm het is dan om te kijken hoe laat het is.

Mijn boeken gingen scrambled-alfabetisch de verhuisdozen in, en komen daar dus nu ook scrambled-alfabetisch uit. Voorlopig staat mijn boekenkast dus scrambled-alfabetisch op auteursnaam.

Quick Vim thing that was useful to me: I was editing a .env file and added a comment for other readers, to point out that they should look at config/filesystems.php for more information. Then I thought, is that the right file? So I put my cursor on it and pressed gf, which opened the file, confirmed that it was the right file, and pressed Ctrl-O to get back.

Hoe tof zou het zijn om je eigen slimme gloeilamp te hacken en er dan met ssh en Vim een geheim dagboek op bij te houden.

Net herinnerde ik me een moment, jaren geleden, waarop ik me afvroeg hoe mijn leven er uit zou zien als ik 29 was. 'Ja,' dacht ik zo hard als ik kon, 'geen zorgen, je zit op een kantoor en je hebt het naar je zin.' Maar in mijn herinnering bleef mijn 23-jarige het zich afvragen.

So at one point I proudly admitted to a co-worker that I knew how to search and replace in Vim: I did /foo, then ciw, bar, and escape (changing the inner word to 'bar', or whatever the right replacement motion would be) and then press n and . for the number of times I needed to (first one goes to the next occurrence of 'foo', and the period key repeats the last edit, which is magic and very powerful in itself).

He replied with a less interesting, but in some cases more appropriate way of doing it: :%s/foo/bar/gc. This command takes the current file (%), and substitutes 'foo' for 'bar', with a flag for global (more than once) and choice. Vim will then stop at each 'foo' and gives you choices for 'y' or 'n' (and others), so you can interactively pick your replacements.

Today I leaned about the gn text object. Where iw stands for 'inner word', gn stands for 'go next'. So one can type /foo, then cgn, bar, and escape, which is almost the same. But then you can just keep hitting ., and it will perform the last action on the next occurrence of 'foo'. No need for n anymore!

I mean if you want to be presented with a choice for each replacement, go use :%s, but this gn thing is darn cool.

Nog steeds ben ik verbaasd als mensen die jonger zijn dan ik een auto hebben. Gaat dat ooit over?

Maybe I should start a Vim-log of things I encounter and find useful. Most of them seem too advanced for the beginner and too trivial for the expert, but who's really an expert at Vim, aren't we all beginners for some part of it?


So, today I learned about the :cd command, which I instantly memorized (for it's just Unix). It changes the home directory of Vim, (by default this is the folder you start Vim in).

For example, if you're at ~/code and you want to check the contents of some file in my Seblog-project, I would do vim seblog/site/config/config.php. But as always, I need to check another file, so I use :e (short for :edit) to open that file, but because I was in ~/code when I opened Vim, I need to type: :e seblog/site/config/other-file.php. I find that annoying, so I would close Vim altogether, cd seblog and then vim ..

Now, I would just :cd seblog and then :e site/config/other-file.php. Or use :Ex (for :Explore) if I wanted to look around, but I knew that one already.

Het fijne aan richting aanwijzen met je handen i.p.v. met een lichtje is dat je er veel meer nuance in kan leggen. ‘Ik ga zo hierheen.’ ‘Ik ga nu.’ ‘Je begreep het waarschijnlijk al uit de verkeerssituatie, maar inderdaad, ik ga hier naar links.’

Ik ga wel gewoon lekker thuis de literator uithangen met een bak sinaasappelkwark en De ontdekking van de hemel.

Het voordeel van het feit dat ik heel nodig de was moet doen, is dat ik eindelijk wat administratieve dingen wegwerk.

Je herkent de tot elektrische fietser bekeerde automobilist aan hun gewoonte om precies in het midden van het fietspad te blijven fietsen. Ze halen ook in via het midden van de tegenliggende rijstrook.

De NRC headlines van dit moment vormen een gek verhaaltje over Poetin, zijn vete met de maffia, en de grote grazers die er de dupe van zijn.

Meer laden