This repository has been archived on 2024-03-04. You can view files and clone it, but cannot push or open issues or pull requests.
linux/.config/nvim/lua/key/Common.lua

22 lines
719 B
Lua

require('key/Rekey')
-- Write all we can and exit. Created this to drop non-writable stuff when piping to nvim.
function bye()
pcall(vim.cmd, "wa")
vim.cmd[[qa!]]
end
rekey_normal('<Leader>.', '@:') -- repeat command.
rekey_visual('<Leader>.', '@:') -- repeat command.
rekey_normal('zz', '<cmd>wa<cr>') -- save all files.
rekey_normal('<Leader>z', '<cmd>lua bye()<cr>') -- save & quit all.
rekey_normal('<Leader>v', 'v') -- visual select (duplicate).
rekey_normal('gh', '0') -- go left.
rekey_normal('gl', '$') -- go right.
rekey_normal('gj', 'G') -- go bottom.
rekey_normal('gk', 'gg') -- go top.
rekey_normal('U', '<C-r>') -- redo.
rekey_normal(';', ':') -- remap ; to :.
rekey_visual(';', ':') -- remap ; to :.