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

55 lines
1.5 KiB
Lua

require('my/plugins')
local map = require('my.functions').map
local telescope = require('telescope')
local actions = require('telescope.actions')
telescope.load_extension('media_files') -- FIXME: does not work
require('telescope').setup {
mappings = {
i = {
["<C-_>"] = actions.which_key,
},
n = {
["?"] = actions.which_key,
}
},
extensions = {
media_files = {
filetypes = { 'png', 'webp', 'jpg', 'jpeg', 'epub', 'pdf' }
}
}
}
local builtin = require('telescope.builtin')
local my = require('my.functions')
map('n', '<Leader>tb', builtin.buffers, 'Buffers')
map('n', '<Leader>tf', function()
builtin.find_files({ cwd = my.get_project_root() })
end, 'Files')
map('n', '<Leader>tF', builtin.find_files, 'Files in this directory')
map('n', '<Leader>to', builtin.oldfiles, 'Recently opened files')
map('n', '<Leader>tg', function()
builtin.live_grep({ cwd = my.get_project_root() })
end, 'Live-grep')
map('n', '<Leader>tm', builtin.man_pages, 'Man pages')
map('n', '<Leader>tr', builtin.registers, 'Registers')
require("nvim-tree").setup({
filters = {
dotfiles = true
},
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')