absvim/lua/plugins.lua

387 lines
10 KiB
Lua
Raw Normal View History

2023-03-02 23:26:30 +00:00
return {
2023-02-28 02:27:44 +00:00
--vimp (in mappings.lua)
2023-03-02 23:26:30 +00:00
'svermeulen/vimpeccable',
2023-02-28 02:27:44 +00:00
2023-03-03 05:30:49 +00:00
{
'nvim-treesitter/nvim-treesitter',
config = function()
require 'nvim-treesitter.configs'.setup {
auto_install = true,
}
end
},
2023-02-28 02:27:44 +00:00
2023-03-02 23:26:30 +00:00
'ctrlpvim/ctrlp.vim',
2023-03-02 06:55:24 +00:00
2023-03-02 23:26:30 +00:00
{
2023-03-02 09:13:40 +00:00
'fatih/vim-go',
2023-03-03 03:12:25 +00:00
ft = { "go", "gomod" },
2023-03-02 06:55:24 +00:00
config = function()
2023-03-02 09:13:40 +00:00
vim.g.go_fmt_command = "gofumpt"
vim.g.go_highlight_types = 1
vim.g.go_highlight_fields = 1
vim.g.go_highlight_functions = 1
vim.g.go_highlight_function_calls = 1
2023-03-03 03:12:25 +00:00
vim.g.go_metalinter_command = 'golangci-lint'
2023-03-02 06:55:24 +00:00
end
2023-03-02 23:26:30 +00:00
},
2023-03-02 18:35:02 +00:00
2023-02-28 02:27:44 +00:00
-- obsession
2023-03-02 23:26:30 +00:00
'tpope/vim-obsession',
2023-02-28 02:27:44 +00:00
--lsp (in lsp_settings.lua)
2023-03-02 23:26:30 +00:00
'neovim/nvim-lspconfig',
'williamboman/mason-lspconfig',
'williamboman/mason.nvim',
'mfussenegger/nvim-dap',
2023-02-28 02:27:44 +00:00
-- auto color hex/rgb
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'norcalli/nvim-colorizer.lua',
2023-03-02 23:53:24 +00:00
config = function()
require('colorizer').setup()
end,
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
2023-03-03 01:51:00 +00:00
{
'numToStr/Comment.nvim',
config = function()
require('Comment').setup()
end
},
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'mrshmllow/document-color.nvim',
config = function()
2023-03-02 23:26:30 +00:00
require('document-color').setup({
2023-02-28 02:27:44 +00:00
mode = "background",
2023-03-02 23:26:30 +00:00
})
2023-03-02 23:53:24 +00:00
vim.g.colorizer_auto_color = 1
2023-02-28 02:27:44 +00:00
end
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
-- Markdown preview
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
"iamcco/markdown-preview.nvim",
run = "cd app && npm install",
2023-03-02 23:26:30 +00:00
init = function()
2023-02-28 02:27:44 +00:00
vim.g.mkdp_filetypes = { "markdown" }
vim.g.mkdp_markdown_css = os.getenv("XDG_CONFIG_HOME") .. '/nvim/static/custom.css'
vim.g.mkdp_highlight_css = os.getenv("XDG_CACHE_HOME") .. '/wal/colors.css'
vim.g.mkdp_browser = 'surf'
vim.g.mkdp_echo_preview_url = 1
end,
ft = { "markdown" }
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
"ellisonleao/glow.nvim",
2023-03-02 23:26:30 +00:00
cmd = "Glow",
2023-02-28 02:27:44 +00:00
config = function()
require('glow').setup({})
end
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
-- auto pairs
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'windwp/nvim-autopairs',
config = function()
require('nvim-autopairs').setup {}
end
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
-- show git diffs
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'lewis6991/gitsigns.nvim',
2023-03-02 23:26:30 +00:00
config = function()
require('gitsigns').setup({
current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'right_align', -- 'eol' | 'overlay' | 'right_align'
delay = 100,
ignore_whitespace = false,
},
yadm = {
enable = true
},
})
end
},
2023-02-28 02:27:44 +00:00
-- fuzzy finder
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'nvim-telescope/telescope.nvim',
branch = '0.1.x',
2023-03-02 23:26:30 +00:00
dependencies = {
{
'nvim-lua/plenary.nvim',
lazy = true
},
2023-02-28 02:27:44 +00:00
}
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
-- file explorer
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'kyazdani42/nvim-tree.lua',
2023-03-03 01:51:00 +00:00
dependencies = { 'kyazdani42/nvim-web-devicons' },
2023-02-28 02:27:44 +00:00
config = function()
require('nvim-tree').setup {
sort_by = "case_sensitive",
view = {
adaptive_size = true,
},
renderer = {
group_empty = true,
},
2023-03-03 01:51:00 +00:00
filters = {
dotfiles = true,
},
2023-02-28 02:27:44 +00:00
}
end
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
2023-03-03 05:30:49 +00:00
{ 'akinsho/toggleterm.nvim', version = "*", config = true },
{
"kylechui/nvim-surround",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end
},
2023-02-28 02:27:44 +00:00
-- open file at last location
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'ethanholz/nvim-lastplace',
config = function()
require('nvim-lastplace').setup {
lastplace_open_folds = true
}
end
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
-- multiple cursors
2023-03-02 23:26:30 +00:00
'mg979/vim-visual-multi',
2023-02-28 02:27:44 +00:00
-- wrap things inside pairs
2023-03-02 23:26:30 +00:00
'FooSoft/vim-argwrap',
2023-02-28 02:27:44 +00:00
-- which key
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
"folke/which-key.nvim",
config = function()
require("which-key").setup {}
end
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
-- pasting indents
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'hrsh7th/nvim-pasta',
config = function()
require('pasta').setup {
converters = {
require('pasta.converters').indentation,
},
paste_mode = true,
next_key = vim.api.nvim_replace_termcodes('<C-p>', true, true, true),
prev_key = vim.api.nvim_replace_termcodes('<C-n>', true, true, true),
}
end
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
2023-03-03 05:30:49 +00:00
{ 'akinsho/toggleterm.nvim', version = "*", config = true },
{
"kylechui/nvim-surround",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end
},
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
"hrsh7th/nvim-cmp",
2023-03-02 23:26:30 +00:00
dependencies = {
2023-02-28 02:27:44 +00:00
{ "hrsh7th/cmp-nvim-lsp" },
{ "hrsh7th/cmp-nvim-lua" },
{ "hrsh7th/cmp-buffer" },
{ "hrsh7th/cmp-path" },
{ "hrsh7th/cmp-cmdline" },
{ "L3MON4D3/LuaSnip" },
{ "saadparwaiz1/cmp_luasnip" },
{ "rafamadriz/friendly-snippets" },
},
config = function()
require('luasnip.loaders.from_vscode').lazy_load()
local cmp = require 'cmp'
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
2023-03-02 23:26:30 +00:00
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
2023-03-03 00:14:50 +00:00
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
2023-02-28 02:27:44 +00:00
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
2023-03-03 00:14:50 +00:00
{ name = 'nvim_lua' },
{ name = 'path' },
2023-02-28 02:27:44 +00:00
{ name = 'luasnip' },
})
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
})
2023-03-02 23:26:30 +00:00
-- buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
2023-02-28 02:27:44 +00:00
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
2023-03-02 23:26:30 +00:00
-- cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
2023-02-28 02:27:44 +00:00
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
end,
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
-- terminal toggler
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
"NvChad/nvterm",
config = function()
require("nvterm").setup()
local toggle_modes = { 'n', 't' }
local mappings = {
{ toggle_modes, '<leader>th', function() require("nvterm.terminal").toggle('horizontal') end },
{ toggle_modes, '<leader>tv', function() require("nvterm.terminal").toggle('vertical') end },
{ toggle_modes, '<leader>tf', function() require("nvterm.terminal").toggle('float') end },
}
local opts = { noremap = true, silent = true }
for _, mapping in ipairs(mappings) do
vim.keymap.set(mapping[1], mapping[2], mapping[3], opts)
end
end
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
--- THEME STUFF
-- colors
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'AlphaTechnolog/pywal.nvim',
2023-03-03 01:51:00 +00:00
priority = 1000,
2023-03-02 23:26:30 +00:00
name = 'pywal',
2023-02-28 02:27:44 +00:00
config = function()
local pywal = require('pywal')
pywal.setup()
end
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
-- better statusbar
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'hoob3rt/lualine.nvim',
2023-03-03 01:51:00 +00:00
dependencies = { { 'kyazdani42/nvim-web-devicons', lazy = true } },
2023-02-28 02:27:44 +00:00
config = function()
2023-03-02 22:22:47 +00:00
require('lualine').setup({
options = {
theme = 'pywal-nvim'
}
})
2023-02-28 02:27:44 +00:00
end,
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
-- better tabs
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'kdheepak/tabline.nvim',
2023-03-03 01:51:00 +00:00
dependencies = { { 'kyazdani42/nvim-web-devicons', lazy = true } },
2023-02-28 02:27:44 +00:00
config = function()
require('tabline').setup({ options = { theme = 'pywal-nvim' } })
end,
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
-- fwatch updates colors automatically
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'rktjmp/fwatch.nvim',
2023-03-02 23:26:30 +00:00
dependencies = { 'pywal' },
2023-02-28 02:27:44 +00:00
config = function()
require('fwatch').watch(os.getenv("XDG_CACHE_HOME") .. "/wal/colors",
2023-03-02 23:26:30 +00:00
{
on_event = function()
vim.defer_fn(function()
vim.cmd('colorscheme pywal')
end, 100)
end
})
2023-02-28 02:27:44 +00:00
end,
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
-- greeter
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'goolord/alpha-nvim',
2023-03-02 23:26:30 +00:00
dependencies = { 'kyazdani42/nvim-web-devicons' },
2023-02-28 02:27:44 +00:00
config = function()
local alpha = require('alpha')
local dashboard = require('alpha.themes.dashboard')
dashboard.section.header.val = {
[[ ▄▄▄ ▄▄▄▄ ██████ ███▄ █ ▄▄▄█████▓]],
[[▒████▄ ▓█████▄ ▒██ ▒ ██ ▀█ █ ▓ ██▒ ▓▒]],
[[▒██ ▀█▄ ▒██▒ ▄██░ ▓██▄ ▓██ ▀█ ██▒▒ ▓██░ ▒░]],
[[░██▄▄▄▄██ ▒██░█▀ ▒ ██▒▓██▒ ▐▌██▒░ ▓██▓ ░ ]],
[[ ▓█ ▓██▒░▓█ ▀█▓▒██████▒▒▒██░ ▓██░ ▒██▒ ░ ]],
[[ ▒▒ ▓▒█░░▒▓███▀▒▒ ▒▓▒ ▒ ░░ ▒░ ▒ ▒ ▒ ░░ ]],
[[ ▒ ▒▒ ░▒░▒ ░ ░ ░▒ ░ ░░ ░░ ░ ▒░ ░ ]],
[[ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ]],
[[ ░ ░ ░ ░ ░ ]],
[[ ░ ]]
}
dashboard.section.buttons.val = {
dashboard.button("e", " New file", ":ene <BAR> startinsert <CR>"),
dashboard.button("r", " Recently used files", ":Telescope oldfiles<CR>"),
dashboard.button("f", " Find file", ":Telescope find_files<CR>"),
dashboard.button("t", " Find text", ":Telescope live_grep <CR>"),
dashboard.button("s", " Settings",
":e $HOME/.config/nvim/init.lua | :cd %:p:h | split . | wincmd k | pwd<CR>"),
dashboard.button("q", " Quit NVIM", ":qa<CR>"),
}
2023-03-02 23:53:24 +00:00
dashboard.section.footer.val = require 'alpha.fortune'
2023-02-28 02:27:44 +00:00
dashboard.section.header.opts.hl = "Title"
dashboard.section.buttons.opts.hl = "Debug"
dashboard.section.footer.opts.hl = "Conceal"
dashboard.config.opts.noautocmd = true
dashboard.config.opts.setup = function()
vim.b.lnstatus = "nonumber"
end
alpha.setup(dashboard.opts)
end
2023-03-02 23:26:30 +00:00
},
}