always show parent in filename

This commit is contained in:
RingOfStorms (Joshua Bell) 2025-04-30 21:56:11 -05:00
parent e5523910a0
commit 46dbdc7758

View file

@ -50,172 +50,175 @@ local function smart_tab_name()
local filename = vim.fn.fnamemodify(filepath, ":t") local filename = vim.fn.fnamemodify(filepath, ":t")
-- Define a whitelist of patterns -- Define a whitelist of patterns
local whitelist = { -- local whitelist = {
"index%..*", -- "index%..*",
"mod%..*", -- "mod%..*",
"Dockerfile", -- "Dockerfile",
"Dockerfile.*", -- "Dockerfile.*",
".envrc", -- ".envrc",
".env", -- ".env",
".env%..*", -- ".env%..*",
"router%..*", -- "router%..*",
"routes%..*", -- "routes%..*",
"controller%..*", -- "controller%..*",
"service%..*", -- "service%..*",
"utils%..*", -- "utils%..*",
"util%..*", -- "util%..*",
"README%..*", -- "README%..*",
"LICENSE", -- "LICENSE",
"Makefile", -- "Makefile",
"build%..*", -- "build%..*",
"config%..*", -- "config%..*",
"setup%..*", -- "setup%..*",
"init%..*", -- "init%..*",
"main%..*", -- "main%..*",
"app%..*", -- "app%..*",
"test%..*", -- "test%..*",
"spec%..*", -- "spec%..*",
"package%..*", -- "package%..*",
"requirements%..*", -- "requirements%..*",
"manifest%..*", -- "manifest%..*",
"composer%..*", -- "composer%..*",
"gulpfile%..*", -- "gulpfile%..*",
"Gruntfile%..*", -- "Gruntfile%..*",
"webpack%..*", -- "webpack%..*",
"tsconfig%..*", -- "tsconfig%..*",
"babel%..*", -- "babel%..*",
"eslint%..*", -- "eslint%..*",
"prettier%..*", -- "prettier%..*",
"tslint%..*", -- "tslint%..*",
"karma%..*", -- "karma%..*",
"jest%..*", -- "jest%..*",
"mocha%..*", -- "mocha%..*",
"rollup%..*", -- "rollup%..*",
"vite%..*", -- "vite%..*",
"nuxt%..*", -- "nuxt%..*",
"next%..*", -- "next%..*",
"angular%..*", -- "angular%..*",
"vue%..*", -- "vue%..*",
"tailwind%..*", -- "tailwind%..*",
"postcss%..*", -- "postcss%..*",
"stylelint%..*", -- "stylelint%..*",
"editorconfig", -- "editorconfig",
"gitignore", -- "gitignore",
"gitattributes", -- "gitattributes",
"gitmodules", -- "gitmodules",
"docker-compose%..*", -- "docker-compose%..*",
"dockerfile%..*", -- "dockerfile%..*",
"dockerignore", -- "dockerignore",
"travis%..*", -- "travis%..*",
"circleci%..*", -- "circleci%..*",
"appveyor%..*", -- "appveyor%..*",
"azure-pipelines%..*", -- "azure-pipelines%..*",
"codecov%..*", -- "codecov%..*",
"coveralls%..*", -- "coveralls%..*",
"dependabot%..*", -- "dependabot%..*",
"renovate%..*", -- "renovate%..*",
"vercel%..*", -- "vercel%..*",
"netlify%..*", -- "netlify%..*",
"heroku%..*", -- "heroku%..*",
"now%..*", -- "now%..*",
"firebase%..*", -- "firebase%..*",
"amplify%..*", -- "amplify%..*",
"serverless%..*", -- "serverless%..*",
"cloudformation%..*", -- "cloudformation%..*",
"terraform%..*", -- "terraform%..*",
"ansible%..*", -- "ansible%..*",
"chef%..*", -- "chef%..*",
"puppet%..*", -- "puppet%..*",
"salt%..*", -- "salt%..*",
"helm%..*", -- "helm%..*",
"kustomize%..*", -- "kustomize%..*",
"kubernetes%..*", -- "kubernetes%..*",
"skaffold%..*", -- "skaffold%..*",
"tilt%..*", -- "tilt%..*",
"argocd%..*", -- "argocd%..*",
"flux%..*", -- "flux%..*",
"istio%..*", -- "istio%..*",
"linkerd%..*", -- "linkerd%..*",
"prometheus%..*", -- "prometheus%..*",
"grafana%..*", -- "grafana%..*",
"loki%..*", -- "loki%..*",
"jaeger%..*", -- "jaeger%..*",
"opentelemetry%..*", -- "opentelemetry%..*",
"zipkin%..*", -- "zipkin%..*",
"thanos%..*", -- "thanos%..*",
"victoria-metrics%..*", -- "victoria-metrics%..*",
"cortex%..*", -- "cortex%..*",
"alertmanager%..*", -- "alertmanager%..*",
"blackbox%..*", -- "blackbox%..*",
"node_exporter%..*", -- "node_exporter%..*",
"cadvisor%..*", -- "cadvisor%..*",
"fluentd%..*", -- "fluentd%..*",
"fluentbit%..*", -- "fluentbit%..*",
"logstash%..*", -- "logstash%..*",
"filebeat%..*", -- "filebeat%..*",
"metricbeat%..*", -- "metricbeat%..*",
"heartbeat%..*", -- "heartbeat%..*",
"packetbeat%..*", -- "packetbeat%..*",
"winlogbeat%..*", -- "winlogbeat%..*",
"auditbeat%..*", -- "auditbeat%..*",
"functionbeat%..*", -- "functionbeat%..*",
"elastic-agent%..*", -- "elastic-agent%..*",
"elasticsearch%..*", -- "elasticsearch%..*",
"kibana%..*", -- "kibana%..*",
"logstash%..*", -- "logstash%..*",
"beats%..*", -- "beats%..*",
"opensearch%..*", -- "opensearch%..*",
"opensearch-dashboards%..*", -- "opensearch-dashboards%..*",
"graylog%..*", -- "graylog%..*",
"sumologic%..*", -- "sumologic%..*",
"datadog%..*", -- "datadog%..*",
"newrelic%..*", -- "newrelic%..*",
"dynatrace%..*", -- "dynatrace%..*",
"appdynamics%..*", -- "appdynamics%..*",
"instana%..*", -- "instana%..*",
"lightstep%..*", -- "lightstep%..*",
"signalfx%..*", -- "signalfx%..*",
"wavefront%..*", -- "wavefront%..*",
"scout%..*", -- "scout%..*",
"rollbar%..*", -- "rollbar%..*",
"sentry%..*", -- "sentry%..*",
"bugsnag%..*", -- "bugsnag%..*",
"airbrake%..*", -- "airbrake%..*",
"raygun%..*", -- "raygun%..*",
"overops%..*", -- "overops%..*",
"pagerduty%..*", -- "pagerduty%..*",
"opsgenie%..*", -- "opsgenie%..*",
"victorops%..*", -- "victorops%..*",
"xmatters%..*", -- "xmatters%..*",
"statuspage%..*", -- "statuspage%..*",
"status.io%..*", -- "status.io%..*",
"pingdom%..*", -- "pingdom%..*",
"uptimerobot%..*", -- "uptimerobot%..*",
"site24x7%..*", -- "site24x7%..*",
"betteruptime%..*", -- "betteruptime%..*",
"freshping%..*", -- "freshping%..*",
"healthchecks%..*", -- "healthchecks%..*",
"deadmanssnitch%..*", -- "deadmanssnitch%..*",
"cronitor%..*", -- "cronitor%..*",
"cronhub%..*", -- "cronhub%..*",
"cronitor%..*", -- "cronitor%..*",
"healthchecks.io%..*", -- "healthchecks.io%..*",
"flake.*", -- "flake.*",
"configuration.nix", -- "linode.nix",
"hardware-configuration.nix", -- "nginx.nix",
"default.nix", -- "configuration.nix",
"shell.nix", -- "hardware-configuration.nix",
} -- "default.nix",
-- "shell.nix",
-- }
-- Check if the filename matches any pattern in the whitelist -- Check if the filename matches any pattern in the whitelist
for _, pattern in ipairs(whitelist) do -- for _, pattern in ipairs(whitelist) do
if filename:match(pattern) then -- if filename:match(pattern) then
return parent_dir .. "/" .. filename -- return parent_dir .. "/" .. filename
end -- end
end -- end
return parent_dir .. "/" .. filename
-- If no match, return just the filename -- If no match, return just the filename
return filename -- return filename
end end
return { return {