Added more plugins

This commit is contained in:
Wojciech Pietraszuk 2025-05-09 17:55:33 +02:00
parent d350db2449
commit 9e5256058d
8 changed files with 260 additions and 42 deletions

View file

@ -0,0 +1,28 @@
return {
'windwp/nvim-autopairs',
event = 'InsertEnter',
dependencies = {
'hrsh7th/nvim-cmp',
},
config = function()
local autopairs = require 'nvim-autopairs'
autopairs.setup {
check_ts = true, -- enable treesitter
ts_config = {
lua = { 'string' }, -- don't add pairs in lua string treesitter nodes
javascript = { 'template_string' }, -- don't add pairs in javscript template_string treesitter nodes
java = false, -- don't check treesitter on java
},
}
-- import nvim-autopairs completion functionality
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
-- import nvim-cmp plugin (completions plugin)
local cmp = require 'cmp'
-- make autopairs and completion work together
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
end,
}

View file

@ -0,0 +1,14 @@
return {
'folke/flash.nvim',
event = 'VeryLazy',
---@type Flash.Config
opts = {},
-- stylua: ignore
keys = {
{ "gs", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "gS", 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" },
},
}

View file

@ -2,4 +2,8 @@
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}
return {
require 'custom.plugins.flash',
require 'custom.plugins.autopairs',
require 'custom.plugins.wilder',
}

View file

@ -0,0 +1,19 @@
return {
'kdheepak/lazygit.nvim',
cmd = {
'LazyGit',
'LazyGitConfig',
'LazyGitCurrentFile',
'LazyGitFilter',
'LazyGitFilterCurrentFile',
},
-- optional for floating window border decoration
dependencies = {
'nvim-lua/plenary.nvim',
},
-- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time
keys = {
{ '<leader>lg', '<cmd>LazyGit<cr>', desc = 'Open [L]azy[G]it' },
},
}

View file

@ -0,0 +1,56 @@
return {
{
'gelguy/wilder.nvim',
keys = {
':',
'/',
'?',
},
dependencies = {
'catppuccin/nvim',
},
config = function()
local wilder = require 'wilder'
local macchiato = require('catppuccin.palettes').get_palette 'macchiato'
-- Create a highlight group for the popup menu
local text_highlight = wilder.make_hl('WilderText', { { a = 1 }, { a = 1 }, { foreground = macchiato.text } })
local mauve_highlight = wilder.make_hl('WilderMauve', { { a = 1 }, { a = 1 }, { foreground = macchiato.mauve } })
-- Enable wilder when pressing :, / or ?
wilder.setup { modes = { ':', '/', '?' } }
-- Enable fuzzy matching for commands and buffers
-- wilder.set_option("pipeline", {
-- wilder.branch(
-- wilder.cmdline_pipeline({
-- fuzzy = 1,
-- }),
-- wilder.vim_search_pipeline({
-- fuzzy = 1,
-- })
-- ),
-- })
wilder.set_option(
'renderer',
wilder.popupmenu_renderer(wilder.popupmenu_border_theme {
highlighter = wilder.basic_highlighter(),
highlights = {
default = text_highlight,
border = mauve_highlight,
accent = mauve_highlight,
},
pumblend = 5,
min_height = '25%',
max_height = '25%',
border = 'rounded',
left = { ' ', wilder.popupmenu_devicons() },
right = { ' ', wilder.popupmenu_scrollbar() },
})
)
end,
build = ':UpdateRemotePlugins',
},
}

View file

@ -1,25 +1,90 @@
-- Neo-tree is a Neovim plugin to browse the file system
-- https://github.com/nvim-neo-tree/neo-tree.nvim
return {
'nvim-neo-tree/neo-tree.nvim',
version = '*',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
'nvim-tree/nvim-web-devicons',
'MunifTanjim/nui.nvim',
},
cmd = 'Neotree',
init = function()
vim.api.nvim_create_autocmd('VimEnter', {
pattern = '*',
command = 'Neotree current',
})
end,
keys = {
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
{ '<leader>e', ':Neotree toggle<CR>', { desc = 'NeoTree toggle' } },
},
opts = {
event_handlers = {
{
event = 'neo_tree_buffer_enter',
handler = function()
vim.opt.relativenumber = true
end,
},
{
event = 'file_opened',
handler = function()
require('neo-tree.command').execute { action = 'close' }
end,
},
},
filesystem = {
bind_to_cwd = false,
follow_current_file = { enabled = true },
use_libuv_file_watcher = true,
hijack_netrw_behavior = 'open_current',
window = {
mappings = {
['\\'] = 'close_window',
['<space>'] = 'none',
['<leader>E'] = 'close_window',
['J'] = function(state)
local tree = state.tree
local node = tree:get_node()
local siblings = tree:get_nodes(node:get_parent_id())
local renderer = require 'neo-tree.ui.renderer'
renderer.focus_node(state, siblings[#siblings]:get_id())
end,
['K'] = function(state)
local tree = state.tree
local node = tree:get_node()
local siblings = tree:get_nodes(node:get_parent_id())
local renderer = require 'neo-tree.ui.renderer'
renderer.focus_node(state, siblings[1]:get_id())
end,
['l'] = 'open',
['h'] = 'close_node',
},
},
filtered_items = {
hide_dotfiles = false,
hide_gitignored = false,
},
},
},
}
-- return {
-- 'nvim-neo-tree/neo-tree.nvim',
-- version = '*',
-- dependencies = {
-- 'nvim-lua/plenary.nvim',
-- 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
-- 'MunifTanjim/nui.nvim',
-- },
-- cmd = 'Neotree',
-- keys = {
-- { '<leader>e', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
-- },
-- opts = {
-- filesystem = {
-- window = {
-- mappings = {
-- ['<leader>e'] = 'close_window',
-- },
-- },
-- },
-- },
-- }