dotfiles/.config/nvim/lua/my/tools.lua
tastytea 7a49812118
nvim: separate plugins and config
It may look nicer but it leads to problems.
Also tweaked some thinks and cleaned up, made firenvim config only run
if it is used.
2022-08-15 01:29:31 +02:00

61 lines
1.5 KiB
Lua

require('my/plugins')
require('my/keymaps')
require('my/filetypes')
packer.use {
'https://github.com/folke/which-key.nvim'
}
require('which-key').setup{}
packer.use {
'https://github.com/nvim-telescope/telescope.nvim',
tag = '*',
requires = {
'https://github.com/nvim-lua/plenary.nvim',
'https://github.com/nvim-treesitter/nvim-treesitter',
},
}
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)
packer.use {
'https://github.com/nvim-telescope/telescope-media-files.nvim',
requires = {
'https://github.com/nvim-lua/popup.nvim',
'https://github.com/nvim-lua/plenary.nvim',
'https://github.com/nvim-telescope/telescope.nvim'
}
}