I generally use ZeusEdit for writing COBOL code and less often, C code. But what I've observed is that the keyboard mappings are at the editor level. Or, another way of thinking about them is to say that the keyboard mappings are global. Example: if I map something to F11, it is mapped to F11 no matter what type of document I am dealing with.
How then can one have non-global (i.e. document type specific) keyboard mappings? I may want one set of mappings when I deal with COBOL, but a different set when I deal with C. Unless I overlooked it (quite possible), I didn't see any functions I could use to change them programatically. If there aren't any, then I would ask that that be added to the feature list.
Alternatively, it would be nice to be able to specify keyboard mappings at either level: global (editor level) or local (document type). And any mapping at the local level overrides the same mapping (if any) at the global level - for each key. In such a fashion, I could have the majority of my non-document specific mappings defined at the editor level, and the document-specific ones defined within each document.
Does this makes sense (hopefully)? Anyone else in favor of such an approach?
Keyboard mapping
Code: Select all
How then can one have non-global (i.e. document type specific) keyboard mappings?
For example:
Code: Select all
function key_macro()
-- macro only works for documents
local document = is_document()
if document > 0 then
local extension = string.lower(macro_tag("$Ext"))
-- add your extensions and comments here
if (extension == ".cob" ) then
-- cobol file
message("File is cobol")
elseif ( (extension == ".c" ) or
(extension == ".h") ) or
(extension == ".cpp") or
(extension == ".hpp") then
-- c/c++ file
message("File is c/c++")
else
-- othe files
message("File is default.")
end
else
message("This macro only works for document files!")
beep()
end
end
key_macro() -- run the macro
There is nothing in Zeus to do this other than using the macro approach shown above.I didn't see any functions I could use to change them programatically.
Cheers Jussi