Permalink
Browse files

Added quotes file. Added unsorted kata master file.

Replaced numbered questions with (#) placeholder.
Added more questions to white belt.
  • Loading branch information...
1 parent 1d46ceb commit 48f96dc6774b44e4fdd9e6408e3df27479b63cb5 @canadaduane committed May 31, 2010
Showing with 246 additions and 66 deletions.
  1. +4 −4 ftplugin/kata.vim
  2. +126 −0 ftplugin/test.vim
  3. +17 −0 quotes.txt
  4. +43 −0 unsorted.master
  5. +56 −62 vim_1_white.master
View
@@ -3,10 +3,10 @@
" Maintainer: Duane Johnson
" Only do this when not done yet for this buffer
-if exists("b:did_ftplugin")
- finish
-endif
-let b:did_ftplugin = 1
+" if exists("b:did_ftplugin")
+" finish
+" endif
+" let b:did_ftplugin = 1
" preserve user's options
let s:save_cpo = &cpo
View
@@ -0,0 +1,126 @@
+
+setlocal statusline=Time:\ \ %{ShowBufferTime()}
+
+function! Renumber() range
+ let b:k_count = 1
+ exe a:firstline . ',' . a:lastline . "g/^(\\d\\+/s//\\='('.b:k_count/ | let b:k_count += 1"
+endfunction
+
+function! GroupRenumber()
+ let group_boundary = '^\[.\{-}\]$'
+ " Locate the boundary of the group we're in
+ let firstline = search(group_boundary,'bnW') + 1
+ let lastline = search(group_boundary, 'nW') - 1
+ if lastline < 0
+ let lastline = line('$')
+ endif
+ exe firstline . ',' . lastline 'call Renumber()'
+endfunction
+
+function! NextQuestion()
+ call search("^(\\d\\+)")
+ normal j
+endfunction
+
+function! NextQuestionWithPrep()
+ call StopRecording()
+ call NextQuestion()
+ call ExecutePreparation()
+ if !exists("g:StartBufferTime")
+ let g:StartBufferTime = GetClock()
+ endif
+ let g:StartQuestionTime = GetClock()
+ call StartRecording()
+endfunction
+
+function! PrevQuestion()
+ call ThisQuestion()
+ normal k
+ call ThisInput()
+endfunction
+
+function! ThisQuestion()
+ call search("^(\\d\\+)", "bc")
+endfunction
+
+function! ThisInput()
+ call ThisQuestion()
+ normal j
+endfunction
+
+function! ThisAnswer()
+ call ThisQuestion()
+ call search("^>")
+ normal ll
+endfunction
+
+function! ThisPreparationLine()
+ call ThisQuestion()
+ let prepline = search("^<", "nW", search("^(\\d\\+)", "nW"))
+ return prepline
+endfunction
+
+function! ExecuteAnswer()
+ call ThisAnswer()
+ exe "normal \"ay$"
+ call ThisInput()
+ exe "normal @a"
+endfunction
+
+function! ExecutePreparation()
+ let prepline = ThisPreparationLine()
+ if prepline > 0
+ exe prepline + "G"
+ normal ll
+ exe "normal \"ay$"
+ call ThisInput()
+ exe "normal @a"
+ else
+ call ThisInput()
+ end
+endfunction
+
+function! GetClock()
+ let l:now = (strftime("%I") * 3600) + (strftime("%M") * 60) + (strftime("%S"))
+ return l:now
+endfunction
+
+function! StartRecording()
+ exe "normal qY"
+endfunction
+
+function! StopRecording()
+ exe "normal q"
+endfunction
+
+function! ClearRecording()
+ let @y = ""
+endfunction
+
+function! ShowBufferTime()
+ let l:now = GetClock()
+ if exists("g:StartBufferTime")
+ let l:diff = l:now - g:StartBufferTime
+ return l:diff
+ else
+ return 0
+ endif
+endfunction
+
+function! CalcCPM()
+ let l:now = GetClock()
+ let l:diff = l:now - g:StartQuestionTime
+ if l:diff <= 0
+ return 0
+ else
+ let l:cpm = strlen(@y) * 60 / l:diff
+ return l:cpm
+ endif
+endfunction
+
+" maps
+nnoremap Q :call NextQuestionWithPrep()<CR>
+nnoremap <LocalLeader>kn NextQuestion()<CR>
+nnoremap <LocalLeader>kp PrevQuestion()<CR>
+
+
View
@@ -0,0 +1,17 @@
+
++-----------------------------------------------------------------------------+
+| Unused Quotes |
++-----------------------------------------------------------------------------+
+
+Who overcomes by force, hath overcome but half his foe.
+~ John Milton
+
+Seek not to follow in the footsteps of men of old; seek what they sought.
+~ Matsu Basho
+
+There are two rules for being successful in martial arts.
+Rule 1: Never tell others everything you know.
+
+The end of one kata is the beginning of another.
+
+Excellence is our goal; deliberate practice is what we praise.
View
@@ -0,0 +1,43 @@
+(#) Using :m and a mark, move odd lines to below the dashed line:
+1. Create a mark by using 'm' and a letter such as 'a'
+2. Move the cursor to a line that needs to be moved
+3. Use :m'a to send the line to the marked line
+-----
+
+> /-ma3k:m'a2k:m'a
+
+(#) Using :m, move odd` lines to below the 'a' mark and even lines to below the 'b' mark:
+1. Try not to pause between keystrokes
+2. Aim for consistent, steady normal mode typing
+3. With practice, normal mode can be as fast as insertion mode.
+
+-- a mark --
+-- b mark --
+
+< /a markma/b markmb:noh5k0
+> :m'a5k:m'b3k:m'a
+
+(#) Using :m, a mark, and visual mode, move the following two lines to below the dashed line:
+Who overcomes by force, hath overcome but half his foe.
+~ John Milton
+-----
+
+> 2jma2kVj:m'a
+
+(#) Each of the following lines has been marked. Using ]' and [', navigate to the 5th, 1st, then 3rd mark:
+This line has been marked with an 'a'
+This line has been marked with a 'b'
+This line has been marked with a 'c'
+This line has been marked with a 'd'
+This line has been marked with an 'e'
+
+< majmbjmcjmdjme4k
+> 5]'2['2['
+
+(#) Using :pu, move the capitalized words below the 'a' mark:
+There are two RULES for being SUCCESSFUL in martial arts.
+Rule 1: Never tell others EVERYTHING you know.
+-- a mark --
+
+< /-ma2k/[A-Z]\{2,}
+> yw:'apuNNyw:'apuNyw:'apu
Oops, something went wrong.

0 comments on commit 48f96dc

Please sign in to comment.