theprimeagen / vim-be-good Goto Github PK
View Code? Open in Web Editor NEWvim-be-good is a nvim plugin designed to make you better at Vim Movements.
vim-be-good is a nvim plugin designed to make you better at Vim Movements.
I am considering switching this plugin to Lua, but I would like to discuss with the core contributors.
Pros
Cons
Thoughts?
Neovim version is 0.3.8
#78 did not solve it
It drive me crazy for allllllllllllllllllllllllllllllday
Thanks for the plugin!
Screenshot tells more about the error - https://share.getcloudapp.com/9Zujqlk8
Randomize the cursor location on the line for the whackamole game so that user needs to use both forward and backward motions.
BaseGame currently does all the rendering and all the operations that games need. This kind of sucks as the games have to know how to work with NVim buffers.
In reference to thread here.
To parapharse that thread:
While playing the game we should
nmap <Left> <nop>
or even better
nmap <Up> :echo "Use `k` to move up!"<Cr>
We'd need to capture their current mapping of Up
and restore it after the game
One of slowest things you can do in vim is to substitute words/terms/suffix/prefix {pattern} on a file and/or across multiple files. A game that challenges users to apply many substitute techniques could be something interesting, specially when you need to use expressions and flags.
Thanks @ThePrimeagen for your awesome work!
Is there already a way to quickly restart the game?
Since this is for getting those Vim muscles trained up, I think it's crucial to have an easy way to just restart.
Maybe we could allow for !
in the command to ignore a file that is not empty and just get back to action.
Thanks for the awesome work โ๏ธ
Whenever I try to run :VimBeGood
in an empty file (or any file at all) in vim, I get an error saying:
E492: Not an editor command
.
I am running NeoVim version 0.4.3 and installed the plugin using VimPlug.
I followed the installation procedure in the README.md and restarted my terminal a few times. Anyone knows how to solve this?
Currently the offset is fixed if the user set the vim_be_good_delete_me_offset
config.
Otherwise the offset is 5 + a random number as seen bellow:
if (isDefindedUserOffset) {
offset = Number(
await game.nvim.getVar("vim_be_good_delete_me_offset"),
);
console.log("delete-round#getColumnOffset - userOffset ", offset);
} else {
offset = Math.floor(Math.random() * (40 - 5)) + 5;
What if instead we had something like:
var minOffset = {noob: 0, easy: 3, medium: 5, hard: 10, nightmare: 15, tpope: 30};
offset = Math.floor(Math.random() * (40 - 5)) + minOffset[game.difficulty];
After installing, when I run VimBeGood
I get the following message:
Error: nvim_create_buf: Invalid method: nvim_create_buf
I am guessing that means you need at least Neovim version X. I am on 0.3.2.
Especially for random mode it would be nice to have the quad a titles show up more frequently
Quad A (great for any level)
Relative
Whack a mole
Ci
Triple A (good till you become an intermediate vim user)
Hjkl
Double A (not common commands useful in certain contexts)
Something similar to the number game I wrote
Besides making sure the current buffer is empty, it would be nice to create a new buffer in the floating/popup buffer
Will add start and end screen later.
:VimBeGood
command is working (I have vim installed through apt install as I'm on Ubuntu + I installed neovim globally through npm thinking it could maybe solve the problem) and I get the menu screen but after deleting an item nothing happens.
I installed plugin using Plug and I'm using NVIM v0.2.2
Preview with :checkhealth
: https://asciinema.org/a/2h1f94vONvNqv4QrEfzt5SIuK
Anyone having a clue why it's not working?
Consider label usage (event build-in) to improve issues readability and searchability.
I think over time the number of issues probably significantly increases as the project will grow. Labels make a lot easier to navigate and search for issues.
Moreover, issues with labels just look cool.
Primeagen how to play more than 10 instances in a game.
I actually typed in :VimBeGod yesterday and it got me thinking. A new command like VimBeGod would be pretty cool.
It could start in a new ultra-hard difficulty, which only "Gods" could beat. If you do beat it, your name goes into a hall of fame section in the readme.
Just an idea. I really like the plugin btw.
Can we use sentences from vim help as stages for whackamole, this force to read a small part of help and learn about a new feature or just remind about forgotten ones?
Even if we jump through the senescent some part of it will remain and will be processed in 'background'.
To Reproduce
min.vim
:call plug#begin('~/.config/nvim/bundle/')
Plug 'ThePrimeagen/vim-be-good'
call plug#end()
nvim -u min.vim
:PlugInstall
:Up
function remote#host#UpdateRemotePlugins[6]..<SNR>26_RegistrationCommands[13]..remote#host#RegisterPlugin, line 5
Plugin "/home/jan/.config/nvim/bundle/vim-be-good/rplugin/node/vim-be-good" is already registered
remote/host: generated rplugin manifest: /home/jan/.local/share/nvim/rplugin.vim
:VimBeGood
E492: Not an editor command: VimBeGood
The game doesn't count the actions I made and I cannot rich the end and score.
How did I not see the sooner? This is literally the biggest complaint when first moving to vim.
Example: always be three keystrokes away from x
// _ = space for visual purposes
// o = starting position
// x = thing to delete
_ _ o
_ _ _
_ x _
This would require jjhx
to win.
Game to learn Multiline Editing
I thought of 3 different challenges:
Replace the contents of "quoted text" with bar.
Replace the contents of 'quoted text' with bar.
Replace the contents of `quoted text` with bar.
The random sentence presented should be something like:
bar `bar` bar "bar" bar bar bar 'bar'.
bar bar "bar 'bar' bar" `bar`.
bar "bar 'bar' `bar` bar".
bar "bar 'bar' bar `bar` bar".
The sentence may be randomly generated given that:
There should be a mode for random gameplay. Meaning that each game type should be able to be played per round.
It would be interesting to have a game that challenges the user to visually jump around, the idea is to make you jump fast to where your eyes are looking. Example: Words highlights randomly across file and user have few seconds to jump to it.
@brandoncc or polarmutex (what was your github name????)
Could you consider porting one game for me? Just to try it out and see how it goes?
After that, the lua lua branch can become master and all those shitty install instructions can go away.
We should update the user on new versions and instruct them to update if available.
We should save config settings such that when you set your options, difficulty, mode, etc etc (more options are inevitable) then we can restore them.
A lot of times you need to adjust the number of closing brackets. e.g.
(a(b(c(
de
)f)g))))))
Sometimes it can be a combination of {
, [
, and (
.
(a{b[c(
de
)f)g])})))
What is the fastest way to achieve this?
Perhaps create a game for this?
I would like to see simple guide on how to contribute to the project and test it locally.
I don't have any experience with js projects and I need simple steps what do to start to contribute.
Ex:
Something along these lines or just point to the video where these steps are made.
Its clear from about 10 days ago that that file sucks. It sucks in every way.
I like where Game and GameBuffer are going. I think they could use a bit more utility. But there appears to be something else that needs to be created. Some sort of runner that runs the game itself. This will allow for a couple things.
Thank you.
PS. I really hate that file.
I am using dein.vim as plugin manager
but am unable to start vim-be-good after installing it with it
for installing I am using the following line:
call dein#add('ThePrimeagen/vim-be-good')
And I see that it's installed but the command VimBeGood
is not recognized after the install.
I am not so sure how to debug this so will be glad if someone has any ideas or pointers.
It would be nice to save scores to file and later use them to check progression.
I think the file should contain:
With the popularity growing with this library its critical that it stays healthy. I will need to create a test suite to test for basic functionality and CI to ensure every PR keeps it nice. :)
I was coding a game during the steam last night on using Ctrl-a and Ctrl-x to increment and decrement a number to solve a math equation
Not sure if this game will have greater community interest but it is a less known command and pretty useful in certain contexts
I can polish it and submit a PR is there is interest
When playing the game I am unable to reach win state in any of the game modes (including my own).
Running:
:VimBeGood2 relative
I get the game count down:
1 Game is starting in 2 ...
~
~
~
Followed by the game state:
1 Game Started: 1 / 10
2 When you see a "DELETE ME", relative jump to it
3 as fast as possible and delete it.
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 DELETE ME
If I complete the task and by jumping to line 26 and deleting the contents of the line:
1 Game Started: 1 / 10
2 When you see a "DELETE ME", relative jump to it
3 as fast as possible and delete it.
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
The game does not register that I have completed the task. This applies to ci{
and my own game that I created.
My :checkhealth
for reference:
2 health#nvim#check
3 ========================================================================
4 ## Configuration
5 - OK: no issues found
6
7 ## Performance
8 - OK: Build type: RelWithDebInfo
9
10 ## Remote Plugins
11 - OK: Up to date
12
13 ## terminal
14 - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
15 - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
16 - INFO: $XTERM_VERSION=''
17 - INFO: $VTE_VERSION=''
18 - INFO: $TERM_PROGRAM=''
19 - INFO: $COLORTERM=''
20 - INFO: $SSH_TTY=''
21
22 ## tmux
23 - OK: escape-time: 0ms
24 - INFO: $TERM: screen-256color
25
26 health#provider#check
27 ========================================================================
28 ## Clipboard (optional)
29 - OK: Clipboard tool found: tmux
30
31 ## Python 2 provider (optional)
32 - INFO: `g:python_host_prog` is not set. Searching for python2 in the environment.
33 - INFO: Executable: /usr/bin/python2
34 - INFO: Python2 version: 2.7.15
35 - INFO: python2-neovim version: 0.2.0 (outdated; from /usr/lib/python2.7/dist-packages/neovim)
36 - WARNING: Latest python2-neovim is NOT installed: 0.3.1
37
38 ## Python 3 provider (optional)
39 - INFO: `g:python3_host_prog` is not set. Searching for python3 in the environment.
40 - INFO: Executable: /usr/bin/python3
41 - INFO: Python3 version: 3.6.8
42 - INFO: python3-neovim version: 0.2.0 (outdated; from /usr/lib/python3/dist-packages/neovim)
43 - WARNING: Latest python3-neovim is NOT installed: 0.3.1
44
45 ## Ruby provider (optional)
46 - WARNING: `ruby` and `gem` must be in $PATH.
47 - ADVICE:
48 - Install Ruby and verify that `ruby` and `gem` commands work.
49
50 ## Node provider (optional)
51 - INFO: Node: v12.16.2
52 - INFO: Host: /usr/local/bin/neovim-node-host
53 - OK: Latest "neovim" npm is installed: 4.8.0
54
After debugging, it appears that the lines
event does not get invoked on changes to the game state. I confirmed this by adding printouts when checkForWin
is called and it was never called. I added a call to checkForWin outside the event and the printout worked.
I attempted to look into the events provided by neovim and if they changed over different versions, but there seems to be very little information regarding the actual events that are available (Perhaps they are shared as part of the original vim documentation, however, I have not looked into that yet).
I am not sure where to look into the events provided by Neovim and if that would be the actual cause of the issue?
Perhaps someone else has insight into this issue?
Install nvim using chocolatey.
choco install neovim --version=0.4.2
install plug.vim inside:
AppData\Local\nvim\autoload
create your init.vim inside:
AppData\Local\nvim
install nodejs
and follow the README
https://github.com/ThePrimeagen/vim-be-good/blob/master/README.md
I would like to have an option to disable timeouts and practice as long as I want regardless of my reaction time.
It would be nice if I could set let g:vim_be_good_practice_mode = 1
or select such an option on the game menu.
Improve logging such that whilst bugs come in, I have a way to debug them.
Hey there,
at the moment im kinda overwhelmed with the speed of all the games other then 'hjkl' but i also have not used vim a my main editor. I tried 'vim-be-good' and i really like the idea. The only thing is that for me the speed of the refresh is to fast.
Would it be possible to add a "untimed" mode for noobs where yo can take your time to think of the proper vim movement and execute it "in peace"?
Sorry for not doing this.
Inspiration:
I'm new with dvorak, I'm new with vim. All games are useful for me, but still need to get familiar with something like this:
// Imagine you want to write a simple function
function foo() {
return "bar";
}
Quite simple but, I needed to learn (improve my muscle memory) to do:
i
(or o
)function
as fast as possible (ignore the function name)(
and )
plus a space
plus a {
as fast as possibleenter
, add }
, press Ctrl+c
then Shift+o
and finally write the return statementThe same for classes, types, arrow functions, reserved words...
The main goal is to get better with that kind of vim command sequences Ctrl+c Shift+o
, Ctrl+c :w
, and commonly used chars like $+[{(&=)}]*!|/@-\?^_#
. You all have way more experience with vim and could give me more suggestions.
I'll be working on it to learn how to write a plugin, and to get better with the real-programmer-dvorak
layout xD
g:vim_be_good_floating defaults to zero if not present, which is not using floating buffer
so either the README needs updating or change the logic to make floating default
A game that challenges and make user practices surrounding words/terms with different brackets/quotes even using the famous Tim Pope's plugin surround.vim.
Hello, What about saving your scores to file so you can track your improvement.
Every 'relative' game starts from stage 2.
Step to reproduce:
Choose any difficulty level -> choose 'relative' -> wait for level indicator
Having a docker image will allow for more portability.
Folks won't have to install neovim
if they are coming from OG vim.
No globally installed npm
Packages!
I found this docker image for neovim
which might a good starting point.
We can strip it down to the bare necessities and add VimBeGood
on top.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.