diff options
| author | Robert Günzler <r@gnzler.io> | 2026-02-10 12:32:48 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2026-02-10 12:41:25 +0100 |
| commit | 63feeb9f369fc6176e85c1c2d8fcc863caad1946 (patch) | |
| tree | 41cd5d2d1ec36e74e464caab722cc9b460153f04 /.vim/after/ftplugin/html.lua | |
| parent | 5bd0a4aca65ecb9818ef1285982d160b6b6ff665 (diff) | |
start new
Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to '.vim/after/ftplugin/html.lua')
| -rw-r--r-- | .vim/after/ftplugin/html.lua | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/.vim/after/ftplugin/html.lua b/.vim/after/ftplugin/html.lua deleted file mode 100644 index 35f0bd1..0000000 --- a/.vim/after/ftplugin/html.lua +++ /dev/null @@ -1,20 +0,0 @@ -local function get_visual_selection() - local start_pos = vim.fn.getpos('v') - local end_pos = vim.fn.getpos('.') - local text = vim.fn.getregion(vim.fn.getpos('v'), vim.fn.getpos('.'), { type = vim.fn.mode() }) - return { start_pos = start_pos, end_pos = end_pos, text = text } -end - -vim.keymap.set('x', '<c-l>', function() - local sel = get_visual_selection() - vim.print(sel) - vim.api.nvim_buf_set_text( - sel.start_pos[1], -- bufnum - sel.start_pos[2] - 1, -- vim.api funcs use 0-based indexing - sel.start_pos[3] - 1, - sel.end_pos[2] - 1, - sel.end_pos[3], - { '<a href="TODO">' .. table.concat(sel.text, '') .. '</a>' } - ) - vim.api.nvim_input('<esc>') -end, { desc = 'html: make link' }) |