nvim(feat): nvim terminal by <Leader>t, nvim(rm): removed tagbar plugin
This commit is contained in:
parent
24b2a44de1
commit
f3017e49c3
@ -29,13 +29,6 @@ return {
|
|||||||
require('colorizer').setup()
|
require('colorizer').setup()
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
|
||||||
'preservim/tagbar',
|
|
||||||
keys = {
|
|
||||||
{ '<Leader>t', '<cmd>TagbarToggle<CR>' }
|
|
||||||
},
|
|
||||||
enabled = vim.fn.executable "ctags" == 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
'preservim/vimux',
|
'preservim/vimux',
|
||||||
enabled = vim.fn.executable "tmux" == 1
|
enabled = vim.fn.executable "tmux" == 1
|
||||||
|
|||||||
@ -14,7 +14,7 @@ return {
|
|||||||
{ '<Leader>fg', '<cmd>Telescope live_grep<CR>' },
|
{ '<Leader>fg', '<cmd>Telescope live_grep<CR>' },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
telescope = require("telescope")
|
local telescope = require("telescope")
|
||||||
|
|
||||||
telescope.load_extension("fzf")
|
telescope.load_extension("fzf")
|
||||||
|
|
||||||
|
|||||||
31
home/user/.config/nvim/lua/base/plugins/toggleterm.lua
Normal file
31
home/user/.config/nvim/lua/base/plugins/toggleterm.lua
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
function SET_TERM_KEYMAP(bufnr, key, cmd)
|
||||||
|
local key_string = string.format([[<Leader>%s]], key)
|
||||||
|
local cmd_string = string.format([[<cmd>%s<CR>]], 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 = {
|
||||||
|
{"<Leader>t", "<cmd>lua _TERMINAL_DEFAULT_TOGGLE()<CR>"},
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user