dotfiles/config/nvim/after/ftplugin/lua.lua
Fernando Schauenburg 97839fa58b vim: use vim.keymap instead of custom functions
`vim.keymap` was introduced in nvim 0.7, so this is the minimum  version
required for this to work.
2022-07-01 21:37:04 +02:00

11 lines
301 B
Lua

vim.bo.tabstop = 2
local nmap = require 'fs.util'.nmap
local buffer = { buffer = true }
-- execute the current line
nmap { '<leader>x', [[<cmd>call luaeval(getline("."))<cr>]], buffer }
-- save and execute the current file
nmap { '<leader><leader>x', '<cmd>silent write | luafile %<cr>', buffer }