Play 2048 inside your favourite editor
Last updated Jun 12, 2026
69
Stars
3
Forks
0
Issues
0
Stars/day
Attention Score
11
Language breakdown
Lua 100.0%
โธ Files
click to expand
README
2048
Implementation of the 2048 game for Neovim.
๐บ Showcase
https://github.com/NStefan002/2048.nvim/assets/100767853/b53c7947-c457-4b5f-814c-f07416ac182d
๐ Installation
lazy:
{
"NStefan002/2048.nvim",
cmd = "Play2048",
config = true,
}
use({
"NStefan002/2048.nvim",
config = function()
require("2048").setup()
end,
})
:Rocks install 2048.nvim
โ How to Play
:Play2048- Use the
h,j,k,lto move the squares in the desired direction. - Squares with the same number will merge when they collide, doubling their value.
- The goal is to create a tile with the number 2048.
- Continue playing and try to achieve the highest score possible.
- The game will automatically save your progress, so you can continue to play it whenever you want
๐ฎ Controls
-
h- move the squares to the left -
j- move the squares down -
k- move the squares up -
l- move the squares to the right -
u- undo the last move -
r- restart the game -
n- new game (select the board size) -
<CR>- confirm in menus -
<Esc>- cancel in menus
You can change the default mappings.
require("2048").setup({
keys = {
up = "<Up>",
down = "<Down>",
left = "<Left>",
right = "<Right>",
undo = "<C-z>",
restart = "R",
new_game = "N",
confirm = "y",
cancel = "n",
},
})
๐ More in this category