dotfiles/nvim/lua/plugins.lua

300 lines
6.6 KiB
Lua
Raw Normal View History

2023-09-02 22:09:00 +02:00
local U = require("utility")
2023-08-20 14:27:47 +02:00
return {
2023-08-19 21:48:52 +02:00
2023-07-22 13:52:10 +02:00
-- Editor theme
2023-08-20 14:27:47 +02:00
{
"rebelot/kanagawa.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd("colorscheme kanagawa")
end,
},
2023-07-22 13:52:10 +02:00
-- Status line
2023-08-20 14:27:47 +02:00
{
"nvim-lualine/lualine.nvim",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
config = function()
local lualine = require("lualine")
lualine.setup({})
end
},
2023-07-22 13:52:10 +02:00
2023-09-02 22:09:00 +02:00
-- Telescope
2023-07-22 15:40:45 +02:00
{
2023-09-02 22:09:00 +02:00
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
2023-07-22 15:40:45 +02:00
dependencies = {
"nvim-lua/plenary.nvim",
2023-09-02 22:09:00 +02:00
{"nvim-telescope/telescope-fzf-native.nvim", build = "make"}
2023-07-22 15:40:45 +02:00
},
2023-09-02 22:09:00 +02:00
config = function()
local telescope = require "telescope"
local builtin = require "telescope.builtin"
telescope.setup({
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
}
}
})
telescope.load_extension("fzf")
2023-09-04 23:01:56 +02:00
local nmap = U.keymap 'n'
2023-09-02 22:09:00 +02:00
nmap "<leader>ff" (builtin.find_files) "Telescope: find files"
nmap "<leader>fb" (builtin.buffers) "Telescope: find buffers"
nmap "<leader>fg" (builtin.live_grep) "Telescope: grep content"
nmap "<leader>fh" (builtin.help_tags) "Telescope: search docs"
end,
2023-07-22 15:40:45 +02:00
},
{
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
opts = {}
},
2023-09-02 22:09:00 +02:00
-- File tree
2023-07-10 13:46:48 +02:00
{
2023-09-02 22:09:00 +02:00
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
2023-07-11 22:41:32 +02:00
dependencies = {
"nvim-lua/plenary.nvim",
2023-09-02 22:09:00 +02:00
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
2023-07-11 22:41:32 +02:00
},
2023-07-22 13:52:10 +02:00
},
2023-07-29 21:15:17 +02:00
-- Bufferline
{
'akinsho/bufferline.nvim',
version = "*",
dependencies = {
'nvim-tree/nvim-web-devicons'
},
config = function()
local config = require("bufferline")
2023-08-20 14:27:47 +02:00
config.setup()
2023-07-29 21:15:17 +02:00
end
},
2023-07-22 15:40:45 +02:00
-- Git diffviewer
{
"sindrets/diffview.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
},
},
-- Git signs
{
"lewis6991/gitsigns.nvim",
config = function()
local gitsigns = require("gitsigns")
2023-08-20 14:27:47 +02:00
gitsigns.setup({})
2023-07-22 13:52:10 +02:00
end,
2023-07-10 13:46:48 +02:00
},
2023-07-22 13:52:10 +02:00
2023-10-23 22:35:53 +02:00
{
"andweeb/presence.nvim",
config = function()
require("presence").setup {
main_image = "file",
show_time = false,
buttons = false,
}
end
},
2023-07-10 22:33:59 +02:00
-- Treesitter
2023-07-10 15:18:34 +02:00
{
"nvim-treesitter/nvim-treesitter",
2023-07-22 13:52:10 +02:00
build = ":TSUpdate",
2023-07-11 22:41:32 +02:00
config = function()
local configs = require("nvim-treesitter.configs");
configs.setup({
2023-07-22 13:52:10 +02:00
sync_install = false,
2023-07-11 22:41:32 +02:00
ensure_installed = {
-- nvim
"vim", "vimdoc", "lua",
2023-07-22 13:52:10 +02:00
-- misc
2023-07-29 21:15:17 +02:00
"comment", "dockerfile", "json", "yaml", "toml", "regex",
-- git
"gitcommit", "gitignore", "diff",
2023-07-11 22:41:32 +02:00
-- shell
"bash",
2023-07-22 13:52:10 +02:00
-- markdown
"markdown", "markdown_inline",
2023-07-11 22:41:32 +02:00
-- python
"python",
2023-07-22 13:52:10 +02:00
-- rust
"rust",
2023-07-11 22:41:32 +02:00
-- webdev
"html", "css", "scss", "javascript", "jsdoc", "typescript", "tsx", "astro", "svelte",
2023-07-11 22:41:32 +02:00
-- haskell
"haskell",
2023-07-22 13:52:10 +02:00
-- nix
"nix",
2023-07-12 19:15:14 +02:00
-- literate
"latex", "bibtex",
2023-07-11 22:41:32 +02:00
},
2023-07-22 13:52:10 +02:00
highlight = {
enable = true,
},
indent = {
enable = true,
},
2023-07-11 22:41:32 +02:00
})
end,
2023-07-10 15:18:34 +02:00
init = function()
vim.treesitter.language.register("markdown", "mdx")
2023-08-16 18:40:52 +02:00
vim.treesitter.language.register("haskell", "purescript")
2023-07-11 22:41:32 +02:00
end,
2023-07-10 15:18:34 +02:00
},
2023-07-22 13:52:10 +02:00
-- LS configs
2023-09-26 21:19:51 +02:00
{
2023-07-10 13:46:48 +02:00
"neovim/nvim-lspconfig",
2023-07-10 22:33:59 +02:00
},
2023-07-22 13:52:10 +02:00
2023-07-10 22:33:59 +02:00
-- Snippet engine
{
2023-07-22 15:40:45 +02:00
"L3MON4D3/LuaSnip",
version = "2.*",
2023-07-10 22:33:59 +02:00
},
2023-07-22 15:40:45 +02:00
2023-07-10 22:33:59 +02:00
-- Completion
2023-08-20 14:27:47 +02:00
U.plugin("plugins.cmp") {
2023-07-10 22:33:59 +02:00
"hrsh7th/nvim-cmp",
dependencies = {
2023-07-11 22:41:32 +02:00
"hrsh7th/cmp-cmdline",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
2023-07-22 15:40:45 +02:00
"hrsh7th/cmp-nvim-lsp",
2023-07-10 22:33:59 +02:00
"saadparwaiz1/cmp_luasnip",
},
2023-07-10 13:46:48 +02:00
},
2023-07-22 15:40:45 +02:00
-- Debugger adapter support
2023-07-11 23:48:37 +02:00
{
"mfussenegger/nvim-dap",
config = function()
2023-07-22 15:40:45 +02:00
local dap = require("dap")
2023-07-11 23:48:37 +02:00
vim.keymap.set('n', "<leader>b", dap.toggle_breakpoint)
end,
},
2023-07-22 15:40:45 +02:00
-- Debugger UI
2023-08-20 14:27:47 +02:00
U.plugin("plugins.dap-ui") {
2023-07-11 23:48:37 +02:00
"rcarriga/nvim-dap-ui",
dependencies = {
"mfussenegger/nvim-dap",
},
},
2023-07-22 15:40:45 +02:00
2023-07-11 23:48:37 +02:00
-- Mason
{
"williamboman/mason.nvim",
config = function()
2023-07-22 15:40:45 +02:00
local mason = require("mason")
mason.setup()
2023-07-11 23:48:37 +02:00
end,
},
2023-07-22 15:40:45 +02:00
-- Automatic language server install
2023-07-11 23:48:37 +02:00
{
"williamboman/mason-lspconfig.nvim",
2023-07-22 15:40:45 +02:00
dependencies = {
"williamboman/mason.nvim",
"neovim/nvim-lspconfig",
},
2023-07-11 23:48:37 +02:00
config = function()
2023-07-22 15:40:45 +02:00
local config = require("mason-lspconfig")
config.setup({
2023-07-11 23:48:37 +02:00
automatic_installation = true,
2023-07-22 15:40:45 +02:00
-- NOTE
-- Haskell: Use GHCup installation instead of hls
2023-07-11 23:48:37 +02:00
ensure_installed = {
2023-07-12 19:15:14 +02:00
"lua_ls", -- Lua
2023-10-23 22:35:53 +02:00
"bashls", -- Bash
2023-07-12 00:34:27 +02:00
"rust_analyzer", -- Rust
2023-07-12 19:15:14 +02:00
"html", -- HTML
"cssls", -- CSS / SCSS
2023-07-12 00:34:27 +02:00
"tsserver", -- TypeScript
"astro", -- Astro
"svelte", -- Svelte
2023-07-12 19:15:14 +02:00
"pyright", -- Python
2023-07-12 19:49:49 +02:00
"rnix", -- Nix
2023-08-16 18:40:52 +02:00
"purescriptls", -- Purescript
"ltex", -- Literate - LaTeX, Markdown, etc.
2023-07-11 23:48:37 +02:00
},
})
2023-07-12 19:15:14 +02:00
2023-07-22 15:40:45 +02:00
local lspconfig = require("lspconfig")
2023-07-12 19:15:14 +02:00
local capabilities = require("cmp_nvim_lsp").default_capabilities()
2023-07-22 15:40:45 +02:00
config.setup_handlers({
2023-07-12 19:15:14 +02:00
function(server)
2023-07-22 15:40:45 +02:00
lspconfig[server].setup({
2023-07-12 19:15:14 +02:00
single_file_support = true,
capabilities = capabilities,
})
end,
["lua_ls"] = function()
2023-07-22 15:40:45 +02:00
lspconfig.lua_ls.setup({
2023-07-12 19:15:14 +02:00
single_file_support = true,
capabilities = capabilities,
2023-07-22 15:40:45 +02:00
settings = { Lua = { diagnostics = { globals = { "vim" } } } },
2023-07-12 19:15:14 +02:00
})
end,
})
2023-07-11 23:48:37 +02:00
end,
},
2023-07-22 15:40:45 +02:00
-- Automatic debugger install
2023-07-11 23:48:37 +02:00
{
"jay-babu/mason-nvim-dap.nvim",
2023-07-22 15:40:45 +02:00
dependencies = {
"mfussenegger/nvim-dap",
"williamboman/mason.nvim",
},
2023-07-11 23:48:37 +02:00
config = function()
2023-07-22 15:40:45 +02:00
local config = require("mason-nvim-dap")
config.setup({
2023-07-11 23:48:37 +02:00
automatic_installation = true,
ensure_installed = {
2023-07-12 01:00:44 +02:00
"codelldb", -- Rust
2023-07-11 23:48:37 +02:00
},
})
end,
},
2023-07-22 15:40:45 +02:00
-- Tools for Rust
2023-08-20 14:27:47 +02:00
U.plugin("plugins.rust-tools") {
2023-07-10 14:30:11 +02:00
"simrat39/rust-tools.nvim",
2023-07-22 15:40:45 +02:00
ft = "rust",
2023-07-10 14:30:11 +02:00
},
2023-07-22 15:40:45 +02:00
-- Tools for Haskell
2023-08-20 14:27:47 +02:00
U.plugin("plugins.haskell-tools") {
2023-07-10 15:18:34 +02:00
"mrcjkb/haskell-tools.nvim",
branch = "2.x.x",
ft = {"haskell", "lhaskell", "cabal", "cabalproject"},
2023-07-12 01:00:44 +02:00
dependencies = {
"nvim-lua/plenary.nvim",
2023-07-22 15:40:45 +02:00
"nvim-telescope/telescope.nvim",
2023-07-12 01:00:44 +02:00
},
},
2023-07-22 15:40:45 +02:00
2023-07-10 13:46:48 +02:00
}