From b929bdf9a36df09c1900d2dd56bf61e2f45679fa Mon Sep 17 00:00:00 2001 From: srdusr Date: Thu, 26 Jan 2023 23:10:06 +0200 Subject: Add alternative mappings for jumping to next match on line and repeating last command | Navigator plugin keymappings --- lua/user/keys.lua | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/lua/user/keys.lua b/lua/user/keys.lua index 1aa5124..712835a 100644 --- a/lua/user/keys.lua +++ b/lua/user/keys.lua @@ -21,9 +21,15 @@ local term_opts = { noremap = true, silent = false } --------------- Standard Operations --------------- + -- Semi-colon as leader key vim.g.mapleader = ";" ---vim.g.maplocalleader = ";" + +-- Jump to next match on line using `.` instead of `;` NOTE: commented out in favour of "ggandor/flit.nvim" +--map("n", ".", ";") + +-- Repeat last command using `` instead of `.` NOTE: commented out in favour of "ggandor/flit.nvim" +--map("n", "", ".") -- "jj" to exit insert-mode map("i", "jj", "") @@ -127,10 +133,34 @@ map("n", "gm", ":Gmove") --end -- --Easier split navigations, just ctrl-j instead of ctrl-w then j -map("n", "", "") -map("n", "", "") -map("n", "", "") -map("n", "", "") +--map("n", "", "") +--map("n", "", "") +--map("n", "", "") +--map("n", "", "") + +-- Tmux navigation (aserowy/tmux.nvim) +--map("n", "", ":lua require'tmux'.move_left()") +--map("n", "", ":lua require'tmux'.move_bottom()") +--map("n", "", ":lua require'tmux'.move_top()") +--map("n", "", ":lua require'tmux'.move_right()") +map('n', '', 'NavigatorLeft') +map('n', '', 'NavigatorRight') +map('n', '', 'NavigatorUp') +map('n', '', 'NavigatorDown') + +-- set line wrap +map("n", "", function() + local wrap_status = vim.api.nvim_exec("set wrap ?", true) + + if wrap_status == "nowrap" then + vim.api.nvim_command("set wrap linebreak") + print("Wrap enabled") + else + vim.api.nvim_command("set wrap nowrap") + print("Wrap disabled") + end +end, { silent = true }) + -- Combine buffers list with buffer name map("n", "b", ":buffers:buffer") -- cgit v1.2.3