refactor(neovim): Convert file-autocmd to after-ftplugin

- Markdown, gitcommit, text: `lua/shared/text_settings.lua`
- Javascript, Typescript, React, Vue:
  `lua/shared/javascript_settings.lua`
- `after/ftplugin` files that `require` the above 2 shared configs
This commit is contained in:
Pratik Tripathy
2025-08-20 13:06:27 +05:30
parent dabd425443
commit 6f288e2976
14 changed files with 55 additions and 59 deletions

View File

@@ -0,0 +1,19 @@
local M = {}
function M.setup()
vim.opt_local.spell = true
vim.keymap.set("v", "<leader>ml", function()
vim.cmd('normal! "vygvc ') -- Save selected text to register 'v' & delete the text
-- Copy the system clipboard
local clipboard_content = vim.fn.getreg("+")
-- Insert the markdown link
local link = string.format("[%s](%s)", vim.fn.getreg("v"), clipboard_content)
vim.api.nvim_put({ link }, "c", false, true)
vim.cmd("normal! T[vt]") -- Move cursor inside the square brackets & visually select text
end, { desc = "Markdown: Create link from system clipboard" })
end
return M