summaryrefslogtreecommitdiff
path: root/nvim/ftplugin
diff options
context:
space:
mode:
authorkkard2 <[email protected]>2024-12-28 10:58:11 +0100
committerkkard2 <[email protected]>2024-12-28 10:58:11 +0100
commita7b27faa7a3ec2ec9fa2d1dcb4e6b7b5fb49b639 (patch)
treefcb21f806ca13f83b98ac123ebd37f3dbd2ba0e2 /nvim/ftplugin
parent75892fecc839d2294d614d6abb6f324a3c465ee1 (diff)
this is more reasonable (and it works)
Diffstat (limited to 'nvim/ftplugin')
-rw-r--r--nvim/ftplugin/php.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/nvim/ftplugin/php.lua b/nvim/ftplugin/php.lua
new file mode 100644
index 0000000..a496f8a
--- /dev/null
+++ b/nvim/ftplugin/php.lua
@@ -0,0 +1,5 @@
+local copy_indent_macro = "<Esc>0\"_d$?.<CR><cmd>noh<CR>0\"myw<C-o>0\"_d$\"mpa"
+
+vim.keymap.set({ "n" }, "o", "o" .. copy_indent_macro, { buffer = 0 })
+vim.keymap.set({ "n" }, "O", "O" .. copy_indent_macro, { buffer = 0 })
+vim.keymap.set({ "i" }, "<CR>", "<CR>" .. copy_indent_macro, { buffer = 0 })