added plugins
This commit is contained in:
parent
5aeddfdd5d
commit
42a8b0ff06
19 changed files with 322 additions and 74 deletions
13
lua/custom/plugins/autopairs.lua
Normal file
13
lua/custom/plugins/autopairs.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
-- Optional dependency
|
||||
dependencies = { 'hrsh7th/nvim-cmp' },
|
||||
config = function()
|
||||
require('nvim-autopairs').setup {}
|
||||
-- If you want to automatically add `(` after selecting a function or method
|
||||
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
|
||||
local cmp = require 'cmp'
|
||||
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
}
|
||||
7
lua/custom/plugins/colorizer.lua
Normal file
7
lua/custom/plugins/colorizer.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
'NvChad/nvim-colorizer.lua',
|
||||
event = 'UIEnter',
|
||||
config = function()
|
||||
require('colorizer').setup {}
|
||||
end,
|
||||
}
|
||||
5
lua/custom/plugins/diffview.lua
Normal file
5
lua/custom/plugins/diffview.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
'sindrets/diffview.nvim',
|
||||
event = 'InsertEnter',
|
||||
config = function() end,
|
||||
}
|
||||
14
lua/custom/plugins/flash.lua
Normal file
14
lua/custom/plugins/flash.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
'folke/flash.nvim',
|
||||
event = 'VeryLazy',
|
||||
---@type Flash.Config
|
||||
opts = {},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
||||
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
|
||||
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
||||
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
||||
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
||||
},
|
||||
}
|
||||
9
lua/custom/plugins/flutter-tools.lua
Normal file
9
lua/custom/plugins/flutter-tools.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
-- 'akinsho/flutter-tools.nvim',
|
||||
-- event = 'InsertEnter',
|
||||
-- dependencies = {
|
||||
-- 'nvim-lua/plenary.nvim',
|
||||
-- 'stevearc/dressing.nvim', -- optional for vim.ui.select
|
||||
-- },
|
||||
-- config = true,
|
||||
}
|
||||
12
lua/custom/plugins/git-blame.lua
Normal file
12
lua/custom/plugins/git-blame.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
'f-person/git-blame.nvim',
|
||||
event = 'UIEnter',
|
||||
config = function()
|
||||
require('gitblame').setup {
|
||||
enabled = false,
|
||||
}
|
||||
vim.keymap.set('n', '<leader>gb', ':GitBlameToggle<CR>', { desc = 'Toggle Git Blame' })
|
||||
vim.keymap.set('n', '<leader>go', ':GitBlameOpenCommitURL<CR>', { desc = '[G]it Blame [O]pen Commit URL' })
|
||||
vim.keymap.set('n', '<leader>gf', ':GitBlameOpenFileURL<CR>', { desc = '[G]it Blame Open [F]ile URL' })
|
||||
end,
|
||||
}
|
||||
33
lua/custom/plugins/harpoon.lua
Normal file
33
lua/custom/plugins/harpoon.lua
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
return {
|
||||
'ThePrimeagen/harpoon',
|
||||
branch = 'harpoon2',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
local harpoon = require 'harpoon'
|
||||
harpoon:setup()
|
||||
|
||||
vim.keymap.set('n', '<leader>ha', function()
|
||||
harpoon:list():append()
|
||||
end, { desc = '[h]arpoon [a]ppend' })
|
||||
vim.keymap.set('n', '<leader>hm', function()
|
||||
harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||
end, {
|
||||
noremap = true,
|
||||
desc = 'Open [H]arpoon [M]enu',
|
||||
})
|
||||
|
||||
for i = 1, 9 do
|
||||
vim.keymap.set('n', '<leader>' .. i, function()
|
||||
harpoon:list():select(i)
|
||||
end, { desc = 'Goto [' .. i .. ']th buffer' })
|
||||
end
|
||||
|
||||
-- Toggle previous & next buffers stored within Harpoon list
|
||||
vim.keymap.set('n', '<C-S-P>', function()
|
||||
harpoon:list():prev()
|
||||
end, { desc = 'Goto [P]revious buffer' })
|
||||
vim.keymap.set('n', '<C-S-N>', function()
|
||||
harpoon:list():next()
|
||||
end, { desc = 'Goto [N]ext buffer' })
|
||||
end,
|
||||
}
|
||||
29
lua/custom/plugins/incline.lua
Normal file
29
lua/custom/plugins/incline.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
return {
|
||||
'b0o/incline.nvim',
|
||||
config = function()
|
||||
local helper = require 'incline.helpers'
|
||||
local devicons = require 'nvim-web-devicons'
|
||||
|
||||
require('incline').setup {
|
||||
window = {
|
||||
padding = 0,
|
||||
margin = { horizontal = 0 },
|
||||
},
|
||||
render = function(props)
|
||||
local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ':p:.')
|
||||
if filename == '' then
|
||||
filename = '[No Name]'
|
||||
end
|
||||
local ft_icon, ft_color = devicons.get_icon_color(filename)
|
||||
local modified = vim.bo[props.buf].modified
|
||||
return {
|
||||
ft_icon and { ' ', ft_icon, ' ', guibg = ft_color, guifg = helper.contrast_color(ft_color) } or '',
|
||||
' ',
|
||||
{ filename, gui = modified and 'bold,italic' or 'bold' },
|
||||
' ',
|
||||
guibg = '#44406e',
|
||||
}
|
||||
end,
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,5 +1 @@
|
|||
-- You can add your own plugins here or in other files in this directory!
|
||||
-- I promise not to create any merge conflicts in this directory :)
|
||||
--
|
||||
-- See the kickstart.nvim README for more information
|
||||
return {}
|
||||
|
|
|
|||
12
lua/custom/plugins/lazygit.lua
Normal file
12
lua/custom/plugins/lazygit.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
'kdheepak/lazygit.nvim',
|
||||
-- optional for floating window border decoration
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-telescope/telescope.nvim',
|
||||
},
|
||||
config = function()
|
||||
require('telescope').load_extension 'lazygit'
|
||||
vim.keymap.set('n', '<leader>gg', '<CMD>:LazyGit<CR>', { desc = 'open lazygit' })
|
||||
end,
|
||||
}
|
||||
19
lua/custom/plugins/mini-surround.lua
Normal file
19
lua/custom/plugins/mini-surround.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
-- 'echasnovski/mini.surround',
|
||||
-- config = function()
|
||||
-- require('mini.surround').setup {
|
||||
-- mappings = {
|
||||
-- add = 'ysa', -- Add surrounding in Normal and Visual modes
|
||||
-- delete = 'ysd', -- Delete surrounding
|
||||
-- find = 'ysf', -- Find surrounding (to the right)
|
||||
-- find_left = 'ysF', -- Find surrounding (to the left)
|
||||
-- highlight = 'ysh', -- Highlight surrounding
|
||||
-- replace = 'ysr', -- Replace surrounding
|
||||
-- update_n_lines = 'ysn', -- Update `n_lines`
|
||||
--
|
||||
-- suffix_last = 'yl', -- Suffix to search with "prev" method
|
||||
-- suffix_next = 'yn', -- Suffix to search wwth "next" method
|
||||
-- },
|
||||
-- }
|
||||
-- end,
|
||||
}
|
||||
6
lua/custom/plugins/notify.lua
Normal file
6
lua/custom/plugins/notify.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
-- "rcarriga/nvim-notify",
|
||||
-- config = function ()
|
||||
-- vim.notify = require("notify")
|
||||
-- end
|
||||
}
|
||||
9
lua/custom/plugins/oil.lua
Normal file
9
lua/custom/plugins/oil.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
'stevearc/oil.nvim',
|
||||
opts = {},
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function()
|
||||
require('oil').setup()
|
||||
vim.keymap.set('n', '<leader>e', '<CMD>Oil<CR>', { desc = 'Open parent directory' })
|
||||
end,
|
||||
}
|
||||
20
lua/custom/plugins/spectre.lua
Normal file
20
lua/custom/plugins/spectre.lua
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
return {
|
||||
'nvim-pack/nvim-spectre',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
config = function()
|
||||
vim.keymap.set('n', '<leader>S', '<cmd>lua require("spectre").toggle()<CR>', {
|
||||
desc = 'Toggle Spectre',
|
||||
})
|
||||
vim.keymap.set('n', '<leader>scw', '<cmd>lua require("spectre").open_visual({select_word=true})<CR>', {
|
||||
desc = 'Search current word',
|
||||
})
|
||||
vim.keymap.set('v', '<leader>scww', '<esc><cmd>lua require("spectre").open_visual()<CR>', {
|
||||
desc = 'Search current word',
|
||||
})
|
||||
vim.keymap.set('n', '<leader>socf', '<cmd>lua require("spectre").open_file_search({select_word=true})<CR>', {
|
||||
desc = 'Search on current file',
|
||||
})
|
||||
end,
|
||||
}
|
||||
7
lua/custom/plugins/treesitter-context.lua
Normal file
7
lua/custom/plugins/treesitter-context.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
'nvim-treesitter/nvim-treesitter-context',
|
||||
-- event = 'VimEnter',
|
||||
enabled = true,
|
||||
opts = { mode = 'cursor', max_lines = 3 },
|
||||
config = function() end,
|
||||
}
|
||||
39
lua/custom/plugins/trouble.lua
Normal file
39
lua/custom/plugins/trouble.lua
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
return {
|
||||
'folke/trouble.nvim',
|
||||
cmd = { 'TroubleToggle', 'Trouble' },
|
||||
opts = { use_diagnostic_signs = true },
|
||||
keys = {
|
||||
{ '<leader>xx', '<cmd>TroubleToggle document_diagnostics<cr>', desc = 'Document Diagnostics (Trouble)' },
|
||||
{ '<leader>X', '<cmd>TroubleToggle workspace_diagnostics<cr>', desc = 'Workspace Diagnostics (Trouble)' },
|
||||
{ '<leader>xL', '<cmd>TroubleToggle loclist<cr>', desc = 'Location List (Trouble)' },
|
||||
{ '<leader>xq', '<cmd>TroubleToggle quickfix<cr>', desc = 'Quickfix List (Trouble)' },
|
||||
{
|
||||
'[q',
|
||||
function()
|
||||
if require('trouble').is_open() then
|
||||
require('trouble').previous { skip_groups = true, jump = true }
|
||||
else
|
||||
local ok, err = pcall(vim.cmd.cprev)
|
||||
if not ok then
|
||||
vim.notify(err, vim.log.levels.ERROR)
|
||||
end
|
||||
end
|
||||
end,
|
||||
desc = 'Previous trouble/quickfix item',
|
||||
},
|
||||
{
|
||||
']q',
|
||||
function()
|
||||
if require('trouble').is_open() then
|
||||
require('trouble').next { skip_groups = true, jump = true }
|
||||
else
|
||||
local ok, err = pcall(vim.cmd.cnext)
|
||||
if not ok then
|
||||
vim.notify(err, vim.log.levels.ERROR)
|
||||
end
|
||||
end
|
||||
end,
|
||||
desc = 'Next trouble/quickfix item',
|
||||
},
|
||||
},
|
||||
}
|
||||
37
lua/custom/plugins/vim-illuminate.lua
Normal file
37
lua/custom/plugins/vim-illuminate.lua
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
return {
|
||||
-- 'RRethy/vim-illuminate',
|
||||
-- event = 'UIEnter',
|
||||
-- opts = {
|
||||
-- keys = {},
|
||||
-- delay = 200,
|
||||
-- large_file_cutoff = 2000,
|
||||
-- large_file_overrides = {
|
||||
-- providers = { 'lsp' },
|
||||
-- },
|
||||
-- },
|
||||
-- config = function(_, opts)
|
||||
-- require('illuminate').configure(opts)
|
||||
--
|
||||
-- local function map(key, dir, buffer)
|
||||
-- vim.keymap.set('n', key, function()
|
||||
-- require('illuminate')['goto_' .. dir .. '_reference'](false)
|
||||
-- end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. ' Reference', buffer = buffer })
|
||||
-- end
|
||||
--
|
||||
-- -- map("]]", "next")
|
||||
-- -- map("[[", "prev")
|
||||
--
|
||||
-- -- also set it after loading ftplugins, since a lot overwrite [[ and ]]
|
||||
-- vim.api.nvim_create_autocmd('FileType', {
|
||||
-- callback = function()
|
||||
-- local buffer = vim.api.nvim_get_current_buf()
|
||||
-- -- map("]]", "next", buffer)
|
||||
-- -- map("[[", "prev", buffer)
|
||||
-- end,
|
||||
-- })
|
||||
-- end,
|
||||
-- keys = {
|
||||
-- -- { "]]", desc = "Next Reference" },
|
||||
-- -- { "[[", desc = "Prev Reference" },
|
||||
-- },
|
||||
}
|
||||
10
lua/custom/plugins/vim-tmux-navigator.lua
Normal file
10
lua/custom/plugins/vim-tmux-navigator.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
'alexghergh/nvim-tmux-navigation',
|
||||
config = function()
|
||||
require('nvim-tmux-navigation').setup {}
|
||||
vim.keymap.set('n', '<C-h>', '<Cmd>NvimTmuxNavigateLeft<CR>', {})
|
||||
vim.keymap.set('n', '<C-j>', '<Cmd>NvimTmuxNavigateDown<CR>', {})
|
||||
vim.keymap.set('n', '<C-k>', '<Cmd>NvimTmuxNavigateUp<CR>', {})
|
||||
vim.keymap.set('n', '<C-l>', '<Cmd>NvimTmuxNavigateRight<CR>', {})
|
||||
end,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue