192 lines
6.8 KiB
Lua
192 lines
6.8 KiB
Lua
local map = require('my.functions').map
|
|
local not_firenvim = require('my.functions').not_firenvim
|
|
|
|
-- TODO: enable projections and dap plugins
|
|
return {
|
|
{ 'https://github.com/folke/which-key.nvim',
|
|
version = '*',
|
|
},
|
|
{ 'https://github.com/nvim-telescope/telescope.nvim',
|
|
dependencies = {
|
|
'plenary.nvim',
|
|
'nvim-treesitter',
|
|
'nvim-web-devicons',
|
|
},
|
|
config = function()
|
|
local telescope = require('telescope')
|
|
local t_actions = require('telescope.actions')
|
|
-- telescope.load_extension('projections')
|
|
-- 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')
|
|
-- map('n', '<Leader>tp', telescope.extensions.projections.projections, 'projects')
|
|
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',
|
|
'https://github.com/nvim-lua/lsp-status.nvim',
|
|
},
|
|
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',
|
|
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',
|
|
},
|
|
init = function()
|
|
vim.notify = require('notify')
|
|
end,
|
|
},
|
|
{ 'https://github.com/gaoDean/autolist.nvim',
|
|
version = '*',
|
|
},
|
|
{ 'https://github.com/LittleMorph/copyright-updater.nvim',
|
|
event = 'BufModifiedSet',
|
|
},
|
|
}
|