nvim.config/lua/plugins.lua
2024-09-11 11:50:37 +02:00

290 lines
5.7 KiB
Lua

local version = vim.version()
local function hasversion(major, minor, patch)
if version.major < major then
return false
end
if minor == nil then
return true
end
if version.minor < minor then
return false
end
if patch == nil then
return true
end
return version.patch <= patch
end
return {
{
'rose-pine/neovim',
name = 'rose-pine',
},
{
'sainnhe/everforest',
init = function()
vim.g.everforest_better_performance = 1
vim.g.everforest_dim_inactive_windows = 1
end,
config = function() vim.cmd [[colorscheme everforest]] end
},
{
'L3MON4D3/LuaSnip',
version = 'v2.*',
build = 'make install_jsregexp',
dependencies = { 'rafamadriz/friendly-snippets' },
config = function()
require('luasnip.loaders.from_vscode').lazy_load()
end,
ft = { 'lua' }
},
{
'hrsh7th/nvim-cmp',
config = function() require 'cmp-setup' end,
event = 'VeryLazy',
dependencies = {
'saadparwaiz1/cmp_luasnip',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'hrsh7th/cmp-cmdline',
}
},
'lukas-reineke/cmp-under-comparator',
{
'neovim/nvim-lspconfig',
config = function() require 'lsp-setup' end,
event = { "BufReadPre", "BufNewFile" },
dependencies = { {
'williamboman/mason.nvim',
config = true
}, { "williamboman/mason-lspconfig.nvim", config = true }, }
},
{
"pmizio/typescript-tools.nvim",
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
opts = {},
event = { "BufReadPre", "BufNewFile" }
},
{
'folke/neodev.nvim',
opts = {
override = function(_, library)
library.enabled = true
library.plugins = true
end,
},
enabled = not hasversion(0, 10),
lazy = false
},
{
"folke/lazydev.nvim",
ft = "lua", -- only load on lua files
opts = {
library = {
{ path = "luvit-meta/library", words = { "vim%.uv" } },
},
},
enabled = hasversion(0, 10),
},
{ "Bilal2453/luvit-meta", lazy = true },
'simrat39/rust-tools.nvim',
'mfussenegger/nvim-dap',
{
'numToStr/Comment.nvim',
opts = {}
},
{
'NeogitOrg/neogit',
version = 'v0.0.1',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim',
'sindrets/diffview.nvim',
},
config = true,
cmd = { 'Neogit' }
},
{
'ahmedkhalf/project.nvim',
opts = {},
config = function(_, opts)
require 'gitsigns'.setup(opts)
end,
event = 'VeryLazy'
},
{
'lambdalisue/suda.vim',
cmd = { 'SudaRead', 'SudaWrite' }
},
{
'kylechui/nvim-surround',
version = '*',
opts = {},
},
{
'nvim-treesitter/nvim-treesitter',
config = function()
require 'nvim-treesitter.configs'.setup({
ensure_installed = { 'c', 'lua', 'vim', 'vimdoc', 'query', 'rust', 'cpp' }
})
end,
build = function()
local ts_update = require('nvim-treesitter.install').update({ with_sync = true })
ts_update()
end,
},
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
opts = {
filesystem = {
hijack_netrw_behavior = "open_default"
}
},
keys = {
{ '<F2>', '<cmd>Neotree<CR>', desc = 'View files', mode = { 'n', 'i', 'x' } }
},
lazy = false
},
'direnv/direnv.vim',
{
'folke/which-key.nvim',
event = 'VeryLazy',
opts = {
delay = function(ctx)
return ctx.plugin and 100 or 200
end,
},
keys = {
{
'<leader>?',
function()
require('which-key').show({ global = false })
end,
desc = 'Buffer Local Keymaps',
},
{
'<leader><M-?>',
function()
require('which-key').show({ global = true })
end,
desc = 'All Keymaps',
},
},
config = function(_, opts)
local wk = require('which-key')
wk.setup(opts)
wk.add({
{ '<leader>x', group = 'Trouble' }
})
end
},
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
opts = {}
},
{
'akinsho/bufferline.nvim',
version = "*",
dependencies = 'nvim-tree/nvim-web-devicons',
opts = {
options = {
mode = 'tabs',
separator_style = "slant"
}
}
},
{
'stevearc/conform.nvim',
config = function()
require('conform').setup({
formatters_by_ft = {
lua = { 'stylua' },
rust = { 'rustfmt', lsp_format = 'fallback' },
-- javascript = { '', stop_after_first = true },
},
})
end,
enabled = hasversion(0, 10),
event = 'VeryLazy'
},
{
'folke/trouble.nvim',
opts = {},
cmd = 'Trouble',
keys = {
{
'<leader>xx',
'<cmd>Trouble diagnostics toggle<cr>',
desc = 'Diagnostics (Trouble)',
},
{
'<leader>xX',
'<cmd>Trouble diagnostics toggle filter.buf=0<cr>',
desc = 'Buffer Diagnostics (Trouble)',
},
{
'<leader>xcs',
'<cmd>Trouble symbols toggle focus=false<cr>',
desc = 'Symbols (Trouble)',
},
{
'<leader>xcl',
'<cmd>Trouble lsp toggle focus=false win.position=right<cr>',
desc = 'LSP Definitions / references / ... (Trouble)',
},
{
'<leader>xL',
'<cmd>Trouble loclist toggle<cr>',
desc = 'Location List (Trouble)',
},
{
'<leader>xQ',
'<cmd>Trouble qflist toggle<cr>',
desc = 'Quickfix List (Trouble)',
},
},
},
{
'lewis6991/gitsigns.nvim',
opts = {
current_line_blame = true
},
event = 'VeryLazy'
},
{
'folke/zen-mode.nvim',
keys = {
{ '<leader>zt', function() require 'zen-mode'.toggle() end, desc = 'Toggle zen mode' }
},
opts = {
window = {
options = {
relativenumber = false,
number = false
}
}
}
},
{
'folke/twilight.nvim',
opts = {},
cmd = { 'Twilight', 'TwilightEnable', 'TwilightDisable' }
},
{
'CWood-sdf/spaceport.nvim',
opts = {
replace_dirs = { { 'C:\\Development', '#' } }
},
lazy = false, -- load spaceport immediately
}
}