aboutsummaryrefslogtreecommitdiff
path: root/plugins/copyfilelocation.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/copyfilelocation.lua')
-rw-r--r--plugins/copyfilelocation.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/copyfilelocation.lua b/plugins/copyfilelocation.lua
new file mode 100644
index 0000000..d365240
--- /dev/null
+++ b/plugins/copyfilelocation.lua
@@ -0,0 +1,17 @@
+local core = require "core"
+local command = require "core.command"
+local config = require "core.config"
+
+
+command.add("core.docview", {
+ ["copy-file-location:copy-file-location"] = function()
+ local doc = core.active_view.doc
+ if not doc.filename then
+ core.error "Cannot copy location of unsaved doc"
+ return
+ end
+ local filename = system.absolute_path(doc.filename)
+ core.log("Copying to clipboard \"%s\"", filename)
+ system.set_clipboard(filename)
+ end
+})