Add Trouble keymaps, remove LazyGit and Ranger keymaps

This commit is contained in:
Evie Litherland-Smith 2022-11-01 17:23:08 +00:00
parent aaa5813ff6
commit 1e21edefbc
2 changed files with 10 additions and 15 deletions

View file

@ -14,18 +14,3 @@ function _G.set_terminal_keymaps()
end
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
local Terminal = require('toggleterm.terminal').Terminal
local lazygit = Terminal:new({ cmd = "lazygit", count = 99, direction = 'float' })
local ranger = Terminal:new({ cmd = "ranger", count = 100, direction = 'float' })
function _lazygit_toggle()
lazygit:toggle()
end
function _ranger_toggle()
ranger:toggle()
end
vim.api.nvim_set_keymap("n", "<leader>tg", "<cmd>lua _lazygit_toggle()<CR>", {noremap = true, silent = true})
vim.api.nvim_set_keymap("n", "<leader>tr", "<cmd>lua _ranger_toggle()<CR>", {noremap = true, silent = true})

View file

@ -41,3 +41,13 @@ nmap('<leader>hw', '<cmd>HopWord<cr>')
-- Nvim-tree
nmap('<leader>nt', '<cmd>NvimTreeToggle<cr>')
nmap('<leader>nf', '<cmd>NvimTreeFindFile<cr>')
-- Trouble
nmap('<leader>tq', '<cmd>TroubleToggle quickfix<cr>')
nmap('<leader>tl', '<cmd>TroubleToggle loclist<cr>')
nmap('<leader>tr', '<cmd>TroubleToggle lsp_references<cr>')
nmap('<leader>td', '<cmd>TroubleToggle lsp_definitions<cr>')
nmap('<leader>tt', '<cmd>TroubleToggle lsp_type_definitions<cr>')
nmap('<leader>ti', '<cmd>TroubleToggle lsp_implementations<cr>')
nmap('<leader>tdd', '<cmd>TroubleToggle document_diagnostics<cr>')
nmap('<leader>twd', '<cmd>TroubleToggle workspace_diagnostics<cr>')