Hacker News new | past | comments | ask | show | jobs | submit login
I've finally implemented the command I keep typing all day: gti (r-wos.org)
108 points by colinprince on Aug 31, 2012 | hide | past | favorite | 60 comments



You need to add extras for common git subcommands like sl implements extras for the common options to ls.

Like "gti init" could have it start from a dead stop, "gti push" could have it push something in front of it, "gti pull" could have it pull a trailer behind it, etc.


Out of curiosity, for those who have typed gti, how do you type 'git'? For me, left index finger on G, right index on I, left middle on T. I'm wondering because I never make this particular typo, although I do have 'sl' installed and tend to see the steam locomotive once every few days.

As an experiment, I tried to type 'git init' very quickly a bunch of times and my typos were:

    git niti
    git niit
    git itnit
    giti nit
but never 'gti'.


It happens with touch-typing. Left index finger for g and t, right middle for i. After pressing g, I move my left index finger over t while simultaneously moving my right middle finger over i. It isn't very probable, but sometimes the index finger gets to the t juuust before I press i, so I get gti, instead of git.


I've just tested a couple different ways

usually it's left-index, right-middle, left-index, but sometimes it's left-index, right-middle, left-middle. It seems to depend on what I'm going to type next, but I don't seem to have a lot of insight as to what my fingers are doing (or why) ;)


Left middle on T, on a querty-based keyboard? And you've never broken anything? :-)

[1] has what seems to be the classic way, with t and even r being typed my the index finger.

[1] http://www.powertyping.com/qwerty.html


Wow, this could hardly be more different from how I type. I use only my middle and index fingers for all letters, moving them around as needed. I use left middle on 't' unless the next or previous letter is 'q', 'w', 'e', 'a' or 's', in which case I use left index for the 't'. It's not at all conscious, so I had to do some experimenting to figure that out.


I type very similarly, although I also tend to keep my arms angled in with index fingers on v and n, and do use ring fingers to type some letters, and pinky for modifiers. The main reason is to keep my wrists at a more comfortable angle. There is some overall greater movement of the hands vs. normal technique. I don't really see a problem with this.

I pretty much learned to type at a reasonable speed from MUDs, IRC, and other online chat. I'm >80wpm even using this nonstandard technique on QWERTY.

I type like this mainly on apple mba13/mbp keyboards (low travel, small); on a full-sized Das Keyboard at my desk, it's closer to conventional typing, although I still never hit a or l with pinky.


I've got a very similar style, using just my two index fingers for nearly everything (except from e.g. my left middle finger for Q and A, and my right thumb for space).

Like you say, it's not at all conscious. I think it's probably because I taught myself to type at a very young age, and never thought to do it any differently.


Impressive. I have no idea how you could manage that.

Where did you learn your style? (Or why?)


I can't speak how for graue, but I can offer my experience since I type almost the same way as graue does, except that I do use my ring fingers occasionally (mostly right ring finger, for stuff like "L") and my pinky for stuff like right shift and enter.

How and why? I started messing around with programming when I was a kid and I never learned typing or trained for it formally. When I started, I was just pecking with my index fingers, but since my mom and dad used a typewriter for their stuff, I was fully aware that pecking was suboptimal. They never offered any practical help with that, probably because they knew that I couldn't care less about how I type, as long as I could crank out my code. Long story short: I've developed my own technique, spontaneously. I'm aware that it's probably suboptimal, but it's good enough for me and I can't be bothered to retrain when there's so much more interesting stuff to do ;)


I have an interesting way of typing based on what I did as a kid too. Due to the large amounts of games I played, my left hand stays firmly over the wasd keys and my right hand moves a lot more than my left. I tend to type really loud and mostly use my index fingers, but also switch to using various other fingers when I'm typing quickly. I know its sub optimal, but I hit 80 wpm pretty consistently.


I would guess you did this test on your own keyboard, which you're used to. I wonder if the results would have been different if you'd used an unfamiliar one.

(I also wonder if the number of trials you did was statistically significant--but never mind!)


