From 31865aabe69b8d886d2c5361d7602e44d8db4b17 Mon Sep 17 00:00:00 2001 From: Huck Boles Date: Sat, 13 May 2023 14:35:31 -0500 Subject: [PATCH] space as map leader --- init.lua | 2 ++ lua/map.lua | 30 +++++++++++++++--------------- lua/plugins.lua | 2 +- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/init.lua b/init.lua index b4a3696..847c8b5 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,5 @@ +vim.g.mapleader = " " + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then diff --git a/lua/map.lua b/lua/map.lua index ccfc248..113283e 100644 --- a/lua/map.lua +++ b/lua/map.lua @@ -1,8 +1,8 @@ -- quick creation for splits, tabs, buffers -vim.keymap.set('n', 'h', ":vsplit ") -vim.keymap.set('n', 'v', ":split ") -vim.keymap.set('n', 't', ':tabnew ') -vim.keymap.set('n', '', 'bprev') +vim.keymap.set('n', 'h', ":vsplit ") +vim.keymap.set('n', 'v', ":split ") +vim.keymap.set('n', 't', ':tabnew ') +vim.keymap.set('n', '', 'bprev') -- move through virtual lines vim.keymap.set('n', 'j', 'gj') @@ -12,7 +12,7 @@ vim.keymap.set('n', 'k', 'gk') vim.keymap.set('n', 'Q', '@@') -- center the screen for movement commands -vim.keymap.set('n', 'w', 'za') +vim.keymap.set('n', 'w', 'za') vim.keymap.set('n', 'n', 'nzz') vim.keymap.set('n', 'N', 'Nzz') vim.keymap.set('n', '', 'zz') @@ -29,21 +29,21 @@ vim.keymap.set('n', 'K', 'Jx') vim.keymap.set('n', '_', 'nohlsearch') -- quick plugin editing -vim.keymap.set('n', '=', 'tabnew ~/.config/nvim/init.lua') -vim.keymap.set('n', 'q', 'Lazy') +vim.keymap.set('n', '=', 'tabnew ~/.config/nvim/init.lua') +vim.keymap.set('n', 'q', 'Lazy') -- better terminal movement keys vim.keymap.set('t', '', [[]]) vim.keymap.set('t', '', [[]]) -- lsp diagnostic navigation -vim.keymap.set('n', 'n', vim.diagnostic.goto_next) -vim.keymap.set('n', 'p', vim.diagnostic.goto_prev) -vim.keymap.set('n', 'R', vim.lsp.buf.rename) -vim.keymap.set('n', 'k', vim.lsp.buf.hover) -vim.keymap.set('n', 'K', vim.diagnostic.open_float) +vim.keymap.set('n', 'n', vim.diagnostic.goto_next) +vim.keymap.set('n', 'p', vim.diagnostic.goto_prev) +vim.keymap.set('n', 'r', vim.lsp.buf.rename) +vim.keymap.set('n', 'k', vim.lsp.buf.hover) +vim.keymap.set('n', 'K', vim.diagnostic.open_float) -vim.keymap.set('n', 'd', +vim.keymap.set('n', 'd', function() if vim.g.visible_diagnostics then vim.diagnostic.disable() @@ -56,7 +56,7 @@ vim.keymap.set('n', 'd', ) -- live grep in git repo, or fall back to current repo -vim.keymap.set('n', 'F', +vim.keymap.set('n', 'F', function() local function is_git_repo() vim.fn.system("git rev-parse --is-inside-work-tree") @@ -81,7 +81,7 @@ vim.keymap.set('n', 'F', end ) -vim.keymap.set('n', 'f', +vim.keymap.set('n', 'f', function() local function is_git_repo() vim.fn.system("git rev-parse --is-inside-work-tree") diff --git a/lua/plugins.lua b/lua/plugins.lua index 014ec5e..85039b2 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -28,7 +28,7 @@ return { keys = { { 'l', 'TroubleToggle document_diagnostics' }, { 'L', 'TroubleToggle workspace_diagnostics' }, - { 'r', 'TroubleToggle lsp_references' }, + { 'R', 'TroubleToggle lsp_references' }, }, opts = { icons = false, -- 2.45.2