aboutsummaryrefslogtreecommitdiff
path: root/titleize.lua
diff options
context:
space:
mode:
authorrxi <rxi@users.noreply.github.com>2020-03-27 17:18:25 +0000
committerrxi <rxi@users.noreply.github.com>2020-03-27 17:18:25 +0000
commitcc1aacfa755001965670420cacbd03d69884aae6 (patch)
tree6c927a3d81766b7057b0e2813e49cba1e448f874 /titleize.lua
parent60fd0cee2118ce10cbfbeb8352b99c0bd74e3d74 (diff)
downloadlite-xl-plugins-cc1aacfa755001965670420cacbd03d69884aae6.tar.gz
lite-xl-plugins-cc1aacfa755001965670420cacbd03d69884aae6.zip
Added titleize plugin
Diffstat (limited to 'titleize.lua')
-rw-r--r--titleize.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/titleize.lua b/titleize.lua
new file mode 100644
index 0000000..2e4b52a
--- /dev/null
+++ b/titleize.lua
@@ -0,0 +1,11 @@
+local core = require "core"
+local command = require "core.command"
+
+command.add("core.docview", {
+ ["titleize:titleize"] = function()
+ core.active_view.doc:replace(function(text)
+ return text:gsub("%f[%w](%w)", string.upper)
+ end)
+ end,
+})
+