From 24010810b8a43ed3d00ce364fc481604c508f73e Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Tue, 10 Oct 2023 10:35:46 -0400 Subject: [PATCH] add toggle term --- home-config/nvim/lua/keybinds.lua | 4 ++++ home-config/nvim/lua/lsp.lua | 1 + home-config/nvim/lua/plugin.lua | 1 + 3 files changed, 6 insertions(+) diff --git a/home-config/nvim/lua/keybinds.lua b/home-config/nvim/lua/keybinds.lua index 67cbfd4..fa9d711 100644 --- a/home-config/nvim/lua/keybinds.lua +++ b/home-config/nvim/lua/keybinds.lua @@ -1,6 +1,8 @@ local opts = { noremap = true, silent = true } local keymap = vim.keymap.set local builtin = require('telescope.builtin') +local Terminal = require('toggleterm.terminal').Terminal +local term_float = Terminal:new({ direction = 'float', hidden = 'true' }) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' @@ -17,3 +19,5 @@ keymap('n', 'fh', builtin.help_tags, {}) keymap('n', 'u', vim.cmd.UndotreeToggle) keymap('n', 'gs', vim.cmd.Git) keymap('n', 't', function() require('trouble').toggle() end) +keymap('n', 's', function() term_float:toggle() end) +keymap('t', 's', function() term_float:toggle() end) diff --git a/home-config/nvim/lua/lsp.lua b/home-config/nvim/lua/lsp.lua index df870ce..6896146 100644 --- a/home-config/nvim/lua/lsp.lua +++ b/home-config/nvim/lua/lsp.lua @@ -74,3 +74,4 @@ vim.diagnostic.config({ require("neodev").setup() require("nvim-surround").setup() +require("toggleterm").setup() diff --git a/home-config/nvim/lua/plugin.lua b/home-config/nvim/lua/plugin.lua index 72be553..bc3af68 100644 --- a/home-config/nvim/lua/plugin.lua +++ b/home-config/nvim/lua/plugin.lua @@ -33,5 +33,6 @@ Plug('j-hui/fidget.nvim', { tag = 'legacy' }) Plug('rcarriga/nvim-notify') Plug('folke/trouble.nvim') Plug('kylechui/nvim-surround') +Plug('akinsho/toggleterm.nvim', {tag = '*'}) vim.call('plug#end')