mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-12-12 17:18:22 -05:00
2a62792e2b
neovim: add more plugins nushell, xonsh: update startup hook for starship
397 lines
13 KiB
Lua
397 lines
13 KiB
Lua
local fn,api = vim.fn,vim.api
|
|
local packer_dir = fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim'
|
|
|
|
if fn.empty(fn.glob(packer_dir)) > 0 then
|
|
fn.system({'git', 'clone', 'https://github.com/wbthomason/packer.nvim', packer_dir})
|
|
api.nvim_command('packadd packer.nvim')
|
|
end
|
|
|
|
-- Require since we use 'packer' as opt
|
|
api.nvim_command [[packadd packer.nvim]]
|
|
|
|
return require('packer').startup(
|
|
function(use)
|
|
use {'wbthomason/packer.nvim', opt = true}
|
|
|
|
---------------------------------
|
|
-- Plugins used by many others --
|
|
---------------------------------
|
|
use {'kyazdani42/nvim-web-devicons', module = 'nvim-web-devicons'}
|
|
use {'nvim-lua/plenary.nvim', module = 'plenary'}
|
|
use {'nvim-lua/popup.nvim', module = 'popup'}
|
|
|
|
--------
|
|
-- UI --
|
|
--------
|
|
local ui = require('modules.ui')
|
|
use {
|
|
'glepnir/dashboard-nvim',
|
|
cmd = {
|
|
'Dashboard',
|
|
'DashboardNewFile',
|
|
'DashboardFindFile',
|
|
'DashboardFindHistory',
|
|
'DashboardFindWord',
|
|
'DashboardJumpMark',
|
|
'SessionLoad',
|
|
'SessionSave'
|
|
},
|
|
setup = ui.dashboard_conf
|
|
}
|
|
use { -- TODO: consider moving to feline.nvim
|
|
'glepnir/galaxyline.nvim',
|
|
branch = 'main',
|
|
wants = 'nvim-web-devicons',
|
|
config = ui.statusline_conf
|
|
}
|
|
use {
|
|
'akinsho/nvim-bufferline.lua',
|
|
event = {'BufRead', 'BufNewFile'},
|
|
config = ui.bufferline_conf
|
|
}
|
|
use {
|
|
'kyazdani42/nvim-tree.lua',
|
|
cmd = 'NvimTreeToggle',
|
|
setup = ui.nvimtree_conf
|
|
}
|
|
use {
|
|
'folke/which-key.nvim',
|
|
config = ui.whichkey_conf
|
|
}
|
|
use {
|
|
'lewis6991/gitsigns.nvim',
|
|
event = {'BufRead', 'BufNewFile'},
|
|
wants = 'plenary.nvim',
|
|
config = ui.gitsigns_conf
|
|
}
|
|
|
|
------------
|
|
-- Editor --
|
|
------------
|
|
local editor = require('modules.editor')
|
|
use {
|
|
'norcalli/nvim-colorizer.lua',
|
|
cmd = 'ColorizerToggle',
|
|
config = editor.colorizer_conf
|
|
}
|
|
use {
|
|
'RRethy/vim-illuminate',
|
|
event = {'BufReadPre', 'BufNewFile'}
|
|
}
|
|
use {
|
|
'lukas-reineke/indent-blankline.nvim',
|
|
event = 'BufRead',
|
|
config = editor.blankline_conf
|
|
}
|
|
use {
|
|
'nvim-treesitter/nvim-treesitter',
|
|
run = ':TSUpdate',
|
|
event = 'BufRead',
|
|
config = editor.treesitter_conf
|
|
}
|
|
use {
|
|
'p00f/nvim-ts-rainbow',
|
|
after = 'nvim-treesitter',
|
|
-- Putting config into `treesitter_conf` doesn't work for some reason
|
|
config = editor.rainbow_conf
|
|
}
|
|
use {
|
|
'romgrk/nvim-treesitter-context',
|
|
after = 'nvim-treesitter'
|
|
}
|
|
use {
|
|
'nvim-treesitter/nvim-treesitter-textobjects',
|
|
after = 'nvim-treesitter'
|
|
}
|
|
use {
|
|
'andymass/vim-matchup',
|
|
after = 'nvim-treesitter',
|
|
config = editor.matchup_conf
|
|
}
|
|
use {
|
|
'machakann/vim-sandwich',
|
|
keys = {'sa', 'sd', 'sr'}
|
|
}
|
|
use {
|
|
'phaazon/hop.nvim',
|
|
cmd = {'HopChar1', 'HopChar2', 'HopWord', 'HopPattern', 'HopLine'},
|
|
config = editor.hop_conf
|
|
}
|
|
use {
|
|
'hrsh7th/vim-eft',
|
|
event = {'BufRead', 'BufNewFile'},
|
|
setup = editor.eft_conf
|
|
}
|
|
use {
|
|
'junegunn/vim-easy-align',
|
|
cmd = 'EasyAlign'
|
|
}
|
|
use {
|
|
'terrortylor/nvim-comment',
|
|
keys = 'gc',
|
|
config = editor.comment_conf
|
|
}
|
|
use {
|
|
'editorconfig/editorconfig-vim',
|
|
ft = {'go', 'rust', 'python', 'c', 'cpp', 'javascript', 'typescript', 'vim', 'zig'}
|
|
}
|
|
use { -- TODO: move to nvim-parinfer (lua)
|
|
'eraserhd/parinfer-rust',
|
|
run = 'cargo build --release',
|
|
ft = {'clojure', 'lisp', 'scheme'}
|
|
}
|
|
|
|
---------
|
|
-- LSP --
|
|
---------
|
|
local lsp = require('modules.lsp')
|
|
use { -- TODO: scripts to install/update lsp servers
|
|
'neovim/nvim-lspconfig',
|
|
event = 'BufReadPre',
|
|
wants = 'lsp_signature.nvim',
|
|
requires = {{'ray-x/lsp_signature.nvim', opt = true}},
|
|
config = lsp.lsp_conf
|
|
}
|
|
use {
|
|
'nanotee/sqls.nvim',
|
|
ft = {'sql', 'mysql', 'plsql'},
|
|
wants = 'nvim-lspconfig',
|
|
config = lsp.sqls_conf
|
|
}
|
|
use {
|
|
'ahmedkhalf/lsp-rooter.nvim',
|
|
after = 'nvim-lspconfig'
|
|
}
|
|
use {
|
|
'folke/trouble.nvim',
|
|
cmd = {'Trouble', 'TroubleToggle', 'TroubleRefresh'},
|
|
config = lsp.trouble_conf
|
|
}
|
|
use {
|
|
'simrat39/symbols-outline.nvim',
|
|
cmd = {'SymbolsOutline', 'SymbolsOutlineOpen'},
|
|
setup = lsp.outline_conf
|
|
}
|
|
use { -- TODO: scripts to install/update linters
|
|
'mfussenegger/nvim-lint',
|
|
event = 'BufRead',
|
|
config = lsp.lint_conf
|
|
}
|
|
use { -- TODO: config, scripts to install/update dap servers
|
|
'rcarriga/nvim-dap-ui',
|
|
event = 'BufReadPre',
|
|
wants = 'nvim-dap',
|
|
requires = {{'mfussenegger/nvim-dap', config = lsp.dap_conf, opt = true}},
|
|
config = lsp.dapui_conf
|
|
}
|
|
|
|
----------------
|
|
-- Completion --
|
|
----------------
|
|
local completion = require('modules.completion')
|
|
use {
|
|
'hrsh7th/nvim-cmp',
|
|
event = 'InsertEnter',
|
|
wants = 'LuaSnip',
|
|
requires = {
|
|
{
|
|
'L3MON4D3/LuaSnip',
|
|
wants = 'friendly-snippets',
|
|
requires = {{'rafamadriz/friendly-snippets', opt = true}},
|
|
config = completion.snippets_conf,
|
|
opt = true
|
|
},
|
|
{'saadparwaiz1/cmp_luasnip', after = 'nvim-cmp', opt = true},
|
|
{'hrsh7th/cmp-path', after = 'nvim-cmp', opt = true},
|
|
{'hrsh7th/cmp-buffer', after = 'nvim-cmp', opt = true},
|
|
-- {'hrsh7th/cmp-calc', after = 'nvim-cmp', opt = true},
|
|
-- {'f3fora/cmp-nuspell', after = 'nvim-cmp', rocks={'lua-nuspell'}, opt = true},
|
|
{'f3fora/cmp-spell', after = 'nvim-cmp', opt = true},
|
|
{'hrsh7th/cmp-emoji', after = 'nvim-cmp', opt = true},
|
|
{'hrsh7th/cmp-nvim-lsp', after = 'nvim-cmp', opt = true},
|
|
{'kdheepak/cmp-latex-symbols', after = 'nvim-cmp', opt = true},
|
|
{'andersevenrud/compe-tmux', after = 'nvim-cmp', branch = 'cmp', opt = true}
|
|
},
|
|
config = completion.cmp_conf
|
|
}
|
|
use {
|
|
'windwp/nvim-autopairs',
|
|
after = 'nvim-cmp',
|
|
config = completion.autopairs_conf
|
|
}
|
|
-- use {
|
|
-- 'ms-jpq/coq_nvim',
|
|
-- branch = 'coq',
|
|
-- event = 'InsertEnter',
|
|
-- run = ':COQdeps',
|
|
-- wants = 'coq.artifacts',
|
|
-- requires = {{'ms-jpq/coq.artifacts', branch = 'artifacts', opt = true}},
|
|
-- setup = completion.coq_conf
|
|
-- }
|
|
use {
|
|
'windwp/nvim-ts-autotag',
|
|
ft = {
|
|
'html',
|
|
'xml',
|
|
'javascript',
|
|
'javascriptreact',
|
|
'typescript',
|
|
'typescriptreact',
|
|
'vue',
|
|
'svelte',
|
|
'php'
|
|
},
|
|
wants = 'nvim-treesitter',
|
|
config = completion.autotag_conf
|
|
}
|
|
|
|
-----------
|
|
-- Tools --
|
|
-----------
|
|
local tools = require('modules.tools')
|
|
use {
|
|
'nvim-telescope/telescope.nvim',
|
|
cmd = 'Telescope',
|
|
wants = {
|
|
'popup.nvim',
|
|
'plenary.nvim',
|
|
'telescope-symbols.nvim',
|
|
'telescope-project.nvim',
|
|
'telescope-fzf-native.nvim'
|
|
},
|
|
requires = {
|
|
{'nvim-telescope/telescope-symbols.nvim', opt = true},
|
|
{'nvim-telescope/telescope-project.nvim', opt = true},
|
|
{'nvim-telescope/telescope-fzf-native.nvim', run = 'make', opt = true}
|
|
},
|
|
config = tools.telescope_conf
|
|
}
|
|
use { -- Telescope file browser doesn't support dotfiles
|
|
'mcchrish/nnn.vim',
|
|
cmd = 'NnnPicker',
|
|
config = tools.nnn_conf
|
|
}
|
|
use { -- TODO: colors + config
|
|
'pwntester/octo.nvim',
|
|
cmd = 'Octo',
|
|
wants = 'telescope.nvim',
|
|
config = tools.octo_conf
|
|
}
|
|
use {
|
|
'TimUntersberger/neogit',
|
|
cmd = 'Neogit',
|
|
wants = {'diffview.nvim', 'plenary.nvim'},
|
|
requires = {
|
|
{
|
|
'sindrets/diffview.nvim',
|
|
config = function()
|
|
require('diffview').setup {
|
|
diff_binaries = true
|
|
}
|
|
end,
|
|
opt = true
|
|
}
|
|
},
|
|
config = tools.neogit_conf
|
|
}
|
|
use {
|
|
'skywind3000/asynctasks.vim',
|
|
cmd = {
|
|
'AsyncTask',
|
|
'AsyncTaskEdit',
|
|
'AsyncTaskList',
|
|
'AsyncTaskMacro'
|
|
},
|
|
wants = 'asyncrun.vim',
|
|
requires = {{
|
|
'skywind3000/asyncrun.vim',
|
|
setup = tools.asynctasks_conf,
|
|
opt = true
|
|
}}
|
|
}
|
|
use {
|
|
'iamcco/markdown-preview.nvim',
|
|
run = 'cd app && yarn install',
|
|
ft = {'markdown', 'pandoc.markdown', 'rmd'},
|
|
config = tools.markdown_preview_conf
|
|
}
|
|
use {
|
|
'turbio/bracey.vim',
|
|
run = 'npm install --prefix server',
|
|
cmd = 'Bracey'
|
|
}
|
|
use {
|
|
'folke/zen-mode.nvim',
|
|
cmd = 'ZenMode',
|
|
wants = 'twilight.nvim',
|
|
requires = {{'folke/twilight.nvim', opt = true}},
|
|
config = tools.zenmode_conf
|
|
}
|
|
use { -- shouldn't be lazy-loaded (global bindings don't work)
|
|
'kristijanhusak/orgmode.nvim',
|
|
ft = 'org',
|
|
config = tools.orgmode_conf
|
|
}
|
|
use { -- TODO: config
|
|
'lervag/vimtex',
|
|
ft = 'tex',
|
|
setup = tools.vimtext_conf
|
|
}
|
|
use {
|
|
'windwp/nvim-spectre',
|
|
event = {'BufRead', 'BufNewFile'},
|
|
wants = 'plenary.nvim',
|
|
config = tools.spectre_conf
|
|
}
|
|
use {
|
|
'echuraev/translate-shell.vim',
|
|
cmd = {'Trans', 'TransSelectDirection'},
|
|
config = tools.translate_conf
|
|
}
|
|
use {
|
|
'mbbill/undotree',
|
|
cmd = 'UndotreeToggle',
|
|
setup = tools.undotree_conf
|
|
}
|
|
use {
|
|
'akinsho/nvim-toggleterm.lua',
|
|
cmd = 'ToggleTerm',
|
|
config = tools.toggleterm_conf
|
|
}
|
|
-- use {
|
|
-- 'gelguy/wilder.nvim',
|
|
-- run = ':UpdateRemotePlugins',
|
|
-- event = 'CmdlineEnter',
|
|
-- config = tools.wilder_conf
|
|
-- }
|
|
use {
|
|
'karb94/neoscroll.nvim',
|
|
event = 'WinScrolled',
|
|
config = tools.neoscroll_conf
|
|
}
|
|
use { -- TODO: colors + config
|
|
'michaelb/sniprun',
|
|
run = 'bash ./install.sh 1',
|
|
cmd = 'SnipRun'
|
|
}
|
|
use {
|
|
'NTBBloodbath/rest.nvim',
|
|
keys = {'<Plug>RestNvim', '<Plug>RestNvimPreview', '<Plug>RestNvimLast'},
|
|
wants = {'plenary.nvim', 'nvim-treesitter'},
|
|
run = ':TSInstall http',
|
|
config = tools.rest_conf
|
|
}
|
|
-- use { -- TODO: mappings
|
|
-- 'rktjmp/hotpot.nvim',
|
|
-- config = function() require('hotpot') end
|
|
-- }
|
|
use {
|
|
'sbdchd/neoformat',
|
|
cmd = 'Neoformat'
|
|
}
|
|
use {'tweekmonster/startuptime.vim', cmd = 'StartupTime'} -- Just for benchmarking
|
|
|
|
-- TODO: conjure + cmp-conjure, dial.nvim, rust-tools.nvim, crates.nvim, go.nvim
|
|
end
|
|
)
|