feat: add toggleterm

This commit is contained in:
Michael Mandl 2022-02-21 16:46:37 +01:00
parent c341636729
commit 9c8ed18e9e
Signed by: mandlm
GPG key ID: 4AA25D647AA54CC7
2 changed files with 26 additions and 0 deletions

View file

@ -30,3 +30,15 @@ nnoremap("<leader>G", ":tab G<CR>")
nnoremap("<leader>ff", "<Cmd>Telescope find_files theme=dropdown<CR>")
nnoremap("<leader>fb", "<Cmd>Telescope buffers theme=dropdown<CR>")
nnoremap("<leader>fg", "<Cmd>Telescope git_files theme=dropdown<CR>")
-- terminal
function _G.set_terminal_keymaps()
local opts = {noremap = true}
vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
vim.api.nvim_buf_set_keymap(0, 't', '<C-h>', [[<C-\><C-n><C-W>h]], opts)
vim.api.nvim_buf_set_keymap(0, 't', '<C-j>', [[<C-\><C-n><C-W>j]], opts)
vim.api.nvim_buf_set_keymap(0, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
vim.api.nvim_buf_set_keymap(0, 't', '<C-l>', [[<C-\><C-n><C-W>l]], opts)
end
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')

View file

@ -119,6 +119,20 @@ return require('packer').startup(function(use)
config = function() require('plugins.telescope') end,
})
-- markdown preview
use({'iamcco/markdown-preview.nvim'})
-- terminal
use({
"akinsho/nvim-toggleterm.lua",
config = function()
require("toggleterm").setup({
size = 32,
open_mapping = [[<F4>]],
})
end,
})
if packer_bootstrap then
require('packer').sync()
end