2021-08-08 15:33:23 +03:00
|
|
|
local fn = vim.fn
|
|
|
|
|
|
|
|
-- Install packer if it's not yet installed
|
|
|
|
local install_path = fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim'
|
2022-08-22 14:57:24 +03:00
|
|
|
if fn.empty(fn.glob(install_path)) > 0 then
|
2022-08-23 17:56:24 +03:00
|
|
|
print('Installing Packer')
|
|
|
|
Packer_bootstrap = fn.system({
|
|
|
|
'git', 'clone', '--depth', '1',
|
|
|
|
'https://github.com/wbthomason/packer.nvim', install_path
|
|
|
|
})
|
|
|
|
vim.o.runtimepath = vim.fn.stdpath('data') .. '/site/pack/*/start/*,' ..
|
|
|
|
vim.o.runtimepath
|
|
|
|
print('Installed Packer')
|
2021-08-08 15:33:23 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
-- Configure packer
|
2022-08-22 14:57:24 +03:00
|
|
|
vim.cmd [[packadd packer.nvim]]
|
2021-08-08 15:33:23 +03:00
|
|
|
require('packer').startup(function()
|
2022-08-23 17:56:24 +03:00
|
|
|
local use = require('packer').use
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- The plugin manager itself
|
|
|
|
use { 'wbthomason/packer.nvim', opt = true }
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Colorscheme
|
|
|
|
use {
|
|
|
|
'catppuccin/nvim',
|
|
|
|
as = 'catppuccin',
|
|
|
|
config = require('plugins.colorscheme'),
|
|
|
|
}
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Git in signcolumn
|
|
|
|
use 'airblade/vim-gitgutter'
|
2021-08-18 09:29:44 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Statusline
|
|
|
|
use {
|
|
|
|
'hoob3rt/lualine.nvim',
|
|
|
|
requires = { 'kyazdani42/nvim-web-devicons', opt = true },
|
|
|
|
config = function()
|
|
|
|
require('lualine').setup {
|
|
|
|
options = { theme = 'catppuccin' }
|
|
|
|
}
|
|
|
|
end,
|
|
|
|
}
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Tabline/bufferline
|
|
|
|
use {
|
|
|
|
'akinsho/nvim-bufferline.lua',
|
|
|
|
tag = '*',
|
|
|
|
requires = 'kyazdani42/nvim-web-devicons',
|
|
|
|
config = function() require('bufferline').setup {} end
|
|
|
|
}
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Git commands
|
|
|
|
use 'tpope/vim-fugitive'
|
2021-08-18 14:17:19 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Indent characters
|
|
|
|
use {
|
|
|
|
'lukas-reineke/indent-blankline.nvim',
|
|
|
|
config = require('plugins.indent-blankline')
|
|
|
|
}
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Tree explorer
|
|
|
|
use {
|
|
|
|
'kyazdani42/nvim-tree.lua',
|
|
|
|
requires = 'kyazdani42/nvim-web-devicons',
|
|
|
|
config = function() require('nvim-tree').setup {} end
|
|
|
|
}
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Telescope
|
|
|
|
use {
|
|
|
|
'nvim-telescope/telescope.nvim',
|
|
|
|
config = require('plugins.telescope'),
|
|
|
|
requires = {
|
|
|
|
{ 'nvim-lua/plenary.nvim' }, -- Internal dep for telescope
|
|
|
|
{ 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }, -- Use fzf for fuzzy finder
|
|
|
|
{ 'nvim-telescope/telescope-ui-select.nvim' } -- Replace vim built in select with telescope
|
|
|
|
}
|
|
|
|
}
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Do stuff as sudo
|
|
|
|
use 'lambdalisue/suda.vim'
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 12:17:21 +03:00
|
|
|
-- Display possible keybinds
|
|
|
|
use {
|
|
|
|
'folke/which-key.nvim',
|
2022-08-23 17:56:24 +03:00
|
|
|
config = function() require('which-key').setup {} end
|
2022-08-23 12:17:21 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
-- Read editorconfig settings
|
|
|
|
use 'editorconfig/editorconfig-vim'
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Install LSP server executables
|
|
|
|
use {
|
|
|
|
'williamboman/mason.nvim',
|
|
|
|
config = function() require('mason').setup {} end
|
|
|
|
}
|
|
|
|
use {
|
|
|
|
'williamboman/mason-lspconfig.nvim',
|
|
|
|
config = function()
|
|
|
|
require('mason-lspconfig').setup { automatic_installation = true }
|
|
|
|
end
|
|
|
|
}
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Configs for built-in LSP
|
|
|
|
use {
|
|
|
|
'neovim/nvim-lspconfig',
|
|
|
|
config = require('plugins.lspconfig').setup
|
|
|
|
}
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Additional LSP features for Java
|
|
|
|
use 'mfussenegger/nvim-jdtls'
|
2022-02-24 18:08:59 +02:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Display function signature
|
|
|
|
use 'ray-x/lsp_signature.nvim'
|
|
|
|
|
|
|
|
-- Completion
|
|
|
|
use {
|
|
|
|
'hrsh7th/nvim-cmp',
|
|
|
|
requires = {
|
|
|
|
{ 'hrsh7th/cmp-nvim-lsp' }, -- LSP source
|
|
|
|
{ 'hrsh7th/cmp-path' }, -- Path source
|
|
|
|
{ 'petertriho/cmp-git', requires = "nvim-lua/plenary.nvim" }, -- Git source
|
|
|
|
{ 'hrsh7th/cmp-buffer' }, -- Buffer source
|
|
|
|
{ 'saadparwaiz1/cmp_luasnip' }, -- Snippets source
|
|
|
|
{ 'L3MON4D3/LuaSnip' }, -- Snippets plugin
|
|
|
|
{ 'rafamadriz/friendly-snippets' }, -- Snippets collection
|
|
|
|
},
|
|
|
|
config = require('plugins.cmp'),
|
|
|
|
}
|
2022-08-14 20:36:32 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Automatic brackets
|
2022-08-23 11:45:28 +03:00
|
|
|
use {
|
2022-08-23 12:17:21 +03:00
|
|
|
'windwp/nvim-autopairs',
|
2022-08-23 17:56:24 +03:00
|
|
|
config = function() require('nvim-autopairs').setup{} end
|
2022-08-23 11:45:28 +03:00
|
|
|
}
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- treesitter
|
|
|
|
use {
|
|
|
|
'nvim-treesitter/nvim-treesitter',
|
|
|
|
run = function()
|
|
|
|
require('nvim-treesitter.install').update({ with_sync = true })
|
|
|
|
end,
|
|
|
|
config = require('plugins.treesitter')
|
|
|
|
}
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- treesitter plugin for commentstring
|
|
|
|
use 'JoosepAlviste/nvim-ts-context-commentstring'
|
2021-08-18 21:20:20 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Additional plugins for formats not supported
|
|
|
|
-- by treesitter
|
|
|
|
use 'jamespeapen/swayconfig.vim'
|
2021-08-18 21:20:20 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- mappings for commenting in code
|
|
|
|
use 'tpope/vim-commentary'
|
2021-08-18 21:20:20 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- we all know this one
|
|
|
|
use 'tpope/vim-surround'
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Formatter plugin
|
|
|
|
use 'sbdchd/neoformat'
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Make editing passwords safer
|
|
|
|
use {
|
|
|
|
'https://git.zx2c4.com/password-store',
|
|
|
|
rtp = 'contrib/vim/redact_pass.vim'
|
|
|
|
}
|
2021-08-08 15:33:23 +03:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Neovim inside Firefox
|
|
|
|
use {
|
|
|
|
'glacambre/firenvim',
|
|
|
|
run = function() vim.fn['firenvim#install'](0) end
|
|
|
|
}
|
2021-11-20 12:13:39 +02:00
|
|
|
|
2022-08-23 17:56:24 +03:00
|
|
|
-- Vim <3 Asciidoctor
|
|
|
|
use 'habamax/vim-asciidoctor'
|
2022-04-10 13:16:45 +03:00
|
|
|
|
2021-08-08 15:33:23 +03:00
|
|
|
end)
|
|
|
|
|
2022-08-23 09:28:07 +03:00
|
|
|
-- Sync plugins if Packer was just
|
|
|
|
-- installed
|
|
|
|
if Packer_bootstrap then
|
2022-08-23 17:56:24 +03:00
|
|
|
print('Syncing plugins')
|
|
|
|
require('packer').sync()
|
|
|
|
print('Synced')
|
2022-08-23 09:28:07 +03:00
|
|
|
end
|