I just tried the same and had a very hard time typing gti. I had to slow down to get it; if I try to type it as quickly as possible I end up with either "git" or "gir". The parallization between hands just makes it too easy to type correctly. While your left pointer finger is making that long move from g to t, your right middle finger is already done pressing i.

I never type "sl" either.


I was thinking along the same line.

When you use the same finger to type the G and T and a different finger to type I, it seems really impossible for me to accidentally type G-T-I.

The more common mistake is when you have to type two consecutive letters with the same finger but end up typing the next one earlier because its on a different finger (usually on the opposing hand).

Ex: 'teh' instead of 'the'- T,H with left index finger. E with left middle finger.

I also almost never type 'sl' though I do often type 'qw' in the Vim command line instead of 'wq'


A even more challenging task (at least for me) is to type a lower case letter after a symbol that requires Shift.

For example, I frequently type :Wq instead of :wq, especially in a SSH session, which adds some latency to the release of Shift key.

EDIT: SSH has nothing to do with this. It's just an emotional impact on the extra hassles of backspacing with latency.


I do this all the time too, but I think you're wrong about the ssh difference.

ssh doesn't see the keystroke until it's fully formed by your OS and/or window manager, so there can be no latency to the release of shift.


Thanks for telling me that! I realized that I can make the same mistakes locally with comparable frequency. Perhaps it's just that I feel annoyed when I have to backspace with latency.


Use mosh instead: http://mosh.mit.edu/

It predicts what the server will do with your input and displays the result (with an underline) until the server responds. This means typing is always at local speed even if the network is being flaky.


Happens to me even when working directly in Vim on my local system. Earlier I used to map "Tabnew" to "tabnew" and other such hacks.

Then I saw this trick that saved me considerable grief:

    noremap ; :
Now, just hit ; in normal mode to get the command line.


Same here! It's true even if it's a capital letter. Like "HEllo", "BEst REgards", "THanks"...

About "git", for me left-index, right-middle, left-middle.


I do right index finger on G, left index on I, right middle on T.

Oh, I'm a dvorak user, by the way. :)


Left index, right middle, left index.


Why not just alias 'gti' to 'git'? I don't see what constructive purpose this serves. The only situation where it might matter is if you were using lots of different systems and didn't want to copy your aliases file over, though that's pretty simple nowadays, thanks to Git itself.


It serves the same purpose that sl serves. A minor somewhat amusing annoyance that gets tiresome over time, forcing you to drop the bad habit.

Aliasing it to 'sleep 2 ; git' would do the same thing, but would lack the embarrassment and amusement that the animation gives.

Of course mostly that is just an excuse. "Because it is fun" is really the only reason that there needs to be.


I've been tempted to do things like this alias, but it's a slippery slope; I don't want to train my muscle memory to type the wrong thing, and if it's silently accepted that's what is likely to happen. This way, the command gets run but you get a reminder that you typed the wrong thing, I guess.

Now I need something to stop me typing 'pythong' in shebangs.


It's more fun.


You're right. How dare we have fun on the internet!?


What would there be to blog about if he did that? Blogging is a sign of intelligence, and if you just do something simple and don't tell anyone, how smart are you really?

I use an even more failsafe technique: typing the word "git" correctly each time.


For me I always mistype 'master' as 'amster'. In my mind, I've invented a friendly little mascot, the Git Hamster.


Holy crap, I do this exact thing, and had the same thought about the git hamster. That and "gitp ush".


Being a slow typer, I couldn't get bothered. I have about 30 alias in my bash_profile for git. These are the ones I use most:

    alias ga='git add'
    alias gs='git status'                                                                                                                                                                            
    alias gc='git commit'
    alias gls='git ls-files' #lists all tracked files!  
    alias gg='git add -u; git commit -a -m "lazy commit"' # stage and    commit everything tracked. So lazy ...                                                                                        
The latter I only use for committing non-code. Like my notes in org-mode.

I also found it very convenient to have

    alias eb='emacs ~/.bash_profile'
makes me edit my dash_profile almost every day.


I'm with this guy. Basically the same setup.

I still alias 'git' to 'g' also for all the other commands needed throughout the day. Not sure why yall would keep typing 'it'.

