vimgolf 0.4.5 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +2 -10
- data/lib/vimgolf.rb +3 -0
- data/lib/vimgolf/challenge.rb +70 -45
- data/lib/vimgolf/cli.rb +96 -31
- data/lib/vimgolf/keylog.rb +253 -207
- data/lib/vimgolf/ui.rb +13 -1
- data/lib/vimgolf/version.rb +1 -1
- data/lib/vimgolf/vimgolf.vimrc +28 -0
- metadata +110 -91
- data/.gitignore +0 -4
- data/.gitmodules +0 -3
- data/.rspec +0 -0
- data/Gemfile +0 -4
- data/Gemfile.lock +0 -30
- data/Rakefile +0 -10
- data/emacs/README.md +0 -69
- data/emacs/ROADMAP.md +0 -69
- data/emacs/features/emacs.feature +0 -24
- data/emacs/features/step-definitions/emacs-steps.el +0 -53
- data/emacs/features/support/env.el +0 -37
- data/emacs/todo.org +0 -45
- data/emacs/vimgolf.el +0 -484
- data/spec/challenge_spec.rb +0 -31
- data/spec/cli_spec.rb +0 -25
- data/spec/fixtures/4d19832d8ae121365c00000b.log +0 -1
- data/spec/fixtures/4d1a1c36567bac34a9000002.log +0 -1
- data/spec/fixtures/4d1a1c69567bac34a9000004.log +0 -1
- data/spec/fixtures/4d1a21e88ae121365c00000e.log +0 -1
- data/spec/fixtures/4d1a34ccfa85f32065000004.log +0 -1
- data/spec/helper.rb +0 -25
- data/spec/keylog_spec.rb +0 -16
- data/vimgolf.gemspec +0 -42
data/lib/vimgolf/ui.rb
CHANGED
@@ -40,6 +40,18 @@ module VimGolf
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
+
# Take list of keystrokes, pretty-print them
|
44
|
+
def print_log(strokes)
|
45
|
+
strokes.each do |stroke|
|
46
|
+
if stroke.length == 1 # not a special character
|
47
|
+
say stroke, color=nil, force_new_line=false
|
48
|
+
else
|
49
|
+
say stroke, color=:red, force_new_line=false
|
50
|
+
end
|
51
|
+
end
|
52
|
+
say
|
53
|
+
end
|
54
|
+
|
43
55
|
def debug(name, message = nil)
|
44
56
|
return unless ENV["DEBUG"]
|
45
57
|
|
@@ -127,7 +139,7 @@ module VimGolf
|
|
127
139
|
print_table(table, :ident => 2, :truncate => true, :colwidth => 20)
|
128
140
|
end
|
129
141
|
|
130
|
-
def set_color(string,
|
142
|
+
def set_color(string, *colors)
|
131
143
|
($stdout.tty? || ENV['THOR_SHELL']) ? super : string
|
132
144
|
end
|
133
145
|
|
data/lib/vimgolf/version.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
" http://vimdoc.sourceforge.net/htmldoc/starting.html#vimrc
|
2
|
+
|
3
|
+
set nocompatible " use vim defaults
|
4
|
+
set scrolloff=3 " keep 3 lines when scrolling
|
5
|
+
set ai " set auto-indenting on for programming
|
6
|
+
|
7
|
+
set showcmd " display incomplete commands
|
8
|
+
set nobackup " do not keep a backup file
|
9
|
+
set number " show line numbers
|
10
|
+
set ruler " show the current row and column
|
11
|
+
|
12
|
+
set hlsearch " highlight searches
|
13
|
+
set incsearch " do incremental searching
|
14
|
+
set showmatch " jump to matches when entering regexp
|
15
|
+
set ignorecase " ignore case when searching
|
16
|
+
set smartcase " no ignorecase if Uppercase char present
|
17
|
+
|
18
|
+
set visualbell t_vb= " turn off error beep/flash
|
19
|
+
set novisualbell " turn off visual bell
|
20
|
+
|
21
|
+
set backspace=indent,eol,start " make that backspace key work the way it should
|
22
|
+
set runtimepath=$VIMRUNTIME " turn off user scripts, https://github.com/igrigorik/vimgolf/issues/129
|
23
|
+
|
24
|
+
syntax on " turn syntax highlighting on by default
|
25
|
+
filetype on " detect type of file
|
26
|
+
filetype indent on " load indent file for specific file type
|
27
|
+
|
28
|
+
set t_RV= " http://bugs.debian.org/608242, http://groups.google.com/group/vim_dev/browse_thread/thread/9770ea844cec3282
|
metadata
CHANGED
@@ -1,97 +1,159 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vimgolf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Ilya Grigorik
|
9
|
-
autorequire:
|
8
|
+
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2021-05-28 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: thor
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0
|
19
|
+
version: '1.0'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.0.1
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
25
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.0'
|
30
|
+
- - ">="
|
28
31
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
32
|
+
version: 1.0.1
|
30
33
|
- !ruby/object:Gem::Dependency
|
31
34
|
name: json_pure
|
32
35
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
36
|
requirements:
|
35
|
-
- -
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '2.3'
|
40
|
+
- - ">="
|
36
41
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
42
|
+
version: 2.3.1
|
38
43
|
type: :runtime
|
39
44
|
prerelease: false
|
40
45
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
46
|
requirements:
|
43
|
-
- -
|
47
|
+
- - "~>"
|
44
48
|
- !ruby/object:Gem::Version
|
45
|
-
version: '
|
49
|
+
version: '2.3'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 2.3.1
|
46
53
|
- !ruby/object:Gem::Dependency
|
47
54
|
name: highline
|
48
55
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
56
|
requirements:
|
51
|
-
- -
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '2.0'
|
60
|
+
- - ">="
|
52
61
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
62
|
+
version: 2.0.3
|
54
63
|
type: :runtime
|
55
64
|
prerelease: false
|
56
65
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
66
|
requirements:
|
59
|
-
- -
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '2.0'
|
70
|
+
- - ">="
|
60
71
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
72
|
+
version: 2.0.3
|
62
73
|
- !ruby/object:Gem::Dependency
|
63
74
|
name: rspec
|
64
75
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
76
|
requirements:
|
67
|
-
- -
|
77
|
+
- - ">="
|
68
78
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
79
|
+
version: 3.7.0
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.7'
|
70
83
|
type: :development
|
71
84
|
prerelease: false
|
72
85
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
86
|
requirements:
|
75
|
-
- -
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 3.7.0
|
90
|
+
- - "~>"
|
76
91
|
- !ruby/object:Gem::Version
|
77
|
-
version: '
|
92
|
+
version: '3.7'
|
78
93
|
- !ruby/object:Gem::Dependency
|
79
94
|
name: rake
|
80
95
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
96
|
requirements:
|
83
|
-
- -
|
97
|
+
- - "~>"
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '12.3'
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 12.3.1
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '12.3'
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 12.3.1
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: climate_control
|
115
|
+
requirement: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - "~>"
|
84
118
|
- !ruby/object:Gem::Version
|
85
|
-
version: '0'
|
119
|
+
version: '0.2'
|
86
120
|
type: :development
|
87
121
|
prerelease: false
|
88
122
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
123
|
requirements:
|
91
|
-
- -
|
124
|
+
- - "~>"
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0.2'
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: rexml
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - "~>"
|
92
132
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
94
|
-
|
133
|
+
version: 3.1.9
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - "~>"
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: 3.1.9
|
141
|
+
- !ruby/object:Gem::Dependency
|
142
|
+
name: webmock
|
143
|
+
requirement: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - "~>"
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '3.13'
|
148
|
+
type: :development
|
149
|
+
prerelease: false
|
150
|
+
version_requirements: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - "~>"
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '3.13'
|
155
|
+
description: Real Vim ninjas count every keystroke - do you? Pick a challenge on vimgolf.com,
|
156
|
+
fire up Vim, and show us what you got.
|
95
157
|
email:
|
96
158
|
- ilya@igvita.com
|
97
159
|
executables:
|
@@ -99,21 +161,8 @@ executables:
|
|
99
161
|
extensions: []
|
100
162
|
extra_rdoc_files: []
|
101
163
|
files:
|
102
|
-
- .gitignore
|
103
|
-
- .gitmodules
|
104
|
-
- .rspec
|
105
|
-
- Gemfile
|
106
|
-
- Gemfile.lock
|
107
164
|
- README.md
|
108
|
-
- Rakefile
|
109
165
|
- bin/vimgolf
|
110
|
-
- emacs/README.md
|
111
|
-
- emacs/ROADMAP.md
|
112
|
-
- emacs/features/emacs.feature
|
113
|
-
- emacs/features/step-definitions/emacs-steps.el
|
114
|
-
- emacs/features/support/env.el
|
115
|
-
- emacs/todo.org
|
116
|
-
- emacs/vimgolf.el
|
117
166
|
- lib/vimgolf.rb
|
118
167
|
- lib/vimgolf/challenge.rb
|
119
168
|
- lib/vimgolf/cli.rb
|
@@ -121,71 +170,41 @@ files:
|
|
121
170
|
- lib/vimgolf/keylog.rb
|
122
171
|
- lib/vimgolf/ui.rb
|
123
172
|
- lib/vimgolf/version.rb
|
124
|
-
-
|
125
|
-
- spec/cli_spec.rb
|
126
|
-
- spec/fixtures/4d19832d8ae121365c00000b.log
|
127
|
-
- spec/fixtures/4d1a1c36567bac34a9000002.log
|
128
|
-
- spec/fixtures/4d1a1c69567bac34a9000004.log
|
129
|
-
- spec/fixtures/4d1a21e88ae121365c00000e.log
|
130
|
-
- spec/fixtures/4d1a34ccfa85f32065000004.log
|
131
|
-
- spec/helper.rb
|
132
|
-
- spec/keylog_spec.rb
|
133
|
-
- vimgolf.gemspec
|
173
|
+
- lib/vimgolf/vimgolf.vimrc
|
134
174
|
homepage: http://github.com/igrigorik/vimgolf
|
135
|
-
licenses:
|
136
|
-
|
175
|
+
licenses:
|
176
|
+
- MIT
|
177
|
+
metadata: {}
|
178
|
+
post_install_message: |2
|
137
179
|
|
138
180
|
------------------------------------------------------------------------------
|
139
|
-
|
140
|
-
Thank you for installing vimgolf-0.4.5.
|
141
|
-
|
181
|
+
Thank you for installing vimgolf-0.5.0.
|
142
182
|
|
143
183
|
0.1.3: custom vimgolf .vimrc file to help level the playing field
|
144
|
-
|
145
184
|
0.2.0: proxy support, custom diffs + proper vimscript parser/scoring
|
146
|
-
|
147
185
|
0.3.0: improve windows support, switch to YAML to remove c-ext dependency
|
148
|
-
|
149
186
|
0.4.0: improved diff/retry CLI, emacs support: http://bit.ly/yHgOPF
|
150
187
|
|
151
|
-
|
152
188
|
*NOTE*: please re-run "vimgolf setup" prior to playing!
|
153
189
|
|
154
|
-
|
155
190
|
For more information, rules & updates: http://vimgolf.com/about
|
156
|
-
|
157
191
|
------------------------------------------------------------------------------
|
158
|
-
|
159
|
-
'
|
160
192
|
rdoc_options: []
|
161
193
|
require_paths:
|
162
194
|
- lib
|
163
195
|
required_ruby_version: !ruby/object:Gem::Requirement
|
164
|
-
none: false
|
165
196
|
requirements:
|
166
|
-
- -
|
197
|
+
- - ">="
|
167
198
|
- !ruby/object:Gem::Version
|
168
|
-
version: '0'
|
199
|
+
version: '2.0'
|
169
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
|
-
none: false
|
171
201
|
requirements:
|
172
|
-
- -
|
202
|
+
- - ">="
|
173
203
|
- !ruby/object:Gem::Version
|
174
204
|
version: '0'
|
175
205
|
requirements: []
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
specification_version: 3
|
206
|
+
rubygems_version: 3.0.3.1
|
207
|
+
signing_key:
|
208
|
+
specification_version: 4
|
180
209
|
summary: CLI client for vimgolf.com
|
181
|
-
test_files:
|
182
|
-
- spec/challenge_spec.rb
|
183
|
-
- spec/cli_spec.rb
|
184
|
-
- spec/fixtures/4d19832d8ae121365c00000b.log
|
185
|
-
- spec/fixtures/4d1a1c36567bac34a9000002.log
|
186
|
-
- spec/fixtures/4d1a1c69567bac34a9000004.log
|
187
|
-
- spec/fixtures/4d1a21e88ae121365c00000e.log
|
188
|
-
- spec/fixtures/4d1a34ccfa85f32065000004.log
|
189
|
-
- spec/helper.rb
|
190
|
-
- spec/keylog_spec.rb
|
191
|
-
has_rdoc:
|
210
|
+
test_files: []
|
data/.gitignore
DELETED
data/.gitmodules
DELETED
data/.rspec
DELETED
File without changes
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
vimgolf (0.4.0)
|
5
|
-
highline
|
6
|
-
thor (>= 0.14.6)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: http://rubygems.org/
|
10
|
-
specs:
|
11
|
-
diff-lcs (1.1.3)
|
12
|
-
highline (1.6.11)
|
13
|
-
rake (0.9.2.2)
|
14
|
-
rspec (2.9.0)
|
15
|
-
rspec-core (~> 2.9.0)
|
16
|
-
rspec-expectations (~> 2.9.0)
|
17
|
-
rspec-mocks (~> 2.9.0)
|
18
|
-
rspec-core (2.9.0)
|
19
|
-
rspec-expectations (2.9.0)
|
20
|
-
diff-lcs (~> 1.1.3)
|
21
|
-
rspec-mocks (2.9.0)
|
22
|
-
thor (0.14.6)
|
23
|
-
|
24
|
-
PLATFORMS
|
25
|
-
ruby
|
26
|
-
|
27
|
-
DEPENDENCIES
|
28
|
-
rake
|
29
|
-
rspec
|
30
|
-
vimgolf!
|
data/Rakefile
DELETED
data/emacs/README.md
DELETED
@@ -1,69 +0,0 @@
|
|
1
|
-
# VimGolf Minor Mode Roadmap
|
2
|
-
|
3
|
-
## Features
|
4
|
-
|
5
|
-
1. Completing read of challenges by title rather than by challenge id
|
6
|
-
|
7
|
-
2. `M-x vimgolf-browse`: Dired/Ibuffer/Magit-like interface to VimGolf challenges.
|
8
|
-
|
9
|
-
Bindings:
|
10
|
-
|
11
|
-
- Bindings should mimic Dired/Ibuffer wherever possible. Magit is listed primarily because I want TAB to open up the long description of the challenge.
|
12
|
-
|
13
|
-
At least:
|
14
|
-
|
15
|
-
- n/p
|
16
|
-
- ENTER/o: launch `vimgolf` with the correct arg.
|
17
|
-
|
18
|
-
Interface Mockup:
|
19
|
-
|
20
|
-
VimGolf in Emacs! Compete on vimgolf with the One True Editor.
|
21
|
-
|
22
|
-
Sort entries based on date - Sort some entries in a Ledger-file based on date.
|
23
|
-
PHP Array Syntax -> MailChimp Merge Syntax - I recently needed to send an e-m...
|
24
|
-
Refactor to Helpers
|
25
|
-
This Rails partial is almost all template escapes. Put it into a helper,
|
26
|
-
and refactor each case to methods so we can build out the controls for
|
27
|
-
each. (I've converted to tabs - fighting with Vimgolf's default config
|
28
|
-
shouldn't be part of the challenge.)
|
29
|
-
|
30
|
-
Alphabetize the directory - Put the contacts and their information in alphabe...
|
31
|
-
PHP <--> Java class conversion Part 2 - Same class but reverse!
|
32
|
-
PHP <--> Java class conversion Part 1 - Convert this tiny php class to adequa...
|
33
|
-
Multiplication table. - Create a multiplication table.
|
34
|
-
Complete the hex array data (Part II) - Do not use external tools(e.g. tac, s...
|
35
|
-
Interweave two blocks of text - Suppose you've got data on a list of things f...
|
36
|
-
.
|
37
|
-
.
|
38
|
-
.
|
39
|
-
|
40
|
-
--------------------------------------------------------------------------------
|
41
|
-
|
42
|
-
Commentary:
|
43
|
-
|
44
|
-
- Tab has been pressed on the Refactor to Helpers line and thus it's been expanded.
|
45
|
-
|
46
|
-
- The challenges `formatted text to markdown` and `Line Zipper` have both been completed and thus are hidden. Could provide a customization setting that turns this off completely, as well as an `M-x vimgolf-show-all` function to toggle the hiding.
|
47
|
-
|
48
|
-
- Fill column has been set to 80
|
49
|
-
|
50
|
-
- It would be fun if a local cache of the vimgolf data could be kept together so that you could record solutions or at least play offline.
|
51
|
-
|
52
|
-
3. Real submission to vimgolf.
|
53
|
-
|
54
|
-
This could look like:
|
55
|
-
|
56
|
-
Pop-open buffer
|
57
|
-
|
58
|
-
You solved the formatted text to markdown challenge in 25 keystrokes! The best entry for this challenge was 23.
|
59
|
-
|
60
|
-
M-x qrr ;; query-replace-regexp
|
61
|
-
SPC*2 ;; self-insert-command
|
62
|
-
dummy ;; self-insert-command * 5
|
63
|
-
.
|
64
|
-
.
|
65
|
-
.
|
66
|
-
|
67
|
-
Mini-buffer
|
68
|
-
|
69
|
-
Submit to your solution to vimgolf? <y-or-n-predicate>
|