Created
August 19, 2010 12:08
-
-
Save rgieseke/537711 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module('_m.common.filename', package.seeall) | |
function insert_filename() | |
local current_dir = (buffer.filename or ''):match('.+[/\\]') | |
if not current_dir then | |
current_dir = _HOME | |
end | |
filename = | |
gui.dialog('fileselect', | |
'--title', "Insert filename", | |
'--select-multiple', | |
'--with-directory', current_dir) | |
if filename then | |
filename = filename:gsub('\n', '') | |
filename = filename:gsub(current_dir, '') | |
buffer:add_text(filename) | |
end | |
end | |
keys.caO = {insert_filename} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment