2022-08-19 03:20:29 +02:00
|
|
|
require('which-key').setup({})
|
|
|
|
|
2022-08-16 04:23:12 +02:00
|
|
|
local map = require('my.functions').map
|
2022-08-15 01:29:31 +02:00
|
|
|
local telescope = require('telescope')
|
2022-08-17 19:57:20 +02:00
|
|
|
local t_actions = require('telescope.actions')
|
2022-08-17 19:55:12 +02:00
|
|
|
telescope.load_extension('projects')
|
2022-08-28 20:30:59 +02:00
|
|
|
telescope.load_extension('dap')
|
2022-08-30 06:39:04 +02:00
|
|
|
telescope.load_extension('fzf')
|
2022-08-13 19:09:59 +02:00
|
|
|
|
2022-08-28 21:39:24 +02:00
|
|
|
telescope.setup({
|
2022-08-15 01:29:31 +02:00
|
|
|
mappings = {
|
|
|
|
i = {
|
2022-08-17 19:57:20 +02:00
|
|
|
["<C-_>"] = t_actions.which_key,
|
2022-08-15 01:29:31 +02:00
|
|
|
},
|
|
|
|
n = {
|
2022-08-17 19:57:20 +02:00
|
|
|
["?"] = t_actions.which_key,
|
2022-08-15 01:29:31 +02:00
|
|
|
}
|
|
|
|
},
|
2022-09-01 20:23:18 +02:00
|
|
|
defaults = {
|
|
|
|
file_ignore_patterns = { '^\\.git', '^fun' },
|
|
|
|
},
|
|
|
|
pickers = {
|
|
|
|
find_files = {
|
|
|
|
-- show hidden files by default
|
|
|
|
find_command = { "rg", "--files", "--hidden", "--glob", "!.git/*" }
|
|
|
|
}
|
|
|
|
}
|
2022-08-28 21:39:24 +02:00
|
|
|
})
|
2022-08-13 19:09:59 +02:00
|
|
|
|
2022-08-17 19:13:25 +02:00
|
|
|
local t_builtin = require('telescope.builtin')
|
2022-08-15 01:29:31 +02:00
|
|
|
local my = require('my.functions')
|
2022-08-17 19:13:25 +02:00
|
|
|
map('n', '<Leader>tb', t_builtin.buffers, 'Buffers')
|
2022-08-15 01:29:31 +02:00
|
|
|
map('n', '<Leader>tf', function()
|
2022-08-22 04:04:10 +02:00
|
|
|
t_builtin.find_files({ cwd = my.get_project_root() })
|
2022-08-16 04:55:49 +02:00
|
|
|
end, 'Files')
|
2022-08-31 06:09:43 +02:00
|
|
|
map('n', '<Leader>tF', t_builtin.find_files, 'Files in cwd')
|
2022-08-17 19:13:25 +02:00
|
|
|
map('n', '<Leader>to', t_builtin.oldfiles, 'Recently opened files')
|
2022-08-15 01:29:31 +02:00
|
|
|
map('n', '<Leader>tg', function()
|
2022-08-17 19:13:25 +02:00
|
|
|
t_builtin.live_grep({ cwd = my.get_project_root() })
|
2022-08-16 04:55:49 +02:00
|
|
|
end, 'Live-grep')
|
2022-08-17 19:13:25 +02:00
|
|
|
map('n', '<Leader>tm', t_builtin.man_pages, 'Man pages')
|
|
|
|
map('n', '<Leader>tr', t_builtin.registers, 'Registers')
|
2022-08-19 00:50:36 +02:00
|
|
|
map('n', '<Leader>gh', t_builtin.git_bcommits, 'History of this file')
|
2022-08-28 21:39:24 +02:00
|
|
|
map('n', '<F7>', t_builtin.diagnostics, 'Show diagnostics')
|
|
|
|
map('n', '<Leader>tp', telescope.extensions.projects.projects, 'Projects')
|
2022-08-29 04:24:01 +02:00
|
|
|
map('n', '<Leader>tt',
|
|
|
|
require("telescope._extensions.todo-comments").exports.todo,
|
|
|
|
'Display TODO comments in project')
|
2022-09-06 05:40:03 +02:00
|
|
|
map('n', '<Leader>tn', telescope.extensions.notify.notify, 'Notifications')
|
2022-08-19 00:50:36 +02:00
|
|
|
|
2022-08-19 00:11:15 +02:00
|
|
|
local nerdfont_installed = require('my.functions').nerdfont_installed()
|
|
|
|
|
2022-08-16 21:38:31 +02:00
|
|
|
require("nvim-tree").setup({
|
|
|
|
filters = {
|
2022-08-19 00:50:36 +02:00
|
|
|
dotfiles = false,
|
|
|
|
custom = { '^\\.git' }
|
2022-08-16 21:38:31 +02:00
|
|
|
},
|
2022-08-17 20:07:52 +02:00
|
|
|
sync_root_with_cwd = true,
|
|
|
|
respect_buf_cwd = true,
|
|
|
|
update_focused_file = {
|
|
|
|
enable = true,
|
|
|
|
update_root = true
|
|
|
|
},
|
2022-08-16 21:38:31 +02:00
|
|
|
renderer = {
|
|
|
|
icons = {
|
|
|
|
show = {
|
2022-08-19 00:11:15 +02:00
|
|
|
file = nerdfont_installed,
|
|
|
|
folder = nerdfont_installed,
|
|
|
|
folder_arrow = nerdfont_installed,
|
|
|
|
git = nerdfont_installed
|
2022-08-16 21:38:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
map('n', '<F9>', require("nvim-tree.api").tree.toggle, 'Open nvim-tree')
|
|
|
|
map('i', '<F9>', require("nvim-tree.api").tree.toggle, 'Open nvim-tree')
|
2022-08-18 17:40:37 +02:00
|
|
|
|
|
|
|
vim.o.showmode = false
|
|
|
|
require('lualine').setup({
|
|
|
|
options = {
|
2022-08-19 02:12:19 +02:00
|
|
|
icons_enabled = nerdfont_installed,
|
2022-08-18 17:40:37 +02:00
|
|
|
component_separators = {},
|
|
|
|
section_separators = {},
|
2022-08-26 04:20:49 +02:00
|
|
|
extensions = {},
|
|
|
|
globalstatus = true
|
2022-08-18 17:40:37 +02:00
|
|
|
},
|
|
|
|
sections = {
|
2022-08-26 04:20:49 +02:00
|
|
|
lualine_a = { { 'mode' } },
|
|
|
|
lualine_b = {
|
|
|
|
{ 'branch', icons_enabled = true },
|
|
|
|
{ 'require("my.functions").lsp_status()', padding = 0 },
|
|
|
|
{ 'diagnostics' }
|
|
|
|
},
|
2022-08-30 18:32:38 +02:00
|
|
|
lualine_c = { { 'filename', path = 1,
|
|
|
|
cond = function() return vim.g.started_by_firenvim == nil end },
|
|
|
|
{ function()
|
|
|
|
local curfun = vim.b.lsp_current_function
|
|
|
|
if curfun and curfun ~= '' then
|
|
|
|
return '(' .. curfun .. ')'
|
|
|
|
end
|
|
|
|
return ''
|
|
|
|
end, padding = 0, color = 'StatusLineNC' } },
|
2022-09-01 00:24:53 +02:00
|
|
|
lualine_x = { { 'require("my.functions").lsp_sig_status()',
|
|
|
|
color = 'StatusLineNC' }, { 'filetype' } },
|
2022-08-26 04:20:49 +02:00
|
|
|
lualine_y = { { 'progress' } },
|
|
|
|
lualine_z = { { 'location' }, { '"🍄"', padding = 0 }
|
2022-08-26 04:08:10 +02:00
|
|
|
}
|
2022-08-18 17:40:37 +02:00
|
|
|
},
|
|
|
|
})
|
2022-08-26 04:10:26 +02:00
|
|
|
|
2022-08-29 04:24:01 +02:00
|
|
|
map('n', '<Leader>B', require('bug-reference').open, 'Open bug under cursor')
|
|
|
|
|
2022-08-26 04:10:26 +02:00
|
|
|
local mind = require('mind')
|
2022-08-31 03:55:28 +02:00
|
|
|
mind.setup({
|
|
|
|
ui = {
|
|
|
|
width = 50
|
|
|
|
}
|
|
|
|
})
|
2022-08-26 04:10:26 +02:00
|
|
|
map('n', '<C-F9>', mind.open_main, 'Open main mind')
|
|
|
|
map('n', '<F33>', mind.open_main, 'Open main mind') -- <C-F9> = <F33>
|
|
|
|
map('n', '<S-F9>', mind.open_main, 'Open main mind')
|
|
|
|
map('n', '<F21>', mind.open_project, 'Open project mind') -- <S-F9> = <F21>
|
2022-08-31 22:59:30 +02:00
|
|
|
|
|
|
|
require('nvim-surround').setup({})
|
2022-09-01 20:23:38 +02:00
|
|
|
|
2022-09-08 01:16:13 +02:00
|
|
|
vim.g.table_mode_map_prefix = '<Leader><S-T>'
|
2022-09-06 05:40:03 +02:00
|
|
|
|
|
|
|
require('dressing').setup({})
|
|
|
|
vim.notify = require('notify')
|