
Vim Croquet - saamm
http://www.drbunsen.org/vim-croquet/
======
nathan_long
Awesome! I'd love to see something like this as a standalone project. "Vim
Critic" or "Vim Coach" \- something to say "these are the inefficient things
you personally do."

Probably some low-hanging fruit would be "any keystroke in Normal mode that's
repeated." Eg, if I'm doing 'jjjj' to move down or even 'wwww' to hop from
word to word, I could be searching or using a movement combo like '4j'.

~~~
sdegutis
Personally, the main reason I moved from vim to emacs is because I don't want
to have to _think_ about my editor, I want it to be pure muscle memory. I'm
okay with hitting "jjjjk" to go 3 lines down rather than trying to guess that
it's exactly 3 down and typing "3j". Emacs-style navigating/editing is great
for this kind of error-tolerant navigation/editing. It leaves my brain mostly
free to focus on whatever I'm actually coding at the time.

~~~
vectorpush
I think most experienced vim users will tell you that it _is_ pure muscle
memory for them. Also, vim supports jjjjk as well as 3j. Anyway, I just
realized I am debating vim vs emacs so I'll stop here.

~~~
sdegutis
We all know the one true editor is the Chrome console anyway.

~~~
pycassa
ewww

------
aaronem
The keyboard heatmap code is nifty enough to justify this being on the front
page of HN all by itself, which is not to say the rest is without value --
quite the converse; I hadn't thought of doing this sort of usage analysis with
Emacs, but I think that's going to be my next weekend project once I'm done
updating weatherline-mode.

------
mkdir
Judging by the heatmap, it appears the author isn't familiar with Vim's _c_
verb.

It works just like _d_ , except it puts you in insert mode after you've
completed your command.

For example, to replace the text within a set of quotation marks with _You don
't like Vim?_, move your cursor on or within those quotation marks and use:

    
    
        ci"You don't like Vim?<esc>
    

To replace the text up to (but not including) the next exclamation point with
_I would never drink orange juice_ , use:

    
    
        ct!I would never drink orange juice<esc>
    

EDIT: Gah. He explicitly mentioned his use of _cib_. I'll leave this here in
case it helps anyone.

~~~
nbouscal
Judging from his discussion of cib in the Data Acquisition section, it seems
like he's familiar with it.

~~~
falcolas
Perhaps familiar, but not ingrained in his muscle memory to used instead of
d<motion>i.

~~~
nbouscal
To be fair, I'll often do that as well, but just looking at the keys misses
that there's a pause between the d<motion> and the i. I don't like sitting in
insert mode, so if I don't know what I'm going to replace a thing with, I'd
rather delete it, then insert something else after I've figured it out.

------
jbeja
Even if not related to it and my get some downvoted for saying this. Something
that strike me in this post is how cooler haskell code looks vs python.

~~~
mercurial
The nice thing with Haskell is that it can be extremely compact. The problem
with Haskell is that it can be extremely compact.

~~~
bjackman
map (format "The %s thing with Haskell is that it can be extremely compact")
["nice thing", "problem"]

(disclaimer: that probably isn't actual Haskell syntax.)

~~~
chongli

        mapM_ (printf "The %s thing with Haskell is that it can be extremely compact\n")
              ["nice thing", "problem"]
    

This works. :)

Alternatively, you could do this:

    
    
        forM_ ["nice thing", "problem"] $
              printf "The %s thing with Haskell is that it can be extremely compact\n"

------
ajanuary
Using a language that eschews state to try and process the state in a modal
editor tickles me.

~~~
nbouscal
To elaborate on the other reply, Haskell actually takes a very in-depth and
principled approach to managing state. State is necessary for many
applications, so rather than eschew it entirely, the idea is to isolate it and
make it as explicit as possible. Frequently in complex stateful applications
this is done by use of the State monad, with lenses to handle mutation of that
state. There's a lot of theory behind it, but in practice it ends up being
pretty similar in difficulty level to managing state in more popular
languages, just a hell of a lot safer.

------
weavie
Looking at the heat map, what does surprise me is how he never uses Escape or
^[. How does he managed to move out of Insert mode? My [ key is starting to
wear out due to such heavy use..

~~~
aaronem
I don't use vim, but from the parsing example he gives in the post, I'm
guessing he uses C-c:

    
    
        `Mihere's some text^Cyyp$bimore ^C0~A.^C:w^M:q
    

[…]

> The lexer correctly determined that I started in normal mode by navigating
> to a specific buffer using the `M mark, then typed _here 's some text_ in
> insert mode, then[…]

~~~
weavie
Wow. I never knew about that one.

------
tnorthcutt
This is very cool. Can anyone point me in the general direction of how to
implement this on my machine? I understand logging keystrokes in Vim, but I'm
not sure how to use the source code given for the lexer, or that given for the
Makefile.

------
nbouscal
ggvG$"zy can be replaced with ggVG"zy

Visual line mode is often very convenient.

Also, kana's text-object-entire plugin may come in handy here (many of her
text-object plugins are very useful).

~~~
eggoa
Or

    
    
        :%yz

~~~
nbouscal
Good call! But you'll need a space:

    
    
        :%y z

------
mateuszf
This guy should definitely start using caps lock as control.

~~~
nbouscal
If you read more closely, he mentions that he uses a Kinesis Advantage where
his control key is quite convenient. The heatmap is just plotted on a standard
keyboard.

~~~
rjzzleep
[http://www.drbunsen.org/an-affray-with-rsi/](http://www.drbunsen.org/an-
affray-with-rsi/)

his end key is escape. on his keyboard i think it translates to being on a
thumb

------
a-b
Bay area folks, please join Vim meetups [http://www.meetup.com/vim-
ed/](http://www.meetup.com/vim-ed/)

------
vsviridov
This needs to be a standalone tool. Is it on github somewhere? Or do I have to
copy/paste from the article?

------
atmosx
Awesome stuff!!!!

