diff --git a/nvim/lua/nvim-tree-config.lua b/nvim/lua/nvim-tree-config.lua index d13bcd0..0c4cb31 100644 --- a/nvim/lua/nvim-tree-config.lua +++ b/nvim/lua/nvim-tree-config.lua @@ -1,21 +1,26 @@ vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 -require("nvim-tree").setup() +require("nvim-tree").setup({ + filters = { + dotfiles = false, + git_ignored = false, + }, +}) local function open_nvim_tree(data) - -- buffer is a real file on the disk - local real_file = vim.fn.filereadable(data.file) == 1 + -- buffer is a real file on the disk + local real_file = vim.fn.filereadable(data.file) == 1 - -- buffer is a [No Name] - local no_name = data.file == "" and vim.bo[data.buf].buftype == "" + -- buffer is a [No Name] + local no_name = data.file == "" and vim.bo[data.buf].buftype == "" - if not real_file and not no_name then - return - end + if not real_file and not no_name then + return + end - -- open the tree, find the file but don't focus it - require("nvim-tree.api").tree.toggle({ focus = false, find_file = true, }) + -- open the tree, find the file but don't focus it + require("nvim-tree.api").tree.toggle({ focus = false, find_file = true }) end vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) diff --git a/nvim/lua/telescope-config.lua b/nvim/lua/telescope-config.lua index 00dc1b5..d4997ce 100644 --- a/nvim/lua/telescope-config.lua +++ b/nvim/lua/telescope-config.lua @@ -1,8 +1,15 @@ -require('telescope').setup() +require("telescope").setup({ + pickers = { + find_files = { + -- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d. + find_command = { "rg", "--files", "--hidden", "--no-ignore", "--glob", "!**/.git/*" }, + }, + }, +}) -local builtin = require('telescope.builtin') +local builtin = require("telescope.builtin") -vim.keymap.set('n', 'ff', builtin.find_files, {}) -vim.keymap.set('n', 'fg', builtin.live_grep, {}) -vim.keymap.set('n', 'fb', builtin.buffers, {}) -vim.keymap.set('n', 'fh', builtin.help_tags, {}) +vim.keymap.set("n", "ff", builtin.find_files, {}) +vim.keymap.set("n", "fg", builtin.live_grep, {}) +vim.keymap.set("n", "fb", builtin.buffers, {}) +vim.keymap.set("n", "fh", builtin.help_tags, {})