feat(nvim): plugins definition now in lua/base/plugins/*.lua
This commit is contained in:
parent
ddc169dff3
commit
6d6d949f99
@ -16,220 +16,17 @@ install_lazy_if_not_installed(lazypath)
|
|||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
|
||||||
local plugins = {
|
local plugins = {}
|
||||||
{
|
|
||||||
'nvim-lualine/lualine.nvim',
|
local modules = vim.split(vim.fn.glob(vim.fn.stdpath("config") .. '/lua/*/plugins/*lua'), '\n')
|
||||||
dependencies = { 'kyazdani42/nvim-web-devicons' }
|
|
||||||
},
|
for i, module_path in pairs(modules) do
|
||||||
{
|
splitted_path = vim.split(module_path, '/')
|
||||||
"max397574/better-escape.nvim",
|
module_name = splitted_path[#splitted_path]:gsub(".lua", "")
|
||||||
config = function()
|
|
||||||
require("better_escape").setup({
|
table.insert(plugins, require('base.plugins.' .. module_name))
|
||||||
mapping = {'jf', 'оа'},
|
end
|
||||||
timeout = vim.o.timeoutlen,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'chentoast/marks.nvim',
|
|
||||||
config = function()
|
|
||||||
require("marks").setup()
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'karb94/neoscroll.nvim',
|
|
||||||
config = function()
|
|
||||||
require('neoscroll').setup()
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'EdenEast/nightfox.nvim' -- colorscheme
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'ellisonleao/gruvbox.nvim' -- colorscheme
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'kana/vim-textobj-lastpat', -- text-object i/, operate under finding
|
|
||||||
dependencies = { 'kana/vim-textobj-user' }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'tpope/vim-surround'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'tpope/vim-repeat'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'google/vim-searchindex'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'tpope/vim-commentary' -- gcc to comment line
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'norcalli/nvim-colorizer.lua',
|
|
||||||
config = function()
|
|
||||||
require('colorizer').setup()
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'preservim/tagbar',
|
|
||||||
keys = {
|
|
||||||
{ '<Leader>t', '<cmd>TagbarToggle<CR>' }
|
|
||||||
},
|
|
||||||
enabled = vim.fn.executable "ctags" == 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'preservim/vimux',
|
|
||||||
enabled = vim.fn.executable "tmux" == 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'rbgrouleff/bclose.vim'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'Pocco81/auto-save.nvim' -- autosave files
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'windwp/nvim-autopairs' -- auto pair brackets and tags
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'lewis6991/gitsigns.nvim' -- git integration
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'windwp/nvim-ts-autotag'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'nvim-treesitter/nvim-treesitter',
|
|
||||||
build = ':TSUpdate'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'numToStr/Comment.nvim'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'neovim/nvim-lspconfig'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'folke/trouble.nvim',
|
|
||||||
dependencies = { 'kyazdani42/nvim-web-devicons' }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'hrsh7th/nvim-cmp',
|
|
||||||
dependencies = {
|
|
||||||
"hrsh7th/cmp-buffer",
|
|
||||||
"hrsh7th/cmp-path",
|
|
||||||
"hrsh7th/cmp-cmdline",
|
|
||||||
'saadparwaiz1/cmp_luasnip',
|
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'L3MON4D3/LuaSnip',
|
|
||||||
dependencies = 'hrsh7th/nvim-cmp',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'honza/vim-snippets'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'williamboman/mason.nvim',
|
|
||||||
dependencies = "williamboman/mason-lspconfig.nvim"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'folke/which-key.nvim',
|
|
||||||
config = function()
|
|
||||||
require("which-key").setup()
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'nvim-telescope/telescope.nvim',
|
|
||||||
enabled = vim.fn.executable "fzf" == 1,
|
|
||||||
dependencies = {
|
|
||||||
'nvim-lua/plenary.nvim',
|
|
||||||
{
|
|
||||||
'nvim-telescope/telescope-fzf-native.nvim',
|
|
||||||
enabled = vim.fn.executable "make" == 1,
|
|
||||||
build = "make"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{ '<Leader>ff', '<cmd>Telescope find_files<CR>' },
|
|
||||||
{ '<Leader>fg', '<cmd>Telescope live_grep<CR>' },
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'nmac427/guess-indent.nvim',
|
|
||||||
config = function()
|
|
||||||
require('guess-indent').setup()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
|
||||||
config = function()
|
|
||||||
require("ibl").setup({
|
|
||||||
scope = { enabled = false },
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
main = "ibl"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("neo-tree").setup({
|
|
||||||
close_if_last_window = true,
|
|
||||||
filesystem = {
|
|
||||||
hide_gitignored = true,
|
|
||||||
hijack_netrw_behavior = "open_current",
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
mappings = {
|
|
||||||
["l"] = "open",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'folke/neodev.nvim',
|
|
||||||
ft = {'lua'},
|
|
||||||
dependencies = {
|
|
||||||
'neovim/nvim-lspconfig'
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require('neodev').setup()
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'chaoren/vim-wordmotion',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'ggandor/leap.nvim',
|
|
||||||
keys = {
|
|
||||||
{ 'gs', '<Plug>(leap-forward-to)' },
|
|
||||||
{ 'gS', '<Plug>(leap-backward-to)' },
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'toppair/peek.nvim',
|
|
||||||
enabled = vim.fn.executable "deno" == 1,
|
|
||||||
ft = {'markdown'},
|
|
||||||
build = 'deno task --quiet build:fast',
|
|
||||||
config = function()
|
|
||||||
require('peek').setup({
|
|
||||||
auto_load = true,
|
|
||||||
close_on_bdelete = true,
|
|
||||||
syntax = true,
|
|
||||||
theme = 'dark',
|
|
||||||
update_on_change = true,
|
|
||||||
app = 'webview',
|
|
||||||
filetype = {'markdown'},
|
|
||||||
throttle_at = 200000,
|
|
||||||
throttle_time = 'auto',
|
|
||||||
vim.keymap.set('n', '<Leader>rr', "<cmd>lua require('peek').open()<CR>", {noremap=true, silent=true})
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
require("lazy").setup(
|
require("lazy").setup(
|
||||||
plugins,
|
plugins,
|
||||||
|
|||||||
@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
"max397574/better-escape.nvim",
|
||||||
|
config = function()
|
||||||
|
require("better_escape").setup({
|
||||||
|
mapping = {'jf', 'оа'},
|
||||||
|
timeout = vim.o.timeoutlen,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
8
home/user/.config/nvim/lua/base/plugins/colorschemes.lua
Normal file
8
home/user/.config/nvim/lua/base/plugins/colorschemes.lua
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
'EdenEast/nightfox.nvim'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'ellisonleao/gruvbox.nvim'
|
||||||
|
},
|
||||||
|
}
|
||||||
6
home/user/.config/nvim/lua/base/plugins/guess_indent.lua
Normal file
6
home/user/.config/nvim/lua/base/plugins/guess_indent.lua
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
'nmac427/guess-indent.nvim',
|
||||||
|
config = function()
|
||||||
|
require('guess-indent').setup()
|
||||||
|
end,
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
config = function()
|
||||||
|
require("ibl").setup({
|
||||||
|
scope = { enabled = false },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
main = "ibl"
|
||||||
|
}
|
||||||
7
home/user/.config/nvim/lua/base/plugins/leap.lua
Normal file
7
home/user/.config/nvim/lua/base/plugins/leap.lua
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
'ggandor/leap.nvim',
|
||||||
|
keys = {
|
||||||
|
{ 'gs', '<Plug>(leap-forward-to)' },
|
||||||
|
{ 'gS', '<Plug>(leap-backward-to)' },
|
||||||
|
}
|
||||||
|
}
|
||||||
4
home/user/.config/nvim/lua/base/plugins/lualine.lua
Normal file
4
home/user/.config/nvim/lua/base/plugins/lualine.lua
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
'nvim-lualine/lualine.nvim',
|
||||||
|
dependencies = { 'kyazdani42/nvim-web-devicons' }
|
||||||
|
}
|
||||||
6
home/user/.config/nvim/lua/base/plugins/marks.lua
Normal file
6
home/user/.config/nvim/lua/base/plugins/marks.lua
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
'chentoast/marks.nvim',
|
||||||
|
config = function()
|
||||||
|
require("marks").setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
4
home/user/.config/nvim/lua/base/plugins/mason.lua
Normal file
4
home/user/.config/nvim/lua/base/plugins/mason.lua
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
'williamboman/mason.nvim',
|
||||||
|
dependencies = "williamboman/mason-lspconfig.nvim"
|
||||||
|
}
|
||||||
37
home/user/.config/nvim/lua/base/plugins/misc.lua
Normal file
37
home/user/.config/nvim/lua/base/plugins/misc.lua
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
return {
|
||||||
|
'tpope/vim-surround',
|
||||||
|
'tpope/vim-repeat',
|
||||||
|
'google/vim-searchindex',
|
||||||
|
'rbgrouleff/bclose.vim',
|
||||||
|
'Pocco81/auto-save.nvim', -- autosave files
|
||||||
|
'windwp/nvim-autopairs', -- auto pair brackets and tags
|
||||||
|
'lewis6991/gitsigns.nvim', -- git integration
|
||||||
|
'windwp/nvim-ts-autotag',
|
||||||
|
'chaoren/vim-wordmotion',
|
||||||
|
'numToStr/Comment.nvim',
|
||||||
|
{
|
||||||
|
'norcalli/nvim-colorizer.lua',
|
||||||
|
config = function()
|
||||||
|
require('colorizer').setup()
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'preservim/tagbar',
|
||||||
|
keys = {
|
||||||
|
{ '<Leader>t', '<cmd>TagbarToggle<CR>' }
|
||||||
|
},
|
||||||
|
enabled = vim.fn.executable "ctags" == 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'preservim/vimux',
|
||||||
|
enabled = vim.fn.executable "tmux" == 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
build = ':TSUpdate'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'folke/trouble.nvim',
|
||||||
|
dependencies = { 'kyazdani42/nvim-web-devicons' }
|
||||||
|
},
|
||||||
|
}
|
||||||
10
home/user/.config/nvim/lua/base/plugins/neodev.lua
Normal file
10
home/user/.config/nvim/lua/base/plugins/neodev.lua
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
return {
|
||||||
|
'folke/neodev.nvim',
|
||||||
|
ft = {'lua'},
|
||||||
|
dependencies = {
|
||||||
|
'neovim/nvim-lspconfig'
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require('neodev').setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
6
home/user/.config/nvim/lua/base/plugins/neoscroll.lua
Normal file
6
home/user/.config/nvim/lua/base/plugins/neoscroll.lua
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
'karb94/neoscroll.nvim',
|
||||||
|
config = function()
|
||||||
|
require('neoscroll').setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
21
home/user/.config/nvim/lua/base/plugins/neotree.lua
Normal file
21
home/user/.config/nvim/lua/base/plugins/neotree.lua
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
return {
|
||||||
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("neo-tree").setup({
|
||||||
|
close_if_last_window = true,
|
||||||
|
filesystem = {
|
||||||
|
hide_gitignored = true,
|
||||||
|
hijack_netrw_behavior = "open_current",
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
mappings = {
|
||||||
|
["l"] = "open",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
22
home/user/.config/nvim/lua/base/plugins/nvim_cmp.lua
Normal file
22
home/user/.config/nvim/lua/base/plugins/nvim_cmp.lua
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
"hrsh7th/cmp-cmdline",
|
||||||
|
'saadparwaiz1/cmp_luasnip',
|
||||||
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'neovim/nvim-lspconfig'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'L3MON4D3/LuaSnip',
|
||||||
|
dependencies = 'hrsh7th/nvim-cmp',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'honza/vim-snippets'
|
||||||
|
},
|
||||||
|
}
|
||||||
20
home/user/.config/nvim/lua/base/plugins/peek.lua
Normal file
20
home/user/.config/nvim/lua/base/plugins/peek.lua
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
return {
|
||||||
|
'toppair/peek.nvim',
|
||||||
|
enabled = vim.fn.executable "deno" == 1,
|
||||||
|
ft = {'markdown'},
|
||||||
|
build = 'deno task --quiet build:fast',
|
||||||
|
config = function()
|
||||||
|
require('peek').setup({
|
||||||
|
auto_load = true,
|
||||||
|
close_on_bdelete = true,
|
||||||
|
syntax = true,
|
||||||
|
theme = 'dark',
|
||||||
|
update_on_change = true,
|
||||||
|
app = 'webview',
|
||||||
|
filetype = {'markdown'},
|
||||||
|
throttle_at = 200000,
|
||||||
|
throttle_time = 'auto',
|
||||||
|
vim.keymap.set('n', '<Leader>rr', "<cmd>lua require('peek').open()<CR>", {noremap=true, silent=true})
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
16
home/user/.config/nvim/lua/base/plugins/telescope.lua
Normal file
16
home/user/.config/nvim/lua/base/plugins/telescope.lua
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
return {
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
enabled = vim.fn.executable "fzf" == 1,
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
{
|
||||||
|
'nvim-telescope/telescope-fzf-native.nvim',
|
||||||
|
enabled = vim.fn.executable "make" == 1,
|
||||||
|
build = "make"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{ '<Leader>ff', '<cmd>Telescope find_files<CR>' },
|
||||||
|
{ '<Leader>fg', '<cmd>Telescope live_grep<CR>' },
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
'kana/vim-textobj-lastpat', -- text-object i/, operate under finding
|
||||||
|
dependencies = { 'kana/vim-textobj-user' }
|
||||||
|
}
|
||||||
6
home/user/.config/nvim/lua/base/plugins/which_key.lua
Normal file
6
home/user/.config/nvim/lua/base/plugins/which_key.lua
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
'folke/which-key.nvim',
|
||||||
|
config = function()
|
||||||
|
require("which-key").setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user