From b4256a60f3613c7c25d015320cfd8f055601ccf5 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Sat, 27 May 2023 03:10:53 +0200 Subject: [PATCH] Added default user files --- config/nvim/lua/user/plugins/core.lua | 77 +++++++++++++++++++++ config/nvim/lua/user/plugins/null-ls.lua | 17 +++++ config/nvim/lua/user/plugins/treesitter.lua | 9 +++ config/nvim/lua/user/plugins/user.lua | 12 ++++ 4 files changed, 115 insertions(+) create mode 100644 config/nvim/lua/user/plugins/core.lua create mode 100644 config/nvim/lua/user/plugins/null-ls.lua create mode 100644 config/nvim/lua/user/plugins/treesitter.lua create mode 100644 config/nvim/lua/user/plugins/user.lua diff --git a/config/nvim/lua/user/plugins/core.lua b/config/nvim/lua/user/plugins/core.lua new file mode 100644 index 0000000..be1fc3e --- /dev/null +++ b/config/nvim/lua/user/plugins/core.lua @@ -0,0 +1,77 @@ +return { + -- customize alpha options + { + "goolord/alpha-nvim", + opts = function(_, opts) + -- customize the dashboard header + opts.section.header.val = { + " █████ ███████ ████████ ██████ ██████", + "██ ██ ██ ██ ██ ██ ██ ██", + "███████ ███████ ██ ██████ ██ ██", + "██ ██ ██ ██ ██ ██ ██ ██", + "██ ██ ███████ ██ ██ ██ ██████", + " ", + " ███  ██ ██  ██ ██ ███  ███", + " ████  ██ ██  ██ ██ ████  ████", + " ██ ██  ██ ██  ██ ██ ██ ████ ██", + " ██  ██ ██  ██  ██  ██ ██  ██  ██", + " ██   ████   ████   ██ ██      ██", + } + return opts + end, + }, + -- You can disable default plugins as follows: + -- { "max397574/better-escape.nvim", enabled = false }, + -- + -- You can also easily customize additional setup of plugins that is outside of the plugin's setup call + -- { + -- "L3MON4D3/LuaSnip", + -- config = function(plugin, opts) + -- require "plugins.configs.luasnip"(plugin, opts) -- include the default astronvim config that calls the setup call + -- -- add more custom luasnip configuration such as filetype extend or custom snippets + -- local luasnip = require "luasnip" + -- luasnip.filetype_extend("javascript", { "javascriptreact" }) + -- end, + -- }, + -- { + -- "windwp/nvim-autopairs", + -- config = function(plugin, opts) + -- require "plugins.configs.nvim-autopairs"(plugin, opts) -- include the default astronvim config that calls the setup call + -- -- add more custom autopairs configuration such as custom rules + -- local npairs = require "nvim-autopairs" + -- local Rule = require "nvim-autopairs.rule" + -- local cond = require "nvim-autopairs.conds" + -- npairs.add_rules( + -- { + -- Rule("$", "$", { "tex", "latex" }) + -- -- don't add a pair if the next character is % + -- :with_pair(cond.not_after_regex "%%") + -- -- don't add a pair if the previous character is xxx + -- :with_pair( + -- cond.not_before_regex("xxx", 3) + -- ) + -- -- don't move right when repeat character + -- :with_move(cond.none()) + -- -- don't delete if the next character is xx + -- :with_del(cond.not_after_regex "xx") + -- -- disable adding a newline when you press + -- :with_cr(cond.none()), + -- }, + -- -- disable for .vim files, but it work for another filetypes + -- Rule("a", "a", "-vim") + -- ) + -- end, + -- }, + -- By adding to the which-key config and using our helper function you can add more which-key registered bindings + -- { + -- "folke/which-key.nvim", + -- config = function(plugin, opts) + -- require "plugins.configs.which-key"(plugin, opts) -- include the default astronvim config that calls the setup call + -- -- Add bindings which show up as group name + -- local wk = require "which-key" + -- wk.register({ + -- b = { name = "Buffer" }, + -- }, { mode = "n", prefix = "" }) + -- end, + -- }, +} diff --git a/config/nvim/lua/user/plugins/null-ls.lua b/config/nvim/lua/user/plugins/null-ls.lua new file mode 100644 index 0000000..beceeda --- /dev/null +++ b/config/nvim/lua/user/plugins/null-ls.lua @@ -0,0 +1,17 @@ +return { + "jose-elias-alvarez/null-ls.nvim", + opts = function(_, config) + -- config variable is the default configuration table for the setup function call + -- local null_ls = require "null-ls" + + -- Check supported formatters and linters + -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting + -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics + config.sources = { + -- Set a formatter + -- null_ls.builtins.formatting.stylua, + -- null_ls.builtins.formatting.prettier, + } + return config -- return final config table + end, +} diff --git a/config/nvim/lua/user/plugins/treesitter.lua b/config/nvim/lua/user/plugins/treesitter.lua new file mode 100644 index 0000000..94bb375 --- /dev/null +++ b/config/nvim/lua/user/plugins/treesitter.lua @@ -0,0 +1,9 @@ +return { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + -- add more things to the ensure_installed table protecting against community packs modifying it + opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, { + "lua", + }) + end, +} diff --git a/config/nvim/lua/user/plugins/user.lua b/config/nvim/lua/user/plugins/user.lua new file mode 100644 index 0000000..acdbf63 --- /dev/null +++ b/config/nvim/lua/user/plugins/user.lua @@ -0,0 +1,12 @@ +return { + -- You can also add new plugins here as well: + -- Add plugins, the lazy syntax + -- "andweeb/presence.nvim", + -- { + -- "ray-x/lsp_signature.nvim", + -- event = "BufRead", + -- config = function() + -- require("lsp_signature").setup() + -- end, + -- }, +}