miércoles, 12 de julio de 2017

TIL: insert key in kinesis advantage

I found this in the kinesis FAQ.
 
How can I remap the embedded Insert key to the top layer, so it’s like my older keyboard?
1). Turn Keypad On.
2). Press and hold the Progrm key and tap F12 (LED’s on keyboard will flash rapidly).
3). Press and release the “Insert” key (LED’s will slow down).
4). Press and release the Keypad key.
5). Press and release the Insert key again (LED’s will speed up).
6). Exit by repeating step 2 (LED’s will stop flashing).

miércoles, 5 de julio de 2017

TIL: awk > grep

Well, I already knew that awk > grep, but what I learned today is this little trick of "regex over a single field":

cat file.tsv | awk '$1 ~ /-01$/'
foo-01  bar
 

domingo, 2 de julio de 2017

Announcing commit-msg-prefix.

When writing commit messages, it's usual that your company/organisation has some policies and rules about the format and contents in the messages.

Some use an issue number, or name, or start with keywords (or emojis) like Add:/Clean:/Remove:.. (that can be converted to emojis in emacs too). But it's clear that somehow there's value in some kind of standarization.

So I created commit-msg-prefix, which lists the previous git commit messages and lets you pick one of them, and it will insert the relevant part of the commit in your current buffer.

My use case is when I do not remember the issue name/number I'm working on, but I remember keywords of previous commits that belong to the same issue.

There are a few variables to configure, like the exact git (or other) command to fetch logs, and the regex to apply to the log to extract the relevant part to insert.

The variable "commit-msg-prefix-input-method" is one of the symbols ('completing-read 'ido-completing-read 'commit-msg-prefix-helm-read 'ivy-read).

it defaults to ido-completing-read, but the idea is that you use your favourite input method.  ivy or helm, I guess :)