Show HN: Zsweep – Play Minesweeper using only Vim motions
11–20 of 34 posts
Re: Show HN: Zsweep – Play Minesweeper using only Vim motions
#12Re: Show HN: Zsweep – Play Minesweeper using only Vim motions
#13Re: Show HN: Zsweep – Play Minesweeper using only Vim motions
#14Re: Show HN: Zsweep – Play Minesweeper using only Vim motions
#15 case '0': return { type: 'ZERO' };
case '_': return { type: 'START_ROW' };
// --- SEARCH ---
case '/': return { type: 'START_SEARCH' };
case 'n': return { type: 'NEXT_MATCH' };
case 'N': return { type: 'PREV_MATCH' };
// --- MOVEMENT (WASD Removed) ---
case 'h': case 'ArrowLeft': return { type: 'MOVE_CURSOR', dx: -1, dy: 0 };
case 'j': case 'ArrowDown': return { type: 'MOVE_CURSOR', dx: 0, dy: 1 };
case 'k': case 'ArrowUp': return { type: 'MOVE_CURSOR', dx: 0, dy: -1 };
case 'l': case 'ArrowRight': return { type: 'MOVE_CURSOR', dx: 1, dy: 0 };
// --- SKIPS ---
case 'w': return { type: 'NEXT_UNREVEALED' };
case 'b': return { type: 'PREV_UNREVEALED' };
// --- ACTIONS ---
case 'i': case 'Enter': return { type: 'REVEAL' };
case ' ': return { type: 'SMART' };
case 'f': return { type: 'FLAG' };
// --- ADVANCED MOTIONS ---
case '$': return { type: 'MOVE_CURSOR', dx: 999, dy: 0 };
case 'G': return { type: 'GO_BOTTOM' };
case 'g': return { type: 'GO_TOP' };
No macros or block select yet, still fun! probably for the best that /mine doesn't work yetRe: Show HN: Zsweep – Play Minesweeper using only Vim motions
#16Re: Show HN: Zsweep – Play Minesweeper using only Vim motions
#17Re: Show HN: Zsweep – Play Minesweeper using only Vim motions
#18It is common in traditional roguelikes to support vi keys as an alternative to arrow keys. I use that all the time when playing Brogue. Have a great vi keys muscle memory now thanks to that, but I use Emacs and only rarely vi, so it's not doing me much good.
Re: Show HN: Zsweep – Play Minesweeper using only Vim motions
#19This was fun! It would feel a little more intuitive if w/b worked on groups of unrevealed tiles instead of just moving 1 space when you were already on an unrevealed tile. i.e. unrevealed = words, revealed = spaces. That way, you could also use them to meaningfully navigate around unrevealed groups better than using h/l. I also found myself missing "e" to go to the end of a word, apparently I use it more often than "…
I'll add `e` (end of word) support in the next push, too. Thank a lot for the feedback!
Re: Show HN: Zsweep – Play Minesweeper using only Vim motions
#20This is a fun idea and the implementation works pretty well. The only complaint I have is that enter for clearing feels awkward in conjunction with hjkl movement; maybe add (d)elete and (f)lag as alternatives to enter and space to keep everything on the home row without requiring stretching?
Now I mainly use `space` key for both chording and flagging. It's the old muscle memory I inherited from playing the classic minesweeper game. One good thing about using the space is that, thumb is always available in vim motions, where other fingers are on the home row.
Thanks for the advise!!