summaryrefslogtreecommitdiff
path: root/after
diff options
context:
space:
mode:
Diffstat (limited to 'after')
-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" })