dotfiles/.config/nvim/lua/my/tools.lua
tastytea 4615f1f9c5
nvim: declare all plugins in one file
Having it in many files is logically nicer, but breaks on fresh
installs.
2022-08-15 04:06:26 +02:00

39 lines
1000 B
Lua

require('my/plugins')
require('my/keymaps')
require('my/filetypes')
require('which-key').setup{}
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)
map('n', '<Leader>tf', function()
builtin.find_files({ cwd = my.get_project_root() })
end)
map('n', '<Leader>to', builtin.oldfiles)
map('n', '<Leader>tg', function()
builtin.live_grep({ cwd = my.get_project_root() })
end)
map('n', '<Leader>tm', builtin.man_pages)
map('n', '<Leader>tr', builtin.registers)