diff --git a/.config/nvim/lua/my/tools.lua b/.config/nvim/lua/my/tools.lua index 08a4fb3..93b491f 100644 --- a/.config/nvim/lua/my/tools.lua +++ b/.config/nvim/lua/my/tools.lua @@ -1,5 +1,6 @@ require('my/plugins') require('my/keymaps') +require('my/fileformats') packer.use { 'https://github.com/folke/which-key.nvim', @@ -10,13 +11,46 @@ packer.use { } packer.use { - 'https://github.com/ctrlpvim/ctrlp.vim', + 'https://github.com/nvim-telescope/telescope.nvim', + tag = '*', + requires = { + 'https://github.com/nvim-lua/plenary.nvim', + 'https://github.com/nvim-treesitter/nvim-treesitter', + }, config = function() - vim.g.ctrlp_map = '' - vim.g.ctrlp_cmd = 'CtrlP' - map('n', '', ':CtrlPMRUFiles') - vim.g.ctrlp_root_markers = { - '.projectile', '.luarc.json', '.clang-format' + local telescope = require('telescope') + local actions = require('telescope.actions') + telescope.load_extension('media_files') -- FIXME: does not work + + require('telescope').setup { + mappings = { + i = { + [""] = actions.which_key, + }, + n = { + ["?"] = actions.which_key, + } + }, + extensions = { + media_files = { + filetypes = { 'png', 'webp', 'jpg', 'jpeg', 'epub', 'pdf' } + } + } } + + map('n', 'tb', require('telescope.builtin').buffers) + map('n', 'tf', function() require('telescope.builtin').find_files({ cwd = MY_get_project_root() }) end) + map('n', 'tr', require('telescope.builtin').oldfiles) + map('n', 'tg', require('telescope.builtin').live_grep) + map('n', 'tm', require('telescope.builtin').man_pages) end } + +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' + } +}