From 1108538484ea452d789100b10e1288e8b1924f7f Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Sun, 18 Feb 2024 14:25:15 +0100 Subject: [PATCH] vim: add keymaps to change quote style in lua files --- config/nvim/after/ftplugin/lua.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/nvim/after/ftplugin/lua.lua b/config/nvim/after/ftplugin/lua.lua index 7dc0901..a5c8b4c 100644 --- a/config/nvim/after/ftplugin/lua.lua +++ b/config/nvim/after/ftplugin/lua.lua @@ -3,11 +3,17 @@ vim.bo.tabstop = 2 local lua = require('fschauen.util.lua') local opts = function(desc) - return { desc = desc, buffer = true } + return { desc = desc, buffer = true, silent = true } end vim.keymap.set('n', 'gf', lua.go_to_module, opts('Go to module under cursor')) + vim.keymap.set('n', 'x', lua.execute_lines, opts('Execute current line')) vim.keymap.set('x', 'x', lua.execute_selection, opts('Execute selection')) vim.keymap.set('n', 'x', lua.execute_file, opts('Execute current file')) +vim.keymap.set('n', [[']], [[:.s/"/'/g | nohl]], opts([[Replace: " 󱦰 ']])) +vim.keymap.set('n', [["]], [[:.s/'/"/g | nohl]], opts([[Replace: ' 󱦰 "]])) +vim.keymap.set('x', [[']], [[:s/"/'/g | nohl]], opts([[Replace: " 󱦰 ']])) +vim.keymap.set('x', [["]], [[:s/'/"/g | nohl]], opts([[Replace: ' 󱦰 "]])) +