summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/plugins
diff options
context:
space:
mode:
authorSam Nystrom <sam@samnystrom.dev>2023-07-10 14:05:55 -0400
committerSam Nystrom <sam@samnystrom.dev>2023-07-19 11:52:52 -0400
commit0613f29757b688b55b74027063d35dcebc23b10a (patch)
tree65223cfb311adcdadd9d673095c153cba99236cf /.config/nvim/lua/plugins
parent9b4332d25594ff14a4b3038acc4a482325207759 (diff)
nvim: stuff
Diffstat (limited to '.config/nvim/lua/plugins')
-rw-r--r--.config/nvim/lua/plugins/catppuccin.lua3
-rw-r--r--.config/nvim/lua/plugins/dap.lua9
-rw-r--r--.config/nvim/lua/plugins/dressing.lua17
-rw-r--r--.config/nvim/lua/plugins/editor.lua47
-rw-r--r--.config/nvim/lua/plugins/illuminate.lua15
-rw-r--r--.config/nvim/lua/plugins/lsp.lua18
-rw-r--r--.config/nvim/lua/plugins/lualine.lua1
-rw-r--r--.config/nvim/lua/plugins/neotest.lua13
-rw-r--r--.config/nvim/lua/plugins/textobjects.lua17
-rw-r--r--.config/nvim/lua/plugins/treesitter.lua27
10 files changed, 117 insertions, 50 deletions
diff --git a/.config/nvim/lua/plugins/catppuccin.lua b/.config/nvim/lua/plugins/catppuccin.lua
index f4c1987..bddf31a 100644
--- a/.config/nvim/lua/plugins/catppuccin.lua
+++ b/.config/nvim/lua/plugins/catppuccin.lua
@@ -11,6 +11,9 @@ return {
neogit = true,
notify = true,
neotest = true,
+ which_key = true,
+ fidget = true,
+ navic = { enabled = true },
},
})
vim.cmd.colorscheme("catppuccin")
diff --git a/.config/nvim/lua/plugins/dap.lua b/.config/nvim/lua/plugins/dap.lua
index 040511c..25a7c05 100644
--- a/.config/nvim/lua/plugins/dap.lua
+++ b/.config/nvim/lua/plugins/dap.lua
@@ -20,7 +20,7 @@ return {
config = function()
local dapui = require("dapui")
dapui.setup()
-
+
local dap = require("dap")
dap.listeners.after.event_initialized["dapui_config"] = dapui.open
dap.listeners.before.event_terminated["dapui_config"] = dapui.close
@@ -46,6 +46,13 @@ return {
{ "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" },
{ "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
},
+ config = function()
+ require("dap")
+ local sign = vim.fn.sign_define
+ sign("DapBreakpoint", { text = "●", texthl = "DapBreakpoint", linehl = "", numhl = ""})
+ sign("DapBreakpointCondition", { text = "●", texthl = "DapBreakpointCondition", linehl = "", numhl = ""})
+ sign("DapLogPoint", { text = "◆", texthl = "DapLogPoint", linehl = "", numhl = ""})
+ end,
},
}
diff --git a/.config/nvim/lua/plugins/dressing.lua b/.config/nvim/lua/plugins/dressing.lua
new file mode 100644
index 0000000..763aee8
--- /dev/null
+++ b/.config/nvim/lua/plugins/dressing.lua
@@ -0,0 +1,17 @@
+return {
+ {
+ "stevearc/dressing.nvim",
+ lazy = true,
+ init = function()
+ vim.ui.select = function(...)
+ require("lazy").load({ plugins = { "dressing.nvim" } })
+ return vim.ui.select(...)
+ end
+ vim.ui.input = function(...)
+ require("lazy").load({ plugins = { "dressing.nvim" } })
+ return vim.ui.input(...)
+ end
+ end,
+ },
+}
+
diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua
index 7cc48ea..99c4647 100644
--- a/.config/nvim/lua/plugins/editor.lua
+++ b/.config/nvim/lua/plugins/editor.lua
@@ -1,4 +1,15 @@
return {
+ { "nvimdev/hlsearch.nvim", event = { "BufReadPre", "BufNewFile" }, opts = {} },
+ { "folke/todo-comments.nvim", event = { "BufReadPre", "BufNewFile" }, opts = {} },
+ { "kylechui/nvim-surround", event = "VeryLazy", opts = {} },
+ { "numtostr/comment.nvim", event = "VeryLazy", opts = {} },
+ { "folke/neodev.nvim", ft = "lua", opts = {} },
+ { "simrat39/rust-tools.nvim", ft = "rust", opts = {} },
+ {
+ "iamcco/markdown-preview.nvim",
+ build = "cd app && npm install",
+ cmd = { "MarkdownPreview", "MarkdownPreviewStop", "MarkdownPreviewToggle" },
+ },
{
"Olical/conjure",
ft = {
@@ -15,43 +26,9 @@ return {
"lua",
"python",
},
- },
- { "nvimdev/hlsearch.nvim", event = { "BufReadPre", "BufNewFile" }, opts = {} },
- { "folke/todo-comments.nvim", event = { "BufReadPre", "BufNewFile" }, opts = {} },
- { "stevearc/dressing.nvim", event = "VeryLazy", opts = {} },
- { "kylechui/nvim-surround", event = "VeryLazy", opts = {} },
- { "numtostr/comment.nvim", event = "VeryLazy", opts = {} },
- { "folke/neodev.nvim", ft = "lua", opts = {} },
- {
- "iamcco/markdown-preview.nvim",
- build = "cd app && npm install",
- cmd = { "MarkdownPreview", "MarkdownPreviewStop", "MarkdownPreviewToggle" },
- },
- {
- "RRethy/vim-illuminate",
- event = { "BufReadPre", "BufNewFile" },
config = function()
- require("illuminate").configure({
- providers = { "lsp", "treesitter" },
- })
- vim.api.nvim_set_hl(0, "IlluminatedWordText", { link = "illuminatedWord" })
- vim.api.nvim_set_hl(0, "IlluminatedWordRead", { link = "illuminatedWord" })
- vim.api.nvim_set_hl(0, "IlluminatedWordWrite", { link = "illuminatedWord" })
+ vim.g.conjure = { mapping = { doc_word = false } }
end,
},
- {
- "echasnovski/mini.ai",
- event = "VeryLazy",
- config = function()
- local ai = require("mini.ai")
- ai.setup({
- n_lines = 200,
- custom_textobjects = {
- F = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }),
- c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }),
- },
- })
- end
- },
}
diff --git a/.config/nvim/lua/plugins/illuminate.lua b/.config/nvim/lua/plugins/illuminate.lua
new file mode 100644
index 0000000..125f6d8
--- /dev/null
+++ b/.config/nvim/lua/plugins/illuminate.lua
@@ -0,0 +1,15 @@
+return {
+ {
+ "RRethy/vim-illuminate",
+ event = { "BufReadPre", "BufNewFile" },
+ config = function()
+ require("illuminate").configure({
+ providers = { "lsp", "treesitter" },
+ })
+ vim.api.nvim_set_hl(0, "IlluminatedWordText", { link = "illuminatedWord" })
+ vim.api.nvim_set_hl(0, "IlluminatedWordRead", { link = "illuminatedWord" })
+ vim.api.nvim_set_hl(0, "IlluminatedWordWrite", { link = "illuminatedWord" })
+ end,
+ },
+}
+
diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua
index cb4511d..4d169c1 100644
--- a/.config/nvim/lua/plugins/lsp.lua
+++ b/.config/nvim/lua/plugins/lsp.lua
@@ -4,6 +4,12 @@ return {
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"jose-elias-alvarez/null-ls.nvim",
+ {
+ "SmiteshP/nvim-navic",
+ opts = {
+ highlight = true,
+ },
+ },
},
event = { "BufReadPre", "BufNewFile" },
config = function()
@@ -11,10 +17,14 @@ return {
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local common = {
capabilities = capabilities,
+ on_attach = function(client, bufnr)
+ if client.server_capabilities.documentSymbolProvider then
+ require("nvim-navic").attach(client, bufnr)
+ end
+ end,
}
local lsps = {
- "rust_analyzer",
"gopls",
"lua_ls",
"pylsp",
@@ -75,4 +85,10 @@ return {
})
end,
},
+ {
+ "j-hui/fidget.nvim",
+ tag = "legacy",
+ event = "LspAttach",
+ opts = {},
+ },
}
diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua
index 21881b9..ffd1e9a 100644
--- a/.config/nvim/lua/plugins/lualine.lua
+++ b/.config/nvim/lua/plugins/lualine.lua
@@ -2,6 +2,7 @@ return {
{
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
+ event = "VeryLazy",
opts = {
options = {
theme = "catppuccin",
diff --git a/.config/nvim/lua/plugins/neotest.lua b/.config/nvim/lua/plugins/neotest.lua
index 74817a5..5e22696 100644
--- a/.config/nvim/lua/plugins/neotest.lua
+++ b/.config/nvim/lua/plugins/neotest.lua
@@ -7,6 +7,8 @@ return {
"antoinemadec/FixCursorHold.nvim",
"nvim-neotest/neotest-python",
+ "rouge8/neotest-rust",
+ "nvim-neotest/neotest-go",
},
keys = {
{ "<leader>tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run buffer" },
@@ -23,9 +25,20 @@ return {
{ "<leader>tws", function() require("neotest").watch.stop() end, desc = "Stop watching" },
},
config = function()
+ local neotest_ns = vim.api.nvim_create_namespace("neotest")
+ vim.diagnostic.config({
+ virtual_text = {
+ format = function(diagnostic)
+ return diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "")
+ end,
+ },
+ }, neotest_ns)
+
require("neotest").setup({
adapters = {
require("neotest-python"),
+ require("neotest-rust"),
+ require("neotest-go"),
},
})
end,
diff --git a/.config/nvim/lua/plugins/textobjects.lua b/.config/nvim/lua/plugins/textobjects.lua
new file mode 100644
index 0000000..909ece4
--- /dev/null
+++ b/.config/nvim/lua/plugins/textobjects.lua
@@ -0,0 +1,17 @@
+return {
+ {
+ "echasnovski/mini.ai",
+ event = "VeryLazy",
+ config = function()
+ local ai = require("mini.ai")
+ ai.setup({
+ n_lines = 200,
+ custom_textobjects = {
+ F = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }),
+ c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }),
+ },
+ })
+ end
+ },
+}
+
diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua
index ba45ada..e07c895 100644
--- a/.config/nvim/lua/plugins/treesitter.lua
+++ b/.config/nvim/lua/plugins/treesitter.lua
@@ -7,24 +7,25 @@ return {
require("nvim-treesitter.configs").setup({
auto_install = true,
ensure_installed = {
- "lua",
- "python",
- "rust",
"bash",
- "regex",
- "json",
- "toml",
- "yaml",
- "ini",
- "markdown",
- "html",
+ "clojure",
"css",
+ "html",
+ "ini",
"javascript",
- "typescript",
- "tsx",
+ "json",
+ "kotlin",
+ "lua",
+ "markdown",
+ "python",
+ "regex",
+ "rust",
"scss",
- "clojure",
"sql",
+ "toml",
+ "tsx",
+ "typescript",
+ "yaml",
},
highlight = { enable = true },
})