Title photo
frugal technology, simple living and guerrilla large-appliance repair

Regular blog here, 'microblog' there

Many of my traditional blog post live on this site, but a great majority of my social-style posts can be found on my much-busier microbloging site at updates.passthejoe.net. It's busier because my BlogPoster "microblogging" script generates short, Twitter-style posts from the Linux or Windows (or anywhere you can run Ruby with too many Gems) command line, uploads them to the web server and send them out on my Twitter and Mastodon feeds.

I used to post to this blog via scripts and Unix/Linux utilities (curl and Unison) that helped me mirror the files locally and on the server. Since this site recently moved hosts, none of that is set up. I'm just using SFTP and SSH to write posts and manage the site.

Disqus comments are not live just yet because I'm not sure about what I'm going to do for the domain on this site. I'll probably restore the old domain at first just to have some continuity, but for now I like using the "free" domain from this site's new host, NearlyFreeSpeech.net.

Wed, 30 May 2018

Mind-blowing Vim tip: Ctrl-[ is esc

As I'm reading through Evan Klitzke's excellent blog, I came across Esc is Ctrl-[.

One of Vim's quirks is that it's a modal editor, and you switch from edit mode (where you're typing things) to command mode by hitting the esc key, which on most keyboards is the upper-leftmost key on the keyboard.

Lots of Vim/vi users map esc to a ctrl key, but Evan says that ctrl-[ is a default equivalent of esc.

He's right. Try it.

I'm not sure if ctrl-[ will replace esc in my future, but it very well might.

If you think of using your keyboard like a that of a musician -- and when text editing, I think this is a very valid comparison -- think of how you type.

I do touch type -- I learned it on manual typewriters at U.S. Grant High School in the San Fernando Valley back in the day. I can't remember if I took one semester or two, but it was enough to give me a lifelong ability that I use every day-- and heavily.

But when it comes to things like esc keys or ctrl sequences, pre-computer touch-typing doesn't really help.

So here's the deal: I use my left-hand ring finger (or 3rd finger in guitar-fingering parlance) to hit the esc (as well as the backtick key below it. I can generally find esc fairly well, though I have to look much of the time to get the backtick.

But ctrl-[ is a little harder to type. I use the left-ctrl with my left pinky finger (aka 4th finger), and it looks like I'll have to hit the [ with my right pinky finger (or maybe 3rd finger). That's a funky stretch for my right hand. I may be able to get used to it, but the question is whether it's easier or faster than stabbing for esc with my left hand's 3rd finger.

In any case, having an esc alternative in Vim without any configuration is a nice feature.

Wed, 04 Apr 2018

Using Vim in my project has really helped my skills in that editor

Using Vim in my project has really helped my skills in that editor. That's what working with a couple dozen small Vim files per day will do for you.

I had to ssh into a server yesterday and set up a small script and a cron job, and I could feel how different that process was now that I can do more with Vim.

I can move around in files much more easily, and I know the basics of copy/move/paste, which is more than I could say before.

Clojure is trying to push me in the Emacs direction, and maybe I could get comfortable with that editor, but the universality of Vim/Vi is hard to ignore.

Thu, 14 Dec 2017

How to set file permissions from within Vim

I tried this, and it works: How to set file permissions from within Vim | Stack Overflow.

An example. In Vim's command mode:

:call setfperm("foo.txt","rw-r--r--")

It's probably easier to just do this in the Bash shell, but it can be done from within Vi/Vim.

In Bash (to make the files rw-r--r--):

chmod 644 foo.txt

I usually do all the .txt files in the directory (because I generally want text files to be 644, which is rw-r--r--):

chmod 644 *.txt
Thu, 22 Oct 2015

Geany DOES have themes, and now I do, too

I try to switch to dark themes on as many parts of my computing workflow as possible.

The desktop environment, my applications -- I try to make it all dark.

Why? It's easy on the eyes.

I'll go into my full dark-theme setup later, but for now I'd like to share my discovery of the dark themes in the Geany text editor.

I didn't think Geany had themes, let alone dark themes. Turns out it has both.

And I've been using Geany a whole lot because a) copy/paste of text with Windows-style line endings is broken in Gedit (it comes out Unix style) and b) I'm using Geany to work on my Java code because it will compile and run it right in the editor.

I found a link to the Geany Themes site on GitHub. I downloaded the whole thing as a .zip file (I probably should just use git to fork it onto my local drive), then dropped the colorschemes directory into my own ~/.config/geany directory (making it ~/.config/geany/colorschemes) and then in Geany I could choose a Color Scheme under View - Change Color Scheme in the application's menu.

Right now I using the Monokai color scheme.

All I need to do now is figure out how to execute either a Perl or Go program and get the output into the editor (like I do with Gedit Snippets), and I can use Geany instead of Gedit to write this blog's entries, which include a script-generated timestamp for Ode's Indexette add-in.

Update: It is possible to insert a custom-formatted date into your file in Geany under Edit - Insert Date - Use Custom Date Format, using Edit - Insert Date - Set Custom Date Format to set it. For my Ode datestamp I used tag : Indexette : index-date : %Y %m %d %T. Unfortunately it outputs the date in my local timezone instead of UTC, which is what I use in my Ode site. I don't see any way of making the "Custom Date Format" output UTC, so this makes Geany that much less useful for the purpose of writing for Ode.

I tried the Mini-Script plugin, but that is cumbersome, and I even overwrote one of my scripts on accident because of its less-than-ideal user interface.

In short, there's nothing in Geany like Gedit's Snippets plugin, which is ideal (and makes Gedit itself ideal) for writing Ode entries.

Mon, 10 Mar 2014

Gvim is vim-X11 in Fedora

I just installed Gvim, which is vim-X11 in Fedora.

Maybe a graphical version of Vim will encourage me to use it more often.

That's the theory anyway.

Tue, 22 Nov 2011

A salute to Vim from ArsTechnica's Ryan Paul

As much as I dislike his Gwibber social-networking application, I'm that much more of an unabashed fan of Ryan Paul's tech journalism for ArsTechnica, itself a bastion of high-quality reporting and writing.

While I think Paul's a little too close to Ubuntu to write about it objectively, he's just too good not to read.

A recent article, Two decades of productivity: Vim's 20th anniversary, shows Paul at his best:

Vim has been my editor of choice since 1998, about a year after I started using Linux as my main desktop operating system. I’ve used it to write several thousand articles and many, many lines of code. Although I’ve experimented with a lot of conventional modern text editors, I haven’t found any that match Vim’s efficiency. After using Vim nearly every day for so many years, I’m still discovering new features, capabilities, and useful behaviors that further improve my productivity.

Vim has aged well over the past 20 years. It’s not just a greybeard relic—the editor is still as compelling as ever and continues to attract new users. The learning curve is steep, but the productivity gains are well worth the effort.

Read the rest of this post