From 1c0a2345e01975427a16d1b4da637f4662360506 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Sun, 2 Apr 2023 02:06:19 -0400 Subject: [PATCH] show ignored diretories --- init.lua | 37 ++++++++++++++++++++++++++++++++ lua/plugins/configs/nvimtree.lua | 4 ++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 21f0b6f..dafe0a0 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,5 @@ require "core" +vim.api.nvim_set_var('mapleader', ';') local custom_init_path = vim.api.nvim_get_runtime_file("lua/custom/init.lua", false)[1] @@ -19,3 +20,39 @@ end dofile(vim.g.base46_cache .. "defaults") vim.opt.rtp:prepend(lazypath) require "plugins" + +-- Configure Telescope to scroll files with ctrl+j/k +local actions = require('telescope.actions') +local sorters = require('telescope.sorters') + +require('telescope').setup { + defaults = { + mappings = { + i = { + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + }, + }, + file_sorter = sorters.get_fzy_sorter, + file_ignore_patterns = { '.git/*', 'node_modules/*', 'vendor/*' }, + generic_sorter = sorters.get_generic_fuzzy_sorter, + }, + extensions = { + fzf = { + fuzzy = true, + override_generic_sorter = true, + override_file_sorter = true, + case_mode = "smart_case", + } + } +} + + +vim.api.nvim_set_keymap('n', 'e', ':NvimTreeToggle', {noremap = true, silent = true}) + +-- Cycle through open buffers with leader+a +vim.api.nvim_set_keymap('n', 'a', ':bprevious', {noremap = true, silent = true}) +vim.api.nvim_set_keymap('n', 'f', ':bnext', {noremap = true, silent = true}) + +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'ff', builtin.find_files, {}) diff --git a/lua/plugins/configs/nvimtree.lua b/lua/plugins/configs/nvimtree.lua index 6cafb04..74779d3 100644 --- a/lua/plugins/configs/nvimtree.lua +++ b/lua/plugins/configs/nvimtree.lua @@ -19,8 +19,8 @@ local options = { hide_root_folder = true, }, git = { - enable = false, - ignore = true, + enable = true, + ignore = false, }, filesystem_watchers = { enable = true,