-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_usermenu.lua.example
More file actions
107 lines (85 loc) · 5.52 KB
/
_usermenu.lua.example
File metadata and controls
107 lines (85 loc) · 5.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
--[[ fl_scripts ]]--
local scriptspath='scripts/fl_scripts/'
rawset(_G, 'fl_scripts', {})
if not rawget(_G, 'context') then
far.Message("'context' package is not installed.\nFailed to load fl_scripts.", 'Error', nil, 'w')
return
end
-- [==[
context.config.register{key='flhotkeys', path='fl_scripts', name='hotkeys'}
local hotkeys = ctxdata.config.flhotkeys
setmetatable(hotkeys, {__index=function() return '' end})
--------------------------------------------------------------------------------
local scripts = {
editor_actions = { file='editor_actions', area='e' },
comment = { file="comment", area='e' },
nav = { file="nav", area='e' },
sections = { file="sections", area='e' },
multiclip = { file='multiclip', area='e' },
copysymbol = { file='copysymbol', area='e' },
smartkeys = { file='smartkeys', area='e' },
block = { file='block', area='e' },
blockindent = { file='blockindent', area='e' },
select = { file='select', area='e' },
seljump = { file='selection_jump', area='p' },
alias = { file='alias', area='p' },
winepath = { file='winepath', area='p' },
panelfilter = { file='panelfilter', area='p' },
reload_macro = { file='reload_macro', area='evp' },
calc = { file="calc", area='evpd' },
screens = { file="screens", area='evp' },
}
fl_scripts.scripts=scripts
for k,v in pairs(scripts) do
local area=v.area
local folder= area=='e' and 'editor/' or area=='p' and 'panels/' or area:match '^evp' and 'common/'
v.file=scriptspath..folder..v.file
end
----------------------------------------
-- [=[
local entries={
{ name="Comments", key=nil, script=scripts.comment },
{ name="Navigation", key=nil, script=scripts.nav },
{ name="Lua calc &#", key=nil, script=scripts.calc },
{ name="Screens &*", key=nil, script=scripts.screens },
{ name='Sections', key=hotkeys.sections, script=scripts.sections },
{ name='Multiclip', key=hotkeys.multiclip, script=scripts.multiclip },
{ name='Copy up symbol', hide=true, key=hotkeys.copyupsymbol, script=scripts.copysymbol, argument='copyup' },
{ name='Copy down symbol', hide=true, key=hotkeys.copydownsymbol, script=scripts.copysymbol, argument='copydown' },
{ name='SmartHome', hide=true, key=hotkeys.smarthome, script=scripts.smartkeys, argument='smarthome' },
{ name='SmartTab', hide=true, key=hotkeys.smarttab, script=scripts.smartkeys, argument='smarttab' },
{ name='AutoComment', hide=true, key=hotkeys.autocomment, script=scripts.comment, argument='comment' },
{ name='AutoUnComment', hide=true, key=hotkeys.autouncomment, script=scripts.comment, argument='uncomment' },
{ name='Jump to block begin', hide=true, key=hotkeys.jumptoblockbegin, script=scripts.block, argument='jumpbegin' },
{ name='Jump to block end', hide=true, key=hotkeys.jumptoblockend, script=scripts.block, argument='jumpend' },
{ name='Indent right', hide=true, key=hotkeys.indentright, script=scripts.blockindent, argument='indentright' },
{ name='Indent left', hide=true, key=hotkeys.indentleft, script=scripts.blockindent, argument='indentleft' },
{ name='Select stream (begin)', hide=true, key=hotkeys.select_stream, script=scripts.select, argument='selstream' },
{ name='Select column (begin)', hide=true, key=hotkeys.select_column, script=scripts.select, argument='selcolumn' },
{ name='Navigate', hide=true, key=hotkeys.navigate, script=scripts.nav, argument='navigate' },
{ name='Navigate current', hide=true, key=hotkeys.navigate_current, script=scripts.nav, argument='navigate_current' },
{ name='Find associated file', hide=true, key=hotkeys.source, script=scripts.nav, argument='findsource' },
{ name='Jump to the next selected item. &>', key=nil, script=scripts.seljump, argument='next' },
{ name='Jump to the previous selected item. &<', key=nil, script=scripts.seljump, argument='prev' },
{ name='Jump to the first selected item. &^', key=nil, script=scripts.seljump, argument='first' },
{ name='Jump to the last selected item. &v', key=nil, script=scripts.seljump, argument='last' },
{ name='Panel Filter &:', key=nil, script=scripts.panelfilter, argument="filter" },
{ name='Panel Filter: delete &;', key=nil, script=scripts.panelfilter, argument="delete_filter" },
{ name='Alias &@', key=nil, script=scripts.alias },
-- { name='Winepath &w', key=nil, script=scripts.winepath },
{ name='Reload macros', key=nil, script=scripts.reload_macro },
}
fl_scripts.entries=entries
----------------------------------------
AddToMenu('evp',":sep:fl scripts")
for i, v in ipairs(entries) do
AddToMenu(v.script.area, not v.hide and v.name, v.key, v.script.file, v.argument)
end
--]=]
--]==]
----------------------------------------
AddCommand('calc', scripts.calc.file)
AddCommand('filter', scripts.panelfilter.file, "filter")
AddCommand("dir", scriptspath.."examples/fs_menu")
MakeResident(scripts.editor_actions.file)
--------------------------------------------------------------------------------