mirror of
https://github.com/WarrenHood/dotfiles.git
synced 2025-04-29 20:24:59 +01:00
Setup pane/window nav and ToggleTerm, and allow passing opts in map function
This commit is contained in:
parent
cf4ebea204
commit
36bea988a7
|
@ -1,5 +1,9 @@
|
||||||
local function map(m, k, v)
|
local function map(m, k, v, opts)
|
||||||
vim.keymap.set(m, k, v, {silent = true})
|
opts = opts or {}
|
||||||
|
if not opts['silent'] then
|
||||||
|
opts['silent'] = true
|
||||||
|
end
|
||||||
|
vim.keymap.set(m, k, v, opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,10 +17,25 @@ map('i', '<C-S>', '<ESC>:w<CR>')
|
||||||
|
|
||||||
-- Telescope
|
-- Telescope
|
||||||
local telescope_builtin = require('telescope.builtin')
|
local telescope_builtin = require('telescope.builtin')
|
||||||
map('n', '<leader>ff', telescope_builtin.find_files)
|
map('n', '<leader>ff', telescope_builtin.find_files, { desc = 'Find Files' })
|
||||||
map('n', '<leader>fg', telescope_builtin.live_grep)
|
map('n', '<leader>fg', telescope_builtin.live_grep, { desc = 'Live Grep'})
|
||||||
map('n', '<leader>fb', telescope_builtin.buffers)
|
map('n', '<leader>fb', telescope_builtin.buffers, { desc = 'Find Buffers'})
|
||||||
map('n', '<leader>fh', telescope_builtin.help_tags)
|
map('n', '<leader>fh', telescope_builtin.help_tags, { desc = 'Help Tags' })
|
||||||
|
|
||||||
-- NvimTree Toggle (File Explorer)
|
-- NvimTree Toggle (File Explorer)
|
||||||
map('n', '<C-B>', ':NvimTreeToggle<CR>')
|
map('n', '<C-B>', ':NvimTreeToggle<CR>')
|
||||||
|
|
||||||
|
-- ToggleTerm
|
||||||
|
map('n', '<C-t>', ':ToggleTerm<CR>')
|
||||||
|
map('t', '<C-t>', '<C-\\><C-n>:ToggleTerm<CR>')
|
||||||
|
|
||||||
|
-- Pane navigation
|
||||||
|
map('n', '<C-h>', ':wincmd h<CR>')
|
||||||
|
map('n', '<C-j>', ':wincmd j<CR>')
|
||||||
|
map('n', '<C-k>', ':wincmd k<CR>')
|
||||||
|
map('n', '<C-l>', ':wincmd l<CR>')
|
||||||
|
|
||||||
|
map('t', '<C-h>', '<C-\\><C-n>:wincmd h<CR>')
|
||||||
|
map('t', '<C-j>', '<C-\\><C-n>:wincmd j<CR>')
|
||||||
|
map('t', '<C-k>', '<C-\\><C-n>:wincmd k<CR>')
|
||||||
|
map('t', '<C-l>', '<C-\\><C-n>:wincmd l<CR>')
|
||||||
|
|
|
@ -22,3 +22,6 @@ require'nvim-treesitter.configs'.setup {
|
||||||
additional_vim_regex_highlighting = false,
|
additional_vim_regex_highlighting = false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue