|
-- plugins/tools.lua |
|
-- Additional development tools and utilities |
|
|
|
return { |
|
-- Telescope for fuzzy finding |
|
{ |
|
'nvim-telescope/telescope.nvim', |
|
dependencies = { |
|
'nvim-lua/plenary.nvim', |
|
-- Fast file finding in C |
|
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' } |
|
}, |
|
config = function() |
|
local telescope = require('telescope') |
|
telescope.setup({ |
|
defaults = { |
|
-- Configure file and text search behavior |
|
path_display = { "truncate" }, |
|
sorting_strategy = "ascending", |
|
layout_config = { |
|
horizontal = { |
|
prompt_position = "top", |
|
preview_width = 0.55, |
|
}, |
|
}, |
|
}, |
|
-- Configure file ignore patterns |
|
pickers = { |
|
find_files = { |
|
-- Ignore common PowerShell artifacts |
|
file_ignore_patterns = { |
|
"*.dll", "*.pdb", "*.xml", |
|
".git/", "node_modules/", |
|
}, |
|
}, |
|
}, |
|
}) |
|
-- Load the FZF extension for better performance |
|
telescope.load_extension('fzf') |
|
|
|
-- Set up key mappings for Telescope |
|
local map = vim.keymap.set |
|
map('n', '<leader>ff', "<cmd>Telescope find_files<cr>", { desc = "Find files" }) |
|
map('n', '<leader>fg', "<cmd>Telescope live_grep<cr>", { desc = "Live grep" }) |
|
map('n', '<leader>fb', "<cmd>Telescope buffers<cr>", { desc = "Find buffers" }) |
|
map('n', '<leader>fh', "<cmd>Telescope help_tags<cr>", { desc = "Help tags" }) |
|
end, |
|
}, |
|
|
|
-- Git integration |
|
{ |
|
'tpope/vim-fugitive', |
|
config = function() |
|
-- Set up key mappings for common Git operations |
|
local map = vim.keymap.set |
|
map('n', '<leader>gs', vim.cmd.Git, { desc = "Git status" }) |
|
map('n', '<leader>gb', "<cmd>Git blame<cr>", { desc = "Git blame" }) |
|
end, |
|
}, |
|
|
|
-- Undo history visualization |
|
{ |
|
'mbbill/undotree', |
|
config = function() |
|
-- Configure UndoTree layout |
|
vim.g.undotree_SetFocusWhenToggle = 1 |
|
vim.g.undotree_WindowLayout = 2 |
|
|
|
-- Set up key mapping for UndoTree |
|
vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle, { desc = "Toggle UndoTree" }) |
|
end, |
|
}, |
|
|
|
-- Status line |
|
{ |
|
'nvim-lualine/lualine.nvim', |
|
dependencies = { 'nvim-tree/nvim-web-devicons' }, |
|
config = function() |
|
require('lualine').setup({ |
|
options = { |
|
theme = 'auto', |
|
component_separators = '|', |
|
section_separators = '', |
|
}, |
|
sections = { |
|
lualine_a = {'mode'}, |
|
lualine_b = { |
|
'branch', |
|
{'diagnostics', sources = {'nvim_lsp'}}, |
|
}, |
|
lualine_c = { |
|
{ |
|
'filename', |
|
path = 1, -- Show relative path |
|
symbols = { |
|
modified = ' ●', |
|
readonly = ' ', |
|
unnamed = '[No Name]', |
|
} |
|
} |
|
}, |
|
lualine_x = {'encoding', 'fileformat', 'filetype'}, |
|
lualine_y = {'progress'}, |
|
lualine_z = {'location'} |
|
}, |
|
}) |
|
end, |
|
}, |
|
|
|
-- Auto-pairs for brackets and quotes |
|
{ |
|
'windwp/nvim-autopairs', |
|
event = "InsertEnter", |
|
config = function() |
|
require('nvim-autopairs').setup({ |
|
check_ts = true, -- Use treesitter to check for pairs |
|
disable_filetype = { "TelescopePrompt" }, |
|
-- Configure PowerShell-specific pairs |
|
pairs_map = { |
|
["'"] = "'", |
|
['"'] = '"', |
|
['('] = ')', |
|
['['] = ']', |
|
['{'] = '}', |
|
['@('] = ')', -- PowerShell array operator |
|
['@{'] = '}', -- PowerShell hash table operator |
|
}, |
|
}) |
|
end, |
|
}, |
|
|
|
-- Better syntax highlighting for PowerShell |
|
{ |
|
'PProvost/vim-ps1', |
|
ft = 'ps1', |
|
}, |
|
|
|
-- Comment toggling |
|
{ |
|
'numToStr/Comment.nvim', |
|
config = function() |
|
require('Comment').setup({ |
|
-- Enable context-aware commenting |
|
pre_hook = function(ctx) |
|
local U = require('Comment.utils') |
|
local location = nil |
|
if ctx.ctype == U.ctype.block then |
|
location = require('ts_context_commentstring.utils').get_cursor_location() |
|
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then |
|
location = require('ts_context_commentstring.utils').get_visual_start_location() |
|
end |
|
return require('ts_context_commentstring.internal').calculate_commentstring { |
|
key = ctx.ctype == U.ctype.line and '__default' or '__multiline', |
|
location = location, |
|
} |
|
end, |
|
}) |
|
end, |
|
}, |
|
} |