From 821143968581bbdfee5ddae20b58d77cc202ea7f Mon Sep 17 00:00:00 2001 From: Zak Greant Date: Sat, 15 Aug 2015 12:41:24 +0200 Subject: [PATCH 1/3] J.A. (Zak) Greant Copyright Waiver I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. From b2cff3f42086e3ab63f8d2d8df7dd48d42e25938 Mon Sep 17 00:00:00 2001 From: Zak Greant Date: Sat, 15 Aug 2015 12:45:10 +0200 Subject: [PATCH 2/3] Generate normal mode reference Parse entries out of the cmds array in normal.cc, then generate a sorted list of key bindings as an HTML table. --- contrib/kakmap.rb | 61 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 contrib/kakmap.rb diff --git a/contrib/kakmap.rb b/contrib/kakmap.rb new file mode 100755 index 000000000..33b61639c --- /dev/null +++ b/contrib/kakmap.rb @@ -0,0 +1,61 @@ +#!/usr/bin/env ruby + +# Generate a reference sheet for Kakoune's normal mode +# Use: ./kakmap.rb ../src/normal.cc + +require 'markaby' + +# Relies on the cmds array assignment ending with }; +raw = ARGF.read.split( /cmds\[\] =\s+{\s*/m ).last.split( /^};$/ ).first + +commands = {} + +# break code into lines +raw.split( /\n+/ ).each{ |line| + line.gsub!( /(^\s*{\s*|\s*},?\*$)/, '' ) # discard wrapping for array elements + + mod = (line.scan( /^alt|^ctrl/ ).first || 'none').to_sym + key = line.scan(/(?:^Key::(\w+)|(?.*?)(? Date: Sat, 15 Aug 2015 16:46:57 +0200 Subject: [PATCH 3/3] Fixing minor typo s/prevous/previous/ --- src/normal.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/normal.cc b/src/normal.cc index 90487fc0c..0a824cf1b 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -1520,17 +1520,17 @@ static NormalCmdDesc cmds[] = { 'w', "select to next word start", repeated<&select>> }, { 'e', "select to next word end", repeated>> }, - { 'b', "select to prevous word start", repeated>> }, + { 'b', "select to previous word start", repeated>> }, { 'W', "extend to next word start", repeated>> }, { 'E', "extend to next word end", repeated>> }, - { 'B', "extend to prevous word start", repeated>> }, + { 'B', "extend to previous word start", repeated>> }, { alt('w'), "select to next WORD start", repeated>> }, { alt('e'), "select to next WORD end", repeated>> }, - { alt('b'), "select to prevous WORD start", repeated>> }, + { alt('b'), "select to previous WORD start", repeated>> }, { alt('W'), "extend to next WORD start", repeated>> }, { alt('E'), "extend to next WORD end", repeated>> }, - { alt('B'), "extend to prevous WORD start", repeated>> }, + { alt('B'), "extend to previous WORD start", repeated>> }, { alt('l'), "select to line end", repeated>> }, { Key::End, "select to line end", repeated>> },