mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-11-10 10:39:41 +00:00
27 lines
605 B
Lua
27 lines
605 B
Lua
local vim = require("vim")
|
|
local fn = vim.fn
|
|
local m = require("utility.mappings")
|
|
|
|
local function cabbrev(input, result, reabbrev)
|
|
m.abbrev("c", input, result, reabbrev)
|
|
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
|
|
local initlua = fn.stdpath("config") .. "init.lua"
|
|
cabbrev("reload", "luafile " .. initlua)
|