From 437b9545952be01d44b7b6cfa4efa3f2e3646adb Mon Sep 17 00:00:00 2001 From: Takase <20792268+takase1121@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:23:01 +0800 Subject: [PATCH] make the default core.ignore_files more specific (#1160) * make the default core.ignore_files more specific instead of blanket ignoring all dotfiles, we define a list of folders and files to ignore. this makes the overall experience better. * fix wrong path pattern * add ignore_files to user init --- data/core/config.lua | 11 ++++++++++- data/core/init.lua | 16 +++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/data/core/config.lua b/data/core/config.lua index efbe1f1b..87837439 100644 --- a/data/core/config.lua +++ b/data/core/config.lua @@ -7,7 +7,16 @@ config.mouse_wheel_scroll = 50 * SCALE config.animate_drag_scroll = false config.scroll_past_end = true config.file_size_limit = 10 -config.ignore_files = { "^%." } +config.ignore_files = { + -- folders + "^%.svn/", "^%.git/", "^%.hg/", "^CVS/", "^%.Trash/", "^%.Trash%-.*/", + "^node_modules/", "^%.cache/", "^__pycache__/", + -- files + "%.pyc$", "%.pyo$", "%.exe$", "%.dll$", "%.obj$", "%.o$", + "%.a$", "%.lib$", "%.so$", "%.dylib$", "%.ncb$", "%.sdf$", + "%.suo$", "%.pdb$", "%.idb$", "%.class$", "%.psd$", "%.db$", + "^desktop%.ini$", "^%.DS_Store$", "^%.directory$", +} config.symbol_pattern = "[%a_][%w_]*" config.non_word_chars = " \t\n/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-" config.undo_merge_timeout = 0.3 diff --git a/data/core/init.lua b/data/core/init.lua index a9ce4459..44e114e8 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -495,7 +495,6 @@ local style = require "core.style" -- key binding: -- keymap.add { ["ctrl+escape"] = "core:quit" } - ------------------------------- Fonts ---------------------------------------- -- customize fonts: @@ -535,6 +534,21 @@ local style = require "core.style" -- -- disable detectindent, otherwise it is enabled by default -- config.plugins.detectindent = false + +---------------------------- Miscellanous -------------------------------------- + +-- modify list of files to ignore when indexing the project: +-- config.ignore_files = { +-- -- folders +-- "^%.svn/", "^%.git/", "^%.hg/", "^CVS/", "^%.Trash/", "^%.Trash%-.*/", +-- "^node_modules/", "^%.cache/", "^__pycache__/", +-- -- files +-- "%.pyc$", "%.pyo$", "%.exe$", "%.dll$", "%.obj$", "%.o$", +-- "%.a$", "%.lib$", "%.so$", "%.dylib$", "%.ncb$", "%.sdf$", +-- "%.suo$", "%.pdb$", "%.idb$", "%.class$", "%.psd$", "%.db$", +-- "^desktop%.ini$", "^%.DS_Store$", "^%.directory$", +-- } + ]]) init_file:close() end