From 4db2c45d520732fdb49575e7bde691a437b16c73 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Sat, 9 Mar 2024 00:02:07 +0100 Subject: [PATCH] add some common stuff --- init.lua | 2 +- lua/custom/plugins/init.lua | 5 ----- lua/plugins/common.lua | 12 ++++++++++++ lua/plugins/format.lua | 10 ++++++++++ lua/plugins/git.lua | 6 ++++++ lua/plugins/project.lua | 8 ++++++++ lua/plugins/tree.lua | 19 +++++++++++++++++++ 7 files changed, 56 insertions(+), 6 deletions(-) delete mode 100644 lua/custom/plugins/init.lua create mode 100644 lua/plugins/common.lua create mode 100644 lua/plugins/format.lua create mode 100644 lua/plugins/git.lua create mode 100644 lua/plugins/project.lua create mode 100644 lua/plugins/tree.lua diff --git a/init.lua b/init.lua index 3bdb5e3..18f58ca 100644 --- a/init.lua +++ b/init.lua @@ -818,7 +818,7 @@ require('lazy').setup({ -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - -- { import = 'custom.plugins' }, + { import = 'plugins' }, }, { ui = { -- If you have a Nerd Font, set icons to an empty table which will use the diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua deleted file mode 100644 index be0eb9d..0000000 --- a/lua/custom/plugins/init.lua +++ /dev/null @@ -1,5 +0,0 @@ --- You can add your own plugins here or in other files in this directory! --- I promise not to create any merge conflicts in this directory :) --- --- See the kickstart.nvim README for more information -return {} diff --git a/lua/plugins/common.lua b/lua/plugins/common.lua new file mode 100644 index 0000000..9f06874 --- /dev/null +++ b/lua/plugins/common.lua @@ -0,0 +1,12 @@ +return { + { 'tpope/vim-abolish', lazy = false }, + { 'tpope/vim-unimpaired', lazy = false }, + { + 'folke/trouble.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + opts = {}, + keys = { + { 'd', 'TroubleToggle', desc = 'diagnostic quickfix' }, + }, + }, +} diff --git a/lua/plugins/format.lua b/lua/plugins/format.lua new file mode 100644 index 0000000..b093783 --- /dev/null +++ b/lua/plugins/format.lua @@ -0,0 +1,10 @@ +return { + 'stevearc/conform.nvim', + opts = { + format_on_save = { + -- These options will be passed to conform.format() + timeout_ms = 500, + lsp_fallback = true, + }, + }, +} diff --git a/lua/plugins/git.lua b/lua/plugins/git.lua new file mode 100644 index 0000000..1b59f4d --- /dev/null +++ b/lua/plugins/git.lua @@ -0,0 +1,6 @@ +return { + 'tpope/vim-fugitive', + keys = { + { 'gg', 'Git', desc = 'Git' }, + }, +} diff --git a/lua/plugins/project.lua b/lua/plugins/project.lua new file mode 100644 index 0000000..80814fa --- /dev/null +++ b/lua/plugins/project.lua @@ -0,0 +1,8 @@ +return { + 'ahmedkhalf/project.nvim', + config = function() + require('project_nvim').setup { + patterns = { '.git', '_darcs', '.hg', '.bzr', '.svn', 'Makefile' }, + } + end, +} diff --git a/lua/plugins/tree.lua b/lua/plugins/tree.lua new file mode 100644 index 0000000..ba35888 --- /dev/null +++ b/lua/plugins/tree.lua @@ -0,0 +1,19 @@ +vim.cmd [[ let g:neo_tree_remove_legacy_commands = 1 ]] + +return { + 'nvim-neo-tree/neo-tree.nvim', + version = '*', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended + 'MunifTanjim/nui.nvim', + }, + opts = { + follow_current_file = { + enabled = true, + }, + }, + keys = { + { 'e', ':Neotree toggle', desc = 'NeoTree' }, + }, +}