Big backup I guess
This commit is contained in:
parent
98e8510ae7
commit
a6fb4ffbb2
13 changed files with 130 additions and 58 deletions
dotfiles/neovim/ftplugin
34
dotfiles/neovim/ftplugin/lua.lua
Normal file
34
dotfiles/neovim/ftplugin/lua.lua
Normal file
|
@ -0,0 +1,34 @@
|
|||
local opts = function(desc)
|
||||
return { desc = desc, buffer = true }
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<leader>lf", ":source %<cr>", opts("Run current lua file"))
|
||||
vim.keymap.set("n", "<leader>ls", function()
|
||||
local path = vim.api.nvim_buf_get_name(0)
|
||||
local status, M = pcall(dofile, path)
|
||||
|
||||
if status then
|
||||
if M ~= nil then
|
||||
if type(M.setup) == "function" then
|
||||
M.setup()
|
||||
print("M.setup() executed succesfully!")
|
||||
else
|
||||
print("Module does not return a setup function")
|
||||
end
|
||||
else
|
||||
print("Module returned nil")
|
||||
end
|
||||
else
|
||||
print("Cannot import current file :(")
|
||||
end
|
||||
end, opts("Run .setup() in current file"))
|
||||
|
||||
local status, wk = pcall(require, "which-key")
|
||||
|
||||
if status then
|
||||
wk.register({
|
||||
["<leader>l"] = {
|
||||
name = "Local commands"
|
||||
}
|
||||
})
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue