Remove nvim-tree and use telescope-file-browser

This commit is contained in:
Marco 2023-12-12 11:27:00 +01:00
parent 9865f45e15
commit c9e0b1ed30
4 changed files with 15 additions and 17 deletions

View File

@ -1,14 +0,0 @@
local tree = require("nvim-tree")
tree.setup()
-- disable netrw at the very start of your init.lua
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- set termguicolors to enable highlight groups
vim.opt.termguicolors = true
vim.keymap.set("n", "<leader>fj", vim.cmd.NvimTreeFindFile)
vim.keymap.set("n", "<leader>ft", vim.cmd.NvimTreeFindFileToggle)
-- empty setup using defaults

View File

@ -3,3 +3,14 @@ vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fs', builtin.live_grep);
vim.keymap.set('v', '<leader>fs', builtin.grep_string);
-- To get telescope-file-browser loaded and working with telescope,
-- you need to call load_extension, somewhere after setup function:
require("telescope").load_extension "file_browser"
vim.api.nvim_set_keymap(
"n",
"<leader>fb",
":Telescope file_browser path=%:p:h select_buffer=true<CR>",
{ noremap = true }
)

View File

@ -54,6 +54,8 @@ return require('packer').startup(function(use)
-- Neovim development
use 'folke/neodev.nvim'
-- Project explorer
use { 'nvim-tree/nvim-tree.lua', requires = 'nvim-tree/nvim-web-devicons' }
use {
"nvim-telescope/telescope-file-browser.nvim",
requires = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons" }
}
end)

View File

@ -1,5 +1,4 @@
vim.g.mapleader = " "
vim.keymap.set("n", "<leader>pv", vim.cmd.NvimTreeToggle)
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")