add keybinds for executing lua code

This commit is contained in:
2024-12-06 08:18:11 -05:00
parent 95bfc11404
commit 6e466632d8
+6 -1
View File
@@ -14,6 +14,11 @@ keymap.set('n', '<leader>nh', ':nohl<CR>', opts('Clear search highlights'))
keymap.set({ 'n', 'v' }, '<leader>cm', '<cmd>Noice dismiss<CR>', opts('Dismiss notifications'))
keymap.set('n', '<leader>?', '<cmd>Telescope help_tags<CR>', opts('Search documentation'))
-- ──────────────────────────────────────────────────────( run code )─
keymap.set('n', '<leader><leader>x', '<cmd>source %<CR>', opts('Execute the current file'))
keymap.set('n', '<leader>cx', ':.lua<CR>', opts('Execute current line'))
keymap.set('v', '<leader>cx', ':lua<CR>', opts('Execute selected code'))
-- ────────────────────────────────────────────────────( formatting )─
keymap.set({ 'n', 'v' }, '<leader>F', function()
require('conform').format({
@@ -232,4 +237,4 @@ keymap.set('i', '<C-s>', function()
else
vim.opt_local.spell = true
end
end, opts('Toggle spell check'))
end, opts('Toggle spell check'))