absvim/lua/plugins.lua

448 lines
13 KiB
Lua
Raw Normal View History

2023-03-03 06:48:47 +00:00
local vimp = require('vimp')
2023-03-02 23:26:30 +00:00
return {
2023-02-28 02:27:44 +00:00
2023-03-03 07:35:22 +00:00
-- https://github.com/tpope/vim-obsession
'tpope/vim-obsession',
-- https://github.com/svermeulen/vimpeccable
2023-03-02 23:26:30 +00:00
'svermeulen/vimpeccable',
2023-02-28 02:27:44 +00:00
2023-03-03 07:35:22 +00:00
-- https://github.com/kien/ctrlp.vim
'ctrlpvim/ctrlp.vim',
2023-03-05 04:34:54 +00:00
-- https://github.com/iamcco/markdown-preview.nvim
2023-03-03 05:30:49 +00:00
{
2023-03-05 04:34:54 +00:00
"iamcco/markdown-preview.nvim",
run = function()
vim.fn["mkdp#util#install"]()
end,
2023-03-03 05:30:49 +00:00
config = function()
2023-03-05 04:34:54 +00:00
vimp.noremap('<leader>md', [[:MarkdownPreviewToggle<CR>]])
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 = 'rose'
vim.g.mkdp_echo_preview_url = 1
end,
ft = { "markdown" }
2023-03-03 05:30:49 +00:00
},
2023-02-28 02:27:44 +00:00
2023-03-08 19:14:02 +00:00
{
'ThePrimeagen/harpoon',
dependencies = {
'nvim-lua/plenary.nvim'
},
config = function()
require("harpoon").setup({
-- sets the marks upon calling `toggle` on the ui, instead of require `:w`.
save_on_toggle = false,
-- saves the harpoon file upon every change. disabling is unrecommended.
save_on_change = true,
-- sets harpoon to run the command immediately as it's passed to the terminal when calling `sendCommand`.
enter_on_sendcmd = false,
-- closes any tmux windows harpoon that harpoon creates when you close Neovim.
tmux_autoclose_windows = false,
-- filetypes that you want to prevent from adding to the harpoon list menu.
excluded_filetypes = { "harpoon" },
-- set marks specific to each git branch inside git repository
mark_branch = false,
})
end
},
2023-03-06 18:28:11 +00:00
{
'ray-x/web-tools.nvim',
config = function()
require 'web-tools'.setup({
keymaps = {
rename = nil, -- by default use same setup of lspconfig
repeat_rename = '.', -- . to repeat
},
hurl = {
-- hurl default
show_headers = false, -- do not show http headers
floating = false, -- use floating windows (need guihua.lua)
formatters = {
-- format the result by filetype
json = { 'jq' },
html = { 'prettier', '--parser', 'html' },
},
},
})
end
},
2023-03-03 07:35:22 +00:00
-- https://github.com/fatih/vim-go
2023-03-02 23:26:30 +00:00
{
2023-03-02 09:13:40 +00:00
'fatih/vim-go',
2023-03-02 06:55:24 +00:00
config = function()
2023-03-02 09:13:40 +00:00
vim.g.go_fmt_command = "gofumpt"
2023-03-03 08:46:52 +00:00
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-06 06:40:41 +00:00
vim.g.go_highlight_operators = 1
vim.g.go_highlight_extra_types = 1
vim.g.go_highlight_build_constraints = 1
vim.g.go_auto_type_info = 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-03-03 07:35:22 +00:00
-- https://github.com/norcalli/nvim-colorizer.lua
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 07:35:22 +00:00
-- https://github.com/numToStr/Comment.nvim
2023-03-03 01:51:00 +00:00
{
'numToStr/Comment.nvim',
config = function()
require('Comment').setup()
end
},
2023-02-28 02:27:44 +00:00
2023-03-03 07:35:22 +00:00
-- https://github.com/ellisonleao/glow.nvim
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({})
2023-03-03 07:52:20 +00:00
end,
ft = { "markdown" }
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
2023-03-03 07:35:22 +00:00
-- https://github.com/windwp/nvim-autopairs
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 {}
2023-03-05 18:46:32 +00:00
end,
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
2023-03-03 07:35:22 +00:00
-- https://github.com/lewis6991/gitsigns.nvim
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,
2023-03-03 19:34:44 +00:00
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
2023-03-02 23:26:30 +00:00
delay = 100,
ignore_whitespace = false,
},
yadm = {
enable = true
},
})
end
},
2023-02-28 02:27:44 +00:00
2023-03-03 07:35:22 +00:00
-- https://github.com/nvim-telescope/telescope.nvim
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'nvim-telescope/telescope.nvim',
2023-03-03 07:52:20 +00:00
cmd = "Telescope",
2023-02-28 02:27:44 +00:00
branch = '0.1.x',
2023-03-02 23:26:30 +00:00
dependencies = {
{
'nvim-lua/plenary.nvim',
lazy = true
},
2023-03-03 06:48:47 +00:00
},
config = function()
2023-03-08 19:14:02 +00:00
require("telescope").load_extension('harpoon')
2023-03-03 06:48:47 +00:00
vimp.noremap({ 'silent' }, '<leader>ff', [[:Telescope find_files<CR>]])
vimp.noremap({ 'silent' }, '<leader>fg', [[:Telescope live_grep<CR>]])
vimp.noremap({ 'silent' }, '<leader>fb', [[:Telescope buffers<CR>]])
end
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
2023-03-03 07:35:22 +00:00
-- https://github.com/nvim-tree/nvim-tree.lua
2023-03-02 23:26:30 +00:00
{
2023-03-03 07:35:22 +00:00
'nvim-tree/nvim-tree.lua',
2023-03-03 06:48:47 +00:00
vimp.noremap({ 'silent' }, '<leader>n', [[:NvimTreeToggle<CR>]]),
2023-03-03 07:35:22 +00:00
dependencies = {
'nvim-tree/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-03-03 05:53:49 +00:00
live_filter = {
always_show_folders = false,
},
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 07:35:22 +00:00
-- https://github.com/kylechui/nvim-surround
2023-03-03 05:30:49 +00:00
{
"kylechui/nvim-surround",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end
},
2023-03-03 07:35:22 +00:00
-- https://github.com/ethanholz/nvim-lastplace
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
2023-03-03 07:35:22 +00:00
-- https://github.com/mg979/vim-visual-multi
2023-03-02 23:26:30 +00:00
'mg979/vim-visual-multi',
2023-02-28 02:27:44 +00:00
2023-03-03 07:35:22 +00:00
-- https://github.com/FooSoft/vim-argwrap
2023-03-02 23:26:30 +00:00
{
2023-03-03 06:48:47 +00:00
'FooSoft/vim-argwrap',
2023-02-28 02:27:44 +00:00
config = function()
2023-03-03 06:48:47 +00:00
vimp.nnoremap({ 'silent' }, '<leader>a', [[:ArgWrap<CR>]])
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 07:35:22 +00:00
-- https://github.com/kylechui/nvim-surround
2023-03-02 23:26:30 +00:00
{
2023-03-03 07:35:22 +00:00
"kylechui/nvim-surround",
2023-02-28 02:27:44 +00:00
config = function()
2023-03-03 07:35:22 +00:00
require("nvim-surround").setup()
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 07:35:22 +00:00
-- https://github.com/neovim/nvim-lspconfig
'neovim/nvim-lspconfig',
2023-03-03 05:30:49 +00:00
2023-03-03 07:35:22 +00:00
-- https://github.com/williamboman/mason-lspconfig.nvim
'williamboman/mason-lspconfig',
-- https://github.com/williamboman/mason.nvim
'williamboman/mason.nvim',
2023-03-03 05:30:49 +00:00
2023-03-03 07:35:22 +00:00
-- https://github.com/hrsh7th/nvim-cmp
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" },
2023-03-06 06:40:41 +00:00
{ "onsails/lspkind.nvim" },
2023-02-28 02:27:44 +00:00
},
config = function()
2023-03-06 06:40:41 +00:00
local lspkind = require('lspkind')
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
2023-02-28 02:27:44 +00:00
local cmp = require 'cmp'
2023-03-06 06:40:41 +00:00
local luasnip = require("luasnip")
2023-02-28 02:27:44 +00:00
cmp.setup({
2023-03-06 06:40:41 +00:00
experimental = {
ghost_text = true
},
2023-02-28 02:27:44 +00:00
snippet = {
expand = function(args)
2023-03-06 06:40:41 +00:00
luasnip.lsp_expand(args.body)
2023-02-28 02:27:44 +00:00
end,
},
2023-03-06 06:40:41 +00:00
formatting = {
format = lspkind.cmp_format({
mode = 'symbol',
maxwidth = 50,
ellipsis_char = '...',
before = function(entry, vim_item)
return vim_item
end
})
},
2023-02-28 02:27:44 +00:00
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 07:35:22 +00:00
['<CR>'] = cmp.mapping.confirm({ select = false }),
2023-03-06 06:40:41 +00:00
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- they way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
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' },
2023-03-05 04:34:54 +00:00
{ name = 'neorg' },
2023-03-06 06:40:41 +00:00
}, {
{ name = 'buffer' },
2023-02-28 02:27:44 +00:00
})
})
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
2023-03-03 07:35:22 +00:00
{ name = 'cmp_git' },
2023-02-28 02:27:44 +00:00
}, {
{ name = 'buffer' },
})
})
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
2023-03-06 06:40:41 +00:00
require('luasnip.loaders.from_vscode').lazy_load()
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 07:35:22 +00:00
-- https://github.com/AlphaTechnolog/pywal.nvim
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
2023-03-03 07:35:22 +00:00
-- https://github.com/nvim-lualine/lualine.nvim
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'hoob3rt/lualine.nvim',
2023-03-03 07:35:22 +00:00
dependencies = { { 'nvim-tree/nvim-web-devicons' } },
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
2023-03-03 07:35:22 +00:00
-- https://github.com/romgrk/barbar.nvim
2023-03-02 23:26:30 +00:00
{
2023-03-03 07:35:22 +00:00
'romgrk/barbar.nvim',
dependencies = 'nvim-tree/nvim-web-devicons',
2023-02-28 02:27:44 +00:00
config = function()
2023-03-03 07:35:22 +00:00
vimp.nnoremap({ 'silent' }, '<A-Right>', [[:BufferNext<CR>]])
vimp.nnoremap({ 'silent' }, '<A-Left>', [[:BufferPrevious<CR>]])
require 'bufferline'.setup {
animation = true,
closable = true,
clickable = true,
icon_separator_active = ' ',
icon_separator_inactive = ' ',
}
end
2023-03-02 23:26:30 +00:00
},
2023-02-28 02:27:44 +00:00
2023-03-03 07:35:22 +00:00
-- https://github.com/rktjmp/fwatch.nvim
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'rktjmp/fwatch.nvim',
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
2023-03-03 07:35:22 +00:00
-- https://github.com/goolord/alpha-nvim
2023-03-02 23:26:30 +00:00
{
2023-02-28 02:27:44 +00:00
'goolord/alpha-nvim',
2023-03-03 07:35:22 +00:00
dependencies = { 'nvim-tree/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
},
}