Change a lot of neovim stuff
and remove some outdated firefox profiles
This commit is contained in:
parent
c36f93d9c9
commit
a39544b93d
18 changed files with 119 additions and 145 deletions
home/features/neovim/config/lua/my/helpers
39
home/features/neovim/config/lua/my/helpers/wrap.lua
Normal file
39
home/features/neovim/config/lua/my/helpers/wrap.lua
Normal file
|
@ -0,0 +1,39 @@
|
|||
local M = {}
|
||||
|
||||
local function swap(key)
|
||||
vim.keymap.set({ "n", "v" }, key, "g" .. key, { buffer = true })
|
||||
vim.keymap.set({ "n", "v" }, "g" .. key, key, { buffer = true })
|
||||
end
|
||||
|
||||
local function unswap(key)
|
||||
vim.keymap.del({ "n", "v" }, key)
|
||||
vim.keymap.del({ "n", "v" }, "g" .. key)
|
||||
end
|
||||
|
||||
function M.enable()
|
||||
vim.opt.wrap = true
|
||||
|
||||
swap("j")
|
||||
swap("k")
|
||||
swap("0")
|
||||
swap("$")
|
||||
end
|
||||
|
||||
function M.disable()
|
||||
vim.opt.wrap = false
|
||||
|
||||
unswap("j")
|
||||
unswap("k")
|
||||
unswap("0")
|
||||
unswap("$")
|
||||
end
|
||||
|
||||
function M.toggle()
|
||||
if vim.opt.wrap == true then
|
||||
M.disable()
|
||||
else
|
||||
M.enable()
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
Loading…
Add table
Add a link
Reference in a new issue