diff --git a/lua/presence/files.lua b/lua/presence/file_assets.lua similarity index 90% rename from lua/presence/files.lua rename to lua/presence/file_assets.lua index 7dad5a1..e3c6231 100644 --- a/lua/presence/files.lua +++ b/lua/presence/file_assets.lua @@ -1,30 +1,36 @@ -- Discord application asset file names (name, key[, description]) by file extension return { - applescript = { "Applescript", "applescript" }, + COMMIT_EDITMSG = { "git", "git" }, + [".vimrc"] = { ".vimrc", "vim" }, ahk = { "Autohotkey", "autohotkey" }, - cs = { "C#", "c_sharp" }, - cpp = { "C++", "c_plus_plus" }, + applescript = { "Applescript", "applescript" }, + bash = { "Shell", "shell" }, c = { "C ", "c" }, - css = { "CSS", "css" }, clj = { "Clojure", "clojure" }, cljs = { "ClojureScript", "clojurescript" }, coffee = { "CoffeeScript", "coffeescript" }, + cpp = { "C++", "c_plus_plus" }, cr = { "Crystal", "crystal" }, + cs = { "C#", "c_sharp" }, + css = { "CSS", "css" }, dart = { "Dart", "dart" }, - ex = { "Elixir", "elixir" }, elm = { "Elm", "elm" }, erl = { "Erlang", "erlang" }, + ex = { "Elixir", "elixir" }, fs = { "F#", "f_sharp" }, go = { "Go", "go" }, - html = { "HTML", "html" }, hack = { "Hack", "hack" }, hs = { "Haskell", "haskell" }, + html = { "HTML", "html" }, hx = { "Haxe", "haxe" }, java = { "Java", "java" }, - js = { "JavaScript", "javascript" }, jl = { "Julia", "julia" }, + js = { "JavaScript", "javascript" }, + json = { "JSON", "json" }, + jsx = { "React", "react" }, kt = { "Kotlin", "kotlin" }, lua = { "Lua", "lua" }, + md = { "Markdown", "markdown" }, nim = { "Nim", "nim" }, nix = { "Nix", "nix" }, php = { "PHP", "php" }, @@ -33,18 +39,17 @@ return { purs = { "PureScript", "purescript" }, py = { "Python", "python" }, r = { "R", "r" }, - jsx = { "React", "react" }, - tsx = { "React", "react" }, - re = { "Reason", "reason" }, rb = { "Ruby", "ruby" }, + re = { "Reason", "reason" }, rs = { "Rust", "rust" }, scala = { "Scala", "scala" }, sh = { "Shell", "shell" }, - bash = { "Shell", "shell" }, swift = { "Swift", "swift" }, tex = { "TeX", "tex" }, ts = { "TypeScript", "typescript" }, + tsx = { "React", "react" }, vim = { "Vim", "vim" }, viml = { "Vim", "vim" }, vue = { "Vue", "vue" }, + zsh = { "Shell", "shell" }, } diff --git a/lua/presence/init.lua b/lua/presence/init.lua index 48a8a9d..17902c3 100644 --- a/lua/presence/init.lua +++ b/lua/presence/init.lua @@ -1,9 +1,9 @@ local Presence = {} local log = require("lib.log") -local files = require("presence.files") local msgpack = require("deps.msgpack") local Discord = require("presence.discord") +local file_assets = require("presence.file_assets") function Presence:setup(options) options = options or {} @@ -319,7 +319,7 @@ function Presence:update_for_buffer(buffer) local name = filename local asset_key = "file" local description = filename - local file_asset = extension and files[extension] or files[filename] + local file_asset = extension and file_assets[extension] or file_assets[filename] if file_asset then name, asset_key, description = unpack(file_asset) end