I do enjoy the ascii car tho. Cheers to that. Probably will set this up anyways!


The spokes of the GTI wheels often didn't appear to rotate on my screen because the frame rate was too high - I added a change to make the spokes change after every 5 ticks.

https://github.com/dickfickling/gti

Maybe even just every two ticks (% 4 < 2) would be fine.

edit: Forgot to say: wonderful idea and nice implementation! Simple yet satisfying.


Ah, in the finest tradition of that other great Unix utility, sl: http://www.cyberciti.biz/tips/displays-animations-when-accid...


Tim Pope tried to implement interesting plugin for Vim. [1] It basically replaces frequently mistyped words with correct ones. I wouldn't support this method, but it is interesting how frequently I type some words wrong ('fucntion', for example). Instead, you should definitely try proper fingering.

As a pro piano, saxophone and guitar player, I'm prepping a rather lengthy blog post about proper fingering when typing, and the inadequacy of standard keyboard layouts, in particular, wrong placement of modifier keys as pivot points.

[1] http://www.vim.org/scripts/script.php?script_id=1545


Your mentioning of piano made me think of a auto-correct plug-in for an electronic piano. In the spirit of sl and gti, it would have to play a Rickroll first.


Oh I get it. It's a GTI, innit.


From my standard bashrc:

  alias l='ls'
  alias vmi='vim'
  alias ivm='vim'
  alias grpe='grep'
  alias amke='make'
  alias mkae='make'
  alias maek='make'
Fixes most everything I screw up regularly :)


I think a lot of people here are missing the point of 'sl', 'gti' et al. They're practical jokes, not training aids. Of course you can alias 'sl' to 'ls'! Of course some shells are smart enough to DWIM! 'sl' is there so we can watch the expression on the clewless n00b's face when he inevitably mistypes 'ls'-- probably in a moment of stress.


I had just started using Debian a few days before. I was trying in vain for hours to get a crappy Radeon card's direct rendering to work, futzing around with different settings. Suddenly a train roared across my terminal. "What the fu..." Eventually I figured out what happened and laughed my ass off.


I have:

  "\C-ga": "git add "
and so on in my .inputrc (https://github.com/grn/dotfiles/blob/master/inputrc). This allows me to type Ctrl-g, a to insert "git add ". It makes typing faster and is clearer than aliases.


I have something similar on one machine, but without the awesome ASCII graphics. It made me type git better each time but I find I'll miss the h on 'push' so I think that'll be next, the horrors that could be generated in ASCII for 'git pus' will surely help.


I've just used an alias file for some of my more common typos ('sl' is probably my most common) - nice to know I'm not the only one who makes silly typos with enough frequency to warrant some kind of technological solution!


Try zsh (z shell). It has auto correction for typos:

pawka@yoda ~/Desktop> gti

zsh: correct 'gti' to 'git' [nyae]?


After I switch to zsh, I miss the `sl' so much.


You have zsh set to autocorrect sl to ls even if sl is installed? That seems a bit extreme, is that what the default behaviour is these days? I have all the autocorrection turned off in my setup.


I just found that it's oh-my-zsh's feature. It alias sl to ls.


This seems pretty dangerous. If you misspelled git you may also have misspelled the command you wanted to run, and especially if you set 1- or 2- character aliases in git you may run something you never intended to run.


For years I had several aliases for 'make' and after a while I literally couldn't remember how to spell it correctly without thinking quite hard. mkae, meka both looked equally valid.


As much as I type git, I just alias it to 'g' and be done with it.


It would be possible to implement "did you mean" feature in bash, even for command arguments (bash tab completion already knows them.) Not sure if worth it though.


Maybe someone on HN can invent something that shocks you when you type the wrong command instead! Funny post, and GTI's had great mileage


I have an amdin on some servers. don't punish yourself with ascii animations make it launch gtypist or similar.


You can do the same for ls - apt-get install sl IIRC. Generally more productive to just do an alias though :)


./mangae.py runserver, or some variant... another great one!


Ha ha! 'More of a reward than a punishment.


Is this going to be available on gtihub?


i love this lol


alias g='git';


nitty gitty :)




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: