Live data from Hacker News

Vim Croquet

drbunsen.org

31–40 of 56 posts

Re: Vim Croquet

#31

Earlier quoted context omitted.

For values of "cool" meaning "undecipherable", sure.

This is a common misconception. Haskell is extremely readable. You just have to learn it. Python reads like pseudo-code where as Haskell reads like math. Both are readable, they are just different. I suspect it's easier to teach someone Haskell if they have never done imperative programming before because they have a lot less hang ups.

I think this is a fairly insightful analysis. Haskell seems to be semantically very dense - each symbol or function packs a lot of meaning.

Reading Haskell for me is like when I had to do math proofs in Real Analysis or Abstract Algebra - it takes a fair amount of time to get into the mode where I can understand what is written very concisely in front of me.

To me it seems that Haskell suffers from some of the same problem that mathematics does - it is very concise notation for someone already familiar with the concepts, and a lot faster to write if you are familiar, but reading requires unpacking all the meaning of the notation, so ultimately is far more time consuming unless you are already familiar with the concepts that are in the code.

Re: Vim Croquet

#32
post #23

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..

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[…]

Re: Vim Croquet

#33

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

I know others have said it, but I would like to echo the "please don't say that Haskell eschews state" message :)

Re: Vim Croquet

#35
post #5

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).

Also you don't need any visual mode if you don't need visual feedback. Yanking everything:

    gg"zyG

Re: Vim Croquet

#37

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'.

I think it's better to repeatedly hit j rather than count "ah, 5 lines" and type 5j. Even better, you're already looking at where you want to go, it may be faster to hit / and start typing from that point to jump there.

Or, and this is a wild one, grab the mouse and click the point where you want the cursor, rather than giving some sort of treasure map to Vim: "Starting at the typedef, take 5 steps right, then 10 steps down, and 2 more steps right"

Re: Vim Croquet

#38
post #37

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'.

I think it's better to repeatedly hit j rather than count "ah, 5 lines" and type 5j. Even better, you're already looking at where you want to go, it may be faster to hit / and start typing from that point to jump there. Or, and this is a wild one, grab the mouse and click the point where you want the cursor, rather than giving some sort of treasure map to Vim: "Starting at the typedef, take 5 steps right, then 10 ste…

A little tweak that got me in the habit of using things like 5j and 6dd: :set relativenumber.

It numbers your current line as 0, and counts up and down from there. It makes it very easy to see that you need to delete the next 5 lines, or move up 10 lines without doing any math.

As for your mouse comment, I don't think you can compare the speed with which an experienced vim user gets their cursor where they want it to the catastrophic cache miss of removing your hand from the comfort of the home row, grabbing the mouse, moving it where you want, clicking it, and moving your hand back to the keyboard. The mere thought makes me shudder :)

Re: Vim Croquet

#39

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'.

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 actua…

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.

Re: Vim Croquet

#40
post #38
post #37

Earlier quoted context omitted.

I think it's better to repeatedly hit j rather than count "ah, 5 lines" and type 5j. Even better, you're already looking at where you want to go, it may be faster to hit / and start typing from that point to jump there. Or, and this is a wild one, grab the mouse and click the point where you want the cursor, rather than giving some sort of treasure map to Vim: "Starting at the typedef, take 5 steps right, then 10 ste…

A little tweak that got me in the habit of using things like 5j and 6dd: :set relativenumber. It numbers your current line as 0, and counts up and down from there. It makes it very easy to see that you need to delete the next 5 lines, or move up 10 lines without doing any math. As for your mouse comment, I don't think you can compare the speed with which an experienced vim user gets their cursor where they want it to…

catastrophic cache miss

haha, great prose.

+1 for relative line numbers. I scripted up ctr+n so I can toggle between relative and absolute as needed, though, there are even plugins capable of intelligently switching when necessary (like http://www.vim.org/scripts/script.php?script_id=4212).

Post reply on HN