1
0
mirror of https://github.com/jiriks74/presence.nvim synced 2024-11-23 20:37:50 +01:00

Merge branch 'main' into windows-support

This commit is contained in:
Andrew Kwon 2021-04-04 18:15:43 -07:00
commit 4f9eb6137a
2 changed files with 62 additions and 2 deletions

@ -1,42 +1,91 @@
-- Discord application asset file names (name, key[, description]) by file extension -- Discord application asset file names (name, key[, description]) by file extension
return { return {
COMMIT_EDITMSG = { "git", "git" }, COMMIT_EDITMSG = { "git", "git" },
Makefile = { "Makefile", "config" },
[".dockercfg"] = { "Docker", "docker" },
[".dockerfile"] = { "Docker", "docker" },
[".dockerignore"] = { "Docker", "docker" },
[".eslintrc.cjs"] = { "ESLint", "eslint" },
[".eslintrc.js"] = { "ESLint", "eslint" },
[".eslintrc.json"] = { "ESLint", "eslint" },
[".eslintrc.yaml"] = { "ESLint", "eslint" },
[".eslintrc.yml"] = { "ESLint", "eslint" },
[".gitattributes"] = { "git", "git" },
[".gitconfig"] = { "git", "git" },
[".gitignore"] = { "git", "git" },
[".gitmodules"] = { "git", "git" },
[".prettierrc"] = { "Prettier", "prettier" },
[".prettierrc.cjs"] = { "Prettier", "prettier" },
[".prettierrc.js"] = { "Prettier", "prettier" },
[".prettierrc.json"] = { "Prettier", "prettier" },
[".prettierrc.json5"] = { "Prettier", "prettier" },
[".prettierrc.toml"] = { "Prettier", "prettier" },
[".prettierrc.yaml"] = { "Prettier", "prettier" },
[".prettierrc.yml"] = { "Prettier", "prettier" },
[".tmux.conf"] = { "tmux", "tmux" },
[".vimrc"] = { ".vimrc", "vim" }, [".vimrc"] = { ".vimrc", "vim" },
["Dockerfile"] = { "Docker", "docker" },
["docker-compose.yaml"] = { "Docker", "docker" },
["docker-compose.yml"] = { "Docker", "docker" },
["nginx"] = { "NGINX", "nginx" },
["nginx.conf"] = { "NGINX", "nginx" },
["prettier.config.cjs"] = { "Prettier", "prettier" },
["prettier.config.js"] = { "Prettier", "prettier" },
["webpack.config.js"] = { "Webpack", "webpack" },
abookrc = { "abook", "abook" }, abookrc = { "abook", "abook" },
addressbook = { "abook", "abook" }, addressbook = { "abook", "abook" },
ahk = { "Autohotkey", "autohotkey" }, ahk = { "Autohotkey", "autohotkey" },
applescript = { "Applescript", "applescript" }, applescript = { "Applescript", "applescript" },
bash = { "Shell", "shell" }, bash = { "Shell", "shell" },
c = { "C ", "c" }, c = { "C ", "c" },
cc = { "C++", "c_plus_plus" },
cf = { "Configuration file", "config" },
cfg = { "Configuration file", "config" },
clj = { "Clojure", "clojure" }, clj = { "Clojure", "clojure" },
cljs = { "ClojureScript", "clojurescript" }, cljs = { "ClojureScript", "clojurescript" },
cnf = { "Configuration file", "config" },
coffee = { "CoffeeScript", "coffeescript" }, coffee = { "CoffeeScript", "coffeescript" },
conf = { "Configuration file", "config" },
config = { "Configuration file", "config" },
cpp = { "C++", "c_plus_plus" }, cpp = { "C++", "c_plus_plus" },
cr = { "Crystal", "crystal" }, cr = { "Crystal", "crystal" },
cs = { "C#", "c_sharp" }, cs = { "C#", "c_sharp" },
css = { "CSS", "css" }, css = { "CSS", "css" },
cxx = { "C++", "c_plus_plus" },
dart = { "Dart", "dart" }, dart = { "Dart", "dart" },
elm = { "Elm", "elm" }, elm = { "Elm", "elm" },
erl = { "Erlang", "erlang" }, erl = { "Erlang", "erlang" },
ex = { "Elixir", "elixir" }, ex = { "Elixir", "elixir" },
fs = { "F#", "f_sharp" }, fs = { "F#", "f_sharp" },
go = { "Go", "go" }, go = { "Go", "go" },
gql = { "GraphQL", "graphql" },
graphql = { "GraphQL", "graphql" },
h = { "C header file", "c" },
hack = { "Hack", "hack" }, hack = { "Hack", "hack" },
hpp = { "C++ header file", "c_plus_plus" },
hs = { "Haskell", "haskell" }, hs = { "Haskell", "haskell" },
html = { "HTML", "html" }, html = { "HTML", "html" },
hx = { "Haxe", "haxe" }, hx = { "Haxe", "haxe" },
hxx = { "C++ header file", "c_plus_plus" },
ini = { "Configuration file", "config" },
java = { "Java", "java" }, java = { "Java", "java" },
jl = { "Julia", "julia" }, jl = { "Julia", "julia" },
js = { "JavaScript", "javascript" }, js = { "JavaScript", "javascript" },
json = { "JSON", "json" }, json = { "JSON", "json" },
jsx = { "React", "react" }, jsx = { "React", "react" },
kt = { "Kotlin", "kotlin" }, kt = { "Kotlin", "kotlin" },
less = { "Less", "less" },
log = { "Log file", "code" },
lua = { "Lua", "lua" }, lua = { "Lua", "lua" },
markdown = { "Markdown", "markdown" },
md = { "Markdown", "markdown" }, md = { "Markdown", "markdown" },
mjs = { "JavaScript", "javascript" },
nim = { "Nim", "nim" }, nim = { "Nim", "nim" },
nix = { "Nix", "nix" }, nix = { "Nix", "nix" },
pcss = { "PostCSS", "postcss" },
php = { "PHP", "php" }, php = { "PHP", "php" },
pl = { "Perl", "perl" }, pl = { "Perl", "perl" },
postcss = { "PostCSS", "postcss" },
ps1 = { "PowerShell", "powershell" }, ps1 = { "PowerShell", "powershell" },
purs = { "PureScript", "purescript" }, purs = { "PureScript", "purescript" },
py = { "Python", "python" }, py = { "Python", "python" },
@ -44,16 +93,24 @@ return {
rb = { "Ruby", "ruby" }, rb = { "Ruby", "ruby" },
re = { "Reason", "reason" }, re = { "Reason", "reason" },
rs = { "Rust", "rust" }, rs = { "Rust", "rust" },
sass = { "Sass", "sass" },
scala = { "Scala", "scala" }, scala = { "Scala", "scala" },
scss = { "Sass", "scss" },
sh = { "Shell", "shell" }, sh = { "Shell", "shell" },
snap = { "Jest Snapshot", "jest" },
svelte = { "Svelte", "svelte" }, svelte = { "Svelte", "svelte" },
svg = { "SVG", "markup" },
swift = { "Swift", "swift" }, swift = { "Swift", "swift" },
tex = { "TeX", "tex" }, tex = { "TeX", "tex" },
text = { "Text file", "text" },
toml = { "TOML", "toml" },
ts = { "TypeScript", "typescript" }, ts = { "TypeScript", "typescript" },
tsx = { "React", "react" }, tsx = { "React", "react" },
txt = { "Text file", "text" },
vim = { "Vim", "vim" }, vim = { "Vim", "vim" },
viml = { "Vim", "vim" }, viml = { "Vim", "vim" },
vue = { "Vue", "vue" }, vue = { "Vue", "vue" },
xml = { "XML", "markup" },
yaml = { "YAML", "yaml" }, yaml = { "YAML", "yaml" },
yml = { "YAML", "yaml" }, yml = { "YAML", "yaml" },
zsh = { "Shell", "shell" }, zsh = { "Shell", "shell" },

@ -422,13 +422,16 @@ function Presence:update_for_buffer(buffer, should_debounce)
local parent_dirpath = self.get_dir_path(buffer, self.os.path_separator) local parent_dirpath = self.get_dir_path(buffer, self.os.path_separator)
local extension = self.get_file_extension(filename) local extension = self.get_file_extension(filename)
self.log:debug(string.format("Parsed filename %s with %s extension", filename, extension or "no"))
-- Determine image text and asset key -- Determine image text and asset key
local name = filename local name = filename
local asset_key = "file" local asset_key = "code"
local description = filename local description = filename
local file_asset = extension and file_assets[extension] or file_assets[filename] local file_asset = file_assets[filename] or file_assets[extension]
if file_asset then if file_asset then
name, asset_key, description = unpack(file_asset) name, asset_key, description = unpack(file_asset)
self.log:debug(string.format("Using file asset: %s", vim.inspect(file_asset)))
end end
local file_text = description or name local file_text = description or name