Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# nvim-tetris

This fork adds option to play with hjkl instead of arrow keys.

Bringing emacs' greatest feature to neovim - Tetris!

![Gameplay Screenshot](./gameplay.png "Some poorly executed demo gameplay")
Expand Down
6 changes: 3 additions & 3 deletions lua/nvim-tetris/io.lua
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,11 @@ do
do
local v_0_0 = nil
local function set_game_maps0()
local mappings = {["<Down>"] = "soft_drop()", ["<Left>"] = "move_left()", ["<Right>"] = "move_right()", ["<Space>"] = "hard_drop()", ["<Up>"] = "rotate()"}
local mappings = {["<Down>"] = "soft_drop()", ["j"] = "soft_drop()", ["<Left>"] = "move_left()", ["h"] = "move_left()", ["<Right>"] = "move_right()", ["l"] = "move_right()", ["<Space>"] = "hard_drop()", ["<Up>"] = "rotate()", ["k"] = "rotate()"}
for k, v0 in pairs(mappings) do
api.nvim_buf_set_keymap(buf, "n", k, (":lua require\"nvim-tetris.game\"." .. v0 .. "<cr>"), {noremap = true, nowait = true, silent = true})
end
local other_chars = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
local other_chars = {"a", "b", "c", "d", "e", "f", "g", "i", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
for k, v0 in ipairs(other_chars) do
api.nvim_buf_set_keymap(buf, "n", v0, "", {noremap = true, nowait = true, silent = true})
api.nvim_buf_set_keymap(buf, "n", string.upper(v0), "", {noremap = true, nowait = true, silent = true})
Expand Down Expand Up @@ -381,4 +381,4 @@ do
t_0_["prepare_game_cleanup"] = v_0_
prepare_game_cleanup = v_0_
end
return nil
return nil