diff --git a/home/user/.config/nvim/lua/base/plugins/misc.lua b/home/user/.config/nvim/lua/base/plugins/misc.lua index fbda063..d5d6700 100644 --- a/home/user/.config/nvim/lua/base/plugins/misc.lua +++ b/home/user/.config/nvim/lua/base/plugins/misc.lua @@ -29,13 +29,6 @@ return { require('colorizer').setup() end }, - { - 'preservim/tagbar', - keys = { - { 't', 'TagbarToggle' } - }, - enabled = vim.fn.executable "ctags" == 1 - }, { 'preservim/vimux', enabled = vim.fn.executable "tmux" == 1 diff --git a/home/user/.config/nvim/lua/base/plugins/telescope.lua b/home/user/.config/nvim/lua/base/plugins/telescope.lua index 852ee20..997ec98 100644 --- a/home/user/.config/nvim/lua/base/plugins/telescope.lua +++ b/home/user/.config/nvim/lua/base/plugins/telescope.lua @@ -14,7 +14,7 @@ return { { 'fg', 'Telescope live_grep' }, }, config = function() - telescope = require("telescope") + local telescope = require("telescope") telescope.load_extension("fzf") diff --git a/home/user/.config/nvim/lua/base/plugins/toggleterm.lua b/home/user/.config/nvim/lua/base/plugins/toggleterm.lua new file mode 100644 index 0000000..7c765c9 --- /dev/null +++ b/home/user/.config/nvim/lua/base/plugins/toggleterm.lua @@ -0,0 +1,31 @@ +function SET_TERM_KEYMAP(bufnr, key, cmd) + local key_string = string.format([[%s]], key) + local cmd_string = string.format([[%s]], cmd) + vim.api.nvim_buf_set_keymap(bufnr, 't', key_string, cmd_string, { noremap = true }) +end +return { + "akinsho/toggleterm.nvim", + config = function() + local terminal_default = require('toggleterm.terminal').Terminal:new({ + direction = 'horizontal', + on_open = function(term) + SET_TERM_KEYMAP(term.bufnr, 't', 'close') + SET_TERM_KEYMAP(term.bufnr, 'qa', 'qa!') + SET_TERM_KEYMAP(term.bufnr, 'qq', 'bd!') + end + }) + + function _TERMINAL_DEFAULT_TOGGLE() + terminal_default:toggle() + end + + require("toggleterm").setup({ + direction = "horizontal", + shell = vim.o.shell, + hide_numbers = true, + }) + end, + keys = { + {"t", "lua _TERMINAL_DEFAULT_TOGGLE()"}, + } +}