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 -- Discord application asset file names (name, key[, description]) by file extension
return { return {
applescript = { "Applescript", "applescript" }, COMMIT_EDITMSG = { "git", "git" },
[".vimrc"] = { ".vimrc", "vim" },
ahk = { "Autohotkey", "autohotkey" }, ahk = { "Autohotkey", "autohotkey" },
cs = { "C#", "c_sharp" }, applescript = { "Applescript", "applescript" },
cpp = { "C++", "c_plus_plus" }, bash = { "Shell", "shell" },
c = { "C ", "c" }, c = { "C ", "c" },
css = { "CSS", "css" },
clj = { "Clojure", "clojure" }, clj = { "Clojure", "clojure" },
cljs = { "ClojureScript", "clojurescript" }, cljs = { "ClojureScript", "clojurescript" },
coffee = { "CoffeeScript", "coffeescript" }, coffee = { "CoffeeScript", "coffeescript" },
cpp = { "C++", "c_plus_plus" },
cr = { "Crystal", "crystal" }, cr = { "Crystal", "crystal" },
cs = { "C#", "c_sharp" },
css = { "CSS", "css" },
dart = { "Dart", "dart" }, dart = { "Dart", "dart" },
ex = { "Elixir", "elixir" },
elm = { "Elm", "elm" }, elm = { "Elm", "elm" },
erl = { "Erlang", "erlang" }, erl = { "Erlang", "erlang" },
ex = { "Elixir", "elixir" },
fs = { "F#", "f_sharp" }, fs = { "F#", "f_sharp" },
go = { "Go", "go" }, go = { "Go", "go" },
html = { "HTML", "html" },
hack = { "Hack", "hack" }, hack = { "Hack", "hack" },
hs = { "Haskell", "haskell" }, hs = { "Haskell", "haskell" },
html = { "HTML", "html" },
hx = { "Haxe", "haxe" }, hx = { "Haxe", "haxe" },
java = { "Java", "java" }, java = { "Java", "java" },
js = { "JavaScript", "javascript" },
jl = { "Julia", "julia" }, jl = { "Julia", "julia" },
js = { "JavaScript", "javascript" },
json = { "JSON", "json" },
jsx = { "React", "react" },
kt = { "Kotlin", "kotlin" }, kt = { "Kotlin", "kotlin" },
lua = { "Lua", "lua" }, lua = { "Lua", "lua" },
md = { "Markdown", "markdown" },
nim = { "Nim", "nim" }, nim = { "Nim", "nim" },
nix = { "Nix", "nix" }, nix = { "Nix", "nix" },
php = { "PHP", "php" }, php = { "PHP", "php" },
@ -33,18 +39,17 @@ return {
purs = { "PureScript", "purescript" }, purs = { "PureScript", "purescript" },
py = { "Python", "python" }, py = { "Python", "python" },
r = { "R", "r" }, r = { "R", "r" },
jsx = { "React", "react" },
tsx = { "React", "react" },
re = { "Reason", "reason" },
rb = { "Ruby", "ruby" }, rb = { "Ruby", "ruby" },
re = { "Reason", "reason" },
rs = { "Rust", "rust" }, rs = { "Rust", "rust" },
scala = { "Scala", "scala" }, scala = { "Scala", "scala" },
sh = { "Shell", "shell" }, sh = { "Shell", "shell" },
bash = { "Shell", "shell" },
swift = { "Swift", "swift" }, swift = { "Swift", "swift" },
tex = { "TeX", "tex" }, tex = { "TeX", "tex" },
ts = { "TypeScript", "typescript" }, ts = { "TypeScript", "typescript" },
tsx = { "React", "react" },
vim = { "Vim", "vim" }, vim = { "Vim", "vim" },
viml = { "Vim", "vim" }, viml = { "Vim", "vim" },
vue = { "Vue", "vue" }, vue = { "Vue", "vue" },
zsh = { "Shell", "shell" },
} }

@ -1,9 +1,9 @@
local Presence = {} local Presence = {}
local log = require("lib.log") local log = require("lib.log")
local files = require("presence.files")
local msgpack = require("deps.msgpack") local msgpack = require("deps.msgpack")
local Discord = require("presence.discord") local Discord = require("presence.discord")
local file_assets = require("presence.file_assets")
function Presence:setup(options) function Presence:setup(options)
options = options or {} options = options or {}
@ -319,7 +319,7 @@ function Presence:update_for_buffer(buffer)
local name = filename local name = filename
local asset_key = "file" local asset_key = "file"
local description = filename 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 if file_asset then
name, asset_key, description = unpack(file_asset) name, asset_key, description = unpack(file_asset)
end end