Added toggleterm.nvim
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "51e10f838e84b4756c16311d0b1ef0972c6482d2" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "066cccf48a43553a80a210eb3be89a15d789d6e6" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "81c867c5f638597a82c82094dcb90ed42444dabc" },
|
||||
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
|
||||
"vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" },
|
||||
|
||||
@@ -17,10 +17,10 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
|
||||
|
||||
-- Window resizing
|
||||
local resize = 2
|
||||
vim.keymap.set('n', '<C-Left>', string.format(':vertical resize -%d<CR>', resize), { desc = 'Resize Left' })
|
||||
vim.keymap.set('n', '<C-Up>', string.format(':resize -%d<CR>', resize), { desc = 'Resize Up' })
|
||||
vim.keymap.set('n', '<C-Down>', string.format(':resize +%d<CR>', resize), { desc = 'Resize Down' })
|
||||
vim.keymap.set('n', '<C-Right>', string.format(':vertical resize +%d<CR>', resize), { desc = 'Resize Right' })
|
||||
vim.keymap.set({ 'n', 't' }, '<C-Left>', string.format(':vertical resize -%d<CR>', resize), { desc = 'Resize Left' })
|
||||
vim.keymap.set({ 'n', 't' }, '<C-Up>', string.format(':resize -%d<CR>', resize), { desc = 'Resize Up' })
|
||||
vim.keymap.set({ 'n', 't' }, '<C-Down>', string.format(':resize +%d<CR>', resize), { desc = 'Resize Down' })
|
||||
vim.keymap.set({ 'n', 't' }, '<C-Right>', string.format(':vertical resize +%d<CR>', resize), { desc = 'Resize Right' })
|
||||
|
||||
-- Keep selection after < and >
|
||||
vim.keymap.set('v', '<', '<gv', {})
|
||||
|
||||
20
.config/nvim/lua/plugins/toggleterm.lua
Normal file
20
.config/nvim/lua/plugins/toggleterm.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
return {
|
||||
-- TODO: Consider maybe not using this, and just using tmux panes
|
||||
'akinsho/toggleterm.nvim',
|
||||
version = '*',
|
||||
config = function()
|
||||
require('toggleterm').setup({})
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = { buffer = 0 }
|
||||
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts)
|
||||
vim.keymap.set('t', '<C-h>', [[<Cmd>wincmd h<CR>]], opts)
|
||||
vim.keymap.set('t', '<C-j>', [[<Cmd>wincmd j<CR>]], opts)
|
||||
vim.keymap.set('t', '<C-k>', [[<Cmd>wincmd k<CR>]], opts)
|
||||
vim.keymap.set('t', '<C-l>', [[<Cmd>wincmd l<CR>]], opts)
|
||||
vim.keymap.set('t', '<C-w>', [[<C-\><C-n><C-w>]], opts)
|
||||
end
|
||||
|
||||
-- if you only want these mappings for toggle term use term://*toggleterm#* instead
|
||||
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
||||
end,
|
||||
}
|
||||
Reference in New Issue
Block a user