Typing On Cherry G80 And AEKII

I’m running some typing tests on the AEK and the Cherry g08 with the black MX switches.

The Cherry G80

cherry-g80.jpg I tried the cherry keyboard before and liked the keys. They are smooth and linear, and I felt that though they are a bit hard to press, not having the tactile sensation, actually kind of pushed my fingers up, and gave them the energy to move to the next key.

On the other hand, I didn’t like that the keys feel smaller than those in my AEK and Wasd code. My hands felt somewhat claustrophobic when typing, scrambling and twisting to get to the desired keys. Now since I type in Emacs, it means that I need to use modifier keys quite often. The layout didn’t help either. The bottom row is skewed to the left, so the modifiers are not aligned under the ‘z’ and the ‘x’ as they are in other, more conventional keyboards.

Apart for the keys, the cherry keyboard is pretty much crap. It’s very light, and feels to be constructed out of cheap materials. The touch-pad is a jock. It’s barely responsive, and won’t track my finger unless it moves slower than it would have taken me to go to the other room and bring a decent mouse. Overall, though I kinda like the black switches, I think I’ll prefer the browns, which require less force to press. So overall, this keyboard isn’t a keeper.

Apple Extended Keyboard 2

aekii.jpg

And this is now the apple keyboard that I’m typing on, and the first impression is so much better.

Maybe, my only complaint might be that the keys aren’t linear. The blacks, which are linear feels very good, but they are a little too hard. It takes just too much force to push down the keys, and keep a fast typing pace.

Here, with the apple keyboard, typing feels good, but the tactile feeling is a bit weird. It’s like the keys don’t seat right, as if they are not perfectly aligned. The pressing of the key isn’t linear. It feels like there is some kind of a bump the the key pushes through, which gives a non harmonious tactile feel to the click. It feels like driving a car on pebbles. Just like you feel those vibrations coming from the rocky road, that’s how they typing on the AEK feels. My fingers absorb that vibration, caused by the push through this non-linear path the key does when it’s pressed down.

use-package’s :config vs. :init

I read this Reddit thread about favorite themes, and got intrigued by the spacemacs theme1.

I added that theme to my init file, and tried making it the default theme. I use use-package, and configured the theme as follows:

(use-package spacemacs-theme
:ensure t
:config
(load-theme 'spacemacs-light t)
)

When re-evaluating my init file, the theme didn’t load. I tried to run only the (load-theme 'spacemacs-light t) line, and the theme loaded. I changed the :config to :init in the package configuration, and it loaded when I re-loaded emacs.

What, then, is the difference between :init and :config in use-package?

The answer to that question, which I found it in this stack-overflow answer, is that in use-package, whatever defined inside the :init keyword, will load whenever emacs is loading. What’s in the :config, though, will be executed only when the package is actually loaded (i.e lazy loading)2.

Here’s how my configuration for that theme looks like now:

(use-package spacemacs-theme
:ensure t
:init
(load-theme 'spacemacs-light t)
)

Footnotes:

1

I tried spacemacs before, and liked its look and feel, but didn’t know I can take it back with me to gnu emacs

2

Needless to say that, going back to the use-package documentation, the difference between :init and :config is clearly described…

Elisp Video Tutorial – Notes

I’ve just finished watching Daniel Gopar’s elisp video tutorial. So far there are 4 parts to the tutorial, and based on this thread on Reddit, there are more to come.

After watching the guide I don’t feel more proficient in elisp, yet less timid running evals and more courageous tinkering with my config file.

Following is a short summary of the code exercises and shortcuts I logged while watching.

Part 1 – Intro

Link to episode 1

REPL – read-eval-print-loop

Define functions:

(defun add-num (a b) (+ a b))

Define a test:

(require 'ert)
(ert-deftest add-num-pos ()
         (should
         (equal (add-num 10 10) 20)))

To run the test that I’ve just created: M-x ert-run-tests-interactively

Choose the test I would like to run (in this case “pos-add-num”)

Part 2 – Create A Simple Function And A Test Of That Function

Link to episode 2

setq to set variables and lists (setq my-list '(1 2 3))

add-to-list to add element (add-to-list 'my-list 4)

Another way to add to list, but this time to a copy of the list: (cons 5 my-list) – this will return (5 1 2 3 4) But when inquiring my-list, we will get (1 2 3 4)

car returns the first element in every list (car my-list) -> 1

cdr returns everything from a list, after the first element (crd my-list) -> (2 3 4)

nth return a certain element in the list (nth 4 my-list) -> 3

member check for a certain value in a list, and return the elements in that list from that value on (member 3 my-list) -> (3 4) (member 7 my-list) -> nil

Part 3 – Looping And Local Variables

Link to episode 3

Use the scratch buffer, so I can write in multiple lines

C-x C-e to evaluate code. Point needs to be at the end of the code in order to get evaluated.

Looping through variables:

let to create a local variable

when and if – what they suppose to do…

If there is more than one statement in the if statement, need to use to wrap those lines with progn. There is no such limitation in the else statement.

Part 4 – Interactive Functions

Link to episode 4

Created a function to count words, plus the test for it.

(defun cheap-count-words()
  (interactive)
  (let ((words 0))
    (save-excursion
      (goto-char (point-min))
    (while (forward-word)
      (setq words (1+ words)) ))
    (message (format "Words in Buffer: %s" words))words))



;; Tests
(require 'ert)

(ert-deftest count-words-test ()
  (get-buffer-create "*test*")
  (with-current-buffer "*test*"
    (erase-buffer)
    (insert "Hello world")
    (should (=(cheap-count-words) 2)))
  (kill-buffer "*test*"))

Magit – My Simple Workflow

I still not fluent with Magit’s terminology and workflow. Probably because I’m not using git, in general, too often. When I do, and when I try to use Magit as the interface, I usually get confused by the wealth of options and switches, and resort to git in the terminal.

Today I decided to give Magit yet another try. I read the Getting Started guide, and now things makes much more sense. However, I can see how I forget what I’ve just read a week from now, so here’s the gist of that, my simplest cheat-sheet:

(Ma)git status:

C-x g

(Ma)git add

For each unstage file: s

(Ma)git commit

c c

Type the commit note and then C-c C-c to create the commit.

(Ma)git push

p u

Done. Now I can type q to close the Magit pop-up buffer, and be back on the file I was working on.

Electric Pair Mode In Emacs

So far I’ve used TextExpander for text snippets and, well, text expansion. One of my main uses-cases is character pairings. For example, when I type " I almost always enclose it with another ".

But TextExpander is lacking in several ways:

  1. Performance – it takes a friction of a second for the expansion to happen, but it’s notable, and feels like a little hang.
  2. If I delete one part of the pair, it won’t remove the other.
  3. It won’t work to wrap text. If I typed something, and then want to wrap it with brackets, for example, I can’t select the text and type the bracket character.

In addition to the above technical shortcomings, I don’t plan to keep using TextExpander in the long run. The recent move into subscription based pricing, isn’t something I’m interested in. I mean, paying subscription to text snippets…?

Anyway, Emacs comes with an electric-pair-mode, which enables smart pairing. I turned it on, but out of the box it’s configured to work mainly with programming major modes. I need it also in other text based modes, such as org, markdown and simple text. For example, in org I use ~ for inline code snippets, and ~ isn’t paired by default. Same goes with ".

Luckily, defining more pairs is easy, through modifying the electric-pair-pairs variable.

Here’s my configuration for this mode:

(electric-pair-mode 1)
(setq electric-pair-pairs '(
                            (?\" . ?\")
                            (?\` . ?\`)
                            (?\( . ?\))
                            (?\{ . ?\})
                            ) )

I’ll add more pairs as I encounter them. Also, I’ll need to learn how to add pairs for specific major modes.

Ortus Rengi

Recently I’m into gaming. It started with a nostalgic craving to Half-Life, which I used to spend hours on, about ages ago. I wondered if there’s a version for mac, and found that there is, in Steam. I didn’t hear about Steam before (thinking about it, I did hear about it in one of the Cortex podcast episodes), but once visiting that service, there is no way out… a spent almost the entire night browsing through games, feeling I’m in an amusement park. I forgot all about half-life, and eventually immersed myself in Ortus Rengi, a closed-deck, deck-design strategy card game.

Chronicles of Addiction

6 months ago I listened to a podcast, and learned for the first time about this mechanical keyboard thing.

I was intrigued and began reading about it.

3 weeks later I bought a wasd code.

I kinda liked it, but not that much. The blue switches, together with the thin keycaps felt flimsy and hollow. The typing experience wasn’t what I imagined it to be.

More research, and I’ve learned about the different types of switches. I returned blues and replaced with a tenkeyless greens.

The sound and tactile feel of the green switches was better, but the typing experience still wasn’t there.

I’m looking for mechs on Craigslist and find this old Northgste keyboard. I google and find its an old classic. Trying to buy it didn’t work, but I’m getting hooked to old school keyboards. Shortly after, I venture with an Apple Extended Keyboard 2.

The AEK2 felt like a dream. But it’s 30 years old keys start to die one after the other.

I’ve turned into a keyboard doctor and gave it an open heart surgery.

I’m delving deeper into mechs, and spend hours at r/MechanicalKeyboards/.

I heard about Massdrop. This horrible site detached me from hundreds of dollars.

There is more to mechanical keyboards than just the switches. As it turned out keycaps is an entire area that I wasn’t aware of. I’m learning about all the different profiles. SA looked awesome, but there is a Granit DSA drop in Massdrop, and I can’t hold myself from committing to it.

I need to see and try more keyboards than I can buy, so I’m starting a mechanical keyboard meetup.

The granit drop was closed 2 and I’m getting the keys 3 months later.

I’m swapping the crappy wasd keys, but finding that the stabilizers won’t fit into the new granit keycaps, so I buy silicon tape and wrap it over the stabilizers to make it fit more closely with the new granits.

My renewed code can finally compete with the AEK2; compete but never win…

What have become of me… How have I been sucked into this world…?

Anyway, I’m starting to feel an itch for a portable mech. For travels. Going to hunt a 60% drop.

The lesson: never listen to podcasts again.

Just A Couple Of Emacs Keybindings

Every now and then I’ll type something in Emacs with a certain goal, just to find that I get something completely different from what I’ve intended.

When in org file, I tried to convert a list item to a sub-header. The keybinding to make this conversion is C-c *. But when I (thought I) typed it, instead of getting a sub-header, a new buffer opened at the bottom of the frame – a calculator:

emacs-calc-mode.png

Figure 1: Calc mode

view-lossage

I had no idea how did that happen, and luckily recalled a tip I got, on how to move back in time using the view-lossage command, which display last 300 input keystrokes. Doing so, I found that instead of C-c *, I typed C-x *.

So now I know (and hopefully remember) that:

  1. There’s a calculator1 in Emacs, bound to C-x *
  2. C-h l is a useful way to track back clumsy keystrokes

Footnotes:

1

Not that I had any doubts there is, just didn’t think to look for it just yet. There are so many other “to-learn” things on my list…

NY Mechanical Keyboards Meetup

I’ve just started a new meetup group in NYC. This groups is all about mechanical keyboards! 

So if you’re around (in the NYC area), if you have reminiscences to the tactile feel and click-clacky noise keyboards used to have when you were a kid, if you’re already spellbound, spanding hundreds of dollars in Massdrop, if you know everything about SA and DSA,  if you’re one of the 5% who had their spacebar flipped, if you have just built your own Ergdox, or if you just want to learn what’s all the fuss with those retro, charming typing devices – join us