diff --git a/init.lua b/init.lua index e8f6ff11..7d7b1156 100644 --- a/init.lua +++ b/init.lua @@ -4,9 +4,7 @@ ==================== READ THIS BEFORE CONTINUING ==================== ===================================================================== -Kickstart.nvim is *not* a distribution. - -Kickstart.nvim is a template for your own configuration. +Kickstart.nvim is *not* a distribution. Kickstart.nvim is a template for your own configuration. The goal is that you can read every line of code, top-to-bottom, understand what your configuration is doing, and modify it to suit your needs. @@ -232,16 +230,10 @@ require('lazy').setup({ -- [[ Setting options ]] -- See `:help vim.o` -require('custom') -- [[ Basic Keymaps ]] - -- Keymaps for better default experience -- See `:help vim.keymap.set()` -vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) - --- Remap for dealing with word wrap -vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) -vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) +require('custom') -- [[ Highlight on yank ]] -- See `:help vim.highlight.on_yank()` diff --git a/lua/custom/keymap.lua b/lua/custom/keymap.lua new file mode 100755 index 00000000..f174d6fb --- /dev/null +++ b/lua/custom/keymap.lua @@ -0,0 +1,43 @@ +-- Keymaps for better default experience +-- See `:help vim.keymap.set()` +-- Nop overrides +vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) +vim.keymap.set("n", "Q", "") + +-- Open explorer +vim.keymap.set("n", "fv", vim.cmd.Ex) + +-- Allow moving lines or blocks +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") + +-- Handle positioning cusor in window while scrolling +vim.keymap.set("n", "J", "mzJ`z") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") + +vim.keymap.set("x", "p", [["_dP]]) + +vim.keymap.set({"n", "v"}, "y", [["+y]]) +vim.keymap.set("n", "Y", [["+Y]]) + +vim.keymap.set({"n", "v"}, "d", [["_d]]) + +vim.keymap.set("i", "", "") + +vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") +vim.keymap.set("n", "f", vim.lsp.buf.format) + +vim.keymap.set("n", "", "cnextzz") +vim.keymap.set("n", "", "cprevzz") +vim.keymap.set("n", "k", "lnextzz") +vim.keymap.set("n", "j", "lprevzz") + +vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) +vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) + +-- Remap for dealing with word wrap +vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) +vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })