From 45a17fe9df6dbb30d3bc684397f6337f15cc6f57 Mon Sep 17 00:00:00 2001 From: Nikurasu Date: Fri, 23 Dec 2022 15:52:20 +0100 Subject: [PATCH] added nvimtree and toggleterm --- nvim/init.lua | 7 +++++++ nvim/lua/plugins/dashboard.lua | 1 + nvim/lua/plugins/init.lua | 5 ++++- nvim/lua/plugins/nvim-tree.lua | 5 +++++ nvim/lua/plugins/packer.lua | 17 ++++++++++++++++- nvim/lua/plugins/toggleterm.lua | 13 +++++++++++++ 6 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 nvim/lua/plugins/dashboard.lua create mode 100644 nvim/lua/plugins/nvim-tree.lua create mode 100644 nvim/lua/plugins/toggleterm.lua diff --git a/nvim/init.lua b/nvim/init.lua index 744048f..a646180 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -61,6 +61,8 @@ vim.cmd [[colorscheme base16-tomorrow-night-eighties]] -- Set completeopt to have a better completion experience vim.o.completeopt = 'menuone,noselect' +vim.g.loaded_netrw = 1 + -- [[ Basic Keymaps ]] -- Set as the leader key -- See `:help mapleader` @@ -82,6 +84,8 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next) vim.keymap.set('n', 'e', vim.diagnostic.open_float) vim.keymap.set('n', 'q', vim.diagnostic.setloclist) +local api = require("nvim-tree.api") +vim.keymap.set('n', 'ft', api.tree.toggle) require('plugins') -- LSP settings. @@ -132,3 +136,6 @@ end -- nvim-cmp supports additional completion capabilities, so broadcast that to servers local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) + +-- disable some stock plugins +vim.g.loaded_netrwPlugin = 1 diff --git a/nvim/lua/plugins/dashboard.lua b/nvim/lua/plugins/dashboard.lua new file mode 100644 index 0000000..f55f7f3 --- /dev/null +++ b/nvim/lua/plugins/dashboard.lua @@ -0,0 +1 @@ +local db = require('dashboard') diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua index 523ca64..85bb1d5 100644 --- a/nvim/lua/plugins/init.lua +++ b/nvim/lua/plugins/init.lua @@ -6,4 +6,7 @@ require('plugins.gitsigns') require('plugins.treesitter') require('plugins.mason') require('plugins.fidget') -require('plugins.cmp') \ No newline at end of file +require('plugins.cmp') +require('plugins.nvim-tree') +require('plugins.toggleterm') +require('plugins.dashboard') diff --git a/nvim/lua/plugins/nvim-tree.lua b/nvim/lua/plugins/nvim-tree.lua new file mode 100644 index 0000000..c0f33e5 --- /dev/null +++ b/nvim/lua/plugins/nvim-tree.lua @@ -0,0 +1,5 @@ +require("nvim-tree").setup({ + filters = { + dotfiles = true, + }, +}) \ No newline at end of file diff --git a/nvim/lua/plugins/packer.lua b/nvim/lua/plugins/packer.lua index d582655..79a5432 100644 --- a/nvim/lua/plugins/packer.lua +++ b/nvim/lua/plugins/packer.lua @@ -39,11 +39,26 @@ require('packer').startup(function(use) 'nvim-treesitter/nvim-treesitter-textobjects', after = 'nvim-treesitter', } + + use { + 'nvim-tree/nvim-tree.lua', + requires = { + 'nvim-tree/nvim-web-devicons', -- optional, for file icons + }, + } + + use { + 'akinsho/toggleterm.nvim' + } use { -- rainbow brackets using treesitter 'p00f/nvim-ts-rainbow', after = 'nvim-treesitter' } + + use { + 'glepnir/dashboard-nvim' + } -- Git related plugins use 'tpope/vim-fugitive' @@ -58,4 +73,4 @@ require('packer').startup(function(use) if is_bootstrap then require('packer').sync() end - end) \ No newline at end of file + end) diff --git a/nvim/lua/plugins/toggleterm.lua b/nvim/lua/plugins/toggleterm.lua new file mode 100644 index 0000000..490cbff --- /dev/null +++ b/nvim/lua/plugins/toggleterm.lua @@ -0,0 +1,13 @@ +require("toggleterm").setup({ + open_mapping = [[tt]] +}) + +vim.cmd "autocmd! TermOpen term://* lua set_terminal_keymaps()" +local Terminal = require("toggleterm.terminal").Terminal +local lazygit = Terminal:new { cmd = 'lazygit', hidden = true, direction = 'float' } + + +function _LAZYGIT_TOGGLE() + lazygit:toggle() + end +