dotfiles/config/nvim/after/ftplugin/lua.lua
Fernando Schauenburg 237d67f82b vim: move code from lua ftplugin to utils
The ftplugin is executed via the FileType event every time a lua file is
opened, so better to have just the keymaps set there.
2024-02-17 15:16:43 +01:00

13 lines
489 B
Lua

vim.bo.tabstop = 2
local lua = require('fschauen.util').lua
local opts = function(desc)
return { desc = desc, buffer = true }
end
vim.keymap.set('n', 'gf', lua.go_to_module, opts('Go to module under cursor'))
vim.keymap.set('n', '<localleader>x', lua.execute_lines, opts('Execute current line'))
vim.keymap.set('x', '<localleader>x', lua.execute_selection, opts('Execute selection'))
vim.keymap.set('n', '<localleader><localleader>x', lua.execute_file, opts('Execute current file'))