nvim/lua/plugin.lua
2023-08-15 18:09:15 +02:00

201 lines
5.7 KiB
Lua

-- Install packer
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
local is_bootstrap = false
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
is_bootstrap = true
vim.fn.system { 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }
vim.cmd [[packadd packer.nvim]]
end
require('packer').startup({function(use)
-- Package manager
use 'wbthomason/packer.nvim'
use {
-- Useful status updates for LSP
'j-hui/fidget.nvim',
branch = 'legacy',
}
use { -- LSP Configuration & Plugins
'neovim/nvim-lspconfig',
requires = {
-- Automatically install LSPs to stdpath for neovim
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
-- Additional lua configuration, makes nvim stuff amazing
'folke/neodev.nvim',
},
}
-- lsp diagnostics
use {
"folke/trouble.nvim",
requires = "nvim-tree/nvim-web-devicons",
config = function()
require("trouble").setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
end
}
use {
'phaazon/hop.nvim',
branch = 'v2', -- optional but strongly recommended
config = function()
-- you can configure Hop the way you like here; see :h hop-config
require'hop'.setup { keys = 'etovxqpdgfblzhckisuran' }
end
}
use { -- Autocompletion
'hrsh7th/nvim-cmp',
requires = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip' },
}
-- coq Autocompletion
use {
'ms-jpq/coq_nvim',
branch = "coq",
}
use {
"ms-jpq/coq.artifacts",
branch = "artifacts",
requires = {'ms-jpq/coq_nvim'}
}
use { -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
run = function()
pcall(require('nvim-treesitter.install').update { with_sync = true })
end,
}
use {
'nvim-treesitter/playground',
}
use { -- Additional text objects via treesitter
'nvim-treesitter/nvim-treesitter-textobjects',
after = 'nvim-treesitter',
}
-- whichkey
use {
"folke/which-key.nvim",
config = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
require("which-key").setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
-- plugins = {
-- marks = true, -- shows a list of your marks on ' and `
-- registers = false, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
-- -- the presets plugin, adds help for a bunch of default keybindings in Neovim
-- -- No actual key bindings are created
-- spelling = {
-- enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
-- suggestions = 20, -- how many suggestions should be shown in the list?
-- },
-- presets = {
-- operators = true, -- adds help for operators like d, y, ...
-- motions = true, -- adds help for motions
-- text_objects = true, -- help for text objects triggered after entering an operator
-- windows = true, -- default bindings on <c-w>
-- nav = true, -- misc bindings to work with windows
-- z = true, -- bindings for folds, spelling and others prefixed with z
-- g = true, -- bindings for prefixed with g
-- },
-- },
}
end
}
-- file explorer
use {
'nvim-tree/nvim-tree.lua',
requires = {
'nvim-tree/nvim-web-devicons', -- optional, for file icons
},
tag = 'nightly' -- optional, updated every week. (see issue #1193)
}
-- bufferline
use {'akinsho/bufferline.nvim', tag = "v3.*", requires = 'nvim-tree/nvim-web-devicons'}
-- close buffers
use {'ojroques/nvim-bufdel'}
-- toggleterm
use {"akinsho/toggleterm.nvim", tag = '*', config = function()
require("toggleterm").setup{
open_mapping = [[<c-_>]],
}
end}
-- lastplace
use {"ethanholz/nvim-lastplace"}
-- alpha
use {
'goolord/alpha-nvim',
config = function ()
require'alpha'.setup(require'alpha.themes.dashboard'.config)
end
}
-- Git related plugins
use 'tpope/vim-fugitive'
use 'tpope/vim-rhubarb'
use 'lewis6991/gitsigns.nvim'
use 'lervag/vimtex'
use 'sainnhe/sonokai'
use 'navarasu/onedark.nvim' -- Theme inspired by Atom
use 'nvim-lualine/lualine.nvim' -- Fancier statusline
use 'lukas-reineke/indent-blankline.nvim' -- Add indentation guides even on blank lines
use 'numToStr/Comment.nvim' -- "gc" to comment visual regions/lines
use 'tpope/vim-sleuth' -- Detect tabstop and shiftwidth automatically
-- Fuzzy Finder (files, lsp, etc)
use { 'nvim-telescope/telescope.nvim', branch = '0.1.x', requires = { 'nvim-lua/plenary.nvim' } }
-- Fuzzy Finder Algorithm which requires local dependencies to be built. Only load if `make` is available
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make', cond = vim.fn.executable 'make' == 1 }
-- Add custom plugins to packer from ~/.config/nvim/lua/custom/plugins.lua
local has_plugins, plugins = pcall(require, 'custom.plugins')
if has_plugins then
plugins(use)
end
if is_bootstrap then
require('packer').sync()
end
end,
config = {
display = {
open_fn = require('packer.util').float,
}
}})
-- When we are bootstrapping a configuration, it doesn't
-- make sense to execute the rest of the init.lua.
--
-- You'll need to restart nvim, and then it will work.
if is_bootstrap then
print '=================================='
print ' Plugins are being installed'
print ' Wait until Packer completes,'
print ' then restart nvim'
print '=================================='
return
end