dotfiles/.config/nvim/lua/my/plugins/tools.lua

196 lines
6.9 KiB
Lua
Raw Normal View History

2024-08-19 11:59:14 +02:00
local map = require('my.functions').map
local not_firenvim = require('my.functions').not_firenvim
2024-08-20 18:24:33 +02:00
-- TODO: enable dap plugin
2024-08-19 11:59:14 +02:00
return {
{ 'https://github.com/folke/which-key.nvim',
version = '*',
},
{ 'https://github.com/nvim-telescope/telescope.nvim',
dependencies = {
'plenary.nvim',
'nvim-treesitter',
'nvim-web-devicons',
2024-08-20 18:24:33 +02:00
'projections.nvim',
2024-08-19 11:59:14 +02:00
},
config = function()
local telescope = require('telescope')
local t_actions = require('telescope.actions')
2024-08-20 18:24:33 +02:00
telescope.load_extension('projections')
2024-08-19 11:59:14 +02:00
-- telescope.load_extension('dap')
telescope.load_extension('fzf')
telescope.setup({
mappings = {
i = {
["<C-_>"] = t_actions.which_key,
},
n = {
["?"] = t_actions.which_key,
}
},
defaults = {
file_ignore_patterns = { '^\\.git', '^fun' },
},
pickers = {
find_files = {
-- show hidden files by default
find_command = { "rg", "--files", "--hidden", "--glob", "!.git/*" }
}
}
})
local t_builtin = require('telescope.builtin')
local get_project_root = require('my.functions').get_project_root
require('which-key').add({{ '<Leader>t', group = 'telescope' }})
map('n', '<Leader>tb', t_builtin.buffers, 'buffers')
map('n', '<Leader>tf', function()
t_builtin.find_files({ cwd = get_project_root() })
end, 'files')
map('n', '<Leader>tF', t_builtin.find_files, 'files in cwd')
map('n', '<Leader>to', t_builtin.oldfiles, 'recently opened files')
map('n', '<Leader>tg', function()
t_builtin.live_grep({ cwd = get_project_root() })
end, 'Live-grep')
map('n', '<Leader>tm', t_builtin.man_pages, 'man pages')
map('n', '<Leader>tr', t_builtin.registers, 'registers')
map('n', '<Leader>gh', t_builtin.git_bcommits, 'history of this file')
map('n', '<F7>', t_builtin.diagnostics, 'show diagnostics')
2024-08-20 18:24:33 +02:00
map('n', '<Leader>tp', telescope.extensions.projections.projections, 'projects')
2024-08-19 11:59:14 +02:00
map('n', '<Leader>tt',
require("telescope._extensions.todo-comments").exports.todo,
'display TODO comments in project')
map('n', '<Leader>tn', telescope.extensions.notify.notify, 'notifications')
end,
},
{ 'https://github.com/nvim-telescope/telescope-fzf-native.nvim',
build = 'make',
},
{ 'https://github.com/kyazdani42/nvim-tree.lua',
version = '*',
dependencies = { 'nvim-web-devicons' },
config = function()
require("nvim-tree").setup({
filters = {
dotfiles = false,
custom = { '^\\.git' }
},
sync_root_with_cwd = true,
respect_buf_cwd = true,
update_focused_file = {
enable = true,
update_root = true
},
renderer = {
icons = {
show = {
file = nerdfont_installed,
folder = nerdfont_installed,
folder_arrow = nerdfont_installed,
git = nerdfont_installed
}
}
}
})
map('n', '<F9>', require("nvim-tree.api").tree.toggle, 'open nvim-tree')
map('i', '<F9>', require("nvim-tree.api").tree.toggle, 'open nvim-tree')
end,
},
{ 'https://github.com/nvim-lualine/lualine.nvim',
dependencies = {
'nvim-web-devicons',
2024-09-03 19:50:40 +02:00
'lsp-status.nvim',
2024-08-19 11:59:14 +02:00
},
init = function()
vim.o.showmode = false
end,
opts = {
options = {
icons_enabled = nerdfont_installed,
component_separators = {},
section_separators = {},
extensions = {},
globalstatus = true
},
sections = {
lualine_a = { { 'mode' } },
lualine_b = {
{ 'branch', icons_enabled = true },
{ 'diff' },
{ require('my.functions').lsp_status, padding = 0 },
{ 'diagnostics' }
},
lualine_c = {
{
'filename',
path = 1,
newfile_status = true,
cond = not_firenvim
},
{
require('my.functions').current_function,
padding = 0,
color = 'StatusLineNC'
}
},
lualine_x = {
{
require('my.functions').lsp_sig_status,
color = 'StatusLineNC'
},
{ 'filetype' }
},
lualine_y = { { 'progress' } },
lualine_z = { { 'location' }, { '"🍄"', padding = 0 }},
},
inactive_winbar = {
lualine_c = { { 'filename', cond = not_firenvim } },
},
},
},
{ 'https://codeberg.org/tastytea/bug-reference.nvim',
keys = {
{ '<leader>B', '<cmd>BugReference<cr>',
desc = 'open bug under cursor' },
},
},
{ 'https://github.com/dhruvasagar/vim-table-mode',
dependencies = { 'which-key.nvim' },
2024-08-19 11:59:14 +02:00
version = '*',
init = function()
vim.g.table_mode_map_prefix = '<leader>T'
require('which-key').add({{ '<Leader>T', group = 'Table mode' }})
end,
},
{ 'https://github.com/stevearc/dressing.nvim',
opts = {
input = {
relative = 'win',
min_width = { 60, 0.4 },
},
},
},
{ 'https://github.com/rcarriga/nvim-notify',
version = '*',
opts = {
on_open = function(win)
vim.api.nvim_win_set_option(win, 'wrap', true) -- does not work
end,
-- stages = 'static',
stages = 'slide',
timeout = 10000
2024-08-19 11:59:14 +02:00
},
init = function()
vim.notify = require('notify')
end,
},
{ 'https://github.com/gaoDean/autolist.nvim',
version = '*',
},
{ 'https://github.com/LittleMorph/copyright-updater.nvim',
event = 'BufModifiedSet',
},
}