Add auto-detection of OS and distro to scripts

This commit is contained in:
2025-10-06 00:45:59 -05:00
parent 05ca9cfb85
commit 0ad0691120
7 changed files with 56 additions and 64 deletions

View File

@@ -116,11 +116,11 @@ kmgAutocmd('LspAttach', {
-- telescope
local tscBuiltin = require('telescope.builtin')
local custom_tscope_grep = function()
tscBuiltin.grep_string({ search = vim.fn.input("grep > ")})
local custom_grep_str_w_regex = function()
tscBuiltin.grep_string({ search = vim.fn.input("grep > "), use_regex = true, additional_args = "-i", })
end
vim.keymap.set('n', '<leader>ft', tscBuiltin.live_grep, { desc = 'tscope find text, live_grep' })
vim.keymap.set('n', '<leader>fT', custom_tscope_grep, { desc = 'tscope find text, custom grep' })
vim.keymap.set('n', '<leader>fT', custom_grep_str_w_regex, { desc = 'tscope find text, static grep w/regex' })
vim.keymap.set('n', '<leader>fg', tscBuiltin.git_files, { desc = 'tscope find git-tracked files' })
vim.keymap.set('n', '<leader>ff', tscBuiltin.find_files, { desc = 'tscope find files' })
vim.keymap.set('n', '<leader>fb', tscBuiltin.buffers, { desc = 'tscope buffers' })

View File

@@ -1,12 +1,3 @@
local glob_patterns_find_files = {
"-g", "!**/.git/**",
"-g", "!**/build/**",
"-g", "!**/node_modules/**",
}
local glob_patterns_live_grep = {
unpack(glob_patterns_find_files), -- same for now
}
return {
"nvim-telescope/telescope.nvim",
tag = "0.1.8",
@@ -27,13 +18,17 @@ return {
find_files = {
find_command = {
"rg", "--no-ignore", "--hidden", "--files",
unpack(glob_patterns_find_files),
"-g", "!**/.git/**",
"-g", "!**/build/**",
"-g", "!**/node_modules/**",
},
},
live_grep = {
additional_args = {
"--no-ignore", "--hidden",
unpack(glob_patterns_live_grep),
"-g", "!**/.git/**",
"-g", "!**/build/**",
"-g", "!**/node_modules/**",
}
},
},