180 lines
5 KiB
Lua
180 lines
5 KiB
Lua
vim.cmd [[packadd packer.nvim]]
|
|
|
|
return require('packer').startup({function(use)
|
|
-- Packer can manage itself
|
|
use 'wbthomason/packer.nvim'
|
|
|
|
-- LSP stuff
|
|
use {
|
|
"williamboman/mason.nvim",
|
|
"williamboman/mason-lspconfig.nvim",
|
|
"neovim/nvim-lspconfig",
|
|
"hrsh7th/nvim-cmp",
|
|
"hrsh7th/cmp-nvim-lsp",
|
|
}
|
|
|
|
-- Gruvbox theme
|
|
use {
|
|
"ellisonleao/gruvbox.nvim",
|
|
config = function()
|
|
require("gruvbox").setup({
|
|
bold = false,
|
|
italic = true,
|
|
strikethrough = true,
|
|
overrides = {
|
|
Directory = { link = "GruvboxFg2" },
|
|
},
|
|
})
|
|
vim.cmd("colorscheme gruvbox")
|
|
end,
|
|
}
|
|
|
|
-- A way saner buffer closing implementation
|
|
use "ojroques/nvim-bufdel"
|
|
|
|
-- Indentation guide
|
|
use "lukas-reineke/indent-blankline.nvim"
|
|
|
|
-- Indentation autodetection
|
|
use {
|
|
"nmac427/guess-indent.nvim",
|
|
config = function()
|
|
require("guess-indent").setup()
|
|
end
|
|
}
|
|
|
|
-- Scrollbar
|
|
use {
|
|
"petertriho/nvim-scrollbar",
|
|
config = function()
|
|
require("scrollbar").setup()
|
|
end,
|
|
}
|
|
|
|
-- Directory tree
|
|
use {
|
|
"nvim-neo-tree/neo-tree.nvim",
|
|
branch = "v2.x",
|
|
requires = {
|
|
"nvim-lua/plenary.nvim",
|
|
"kyazdani42/nvim-web-devicons",
|
|
"MunifTanjim/nui.nvim",
|
|
},
|
|
config = function()
|
|
require("neo-tree").setup({
|
|
window = {
|
|
position = "left",
|
|
width = 36,
|
|
},
|
|
filesystem = {
|
|
use_libuv_file_watcher = true,
|
|
},
|
|
})
|
|
require("neo-tree.sources.manager").show("filesystem")
|
|
end,
|
|
}
|
|
|
|
-- Tabs
|
|
use {
|
|
"akinsho/bufferline.nvim", tag = "v2.*", requires = "kyazdani42/nvim-web-devicons",
|
|
config = function() require("bufferline").setup({
|
|
options = {
|
|
close_command = "BufDel %d",
|
|
right_mouse_command = "BufDel %d",
|
|
offsets = {
|
|
{
|
|
filetype = "neo-tree",
|
|
text = "Files",
|
|
highlight = "Directory",
|
|
text_align = "left",
|
|
}
|
|
},
|
|
separator_style = "slant",
|
|
}
|
|
}) end,
|
|
}
|
|
|
|
-- Status line
|
|
use {
|
|
"nvim-lualine/lualine.nvim", requires = { 'kyazdani42/nvim-web-devicons', opt = true },
|
|
config = function() require("lualine").setup({
|
|
options = {
|
|
theme = "gruvbox",
|
|
disabled_filetypes = {
|
|
statusline = { "neo-tree" },
|
|
},
|
|
},
|
|
}) end,
|
|
}
|
|
|
|
-- Terminal
|
|
use {
|
|
"akinsho/toggleterm.nvim", tag = "v2.*",
|
|
config = function() require("toggleterm").setup({
|
|
open_mapping = [[<c-\>]],
|
|
persist_size = false,
|
|
shade_terminals = false,
|
|
hide_numbers = false,
|
|
winbar = {
|
|
enabled = false,
|
|
},
|
|
on_open = function()
|
|
-- Toggle the neo-tree file view such that it is
|
|
-- always full height; This is a dirty workaround
|
|
local manager = require('neo-tree.sources.manager')
|
|
if manager.close('filesystem') then
|
|
manager.show('filesystem')
|
|
end
|
|
end,
|
|
}) end,
|
|
}
|
|
|
|
-- Session Manager
|
|
use {
|
|
"olimorris/persisted.nvim",
|
|
config = function()
|
|
require("persisted").setup({
|
|
autoload = true,
|
|
before_save = function()
|
|
require('neo-tree.sources.manager').close('filesystem')
|
|
for _, term in pairs(require("toggleterm.terminal").get_all()) do
|
|
term:close()
|
|
end
|
|
end,
|
|
after_save = function()
|
|
require('neo-tree.sources.manager').show('filesystem')
|
|
end,
|
|
before_source = function()
|
|
require('neo-tree.sources.manager').close('filesystem')
|
|
end,
|
|
after_source = function()
|
|
require('neo-tree.sources.manager').show('filesystem')
|
|
-- Reload LSP
|
|
vim.lsp.stop_client(vim.lsp.get_active_clients())
|
|
end,
|
|
})
|
|
end,
|
|
}
|
|
|
|
-- Mini.nvim tools
|
|
use {
|
|
"echasnovski/mini.nvim",
|
|
config = function()
|
|
-- Trailing space highlighter
|
|
require("mini.trailspace").setup({
|
|
only_in_normal_buffers = true,
|
|
})
|
|
end,
|
|
}
|
|
|
|
-- LaTeX plugin
|
|
use "lervag/vimtex"
|
|
end,
|
|
config = {
|
|
display = {
|
|
open_fn = require('packer.util').float,
|
|
},
|
|
-- Let's reload manually
|
|
auto_reload_compiled = false,
|
|
}})
|