From 43558b3a614de4a9174824b1cb4de8bc1ad147a9 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Fri, 18 Oct 2024 21:50:58 -0500 Subject: initial commit --- lua/tjk/keybindings.lua | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 lua/tjk/keybindings.lua (limited to 'lua/tjk/keybindings.lua') diff --git a/lua/tjk/keybindings.lua b/lua/tjk/keybindings.lua new file mode 100644 index 0000000..563d843 --- /dev/null +++ b/lua/tjk/keybindings.lua @@ -0,0 +1,46 @@ +local key = vim.keymap.set + +vim.g.mapleader = "," + +-- toggle spellcheck +key("n", "l", [[:setlocal spell! spelllang=en_us]]) +-- toggle cursorcolumn +key("n", "c", [[:set cursorcolumn!]]) + +-- scroll doc with ctrl+[jk] +key({ "n", "v" }, "", "") +key({ "n", "v" }, "", "") +-- go to begining or end of line with ctrl+[hl] +key({ "n", "v" }, "", "zh") +key({ "n", "v" }, "", "zl") + +-- split navigation with ctrl+shift+[hjkl] +key("n", "", "h") +key("n", "", "j") +key("n", "", "k") +key("n", "", "l") + +-- browser like tab shortcuts +key("n", "", "gt") +key("n", "", "gT") +--key("n", "", [[:tabe]]) +--key("n", "", [[:tabclose]]) -- is already used lol +-- additional tab shortcuts +key("n", "", "gt") +key("n", "", "gT") + + +-- copy text to x11 buffer +key("", "", [["+y]]) +key("", "", [["+x]]) +key("", "", [["+y]]) +key("", "", [["+x]]) + +-- unmap ex mode +key("", "Q", "") + +-- repeat commands with visual blocks using period +key("v", ".", [[:normal .]]) + +-- save files with root permissions with command `w!!` +key("c", "w!!", [[execute 'silent! write !doas tee % >/dev/null' edit!]]) -- cgit v1.2.3