420 lines
14 KiB
Lua
420 lines
14 KiB
Lua
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
if not vim.loop.fs_stat(lazypath) then
|
|
vim.fn.system({
|
|
"git",
|
|
"clone",
|
|
"--filter=blob:none",
|
|
"https://github.com/folke/lazy.nvim.git",
|
|
"--branch=stable", -- latest stable release
|
|
lazypath,
|
|
})
|
|
end
|
|
vim.opt.rtp:prepend(lazypath)
|
|
|
|
require("lazy").setup({
|
|
-- Color schemes. Lazy, only selected will be loaded.
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'sainnhe/gruvbox-material',
|
|
lazy = true,
|
|
config = function(_)
|
|
vim.g.gruvbox_material_palette = 'material'
|
|
vim.g.gruvbox_material_background = 'hard'
|
|
vim.g.gruvbox_material_enable_bold = 1
|
|
end
|
|
},
|
|
{
|
|
'rebelot/kanagawa.nvim',
|
|
lazy = true,
|
|
},
|
|
{
|
|
'savq/melange-nvim',
|
|
lazy = true,
|
|
},
|
|
{
|
|
'marko-cerovac/material.nvim',
|
|
lazy = true,
|
|
opts = {
|
|
italics = {
|
|
comments = true,
|
|
},
|
|
|
|
plugins = {
|
|
neogit = false,
|
|
sidebar_nvim = false,
|
|
lsp_saga = false,
|
|
nvim_dap = false,
|
|
nvim_navic = false,
|
|
hop = false,
|
|
}
|
|
}
|
|
},
|
|
{
|
|
'EdenEast/nightfox.nvim',
|
|
build = ':NightfoxCompile',
|
|
lazy = true,
|
|
opts = {
|
|
options = {
|
|
styles = {
|
|
comments = "italic",
|
|
keywords = "bold",
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
-- Common dependency for Lua plugins
|
|
-- -------------------------------------------------------------------------
|
|
'nvim-lua/plenary.nvim',
|
|
|
|
-- Common dependency for many plugins (visual)
|
|
-- -------------------------------------------------------------------------
|
|
'nvim-tree/nvim-web-devicons',
|
|
|
|
{
|
|
"folke/which-key.nvim",
|
|
config = function()
|
|
require("which-key").setup({
|
|
-- customize as desired
|
|
})
|
|
end,
|
|
},
|
|
|
|
-- Fuzzy finder (files, buffers, live grep, etc.)
|
|
-- Includes a native build based on FZF for performance.
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'nvim-telescope/telescope.nvim',
|
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
|
keys = {
|
|
{ ';', '<cmd>Telescope buffers<CR>', desc = 'Find Buffer' },
|
|
{ '<C-P>', '<cmd>Telescope find_files<CR>', desc = 'Find File' },
|
|
{ '<leader>fg', '<cmd>Telescope live_grep<CR>', desc = 'Live Grep' },
|
|
{ '<leader>fm', '<cmd>Telescope metals commands<CR>', desc = 'Find Metals Command' },
|
|
{ '<leader>ft', '<cmd>TodoTelescope<CR>', desc = 'Find TODO' },
|
|
}
|
|
},
|
|
{
|
|
'nvim-telescope/telescope-fzf-native.nvim',
|
|
build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build',
|
|
config = function(_)
|
|
require('telescope').load_extension('fzf')
|
|
end
|
|
},
|
|
|
|
-- A pretty list for showing diagnostics, references, telescope results,
|
|
-- quickfix and location lists to help you solve all the trouble your code
|
|
-- is causing.
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'folke/trouble.nvim',
|
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
|
keys = {
|
|
{ '<leader>xx', '<cmd>TroubleToggle<CR>', desc = 'Trouble' },
|
|
{ '<leader>xw', '<cmd>TroubleToggle workspace_diagnostics<CR>', desc = 'Workspace Diagnostics' },
|
|
{ '<leader>xd', '<cmd>TroubleToggle document_diagnostics<CR>', desc = 'Document Diagnostics' },
|
|
{ '<leader>xq', '<cmd>TroubleToggle quickfix<CR>', desc = 'Quickfix' },
|
|
{ '<leader>xl', '<cmd>TroubleToggle loclist<CR>', desc = 'Local List' },
|
|
{ '<leader>xr', '<cmd>TroubleToggle lsp_references<CR>', desc = 'LSP References' },
|
|
{ '<leader>xr', '<cmd>TodoTrouble<CR>', desc = 'Show TODOs' },
|
|
}
|
|
},
|
|
|
|
-- Treesitter: Neovim bindings for the Tree-sitter parser generator tool and
|
|
-- incremental parsing library.
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'nvim-treesitter/nvim-treesitter',
|
|
build = ':TSUpdate'
|
|
},
|
|
|
|
-- Neovim-native LSP Implementation
|
|
--
|
|
-- Some languages are supported elsewhere via plugins that know how to
|
|
-- initialize neovim-lsp under the covers:
|
|
-- - rust (rustaceanvim)
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'neovim/nvim-lspconfig',
|
|
dependencies = {
|
|
'hrsh7th/cmp-nvim-lsp',
|
|
},
|
|
config = function(_)
|
|
local lsp = require('lspconfig')
|
|
|
|
-- Establish a set of capabilities so we can advertise nvim-cmp support.
|
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
|
|
-- Add nvim-cmp support to the capabilities.
|
|
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
|
|
|
-- lua-language-server
|
|
lsp.lua_ls.setup {
|
|
settings = {
|
|
Lua = {
|
|
runtime = {
|
|
-- Tell the language server which version of Lua you're using (most
|
|
-- likely LuaJIT in the case of Neovim)
|
|
version = 'LuaJIT',
|
|
},
|
|
diagnostics = {
|
|
-- Get the language server to recognize the `vim` global
|
|
globals = {'vim'},
|
|
},
|
|
workspace = {
|
|
-- Make the server aware of Neovim runtime files
|
|
library = vim.api.nvim_get_runtime_file("", true),
|
|
},
|
|
-- Do not send telemetry data containing a randomized but unique
|
|
-- identifier
|
|
telemetry = {
|
|
enable = false,
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
-- bash-language-server
|
|
lsp.bashls.setup{}
|
|
|
|
-- texlab = latex language server
|
|
lsp.texlab.setup{}
|
|
|
|
-- tsserver = typescript language server, works for JS as well.
|
|
lsp.tsserver.setup{}
|
|
|
|
-- gopls = go language server
|
|
lsp.gopls.setup({
|
|
settings = {
|
|
gopls = {
|
|
analyses = {
|
|
unusedparams = true,
|
|
},
|
|
staticcheck = true,
|
|
gofumpt = true,
|
|
},
|
|
},
|
|
})
|
|
end
|
|
},
|
|
|
|
-- nvim-cmp - completion plugin, used for LSP and Metals
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'hrsh7th/nvim-cmp',
|
|
dependencies = {
|
|
'L3MON4D3/LuaSnip',
|
|
'hrsh7th/cmp-nvim-lsp',
|
|
'hrsh7th/cmp-path',
|
|
'hrsh7th/cmp-buffer',
|
|
'saadparwaiz1/cmp_luasnip'
|
|
},
|
|
config = function(_)
|
|
local cmp = require('cmp')
|
|
|
|
cmp.setup{
|
|
snippet = {
|
|
expand = function(args)
|
|
require('luasnip').lsp_expand(args.body)
|
|
end,
|
|
},
|
|
sources = {
|
|
{ name = 'nvim_lsp' },
|
|
{ name = 'luasnip' },
|
|
{ name = 'path' },
|
|
{ name = 'buffer', option = { keyword_length = 5 }, },
|
|
},
|
|
mapping = {
|
|
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
|
['<C-Space>'] = cmp.mapping.complete(),
|
|
['<Tab>'] = function(fallback)
|
|
if cmp.visible() then
|
|
cmp.select_next_item()
|
|
else
|
|
fallback()
|
|
end
|
|
end,
|
|
['<S-Tab>'] = function(fallback)
|
|
if cmp.visible() then
|
|
cmp.select_prev_item()
|
|
else
|
|
fallback()
|
|
end
|
|
end,
|
|
},
|
|
}
|
|
end
|
|
},
|
|
|
|
-- Metals, for Scala development.
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'scalameta/nvim-metals',
|
|
dependencies = { 'nvim-lua/plenary.nvim' }
|
|
},
|
|
|
|
-- Lualine (configures the bottom bars)
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'nvim-lualine/lualine.nvim',
|
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
|
config = function()
|
|
local function metals_status_for_lualine()
|
|
return vim.g["metals_status"] or ""
|
|
end
|
|
|
|
require('lualine').setup {
|
|
options = {
|
|
theme = 'gruvbox-material'
|
|
},
|
|
sections = {
|
|
lualine_c = {
|
|
'filename',
|
|
metals_status_for_lualine
|
|
}
|
|
}
|
|
}
|
|
end
|
|
},
|
|
|
|
-- bufferline - shows a bar at the top with open buffers
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'akinsho/bufferline.nvim',
|
|
version = '*',
|
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
|
opts = {
|
|
options = {
|
|
mode = 'buffers',
|
|
indicator = {
|
|
style = 'none'
|
|
},
|
|
diagnostics = 'nvim_lsp',
|
|
color_icons = true,
|
|
show_buffer_icons = true,
|
|
show_buffer_close_icons = false,
|
|
separator_style = 'slant',
|
|
always_show_bufferline = true,
|
|
hover = {
|
|
enabled = false
|
|
},
|
|
},
|
|
}
|
|
},
|
|
|
|
-- Floating terminal
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'voldikss/vim-floaterm',
|
|
keys = {
|
|
{ '<leader>tc', '<cmd>FloatermNew<CR>', desc = 'New Floating Terminal' },
|
|
{ '<leader>tc', '<C-\\><C-n><cmd>FloatermNew<CR>', mode = 't', desc = 'New Floating Terminal' },
|
|
{ '<leader>tt', '<cmd>FloatermToggle<CR>', desc = 'Toggle Floating Terminal' },
|
|
{ '<leader>tt', '<C-\\><C-n><cmd>FloatermToggle<CR>', mode = 't', desc = 'Toggle Floating Terminal' },
|
|
{ '<leader>tp', '<cmd>FloatermPrev<CR>', desc = 'Previous Terminal' },
|
|
{ '<leader>tp', '<C-\\><C-n><cmd>FloatermPrev<CR>', mode = 't', desc = 'Previous Terminal' },
|
|
{ '<leader>tn', '<cmd>FloatermNext<CR>', desc = 'Next Terminal' },
|
|
{ '<leader>tn', '<C-\\><C-n><cmd>FloatermNext<CR>', mode = 't', desc = 'Next Terminal' },
|
|
},
|
|
config = function(_)
|
|
vim.g.floaterm_width = 0.8
|
|
vim.g.floaterm_height = 0.8
|
|
vim.g.floaterm_gitcommit = 'split'
|
|
end
|
|
},
|
|
|
|
-- Show signs for Git
|
|
-- -------------------------------------------------------------------------
|
|
{ 'lewis6991/gitsigns.nvim' },
|
|
|
|
-- Show unobtrusive indentation guides
|
|
-- -------------------------------------------------------------------------
|
|
{ 'lukas-reineke/indent-blankline.nvim', },
|
|
|
|
-- nvim-tree for when I want to view files
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'nvim-tree/nvim-tree.lua',
|
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
|
tag = 'nightly',
|
|
lazy = false,
|
|
keys = {
|
|
{ '<C-A>tt', '<cmd>NvimTreeToggle<CR>', desc = 'File Tree' },
|
|
{ '<C-A>tf', '<cmd>NvimTreeFindFile<CR>', desc = 'Tree Find File' },
|
|
},
|
|
config = function(_)
|
|
require('nvim-tree').setup()
|
|
end
|
|
},
|
|
|
|
-- Automatically close pairs such as {} [] ()
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'm4xshen/autoclose.nvim',
|
|
config = function(_)
|
|
require("autoclose").setup()
|
|
end
|
|
},
|
|
|
|
-- Special highlighting and tracking for certain notable words
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'folke/todo-comments.nvim',
|
|
dependencies = 'nvim-lua/plenary.nvim',
|
|
config = function()
|
|
require("todo-comments").setup{}
|
|
end,
|
|
},
|
|
|
|
-- Racket support
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'benknoble/vim-racket',
|
|
ft = { 'rkt' },
|
|
lazy = true,
|
|
},
|
|
|
|
-- Janet support
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'bakpakin/janet.vim',
|
|
ft = { 'janet' },
|
|
lazy = true
|
|
},
|
|
|
|
-- PlantUML syntax
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'aklt/plantuml-syntax',
|
|
ft = { 'puml' },
|
|
lazy = true,
|
|
},
|
|
|
|
-- i3 configuration syntax
|
|
-- -------------------------------------------------------------------------
|
|
'mboughaba/i3config.vim',
|
|
|
|
-- Golang support
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
"ray-x/go.nvim",
|
|
dependencies = {
|
|
"ray-x/guihua.lua",
|
|
"neovim/nvim-lspconfig",
|
|
"nvim-treesitter/nvim-treesitter",
|
|
},
|
|
config = function()
|
|
require("go").setup()
|
|
end,
|
|
ft = { "go", "gomod" },
|
|
lazy = true,
|
|
},
|
|
|
|
-- Rust support
|
|
-- -------------------------------------------------------------------------
|
|
{
|
|
'mrcjkb/rustaceanvim',
|
|
version = '^4',
|
|
ft = { 'rust' },
|
|
},
|
|
})
|