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