2021-11-30 19:22:51 +00:00
|
|
|
local vim = require("vim")
|
2021-12-06 21:49:03 +00:00
|
|
|
local fn = vim.fn
|
|
|
|
local m = require("utility.mappings")
|
2021-11-30 19:22:51 +00:00
|
|
|
|
2021-12-06 21:49:03 +00:00
|
|
|
local function cabbrev(input, result, reabbrev)
|
|
|
|
m.abbrev("c", input, result, reabbrev)
|
2021-11-30 19:22:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
-- Invalid case abbreviations
|
|
|
|
cabbrev("Wq", "wq")
|
|
|
|
cabbrev("wQ", "wq")
|
|
|
|
cabbrev("WQ", "wq")
|
|
|
|
cabbrev("Wa", "wa")
|
|
|
|
cabbrev("W", "w")
|
|
|
|
cabbrev("Q", "q")
|
|
|
|
cabbrev("Qall", "qall")
|
|
|
|
cabbrev("W!", "w!")
|
|
|
|
cabbrev("Q!", "q!")
|
|
|
|
cabbrev("Qall!", "qall!")
|
|
|
|
|
|
|
|
-- Save file with sudo
|
|
|
|
cabbrev("w!!", "w !sudo tee > /dev/null %")
|
|
|
|
|
|
|
|
-- Reload lua configuration
|
2021-12-06 21:49:03 +00:00
|
|
|
local initlua = fn.stdpath("config") .. "init.lua"
|
|
|
|
cabbrev("reload", "luafile " .. initlua)
|