From 80410786185ef811be074084611952921febecb6 Mon Sep 17 00:00:00 2001 From: actionless Date: Thu, 11 Feb 2016 00:26:57 +0100 Subject: [PATCH 1/4] chore(awful: hotkeys: vim): small improvements in hotkeys descriptions --- lib/awful/hotkeys_popup/keys/vim.lua | 64 ++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 18 deletions(-) diff --git a/lib/awful/hotkeys_popup/keys/vim.lua b/lib/awful/hotkeys_popup/keys/vim.lua index 2c03360c0..fce68b18b 100644 --- a/lib/awful/hotkeys_popup/keys/vim.lua +++ b/lib/awful/hotkeys_popup/keys/vim.lua @@ -37,32 +37,43 @@ local vim_keys = { [';']="repeat t/T/f/F", ["'"]=". goto mk. BOL", b="prev word", - n="next word", + n="next search match", [',']="reverse t/T/f/F", ['/']=". find", ['~']="toggle case", ["#"]='prev indent', ["$"]='EOL', - ["%"]='goto match bracket', + ["%"]='goto matching bracket', ["^"]='"soft" BOL', - ["*"]='next indent', - ["("]='begin sentence', - [")"]='end sentence', + ["*"]='search word under cursor', + ["("]='sentence begin', + [")"]='sentence end', ["_"]='"soft" BOL down', ["+"]='next line', W='next WORD', E='end WORD', - T=". back 'till", - ['{']="begin parag.", - ['}']="end parag.", + T=". \"back\" 'till", + ['{']="paragraph begin", + ['}']="paragraph end", F='. "back" find char', G='EOF/goto line', - H='screen top', - L='screen bottom', + H='move cursor to screen top', + M='move cursor to screen middle', + L='move cursor to screen bottom', B='prev WORD', - N='prev (find)', - M='screen middle', - ['?']='. find(rev.)', + N='prev search match', + ['?']='. "back" find', + } + }, { + modifiers = {"Ctrl"}, + keys = { + e="scroll line up", + y="scroll line down", + u="half page up", + d="half page down", + b="page up", + f="page down", + o="prev mark", } }}, @@ -86,8 +97,11 @@ local vim_keys = { r=". replace char", u="undo", p="paste after", - g="gg: top of file, gf: open file here", - z="zt: cursor to top, zb: bottom, zz: center", + gg="go to the top of file", + gf="open file under cursor", + zt="scroll cursor to the top", + zz="scroll cursor to the center", + zb="scroll cursor to the bottom", x="delete char", v="visual mode", m=". set mark", @@ -97,16 +111,30 @@ local vim_keys = { Q='ex mode', Y='yank line', U='undo line', - P='paste before', + P='paste before cursor', D='delete to EOL', J='join lines', K='help', [':']='ex cmd line', ['"']='. register spec', ["|"]='BOL/goto col', - Z='quit and ZZ:save or ZQ:not', + ZZ='quit and save', + ZQ='quit discarding changes', X='back-delete', - V='visual lines', + V='visual lines selection', + } + }, { + modifiers = {"Ctrl"}, + keys = { + w=". window operations", + r="redo", + ["["]="normal mode", + a="increase number", + x="decrease number", + g="file/cursor info", + z="suspend", + c="cancel/normal mode", + v="visual block selection", } }}, From e5466feb0744d89560146ddfd3fad7bb20986956 Mon Sep 17 00:00:00 2001 From: actionless Date: Fri, 12 Feb 2016 00:49:54 +0100 Subject: [PATCH 2/4] fix(awesomerc): fix importing vim hotkeys --- awesomerc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awesomerc.lua b/awesomerc.lua index 1344e171f..2a0c9f803 100755 --- a/awesomerc.lua +++ b/awesomerc.lua @@ -10,7 +10,7 @@ local beautiful = require("beautiful") -- Notification library local naughty = require("naughty") local menubar = require("menubar") -local hotkeys_popup = require("awful.hotkeys_popup.widget") +local hotkeys_popup = require("awful.hotkeys_popup").widget -- {{{ Error handling -- Check if awesome encountered an error during startup and fell back to From 36e124d894d681999cb1f9817458384b289d7634 Mon Sep 17 00:00:00 2001 From: actionless Date: Fri, 12 Feb 2016 00:50:55 +0100 Subject: [PATCH 3/4] chore(awful: hotkeys: vim): add `find` and `scroll` categories --- lib/awful/hotkeys_popup/keys/vim.lua | 56 +++++++++++++++++----------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/lib/awful/hotkeys_popup/keys/vim.lua b/lib/awful/hotkeys_popup/keys/vim.lua index fce68b18b..94ab675c8 100644 --- a/lib/awful/hotkeys_popup/keys/vim.lua +++ b/lib/awful/hotkeys_popup/keys/vim.lua @@ -13,8 +13,10 @@ local vim_rule_any = {name={"vim", "VIM"}} for group_name, group_data in pairs({ vim_motion= { color="#009F00", rule_any=vim_rule_any }, vim_command= { color="#aFaF00", rule_any=vim_rule_any }, - vim_command_insert= { color="#cF4F40", rule_any=vim_rule_any }, - vim_operator= { color="#aF6F00", rule_any=vim_rule_any }, + vim_command_insert= { color="#cF4F40", rule_any=vim_rule_any }, + vim_operator= { color="#aF6F00", rule_any=vim_rule_any }, + vim_find= { color="#65cF9F", rule_any=vim_rule_any }, + vim_scroll= { color="#659FdF", rule_any=vim_rule_any }, }) do hotkeys_popup.group_rules[group_name] = group_data end @@ -30,45 +32,31 @@ local vim_keys = { ['-']="prev line", w="next word", e="end word", - t=". 'till", ['[']=". misc", [']']=". misc", - f=". find char", - [';']="repeat t/T/f/F", ["'"]=". goto mk. BOL", b="prev word", - n="next search match", - [',']="reverse t/T/f/F", - ['/']=". find", - ['~']="toggle case", - ["#"]='prev indent', + ["|"]='BOL/goto col', ["$"]='EOL', ["%"]='goto matching bracket', ["^"]='"soft" BOL', - ["*"]='search word under cursor', ["("]='sentence begin', [")"]='sentence end', ["_"]='"soft" BOL down', ["+"]='next line', W='next WORD', E='end WORD', - T=". \"back\" 'till", ['{']="paragraph begin", ['}']="paragraph end", - F='. "back" find char', G='EOF/goto line', H='move cursor to screen top', M='move cursor to screen middle', L='move cursor to screen bottom', B='prev WORD', - N='prev search match', - ['?']='. "back" find', } }, { modifiers = {"Ctrl"}, keys = { - e="scroll line up", - y="scroll line down", u="half page up", d="half page down", b="page up", @@ -93,15 +81,13 @@ local vim_keys = { vim_command={{ modifiers = {}, keys = { + ['~']="toggle case", q=". record macro", r=". replace char", u="undo", p="paste after", gg="go to the top of file", gf="open file under cursor", - zt="scroll cursor to the top", - zz="scroll cursor to the center", - zb="scroll cursor to the bottom", x="delete char", v="visual mode", m=". set mark", @@ -117,7 +103,6 @@ local vim_keys = { K='help', [':']='ex cmd line', ['"']='. register spec', - ["|"]='BOL/goto col', ZZ='quit and save', ZQ='quit discarding changes', X='back-delete', @@ -153,6 +138,35 @@ local vim_keys = { C='change to EOL', } }}, + + vim_find={{ + modifiers = {}, + keys = { + [';']="repeat t/T/f/F", + [',']="reverse t/T/f/F", + ['/']=". find", + ['?']='. reverse find', + n="next search match", + N='prev search match', + f=". find char", + F='. reverse find char', + t=". 'till char", + T=". reverse 'till char", + ["*"]='find word under cursor', + ["#"]='reverse find under cursor', + } + }}, + + vim_scroll={{ + modifiers = {}, + keys = { + e="scroll line up", + y="scroll line down", + zt="scroll cursor to the top", + zz="scroll cursor to the center", + zb="scroll cursor to the bottom", + } + }}, } hotkeys_popup.add_hotkeys(vim_keys) From 2501f128e467ed1463ae44870b0c8934339a671d Mon Sep 17 00:00:00 2001 From: actionless Date: Fri, 12 Feb 2016 00:57:01 +0100 Subject: [PATCH 4/4] chore(awful: hotkeys: vim): rename key groups --- lib/awful/hotkeys_popup/keys/vim.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/awful/hotkeys_popup/keys/vim.lua b/lib/awful/hotkeys_popup/keys/vim.lua index 94ab675c8..90c02d9d6 100644 --- a/lib/awful/hotkeys_popup/keys/vim.lua +++ b/lib/awful/hotkeys_popup/keys/vim.lua @@ -11,12 +11,12 @@ local hotkeys_popup = require("awful.hotkeys_popup.widget") local vim_rule_any = {name={"vim", "VIM"}} for group_name, group_data in pairs({ - vim_motion= { color="#009F00", rule_any=vim_rule_any }, - vim_command= { color="#aFaF00", rule_any=vim_rule_any }, - vim_command_insert= { color="#cF4F40", rule_any=vim_rule_any }, - vim_operator= { color="#aF6F00", rule_any=vim_rule_any }, - vim_find= { color="#65cF9F", rule_any=vim_rule_any }, - vim_scroll= { color="#659FdF", rule_any=vim_rule_any }, + ["VIM: motion"] = { color="#009F00", rule_any=vim_rule_any }, + ["VIM: command"] = { color="#aFaF00", rule_any=vim_rule_any }, + ["VIM: command (insert)"] = { color="#cF4F40", rule_any=vim_rule_any }, + ["VIM: operator"] = { color="#aF6F00", rule_any=vim_rule_any }, + ["VIM: find"] = { color="#65cF9F", rule_any=vim_rule_any }, + ["VIM: scroll"] = { color="#659FdF", rule_any=vim_rule_any }, }) do hotkeys_popup.group_rules[group_name] = group_data end @@ -24,7 +24,7 @@ end local vim_keys = { - vim_motion={{ + ["VIM: motion"] = {{ modifiers = {}, keys = { ['`']="goto mark", @@ -65,7 +65,7 @@ local vim_keys = { } }}, - vim_operator={{ + ["VIM: operator"] = {{ modifiers = {}, keys = { ['=']="auto format", @@ -78,7 +78,7 @@ local vim_keys = { } }}, - vim_command={{ + ["VIM: command"] = {{ modifiers = {}, keys = { ['~']="toggle case", @@ -123,7 +123,7 @@ local vim_keys = { } }}, - vim_command_insert={{ + ["VIM: command (insert)"] = {{ modifiers = {}, keys = { i="insert mode", @@ -139,7 +139,7 @@ local vim_keys = { } }}, - vim_find={{ + ["VIM: find"] = {{ modifiers = {}, keys = { [';']="repeat t/T/f/F", @@ -157,7 +157,7 @@ local vim_keys = { } }}, - vim_scroll={{ + ["VIM: scroll"] = {{ modifiers = {}, keys = { e="scroll line up",