2022-08-11 16:22:36 +02:00
|
|
|
require('my/plugins')
|
2022-08-08 19:11:44 +02:00
|
|
|
|
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-13 19:09:59 +02:00
|
|
|
|
2022-08-15 01:29:31 +02:00
|
|
|
require('telescope').setup {
|
|
|
|
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
|
|
|
}
|
|
|
|
},
|
|
|
|
extensions = {
|
|
|
|
media_files = {
|
|
|
|
filetypes = { 'png', 'webp', 'jpg', 'jpeg', 'epub', 'pdf' }
|
|
|
|
}
|
|
|
|
}
|
2022-08-08 19:25:36 +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-17 19:13:25 +02:00
|
|
|
t_builtin.find_files({ cwd = my.get_project_root() })
|
2022-08-16 04:55:49 +02:00
|
|
|
end, 'Files')
|
2022-08-17 19:24:05 +02:00
|
|
|
map('n', '<Leader>tF', t_builtin.find_files, 'Files in cw')
|
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-17 19:55:12 +02:00
|
|
|
map('n', '<Leader>tp', telescope.extensions.projects.projects, 'Projects')
|
2022-08-16 21:38:31 +02:00
|
|
|
|
|
|
|
require("nvim-tree").setup({
|
|
|
|
filters = {
|
2022-08-17 19:55:12 +02:00
|
|
|
dotfiles = false
|
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 = {
|
|
|
|
file = false,
|
|
|
|
folder = false,
|
|
|
|
folder_arrow = false,
|
|
|
|
git = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
map('n', '<F9>', require("nvim-tree.api").tree.toggle, 'Open nvim-tree')
|
|
|
|
map('i', '<F9>', require("nvim-tree.api").tree.toggle, 'Open nvim-tree')
|