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

Support vimrc, markdown, and git editmsg files

This commit is contained in:
Andrew Kwon 2021-02-28 16:16:36 -08:00
parent e92f8f73b7
commit a15aed569a
2 changed files with 18 additions and 13 deletions

@ -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" },
}

@ -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