2021-08-08 15:33:23 +03:00
|
|
|
local fn = vim.fn
|
|
|
|
|
|
|
|
-- Install packer if it's not yet installed
|
2022-08-25 10:42:06 +03:00
|
|
|
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
|
2022-08-22 14:57:24 +03:00
|
|
|
if fn.empty(fn.glob(install_path)) > 0 then
|
2022-08-23 22:12:01 +03:00
|
|
|
print('Installing Packer')
|
2022-08-25 10:42:06 +03:00
|
|
|
Packer_bootstrap = fn.system({
|
2022-08-23 22:12:01 +03:00
|
|
|
'git', 'clone', '--depth', '1',
|
|
|
|
'https://github.com/wbthomason/packer.nvim', install_path
|
|
|
|
})
|
2022-09-03 00:01:15 +03:00
|
|
|
vim.cmd [[packadd packer.nvim]]
|
2022-08-23 22:12:01 +03:00
|
|
|
print('Installed Packer')
|
2021-08-08 15:33:23 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
-- Configure packer
|
|
|
|
require('packer').startup(function()
|
2022-08-23 22:12:01 +03:00
|
|
|
local use = require('packer').use
|
|
|
|
|
|
|
|
-- The plugin manager itself
|
2022-08-25 10:42:06 +03:00
|
|
|
use {'wbthomason/packer.nvim'}
|
2022-08-23 22:12:01 +03:00
|
|
|
|
|
|
|
-- Colorscheme
|
2022-09-03 00:01:15 +03:00
|
|
|
use {'rebelot/kanagawa.nvim', config = require('plugins.colorscheme')}
|
|
|
|
|
|
|
|
-- Statusline
|
2022-08-23 22:12:01 +03:00
|
|
|
use {
|
2022-09-03 00:01:15 +03:00
|
|
|
'nvim-lualine/lualine.nvim',
|
|
|
|
requires = {'kyazdani42/nvim-web-devicons', opt = true},
|
|
|
|
config = require('plugins.lualine')
|
2022-08-23 22:12:01 +03:00
|
|
|
}
|
|
|
|
|
2022-09-03 00:01:15 +03:00
|
|
|
-- Startup screen/dashboard
|
|
|
|
use 'glepnir/dashboard-nvim'
|
2022-08-24 12:09:50 +03:00
|
|
|
|
2022-08-23 22:12:01 +03:00
|
|
|
-- Git in signcolumn
|
|
|
|
use 'airblade/vim-gitgutter'
|
|
|
|
|
|
|
|
-- Tabline/bufferline
|
|
|
|
use {
|
|
|
|
'akinsho/nvim-bufferline.lua',
|
|
|
|
tag = '*',
|
|
|
|
requires = 'kyazdani42/nvim-web-devicons',
|
|
|
|
config = function() require('bufferline').setup {} end
|
|
|
|
}
|
|
|
|
|
|
|
|
-- Git commands
|
|
|
|
use 'tpope/vim-fugitive'
|
|
|
|
|
|
|
|
-- Indent characters
|
|
|
|
use {
|
|
|
|
'lukas-reineke/indent-blankline.nvim',
|
|
|
|
config = require('plugins.indent-blankline')
|
|
|
|
}
|
|
|
|
|
|
|
|
-- Tree explorer
|
|
|
|
use {
|
|
|
|
'kyazdani42/nvim-tree.lua',
|
|
|
|
requires = 'kyazdani42/nvim-web-devicons',
|
2022-08-24 12:07:21 +03:00
|
|
|
config = require('plugins.nvim-tree')
|
2022-08-23 22:12:01 +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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-- Do stuff as sudo
|
|
|
|
use 'lambdalisue/suda.vim'
|
|
|
|
|
|
|
|
-- Display possible keybinds
|
2022-09-03 00:11:56 +03:00
|
|
|
use {'folke/which-key.nvim', config = require('plugins.which-key')}
|
2022-08-23 22:12:01 +03:00
|
|
|
|
|
|
|
-- Read editorconfig settings
|
|
|
|
use 'editorconfig/editorconfig-vim'
|
|
|
|
|
|
|
|
-- Install LSP server executables
|
|
|
|
use {
|
|
|
|
'williamboman/mason.nvim',
|
|
|
|
config = function() require('mason').setup {} end
|
|
|
|
}
|
|
|
|
use {
|
2022-08-26 13:21:42 +03:00
|
|
|
'williamboman/mason-lspconfig.nvim',
|
2022-09-03 00:01:15 +03:00
|
|
|
requires = {'ii14/emmylua-nvim'}, -- vim api documentation for lua lsp
|
2022-08-23 22:12:01 +03:00
|
|
|
config = function()
|
|
|
|
require('mason-lspconfig').setup {automatic_installation = true}
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
|
|
|
-- Configs for built-in LSP
|
2022-08-26 13:21:42 +03:00
|
|
|
use {'neovim/nvim-lspconfig', config = require('plugins.lspconfig').setup}
|
2022-08-23 22:12:01 +03:00
|
|
|
|
|
|
|
-- Additional LSP features for Java
|
|
|
|
use 'mfussenegger/nvim-jdtls'
|
|
|
|
|
|
|
|
-- Display function signature
|
|
|
|
use 'ray-x/lsp_signature.nvim'
|
|
|
|
|
|
|
|
-- Completion
|
|
|
|
use {
|
|
|
|
'hrsh7th/nvim-cmp',
|
|
|
|
requires = {
|
|
|
|
{'hrsh7th/cmp-buffer'}, -- Buffer source
|
2022-09-03 00:01:15 +03:00
|
|
|
{'petertriho/cmp-git', requires = "nvim-lua/plenary.nvim"}, -- Git source
|
2022-08-23 22:12:01 +03:00
|
|
|
{'L3MON4D3/LuaSnip'}, -- Snippets plugin
|
2022-09-03 00:01:15 +03:00
|
|
|
{'hrsh7th/cmp-nvim-lsp'}, -- LSP source
|
|
|
|
{'hrsh7th/cmp-nvim-lua'}, -- Neovim Lua API documentation
|
|
|
|
{'hrsh7th/cmp-path'}, -- Path source
|
|
|
|
{'rafamadriz/friendly-snippets'}, -- Snippets collection
|
|
|
|
{'saadparwaiz1/cmp_luasnip'} -- Snippets source
|
2022-08-23 22:12:01 +03:00
|
|
|
},
|
|
|
|
config = require('plugins.cmp')
|
|
|
|
}
|
|
|
|
|
|
|
|
-- Automatic brackets
|
|
|
|
use {
|
|
|
|
'windwp/nvim-autopairs',
|
|
|
|
config = function() require('nvim-autopairs').setup {} end
|
|
|
|
}
|
|
|
|
|
|
|
|
-- treesitter
|
|
|
|
use {
|
|
|
|
'nvim-treesitter/nvim-treesitter',
|
|
|
|
run = function()
|
|
|
|
require('nvim-treesitter.install').update({with_sync = true})
|
|
|
|
end,
|
|
|
|
config = require('plugins.treesitter')
|
|
|
|
}
|
|
|
|
|
|
|
|
-- treesitter plugin for commentstring
|
|
|
|
use 'JoosepAlviste/nvim-ts-context-commentstring'
|
|
|
|
|
|
|
|
-- Additional plugins for formats not supported
|
|
|
|
-- by treesitter
|
|
|
|
use 'jamespeapen/swayconfig.vim'
|
|
|
|
|
|
|
|
-- mappings for commenting in code
|
|
|
|
use 'tpope/vim-commentary'
|
|
|
|
|
|
|
|
-- we all know this one
|
|
|
|
use 'tpope/vim-surround'
|
|
|
|
|
|
|
|
-- Formatter plugin
|
|
|
|
use 'sbdchd/neoformat'
|
|
|
|
|
|
|
|
-- Make editing passwords safer
|
|
|
|
use {
|
|
|
|
'https://git.zx2c4.com/password-store',
|
|
|
|
rtp = 'contrib/vim/redact_pass.vim'
|
|
|
|
}
|
|
|
|
|
|
|
|
-- Neovim inside Firefox
|
|
|
|
use {
|
|
|
|
'glacambre/firenvim',
|
|
|
|
run = function() vim.fn['firenvim#install'](0) end
|
|
|
|
}
|
|
|
|
|
|
|
|
-- Vim <3 Asciidoctor
|
|
|
|
use 'habamax/vim-asciidoctor'
|
2022-09-03 00:01:15 +03:00
|
|
|
|
|
|
|
-- Edit GPG encrypted files transparently
|
|
|
|
use 'jamessan/vim-gnupg'
|
|
|
|
|
|
|
|
-- If Packer was just installed,
|
|
|
|
-- sync plugins
|
|
|
|
if Packer_bootstrap then require('packer').sync() end
|
2022-08-25 10:42:06 +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
|
2022-08-23 19:35:56 +03:00
|
|
|
if Packer_installed then
|
2022-08-23 22:12:01 +03:00
|
|
|
print('Syncing plugins')
|
|
|
|
require('packer').sync()
|
2022-08-23 09:28:07 +03:00
|
|
|
end
|