summaryrefslogtreecommitdiff
path: root/after/ftplugin
diff options
context:
space:
mode:
authorMarcelo <setanta@gmail.com>2025-03-03 21:05:55 -0300
committerMarcelo Lira <setanta@gmail.com>2025-03-07 02:15:25 -0300
commitc78361a6155dd53cd1098f7fdf33acfea20dc903 (patch)
treee13b8065c4a1180f3b1d483676b55af4cba2ee4c /after/ftplugin
Initial commit.
Diffstat (limited to 'after/ftplugin')
-rw-r--r--after/ftplugin/crystal.lua2
-rw-r--r--after/ftplugin/dot.lua2
-rw-r--r--after/ftplugin/json.lua2
-rw-r--r--after/ftplugin/lua.lua3
4 files changed, 9 insertions, 0 deletions
diff --git a/after/ftplugin/crystal.lua b/after/ftplugin/crystal.lua
new file mode 100644
index 0000000..706425a
--- /dev/null
+++ b/after/ftplugin/crystal.lua
@@ -0,0 +1,2 @@
+vim.bo.formatprg = "crystal tool format -"
+vim.bo.commentstring = "# %s"
diff --git a/after/ftplugin/dot.lua b/after/ftplugin/dot.lua
new file mode 100644
index 0000000..99fc056
--- /dev/null
+++ b/after/ftplugin/dot.lua
@@ -0,0 +1,2 @@
+vim.keymap.set("n", "<F5>", "<CMD>update | !dot % -Tpng > /tmp/%:t:r.png && sxiv /tmp/%:t:r.png<CR>",
+ { desc = "Generate PNG image" })
diff --git a/after/ftplugin/json.lua b/after/ftplugin/json.lua
new file mode 100644
index 0000000..b6bc223
--- /dev/null
+++ b/after/ftplugin/json.lua
@@ -0,0 +1,2 @@
+vim.bo.formatexpr = ""
+vim.bo.formatprg = "jq"
diff --git a/after/ftplugin/lua.lua b/after/ftplugin/lua.lua
new file mode 100644
index 0000000..dca196a
--- /dev/null
+++ b/after/ftplugin/lua.lua
@@ -0,0 +1,3 @@
+vim.keymap.set("n", "<Leader><Leader>x", "<CMD>source %<CR>", { desc = "Reloads the current config file" })
+vim.keymap.set("n", "<Leader>x", "<CMD>.lua<CR>", { desc = "Executes the current line" })
+vim.keymap.set("v", "<Leader>x", "<CMD>lua<CR>", { desc = "Executes the current selection" })