summaryrefslogtreecommitdiff
path: root/lua/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'lua/plugins')
-rw-r--r--lua/plugins/completions.lua52
-rw-r--r--lua/plugins/dadbod.lua16
-rw-r--r--lua/plugins/debugging.lua68
-rw-r--r--lua/plugins/indent-blankline.lua13
-rw-r--r--lua/plugins/lsp-config.lua55
-rw-r--r--lua/plugins/none-ls.lua16
-rw-r--r--lua/plugins/rustaceanvim.lua5
-rw-r--r--lua/plugins/tailwind-tools.lua5
-rw-r--r--lua/plugins/treesitter.lua18
9 files changed, 248 insertions, 0 deletions
diff --git a/lua/plugins/completions.lua b/lua/plugins/completions.lua
new file mode 100644
index 0000000..5aa87aa
--- /dev/null
+++ b/lua/plugins/completions.lua
@@ -0,0 +1,52 @@
+return {
+ {
+ "hrsh7th/cmp-nvim-lsp",
+ lazy = false,
+ config = true,
+ },
+ {
+ "L3MON4D3/LuaSnip",
+ lazy = false,
+ dependencies = {
+ "saadparwaiz1/cmp_luasnip",
+ "rafamadriz/friendly-snippets",
+ },
+ config = function()
+ require("luasnip.loaders.from_vscode").lazy_load()
+ require("luasnip.loaders.from_vscode").load({ paths = { "~/.config/nvim/snippets" } })
+ end,
+ },
+ {
+ "hrsh7th/nvim-cmp",
+ lazy = false,
+ config = function()
+ local cmp = require("cmp")
+ cmp.setup({
+ snippet = {
+ expand = function(args)
+ require("luasnip").lsp_expand(args.body)
+ end,
+ },
+ window = {
+ completion = cmp.config.window.bordered(),
+ documentation = cmp.config.window.bordered(),
+ },
+ mapping = cmp.mapping.preset.insert({
+ ["<Tab>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
+ ["<S-Tab>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
+ ["<C-b>"] = cmp.mapping.scroll_docs(-4),
+ ["<C-f>"] = cmp.mapping.scroll_docs(4),
+ ["<C-Space>"] = cmp.mapping.complete(),
+ ["<C-e>"] = cmp.mapping.abort(),
+ ["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
+ }),
+ sources = cmp.config.sources({
+ { name = "nvim_lsp" },
+ { name = "luasnip" },
+ }, {
+ { name = "buffer" },
+ }),
+ })
+ end,
+ },
+}
diff --git a/lua/plugins/dadbod.lua b/lua/plugins/dadbod.lua
new file mode 100644
index 0000000..888e066
--- /dev/null
+++ b/lua/plugins/dadbod.lua
@@ -0,0 +1,16 @@
+return {
+ "kristijanhusak/vim-dadbod-ui",
+ dependencies = {
+ { "tpope/vim-dadbod", lazy = true },
+ { "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql", "sqloracle" }, lazy = true },
+ },
+ cmd = {
+ "DBUI",
+ "DBUIToggle",
+ "DBUIAddConnection",
+ "DBUIFindBuffer",
+ },
+ init = function()
+ vim.g.db_ui_use_nerd_fonts = 1
+ end,
+}
diff --git a/lua/plugins/debugging.lua b/lua/plugins/debugging.lua
new file mode 100644
index 0000000..0479f28
--- /dev/null
+++ b/lua/plugins/debugging.lua
@@ -0,0 +1,68 @@
+return {
+ "mfussenegger/nvim-dap",
+ dependencies = {
+ "rcarriga/nvim-dap-ui",
+ "nvim-neotest/nvim-nio",
+ },
+
+ config = function()
+ local dap, dapui = require("dap"), require("dapui")
+
+ require("dapui").setup()
+
+ dap.listeners.before.attach.dapui_config = function()
+ dapui.open()
+ end
+ dap.listeners.before.launch.dapui_config = function()
+ dapui.open()
+ end
+ dap.listeners.before.event_terminated.dapui_config = function()
+ dapui.close()
+ end
+ dap.listeners.before.event_exited.dapui_config = function()
+ dapui.close()
+ end
+
+ dap.adapters.lldb = {
+ type = "executable",
+ command = "/usr/bin/lldb-vscode",
+ name = "lldb",
+ }
+
+ dap.configurations.rust = {
+ {
+ name = "Launch",
+ type = "lldb",
+ request = "launch",
+ program = function()
+ return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
+ end,
+ cwd = "${workspaceFolder}",
+ stopOnEntry = false,
+ args = {},
+
+ initCommands = function()
+ -- Find out where to look for the pretty printer Python module
+ local rustc_sysroot = vim.fn.trim(vim.fn.system("rustc --print sysroot"))
+
+ local script_import = 'command script import "'
+ .. rustc_sysroot
+ .. '/lib/rustlib/etc/lldb_lookup.py"'
+ local commands_file = rustc_sysroot .. "/lib/rustlib/etc/lldb_commands"
+
+ local commands = {}
+ local file = io.open(commands_file, "r")
+ if file then
+ for line in file:lines() do
+ table.insert(commands, line)
+ end
+ file:close()
+ end
+ table.insert(commands, 1, script_import)
+
+ return commands
+ end,
+ },
+ }
+ end,
+}
diff --git a/lua/plugins/indent-blankline.lua b/lua/plugins/indent-blankline.lua
new file mode 100644
index 0000000..ac33ea1
--- /dev/null
+++ b/lua/plugins/indent-blankline.lua
@@ -0,0 +1,13 @@
+return {
+ "lukas-reineke/indent-blankline.nvim",
+ main = "ibl",
+ opts = {},
+ config = function()
+ require("ibl").setup({
+ whitespace = {
+ remove_blankline_trail = true,
+ },
+ scope = { enabled = false },
+ })
+ end,
+}
diff --git a/lua/plugins/lsp-config.lua b/lua/plugins/lsp-config.lua
new file mode 100644
index 0000000..af20e91
--- /dev/null
+++ b/lua/plugins/lsp-config.lua
@@ -0,0 +1,55 @@
+return {
+ {
+ "williamboman/mason.nvim",
+ config = function()
+ require("mason").setup()
+ end,
+ },
+ {
+ "williamboman/mason-lspconfig.nvim",
+ config = function()
+ require("mason-lspconfig").setup({
+ ensure_installed = {
+ "lua_ls",
+ "rust_analyzer",
+ "texlab",
+ "svelte",
+ "bashls",
+ "cssls",
+ "html",
+ "vtsls",
+ "ts_ls",
+ "clangd",
+ "tailwindcss",
+ },
+ })
+ end,
+ },
+ {
+ "neovim/nvim-lspconfig",
+ config = function()
+ local capabilities = require("cmp_nvim_lsp").default_capabilities()
+
+ local lspconfig = require("lspconfig")
+ local servers = {
+ "lua_ls",
+ "texlab",
+ "svelte",
+ "bashls",
+ "cssls",
+ "html",
+ "vtsls",
+ "ts_ls",
+ "clangd",
+ "clangd",
+ "tailwindcss",
+ }
+
+ for _, lsp in ipairs(servers) do
+ lspconfig[lsp].setup({
+ capabilities = capabilities,
+ })
+ end
+ end,
+ },
+}
diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua
new file mode 100644
index 0000000..c43dd73
--- /dev/null
+++ b/lua/plugins/none-ls.lua
@@ -0,0 +1,16 @@
+return {
+ "nvimtools/none-ls.nvim",
+ config = function()
+ local null_ls = require("null-ls")
+
+ null_ls.setup({
+ sources = {
+ null_ls.builtins.formatting.stylua,
+ null_ls.builtins.formatting.prettier,
+ null_ls.builtins.formatting.markdownlint,
+ null_ls.builtins.formatting.sql_formatter,
+ null_ls.builtins.formatting.bibclean,
+ },
+ })
+ end,
+}
diff --git a/lua/plugins/rustaceanvim.lua b/lua/plugins/rustaceanvim.lua
new file mode 100644
index 0000000..168e16e
--- /dev/null
+++ b/lua/plugins/rustaceanvim.lua
@@ -0,0 +1,5 @@
+return {
+ "mrcjkb/rustaceanvim",
+ version = "^5", -- Recommended
+ lazy = false, -- This plugin is already lazy
+}
diff --git a/lua/plugins/tailwind-tools.lua b/lua/plugins/tailwind-tools.lua
new file mode 100644
index 0000000..eddbc7f
--- /dev/null
+++ b/lua/plugins/tailwind-tools.lua
@@ -0,0 +1,5 @@
+return {
+ "luckasRanarison/tailwind-tools.nvim",
+ dependencies = { "nvim-treesitter/nvim-treesitter" },
+ opts = {}, -- your configuration
+}
diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua
new file mode 100644
index 0000000..ca5e733
--- /dev/null
+++ b/lua/plugins/treesitter.lua
@@ -0,0 +1,18 @@
+return {
+ "nvim-treesitter/nvim-treesitter",
+ build = ":TSUpdate",
+ config = function()
+ local configs = require("nvim-treesitter.configs")
+ configs.setup({
+ sync_install = false,
+
+ auto_install = true,
+
+ highlight = {
+ enable = true,
+ additional_vim_regex_highlighting = false,
+ },
+ indent = { enable = true },
+ })
+ end,
+}