Add keymap to clean screen

<leader>n to hide signcolumn, line numbers and virtual text
This commit is contained in:
Andy Teijelo 2022-11-10 12:02:57 -05:00
parent eb0dd08f70
commit e3bad09e9f

View file

@ -99,10 +99,10 @@ keymap("n", "<F17>", "<cmd>lua require'dap'.terminate()<cr>", opts) -- Shift+F5
--keymap("n", "<leader>di", "<Plug>VimspectorBalloonEval", opts)
-- move.nvim
vim.keymap.set('n', '<M-j>', ':MoveLine(1)<cr>', opts)
vim.keymap.set('n', '<M-k>', ':MoveLine(-1)<cr>', opts)
vim.keymap.set('x', '<M-j>', ':MoveBlock(1)<cr>', opts)
vim.keymap.set('x', '<M-k>', ':MoveBlock(-1)<cr>', opts)
keymap('n', '<M-j>', ':MoveLine(1)<cr>', opts)
keymap('n', '<M-k>', ':MoveLine(-1)<cr>', opts)
keymap('x', '<M-j>', ':MoveBlock(1)<cr>', opts)
keymap('x', '<M-k>', ':MoveBlock(-1)<cr>', opts)
-- disable arrow keys
keymap("n", "<Right>", "<Nop>", opts)
@ -124,10 +124,19 @@ keymap("i", "<M-h>", "<Left>", opts)
keymap("i", "<M-j>", "<C-o>gj", opts)
keymap("i", "<M-k>", "<C-o>gk", opts)
-- gitsigns
-- vim.keymap.set('n', '<Leader>hp', '<cmd>Gitsigns preview_hunk<cr>', opts)
-- vim.keymap.set('n', '<Leader>hb', function() gs.blame_line{full=false} end, opts)
-- vim.keymap.set('n', '<Leader>hB', function() gs.blame_line{full=true} end, opts)
local function clean_screen()
vim.o.number = not vim.o.number;
--if not vim.diagnostic.get_next() then return end
if vim.o.number then
vim.diagnostic.show()
vim.opt.signcolumn = "yes"
else
vim.diagnostic.hide()
vim.opt.signcolumn = "no"
end
end
keymap("n", "<leader>n", clean_screen, opts)
local function otherkeymaps()
local ok