2015-09-20 16:42:24 +02:00
|
|
|
---------------------------------------------------------------------------
|
|
|
|
--- VIM hotkeys for awful.hotkeys_widget
|
|
|
|
--
|
|
|
|
-- @author Yauheni Kirylau <yawghen@gmail.com>
|
|
|
|
-- @copyright 2014-2015 Yauheni Kirylau
|
2017-07-02 17:12:12 +02:00
|
|
|
-- @submodule awful.hotkeys_popup
|
2015-09-20 16:42:24 +02:00
|
|
|
---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
local hotkeys_popup = require("awful.hotkeys_popup.widget")
|
|
|
|
|
|
|
|
local vim_keys = {
|
|
|
|
|
2016-02-12 00:57:01 +01:00
|
|
|
["VIM: motion"] = {{
|
2015-09-20 16:42:24 +02:00
|
|
|
modifiers = {},
|
|
|
|
keys = {
|
|
|
|
['`']="goto mark",
|
|
|
|
['0']='"hard" BOL',
|
|
|
|
['-']="prev line",
|
|
|
|
w="next word",
|
|
|
|
e="end word",
|
|
|
|
['[']=". misc",
|
|
|
|
[']']=". misc",
|
|
|
|
["'"]=". goto mk. BOL",
|
|
|
|
b="prev word",
|
2016-02-12 00:50:55 +01:00
|
|
|
["|"]='BOL/goto col',
|
2015-09-20 16:42:24 +02:00
|
|
|
["$"]='EOL',
|
2016-02-11 00:26:57 +01:00
|
|
|
["%"]='goto matching bracket',
|
2015-09-20 16:42:24 +02:00
|
|
|
["^"]='"soft" BOL',
|
2016-02-11 00:26:57 +01:00
|
|
|
["("]='sentence begin',
|
|
|
|
[")"]='sentence end',
|
2015-09-20 16:42:24 +02:00
|
|
|
["_"]='"soft" BOL down',
|
|
|
|
["+"]='next line',
|
|
|
|
W='next WORD',
|
|
|
|
E='end WORD',
|
2016-02-11 00:26:57 +01:00
|
|
|
['{']="paragraph begin",
|
|
|
|
['}']="paragraph end",
|
2015-09-20 16:42:24 +02:00
|
|
|
G='EOF/goto line',
|
2016-02-11 00:26:57 +01:00
|
|
|
H='move cursor to screen top',
|
|
|
|
M='move cursor to screen middle',
|
|
|
|
L='move cursor to screen bottom',
|
2015-09-20 16:42:24 +02:00
|
|
|
B='prev WORD',
|
2016-02-11 00:26:57 +01:00
|
|
|
}
|
|
|
|
}, {
|
|
|
|
modifiers = {"Ctrl"},
|
|
|
|
keys = {
|
|
|
|
u="half page up",
|
|
|
|
d="half page down",
|
|
|
|
b="page up",
|
|
|
|
f="page down",
|
|
|
|
o="prev mark",
|
2015-09-20 16:42:24 +02:00
|
|
|
}
|
|
|
|
}},
|
|
|
|
|
2016-02-12 00:57:01 +01:00
|
|
|
["VIM: operator"] = {{
|
2015-09-20 16:42:24 +02:00
|
|
|
modifiers = {},
|
|
|
|
keys = {
|
|
|
|
['=']="auto format",
|
|
|
|
y="yank",
|
|
|
|
d="delete",
|
|
|
|
c="change",
|
|
|
|
["!"]='external filter',
|
|
|
|
['<']='unindent',
|
|
|
|
['>']='indent',
|
|
|
|
}
|
|
|
|
}},
|
|
|
|
|
2016-02-12 00:57:01 +01:00
|
|
|
["VIM: command"] = {{
|
2015-09-20 16:42:24 +02:00
|
|
|
modifiers = {},
|
|
|
|
keys = {
|
2016-02-12 00:50:55 +01:00
|
|
|
['~']="toggle case",
|
2015-09-20 16:42:24 +02:00
|
|
|
q=". record macro",
|
|
|
|
r=". replace char",
|
|
|
|
u="undo",
|
|
|
|
p="paste after",
|
2016-02-11 00:26:57 +01:00
|
|
|
gg="go to the top of file",
|
|
|
|
gf="open file under cursor",
|
2015-09-20 16:42:24 +02:00
|
|
|
x="delete char",
|
|
|
|
v="visual mode",
|
|
|
|
m=". set mark",
|
|
|
|
['.']="repeat command",
|
|
|
|
["@"]='. play macro',
|
|
|
|
["&"]='repeat :s',
|
|
|
|
Q='ex mode',
|
|
|
|
Y='yank line',
|
|
|
|
U='undo line',
|
2016-02-11 00:26:57 +01:00
|
|
|
P='paste before cursor',
|
2015-09-20 16:42:24 +02:00
|
|
|
D='delete to EOL',
|
|
|
|
J='join lines',
|
|
|
|
K='help',
|
|
|
|
[':']='ex cmd line',
|
|
|
|
['"']='. register spec',
|
2016-02-11 00:26:57 +01:00
|
|
|
ZZ='quit and save',
|
|
|
|
ZQ='quit discarding changes',
|
2015-09-20 16:42:24 +02:00
|
|
|
X='back-delete',
|
2016-02-11 00:26:57 +01:00
|
|
|
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",
|
2015-09-20 16:42:24 +02:00
|
|
|
}
|
|
|
|
}},
|
|
|
|
|
2016-02-12 00:57:01 +01:00
|
|
|
["VIM: command (insert)"] = {{
|
2015-09-20 16:42:24 +02:00
|
|
|
modifiers = {},
|
|
|
|
keys = {
|
|
|
|
i="insert mode",
|
|
|
|
o="open below",
|
|
|
|
a="append",
|
|
|
|
s="subst char",
|
|
|
|
R='replace mode',
|
|
|
|
I='insert at BOL',
|
|
|
|
O='open above',
|
|
|
|
A='append at EOL',
|
|
|
|
S='subst line',
|
|
|
|
C='change to EOL',
|
|
|
|
}
|
|
|
|
}},
|
2016-02-12 00:50:55 +01:00
|
|
|
|
2016-02-12 00:57:01 +01:00
|
|
|
["VIM: find"] = {{
|
2016-02-12 00:50:55 +01:00
|
|
|
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',
|
|
|
|
}
|
|
|
|
}},
|
|
|
|
|
2016-02-12 00:57:01 +01:00
|
|
|
["VIM: scroll"] = {{
|
2016-02-12 00:50:55 +01:00
|
|
|
modifiers = {},
|
|
|
|
keys = {
|
|
|
|
zt="scroll cursor to the top",
|
|
|
|
zz="scroll cursor to the center",
|
|
|
|
zb="scroll cursor to the bottom",
|
|
|
|
}
|
2017-03-05 14:58:54 +01:00
|
|
|
},{
|
|
|
|
modifiers = {"Ctrl"},
|
|
|
|
keys = {
|
|
|
|
e="scroll line up",
|
|
|
|
y="scroll line down",
|
|
|
|
}
|
2016-02-12 00:50:55 +01:00
|
|
|
}},
|
2019-12-19 11:37:24 +01:00
|
|
|
|
|
|
|
["VIM: fold"] = {{
|
|
|
|
modifiers = {},
|
|
|
|
keys = {
|
|
|
|
za="toggle",
|
|
|
|
zc="close",
|
|
|
|
zo="open",
|
|
|
|
zA="toggle recursive",
|
|
|
|
zC="close recursive",
|
|
|
|
zO="open recursive",
|
|
|
|
zm="close all one level",
|
|
|
|
zr="open all one level",
|
|
|
|
zM="close all",
|
|
|
|
zR="open all",
|
|
|
|
}
|
|
|
|
}},
|
2020-07-02 07:24:44 +02:00
|
|
|
|
|
|
|
["VIM: diff"] = {{
|
|
|
|
modifiers = {},
|
|
|
|
keys = {
|
|
|
|
["do"]="diff obtain",
|
|
|
|
["dp"]="diff put",
|
|
|
|
["]c"]="jump next",
|
2020-07-02 18:35:45 +02:00
|
|
|
["[c"]="jump previous",
|
2020-07-02 07:24:44 +02:00
|
|
|
}
|
|
|
|
}},
|
2015-09-20 16:42:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
hotkeys_popup.add_hotkeys(vim_keys)
|
|
|
|
|
2019-12-19 11:42:27 +01:00
|
|
|
local vim_rule_any = {name={"vim", "VIM"}}
|
|
|
|
for group_name, _ in pairs(vim_keys) do
|
|
|
|
hotkeys_popup.add_group_rules(group_name, { rule_any=vim_rule_any })
|
|
|
|
end
|
|
|
|
|
2015-09-20 16:42:24 +02:00
|
|
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|