mirror of
https://github.com/jiriks74/presence.nvim
synced 2025-06-30 15:58:58 +02:00
fix(formatting): Fix formatting using stylua
This commit is contained in:
parent
2d57aa297b
commit
a64fc20704
9 changed files with 2068 additions and 1902 deletions
|
@ -1,9 +1,9 @@
|
|||
local Discord = {}
|
||||
|
||||
Discord.opcodes = {
|
||||
auth = 0,
|
||||
frame = 1,
|
||||
closed = 2,
|
||||
auth = 0,
|
||||
frame = 1,
|
||||
closed = 2,
|
||||
}
|
||||
|
||||
-- Discord RPC Subscription events
|
||||
|
@ -11,190 +11,187 @@ Discord.opcodes = {
|
|||
-- Ready: https://discord.com/developers/docs/topics/rpc#ready
|
||||
-- Error: https://discord.com/developers/docs/topics/rpc#error
|
||||
Discord.events = {
|
||||
READY = "READY",
|
||||
ERROR = "ERROR",
|
||||
READY = "READY",
|
||||
ERROR = "ERROR",
|
||||
}
|
||||
|
||||
local struct = require("deps.struct")
|
||||
|
||||
-- Initialize a new Discord RPC client
|
||||
function Discord:init(options)
|
||||
self.log = options.logger
|
||||
self.client_id = options.client_id
|
||||
self.ipc_socket = options.ipc_socket
|
||||
self.log = options.logger
|
||||
self.client_id = options.client_id
|
||||
self.ipc_socket = options.ipc_socket
|
||||
|
||||
self.pipe = vim.loop.new_pipe(false)
|
||||
self.pipe = vim.loop.new_pipe(false)
|
||||
|
||||
return self
|
||||
return self
|
||||
end
|
||||
|
||||
-- Connect to the local Discord RPC socket
|
||||
-- TODO Might need to check for pipes ranging from discord-ipc-0 to discord-ipc-9:
|
||||
-- https://github.com/discord/discord-rpc/blob/master/documentation/hard-mode.md#notes
|
||||
function Discord:connect(on_connect)
|
||||
if self.pipe:is_closing() then
|
||||
self.pipe = vim.loop.new_pipe(false)
|
||||
end
|
||||
if self.pipe:is_closing() then
|
||||
self.pipe = vim.loop.new_pipe(false)
|
||||
end
|
||||
|
||||
self.pipe:connect(self.ipc_socket, on_connect)
|
||||
self.pipe:connect(self.ipc_socket, on_connect)
|
||||
end
|
||||
|
||||
function Discord:is_connected()
|
||||
return self.pipe:is_active()
|
||||
return self.pipe:is_active()
|
||||
end
|
||||
|
||||
-- Disconnect from the local Discord RPC socket
|
||||
function Discord:disconnect(on_close)
|
||||
self.pipe:shutdown()
|
||||
if not self.pipe:is_closing() then
|
||||
self.pipe:close(on_close)
|
||||
end
|
||||
self.pipe:shutdown()
|
||||
if not self.pipe:is_closing() then
|
||||
self.pipe:close(on_close)
|
||||
end
|
||||
end
|
||||
|
||||
-- Make a remote procedure call to Discord
|
||||
-- Callback argument in format: on_response(error[, response_table])
|
||||
function Discord:call(opcode, payload, on_response)
|
||||
self.encode_json(payload, function(success, body)
|
||||
if not success then
|
||||
self.log:warn(string.format("Failed to encode payload: %s", vim.inspect(body)))
|
||||
return
|
||||
end
|
||||
self.encode_json(payload, function(success, body)
|
||||
if not success then
|
||||
self.log:warn(string.format("Failed to encode payload: %s", vim.inspect(body)))
|
||||
return
|
||||
end
|
||||
|
||||
-- Start reading for the response
|
||||
self.pipe:read_start(function(...)
|
||||
self:read_message(payload.nonce, on_response, ...)
|
||||
end)
|
||||
-- Start reading for the response
|
||||
self.pipe:read_start(function(...)
|
||||
self:read_message(payload.nonce, on_response, ...)
|
||||
end)
|
||||
|
||||
-- Construct message denoting little endian, auth opcode, msg length
|
||||
local message = struct.pack("<ii", opcode, #body)..body
|
||||
-- Construct message denoting little endian, auth opcode, msg length
|
||||
local message = struct.pack("<ii", opcode, #body) .. body
|
||||
|
||||
-- Write the message to the pipe
|
||||
self.pipe:write(message, function(err)
|
||||
if err then
|
||||
local err_format = "Pipe write error - %s"
|
||||
local err_message = string.format(err_format, err)
|
||||
-- Write the message to the pipe
|
||||
self.pipe:write(message, function(err)
|
||||
if err then
|
||||
local err_format = "Pipe write error - %s"
|
||||
local err_message = string.format(err_format, err)
|
||||
|
||||
on_response(err_message)
|
||||
else
|
||||
self.log:debug("Wrote message to pipe")
|
||||
end
|
||||
end)
|
||||
end)
|
||||
on_response(err_message)
|
||||
else
|
||||
self.log:debug("Wrote message to pipe")
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
-- Read and handle socket messages
|
||||
function Discord:read_message(nonce, on_response, err, chunk)
|
||||
if err then
|
||||
local err_format = "Pipe read error - %s"
|
||||
local err_message = string.format(err_format, err)
|
||||
if err then
|
||||
local err_format = "Pipe read error - %s"
|
||||
local err_message = string.format(err_format, err)
|
||||
|
||||
on_response(err_message)
|
||||
on_response(err_message)
|
||||
elseif chunk then
|
||||
-- Strip header from the chunk
|
||||
local message = chunk:match("({.+)")
|
||||
local response_opcode = struct.unpack("<ii", chunk)
|
||||
|
||||
elseif chunk then
|
||||
-- Strip header from the chunk
|
||||
local message = chunk:match("({.+)")
|
||||
local response_opcode = struct.unpack("<ii", chunk)
|
||||
self.decode_json(message, function(success, response)
|
||||
-- Check for a non-frame opcode in the response
|
||||
if response_opcode ~= self.opcodes.frame then
|
||||
local err_format = "Received unexpected opcode - %s (code %s)"
|
||||
local err_message = string.format(err_format, response.message, response.code)
|
||||
|
||||
self.decode_json(message, function(success, response)
|
||||
-- Check for a non-frame opcode in the response
|
||||
if response_opcode ~= self.opcodes.frame then
|
||||
local err_format = "Received unexpected opcode - %s (code %s)"
|
||||
local err_message = string.format(err_format, response.message, response.code)
|
||||
return on_response(err_message)
|
||||
end
|
||||
|
||||
return on_response(err_message)
|
||||
end
|
||||
-- Unable to decode the response
|
||||
if not success then
|
||||
-- Indetermine state at this point, no choice but to simply warn on the parse failure
|
||||
-- but invoke empty response callback as request may still have succeeded
|
||||
self.log:warn(string.format("Failed to decode payload: %s", vim.inspect(message)))
|
||||
return on_response()
|
||||
end
|
||||
|
||||
-- Unable to decode the response
|
||||
if not success then
|
||||
-- Indetermine state at this point, no choice but to simply warn on the parse failure
|
||||
-- but invoke empty response callback as request may still have succeeded
|
||||
self.log:warn(string.format("Failed to decode payload: %s", vim.inspect(message)))
|
||||
return on_response()
|
||||
end
|
||||
-- Check for an error event response
|
||||
if response.evt == self.events.ERROR then
|
||||
local data = response.data
|
||||
local err_format = "Received error event - %s (code %s)"
|
||||
local err_message = string.format(err_format, data.message, data.code)
|
||||
|
||||
-- Check for an error event response
|
||||
if response.evt == self.events.ERROR then
|
||||
local data = response.data
|
||||
local err_format = "Received error event - %s (code %s)"
|
||||
local err_message = string.format(err_format, data.message, data.code)
|
||||
return on_response(err_message)
|
||||
end
|
||||
|
||||
return on_response(err_message)
|
||||
end
|
||||
-- Check for a valid nonce value
|
||||
if response.nonce and response.nonce ~= vim.NIL and response.nonce ~= nonce then
|
||||
local err_format = "Received unexpected nonce - %s (expected %s)"
|
||||
local err_message = string.format(err_format, response.nonce, nonce)
|
||||
|
||||
-- Check for a valid nonce value
|
||||
if response.nonce and response.nonce ~= vim.NIL and response.nonce ~= nonce then
|
||||
local err_format = "Received unexpected nonce - %s (expected %s)"
|
||||
local err_message = string.format(err_format, response.nonce, nonce)
|
||||
return on_response(err_message)
|
||||
end
|
||||
|
||||
return on_response(err_message)
|
||||
end
|
||||
|
||||
on_response(nil, response)
|
||||
end)
|
||||
else
|
||||
-- TODO: Handle when pipe is closed
|
||||
self.log:warn("Pipe was closed")
|
||||
end
|
||||
on_response(nil, response)
|
||||
end)
|
||||
else
|
||||
-- TODO: Handle when pipe is closed
|
||||
self.log:warn("Pipe was closed")
|
||||
end
|
||||
end
|
||||
|
||||
-- Call to authorize the client connection with Discord
|
||||
-- Callback argument in format: on_authorize(error[, response_table])
|
||||
function Discord:authorize(on_authorize)
|
||||
local payload = {
|
||||
client_id = self.client_id,
|
||||
v = 1,
|
||||
}
|
||||
local payload = {
|
||||
client_id = self.client_id,
|
||||
v = 1,
|
||||
}
|
||||
|
||||
self:call(self.opcodes.auth, payload, on_authorize)
|
||||
self:call(self.opcodes.auth, payload, on_authorize)
|
||||
end
|
||||
|
||||
-- Call to set the Neovim activity to Discord
|
||||
function Discord:set_activity(activity, on_response)
|
||||
local payload = {
|
||||
cmd = "SET_ACTIVITY",
|
||||
nonce = self.generate_uuid(),
|
||||
args = {
|
||||
activity = activity,
|
||||
pid = vim.loop:os_getpid(),
|
||||
},
|
||||
}
|
||||
local payload = {
|
||||
cmd = "SET_ACTIVITY",
|
||||
nonce = self.generate_uuid(),
|
||||
args = {
|
||||
activity = activity,
|
||||
pid = vim.loop:os_getpid(),
|
||||
},
|
||||
}
|
||||
|
||||
self:call(self.opcodes.frame, payload, on_response)
|
||||
self:call(self.opcodes.frame, payload, on_response)
|
||||
end
|
||||
|
||||
function Discord.generate_uuid(seed)
|
||||
local index = 0
|
||||
local template ="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
|
||||
local index = 0
|
||||
local template = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
|
||||
|
||||
local uuid = template:gsub("[xy]", function(char)
|
||||
-- Increment an index to seed per char
|
||||
index = index + 1
|
||||
math.randomseed((seed or os.clock()) / index)
|
||||
local uuid = template:gsub("[xy]", function(char)
|
||||
-- Increment an index to seed per char
|
||||
index = index + 1
|
||||
math.randomseed((seed or os.clock()) / index)
|
||||
|
||||
local n = char == "x"
|
||||
and math.random(0, 0xf)
|
||||
or math.random(8, 0xb)
|
||||
local n = char == "x" and math.random(0, 0xf) or math.random(8, 0xb)
|
||||
|
||||
return string.format("%x", n)
|
||||
end)
|
||||
return string.format("%x", n)
|
||||
end)
|
||||
|
||||
return uuid
|
||||
return uuid
|
||||
end
|
||||
|
||||
function Discord.decode_json(t, on_done)
|
||||
vim.schedule(function()
|
||||
on_done(pcall(function()
|
||||
return vim.fn.json_decode(t)
|
||||
end))
|
||||
end)
|
||||
vim.schedule(function()
|
||||
on_done(pcall(function()
|
||||
return vim.fn.json_decode(t)
|
||||
end))
|
||||
end)
|
||||
end
|
||||
|
||||
function Discord.encode_json(t, on_done)
|
||||
vim.schedule(function()
|
||||
on_done(pcall(function()
|
||||
return vim.fn.json_encode(t)
|
||||
end))
|
||||
end)
|
||||
vim.schedule(function()
|
||||
on_done(pcall(function()
|
||||
return vim.fn.json_encode(t)
|
||||
end))
|
||||
end)
|
||||
end
|
||||
|
||||
return Discord
|
||||
|
|
|
@ -11,266 +11,266 @@
|
|||
-- go = { "Go", "https://go.dev/blog/go-brand/Go-Logo/PNG/Go-Logo_Aqua.png" },
|
||||
-- }
|
||||
return {
|
||||
[".aliases"] = { ".aliases", "shell" },
|
||||
[".appveyor.yml"] = { "AppVeyor config", "appveyor" },
|
||||
[".babelrc"] = { "Babel config", "babel" },
|
||||
[".babelrc.cjs"] = { "Babel config", "babel" },
|
||||
[".babelrc.js"] = { "Babel config", "babel" },
|
||||
[".babelrc.json"] = { "Babel config", "babel" },
|
||||
[".babelrc.mjs"] = { "Babel config", "babel" },
|
||||
[".bash_login"] = { ".bash_login", "shell" },
|
||||
[".bash_logout"] = { ".bash_logout", "shell" },
|
||||
[".bash_profile"] = { ".bash_profile", "shell" },
|
||||
[".bash_prompt"] = { ".bash_prompt", "shell" },
|
||||
[".bashrc"] = { ".bashrc", "shell" },
|
||||
[".cshrc"] = { ".cshrc", "shell" },
|
||||
[".dockercfg"] = { "Docker", "docker" },
|
||||
[".dockerfile"] = { "Docker", "docker" },
|
||||
[".dockerignore"] = { "Docker", "docker" },
|
||||
[".editorconfig"] = { "EditorConfig", "editorconfig" },
|
||||
[".eslintignore"] = { "ESLint", "eslint" },
|
||||
[".eslintrc"] = { "ESLint", "eslint" },
|
||||
[".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" },
|
||||
[".gitlab-ci.yaml"] = { "GitLab CI", "gitlab" },
|
||||
[".gitlab-ci.yml"] = { "GitLab CI", "gitlab" },
|
||||
[".gitmodules"] = { "git", "git" },
|
||||
[".login"] = { ".login", "shell" },
|
||||
[".logout"] = { ".login", "shell" },
|
||||
[".luacheckrc"] = { ".luacheckrc", "lua" },
|
||||
[".npmignore"] = { "npm config", "npm" },
|
||||
[".npmrc"] = { "npm config", "npm" },
|
||||
[".nvmrc"] = { ".nvmrc", "nodejs" },
|
||||
[".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" },
|
||||
[".profile"] = { ".profile", "shell" },
|
||||
[".tcshrc"] = { ".tcshrc", "shell" },
|
||||
[".terraformrc"] = { "Terraform config", "terraform" },
|
||||
[".tmux.conf"] = { "tmux", "tmux" },
|
||||
[".travis.yml"] = { "Travis CI", "travis" },
|
||||
[".vimrc"] = { ".vimrc", "vim" },
|
||||
[".watchmanconfig"] = { "Watchman config", "watchman" },
|
||||
[".yarnrc"] = { "Yarn config", "yarn" },
|
||||
[".zlogin"] = { ".zlogin", "shell" },
|
||||
[".zprofile"] = { ".zprofile", "shell" },
|
||||
[".zshenv"] = { ".zshenv", "shell" },
|
||||
[".zshrc"] = { ".zshrc", "shell" },
|
||||
["Brewfile"] = { "Brewfile", "homebrew" },
|
||||
["Brewfile.lock.json"] = { "Brewfile.lock.json", "homebrew" },
|
||||
["CHANGELOG"] = { "CHANGELOG", "text" },
|
||||
["CODE_OF_CONDUCT"] = { "Code of Conduct", "text" },
|
||||
["COMMIT_EDITMSG"] = { "git", "git" },
|
||||
["CONTRIBUTING"] = { "CONTRIBUTING", "text" },
|
||||
["Cargo.lock"] = { "Cargo lockfile", "cargo" },
|
||||
["Cargo.toml"] = { "Cargo.toml", "cargo" },
|
||||
["Dockerfile"] = { "Docker", "docker" },
|
||||
["Gemfile"] = { "Gemfile", "ruby" },
|
||||
["Gemfile.lock"] = { "Gemfile lockfile", "ruby" },
|
||||
["LICENSE"] = { "LICENSE", "text" },
|
||||
["Makefile"] = { "Makefile", "code" },
|
||||
["Rakefile"] = { "Rakefile", "ruby" },
|
||||
["abookrc"] = { "abook", "abook" },
|
||||
["alacritty.yaml"] = { "Alacritty config", "alacritty" },
|
||||
["alacritty.yml"] = { "Alacritty config", "alacritty" },
|
||||
["appveyor.yml"] = { "AppVeyor config", "appveyor" },
|
||||
["babel.config.cjs"] = { "Babel config", "babel" },
|
||||
["babel.config.js"] = { "Babel config", "babel" },
|
||||
["babel.config.json"] = { "Babel config", "babel" },
|
||||
["babel.config.mjs"] = { "Babel config", "babel" },
|
||||
["brew.sh"] = { "brew.sh", "homebrew" },
|
||||
["docker-compose.yaml"] = { "Docker", "docker" },
|
||||
["docker-compose.yml"] = { "Docker", "docker" },
|
||||
["gitconfig"] = { "git", "git" },
|
||||
["gitlab.rb"] = { "GitLab config", "gitlab" },
|
||||
["gitlab.yml"] = { "GitLab config", "gitlab" },
|
||||
["go.mod"] = { "go.mod", "go" },
|
||||
["go.sum"] = { "go.sum", "go" },
|
||||
["jest.config.js"] = { "Jest config", "jest" },
|
||||
["jest.setup.js"] = { "Jest config", "jest" },
|
||||
["jest.setup.ts"] = { "Jest config", "jest" },
|
||||
["kitty.conf"] = { "Kitty config", "kitty" },
|
||||
["next-env.d.ts"] = { "Next.js config", "nextjs" },
|
||||
["next.config.js"] = { "Next.js config", "nextjs" },
|
||||
["nginx"] = { "NGINX", "nginx" },
|
||||
["nginx.conf"] = { "NGINX", "nginx" },
|
||||
["nuxt.config.js"] = { "Nuxt config", "nuxtjs" },
|
||||
["prettier.config.cjs"] = { "Prettier", "prettier" },
|
||||
["prettier.config.js"] = { "Prettier", "prettier" },
|
||||
["profile"] = { "profile", "shell" },
|
||||
["renovate.json"] = { "Renovate config", "renovate" },
|
||||
["requirements.txt"] = { "requirements.txt", "python" },
|
||||
["tailwind.config.js"] = { "Tailwind", "tailwind" },
|
||||
["terraform.rc"] = { "Terraform config", "terraform" },
|
||||
["v.mod"] = { "v.mod", "vlang" },
|
||||
["watchman.json"] = { "Watchman config", "watchman" },
|
||||
["webpack.config.js"] = { "Webpack", "webpack" },
|
||||
["webpack.config.ts"] = { "Webpack", "webpack" },
|
||||
["yarn.lock"] = { "Yarn lockfile", "yarn" },
|
||||
["zlogin"] = { "zlogin", "shell" },
|
||||
["zlogout"] = { "zlogout", "shell" },
|
||||
["zprofile"] = { "zprofile", "shell" },
|
||||
["zshenv"] = { "zshenv", "shell" },
|
||||
["zshrc"] = { "zshrc", "shell" },
|
||||
addressbook = { "abook", "abook" },
|
||||
ahk = { "Autohotkey", "autohotkey" },
|
||||
applescript = { "Applescript", "applescript" },
|
||||
bash = { "Bash script", "shell" },
|
||||
bib = { "BibTeX", "latex" },
|
||||
c = { "C ", "c" },
|
||||
cabal = { "Cabal file", "haskell" },
|
||||
cc = { "C++", "c_plus_plus" },
|
||||
cf = { "Configuration file", "config" },
|
||||
cfg = { "Configuration file", "config" },
|
||||
cl = { "Common Lisp", "lisp" },
|
||||
clj = { "Clojure", "clojure" },
|
||||
cljs = { "ClojureScript", "clojurescript" },
|
||||
cls = { "Visual Basic class module", "visual_basic" },
|
||||
cnf = { "Configuration file", "config" },
|
||||
coffee = { "CoffeeScript", "coffeescript" },
|
||||
conf = { "Configuration file", "config" },
|
||||
config = { "Configuration file", "config" },
|
||||
cpp = { "C++", "c_plus_plus" },
|
||||
cr = { "Crystal", "crystal" },
|
||||
cs = { "C#", "c_sharp" },
|
||||
css = { "CSS", "css" },
|
||||
cxx = { "C++", "c_plus_plus" },
|
||||
d = { "D", "d" },
|
||||
dart = { "Dart", "dart" },
|
||||
dll = { "DLL file", "visual_basic" },
|
||||
e = { "Eiffel", "eiffel" },
|
||||
elm = { "Elm", "elm" },
|
||||
erl = { "Erlang", "erlang" },
|
||||
ex = { "Elixir", "elixir" },
|
||||
expect = { "Expect", "tcl" },
|
||||
fasl = { "Common Lisp", "lisp" },
|
||||
fish = { "Fish script", "fish" },
|
||||
fnl = { "Fennel", "fennel" },
|
||||
fs = { "F#", "f_sharp" },
|
||||
g = { "ANTLR grammar", "antlr" },
|
||||
g3 = { "ANTLR 3 grammar", "antlr" },
|
||||
g4 = { "ANTLR 4 grammar", "antlr" },
|
||||
gemspec = { "Gem Spec", "ruby" },
|
||||
go = { "Go", "go" },
|
||||
gql = { "GraphQL", "graphql" },
|
||||
graphql = { "GraphQL", "graphql" },
|
||||
groovy = { "Groovy", "groovy" },
|
||||
gsh = { "Groovy", "groovy" },
|
||||
gvy = { "Groovy", "groovy" },
|
||||
gy = { "Groovy", "groovy" },
|
||||
h = { "C header file", "c" },
|
||||
hack = { "Hack", "hack" },
|
||||
haml = { "Haml", "haml" },
|
||||
hpp = { "C++ header file", "c_plus_plus" },
|
||||
hs = { "Haskell", "haskell" },
|
||||
html = { "HTML", "html" },
|
||||
hx = { "Haxe", "haxe" },
|
||||
hxx = { "C++ header file", "c_plus_plus" },
|
||||
idr = { "Idris", "idris" },
|
||||
ini = { "Configuration file", "config" },
|
||||
ino = { "Arduino", "arduino" },
|
||||
ipynb = { "Jupyter Notebook", "jupyter" },
|
||||
java = { "Java", "java" },
|
||||
jl = { "Julia", "julia" },
|
||||
js = { "JavaScript", "javascript" },
|
||||
json = { "JSON", "json" },
|
||||
jsx = { "React", "react" },
|
||||
ksh = { "KornShell script", "shell" },
|
||||
kshrc = { "KornShell config", "shell" },
|
||||
kt = { "Kotlin", "kotlin" },
|
||||
kv = { "Kivy", "kivy" },
|
||||
l = { "Common Lisp", "lisp" },
|
||||
less = { "Less", "less" },
|
||||
lidr = { "Idris", "idris" },
|
||||
liquid = { "Liquid", "liquid" },
|
||||
lisp = { "Common Lisp", "lisp" },
|
||||
log = { "Log file", "code" },
|
||||
lsp = { "Common Lisp", "lisp" },
|
||||
lua = { "Lua", "lua" },
|
||||
m = { "MATLAB", "matlab" },
|
||||
markdown = { "Markdown", "markdown" },
|
||||
mat = { "MATLAB", "matlab" },
|
||||
md = { "Markdown", "markdown" },
|
||||
mdx = { "MDX", "mdx" },
|
||||
mjs = { "JavaScript", "javascript" },
|
||||
ml = { "OCaml", "ocaml" },
|
||||
nim = { "Nim", "nim" },
|
||||
nix = { "Nix", "nix" },
|
||||
norg = { "Neorg", "neorg" },
|
||||
org = { "Org", "org" },
|
||||
pb = { "Protobuf", "protobuf" },
|
||||
pcss = { "PostCSS", "postcss" },
|
||||
pgsql = { "PostgreSQL", "pgsql" },
|
||||
php = { "PHP", "php" },
|
||||
pl = { "Perl", "perl" },
|
||||
plist = { "Property List", "markup" },
|
||||
postcss = { "PostCSS", "postcss" },
|
||||
proto = { "Protobuf", "protobuf" },
|
||||
ps1 = { "PowerShell", "powershell" },
|
||||
psd1 = { "PowerShell", "powershell" },
|
||||
psm1 = { "PowerShell", "powershell" },
|
||||
purs = { "PureScript", "purescript" },
|
||||
py = { "Python", "python" },
|
||||
r = { "R", "r" },
|
||||
raku = { "Raku", "raku" },
|
||||
rakudoc = { "Raku", "raku" },
|
||||
rakumod = { "Raku", "raku" },
|
||||
rakutest = { "Raku", "raku" },
|
||||
rb = { "Ruby", "ruby" },
|
||||
re = { "Reason", "reason" },
|
||||
res = { "ReScript", "rescript" },
|
||||
rkt = { "Racket", "racket"},
|
||||
rs = { "Rust", "rust" },
|
||||
sass = { "Sass", "sass" },
|
||||
scala = { "Scala", "scala" },
|
||||
scm = { "Scheme", "scheme" },
|
||||
scss = { "Sass", "scss" },
|
||||
sh = { "Shell script", "shell" },
|
||||
shrc = { "Shell config", "shell" },
|
||||
snap = { "Jest Snapshot", "jest" },
|
||||
sql = { "SQL", "database" },
|
||||
ss = { "Scheme", "scheme" },
|
||||
svelte = { "Svelte", "svelte" },
|
||||
svg = { "SVG", "markup" },
|
||||
swift = { "Swift", "swift" },
|
||||
tcl = { "Tcl", "tcl" },
|
||||
tex = { "LaTeX", "latex" },
|
||||
text = { "Text file", "text" },
|
||||
tf = { "Terraform", "terraform" },
|
||||
tk = { "Tcl/Tk", "tcl" },
|
||||
tl = { "Teal", "teal" },
|
||||
toml = { "TOML", "toml" },
|
||||
ts = { "TypeScript", "typescript" },
|
||||
tsx = { "React", "react" },
|
||||
txt = { "Text file", "text" },
|
||||
uc = { "UnrealScript", "unreal" },
|
||||
v = { "Vlang", "vlang" },
|
||||
vsh = { "Vlang shell script", "vlang" },
|
||||
vb = { "Visual Basic", "visual_basic" },
|
||||
vbp = { "Visual Basic project file", "visual_basic" },
|
||||
vim = { "Vim", "vim" },
|
||||
viml = { "Vim", "vim" },
|
||||
vue = { "Vue", "vue" },
|
||||
wasm = { "WebAssembly", "webassembly" },
|
||||
wast = { "WebAssembly", "webassembly" },
|
||||
wat = { "WebAssembly", "webassembly" },
|
||||
xml = { "XML", "markup" },
|
||||
xsd = { "XML Schema", "markup" },
|
||||
xslt = { "XSLT", "markup" },
|
||||
yaml = { "YAML", "yaml" },
|
||||
yml = { "YAML", "yaml" },
|
||||
zig = { "Zig", "zig" },
|
||||
zsh = { "Zsh script", "shell" },
|
||||
zu = { "Zimbu", "zimbu" },
|
||||
[".aliases"] = { ".aliases", "shell" },
|
||||
[".appveyor.yml"] = { "AppVeyor config", "appveyor" },
|
||||
[".babelrc"] = { "Babel config", "babel" },
|
||||
[".babelrc.cjs"] = { "Babel config", "babel" },
|
||||
[".babelrc.js"] = { "Babel config", "babel" },
|
||||
[".babelrc.json"] = { "Babel config", "babel" },
|
||||
[".babelrc.mjs"] = { "Babel config", "babel" },
|
||||
[".bash_login"] = { ".bash_login", "shell" },
|
||||
[".bash_logout"] = { ".bash_logout", "shell" },
|
||||
[".bash_profile"] = { ".bash_profile", "shell" },
|
||||
[".bash_prompt"] = { ".bash_prompt", "shell" },
|
||||
[".bashrc"] = { ".bashrc", "shell" },
|
||||
[".cshrc"] = { ".cshrc", "shell" },
|
||||
[".dockercfg"] = { "Docker", "docker" },
|
||||
[".dockerfile"] = { "Docker", "docker" },
|
||||
[".dockerignore"] = { "Docker", "docker" },
|
||||
[".editorconfig"] = { "EditorConfig", "editorconfig" },
|
||||
[".eslintignore"] = { "ESLint", "eslint" },
|
||||
[".eslintrc"] = { "ESLint", "eslint" },
|
||||
[".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" },
|
||||
[".gitlab-ci.yaml"] = { "GitLab CI", "gitlab" },
|
||||
[".gitlab-ci.yml"] = { "GitLab CI", "gitlab" },
|
||||
[".gitmodules"] = { "git", "git" },
|
||||
[".login"] = { ".login", "shell" },
|
||||
[".logout"] = { ".login", "shell" },
|
||||
[".luacheckrc"] = { ".luacheckrc", "lua" },
|
||||
[".npmignore"] = { "npm config", "npm" },
|
||||
[".npmrc"] = { "npm config", "npm" },
|
||||
[".nvmrc"] = { ".nvmrc", "nodejs" },
|
||||
[".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" },
|
||||
[".profile"] = { ".profile", "shell" },
|
||||
[".tcshrc"] = { ".tcshrc", "shell" },
|
||||
[".terraformrc"] = { "Terraform config", "terraform" },
|
||||
[".tmux.conf"] = { "tmux", "tmux" },
|
||||
[".travis.yml"] = { "Travis CI", "travis" },
|
||||
[".vimrc"] = { ".vimrc", "vim" },
|
||||
[".watchmanconfig"] = { "Watchman config", "watchman" },
|
||||
[".yarnrc"] = { "Yarn config", "yarn" },
|
||||
[".zlogin"] = { ".zlogin", "shell" },
|
||||
[".zprofile"] = { ".zprofile", "shell" },
|
||||
[".zshenv"] = { ".zshenv", "shell" },
|
||||
[".zshrc"] = { ".zshrc", "shell" },
|
||||
["Brewfile"] = { "Brewfile", "homebrew" },
|
||||
["Brewfile.lock.json"] = { "Brewfile.lock.json", "homebrew" },
|
||||
["CHANGELOG"] = { "CHANGELOG", "text" },
|
||||
["CODE_OF_CONDUCT"] = { "Code of Conduct", "text" },
|
||||
["COMMIT_EDITMSG"] = { "git", "git" },
|
||||
["CONTRIBUTING"] = { "CONTRIBUTING", "text" },
|
||||
["Cargo.lock"] = { "Cargo lockfile", "cargo" },
|
||||
["Cargo.toml"] = { "Cargo.toml", "cargo" },
|
||||
["Dockerfile"] = { "Docker", "docker" },
|
||||
["Gemfile"] = { "Gemfile", "ruby" },
|
||||
["Gemfile.lock"] = { "Gemfile lockfile", "ruby" },
|
||||
["LICENSE"] = { "LICENSE", "text" },
|
||||
["Makefile"] = { "Makefile", "code" },
|
||||
["Rakefile"] = { "Rakefile", "ruby" },
|
||||
["abookrc"] = { "abook", "abook" },
|
||||
["alacritty.yaml"] = { "Alacritty config", "alacritty" },
|
||||
["alacritty.yml"] = { "Alacritty config", "alacritty" },
|
||||
["appveyor.yml"] = { "AppVeyor config", "appveyor" },
|
||||
["babel.config.cjs"] = { "Babel config", "babel" },
|
||||
["babel.config.js"] = { "Babel config", "babel" },
|
||||
["babel.config.json"] = { "Babel config", "babel" },
|
||||
["babel.config.mjs"] = { "Babel config", "babel" },
|
||||
["brew.sh"] = { "brew.sh", "homebrew" },
|
||||
["docker-compose.yaml"] = { "Docker", "docker" },
|
||||
["docker-compose.yml"] = { "Docker", "docker" },
|
||||
["gitconfig"] = { "git", "git" },
|
||||
["gitlab.rb"] = { "GitLab config", "gitlab" },
|
||||
["gitlab.yml"] = { "GitLab config", "gitlab" },
|
||||
["go.mod"] = { "go.mod", "go" },
|
||||
["go.sum"] = { "go.sum", "go" },
|
||||
["jest.config.js"] = { "Jest config", "jest" },
|
||||
["jest.setup.js"] = { "Jest config", "jest" },
|
||||
["jest.setup.ts"] = { "Jest config", "jest" },
|
||||
["kitty.conf"] = { "Kitty config", "kitty" },
|
||||
["next-env.d.ts"] = { "Next.js config", "nextjs" },
|
||||
["next.config.js"] = { "Next.js config", "nextjs" },
|
||||
["nginx"] = { "NGINX", "nginx" },
|
||||
["nginx.conf"] = { "NGINX", "nginx" },
|
||||
["nuxt.config.js"] = { "Nuxt config", "nuxtjs" },
|
||||
["prettier.config.cjs"] = { "Prettier", "prettier" },
|
||||
["prettier.config.js"] = { "Prettier", "prettier" },
|
||||
["profile"] = { "profile", "shell" },
|
||||
["renovate.json"] = { "Renovate config", "renovate" },
|
||||
["requirements.txt"] = { "requirements.txt", "python" },
|
||||
["tailwind.config.js"] = { "Tailwind", "tailwind" },
|
||||
["terraform.rc"] = { "Terraform config", "terraform" },
|
||||
["v.mod"] = { "v.mod", "vlang" },
|
||||
["watchman.json"] = { "Watchman config", "watchman" },
|
||||
["webpack.config.js"] = { "Webpack", "webpack" },
|
||||
["webpack.config.ts"] = { "Webpack", "webpack" },
|
||||
["yarn.lock"] = { "Yarn lockfile", "yarn" },
|
||||
["zlogin"] = { "zlogin", "shell" },
|
||||
["zlogout"] = { "zlogout", "shell" },
|
||||
["zprofile"] = { "zprofile", "shell" },
|
||||
["zshenv"] = { "zshenv", "shell" },
|
||||
["zshrc"] = { "zshrc", "shell" },
|
||||
addressbook = { "abook", "abook" },
|
||||
ahk = { "Autohotkey", "autohotkey" },
|
||||
applescript = { "Applescript", "applescript" },
|
||||
bash = { "Bash script", "shell" },
|
||||
bib = { "BibTeX", "latex" },
|
||||
c = { "C ", "c" },
|
||||
cabal = { "Cabal file", "haskell" },
|
||||
cc = { "C++", "c_plus_plus" },
|
||||
cf = { "Configuration file", "config" },
|
||||
cfg = { "Configuration file", "config" },
|
||||
cl = { "Common Lisp", "lisp" },
|
||||
clj = { "Clojure", "clojure" },
|
||||
cljs = { "ClojureScript", "clojurescript" },
|
||||
cls = { "Visual Basic class module", "visual_basic" },
|
||||
cnf = { "Configuration file", "config" },
|
||||
coffee = { "CoffeeScript", "coffeescript" },
|
||||
conf = { "Configuration file", "config" },
|
||||
config = { "Configuration file", "config" },
|
||||
cpp = { "C++", "c_plus_plus" },
|
||||
cr = { "Crystal", "crystal" },
|
||||
cs = { "C#", "c_sharp" },
|
||||
css = { "CSS", "css" },
|
||||
cxx = { "C++", "c_plus_plus" },
|
||||
d = { "D", "d" },
|
||||
dart = { "Dart", "dart" },
|
||||
dll = { "DLL file", "visual_basic" },
|
||||
e = { "Eiffel", "eiffel" },
|
||||
elm = { "Elm", "elm" },
|
||||
erl = { "Erlang", "erlang" },
|
||||
ex = { "Elixir", "elixir" },
|
||||
expect = { "Expect", "tcl" },
|
||||
fasl = { "Common Lisp", "lisp" },
|
||||
fish = { "Fish script", "fish" },
|
||||
fnl = { "Fennel", "fennel" },
|
||||
fs = { "F#", "f_sharp" },
|
||||
g = { "ANTLR grammar", "antlr" },
|
||||
g3 = { "ANTLR 3 grammar", "antlr" },
|
||||
g4 = { "ANTLR 4 grammar", "antlr" },
|
||||
gemspec = { "Gem Spec", "ruby" },
|
||||
go = { "Go", "go" },
|
||||
gql = { "GraphQL", "graphql" },
|
||||
graphql = { "GraphQL", "graphql" },
|
||||
groovy = { "Groovy", "groovy" },
|
||||
gsh = { "Groovy", "groovy" },
|
||||
gvy = { "Groovy", "groovy" },
|
||||
gy = { "Groovy", "groovy" },
|
||||
h = { "C header file", "c" },
|
||||
hack = { "Hack", "hack" },
|
||||
haml = { "Haml", "haml" },
|
||||
hpp = { "C++ header file", "c_plus_plus" },
|
||||
hs = { "Haskell", "haskell" },
|
||||
html = { "HTML", "html" },
|
||||
hx = { "Haxe", "haxe" },
|
||||
hxx = { "C++ header file", "c_plus_plus" },
|
||||
idr = { "Idris", "idris" },
|
||||
ini = { "Configuration file", "config" },
|
||||
ino = { "Arduino", "arduino" },
|
||||
ipynb = { "Jupyter Notebook", "jupyter" },
|
||||
java = { "Java", "java" },
|
||||
jl = { "Julia", "julia" },
|
||||
js = { "JavaScript", "javascript" },
|
||||
json = { "JSON", "json" },
|
||||
jsx = { "React", "react" },
|
||||
ksh = { "KornShell script", "shell" },
|
||||
kshrc = { "KornShell config", "shell" },
|
||||
kt = { "Kotlin", "kotlin" },
|
||||
kv = { "Kivy", "kivy" },
|
||||
l = { "Common Lisp", "lisp" },
|
||||
less = { "Less", "less" },
|
||||
lidr = { "Idris", "idris" },
|
||||
liquid = { "Liquid", "liquid" },
|
||||
lisp = { "Common Lisp", "lisp" },
|
||||
log = { "Log file", "code" },
|
||||
lsp = { "Common Lisp", "lisp" },
|
||||
lua = { "Lua", "lua" },
|
||||
m = { "MATLAB", "matlab" },
|
||||
markdown = { "Markdown", "markdown" },
|
||||
mat = { "MATLAB", "matlab" },
|
||||
md = { "Markdown", "markdown" },
|
||||
mdx = { "MDX", "mdx" },
|
||||
mjs = { "JavaScript", "javascript" },
|
||||
ml = { "OCaml", "ocaml" },
|
||||
nim = { "Nim", "nim" },
|
||||
nix = { "Nix", "nix" },
|
||||
norg = { "Neorg", "neorg" },
|
||||
org = { "Org", "org" },
|
||||
pb = { "Protobuf", "protobuf" },
|
||||
pcss = { "PostCSS", "postcss" },
|
||||
pgsql = { "PostgreSQL", "pgsql" },
|
||||
php = { "PHP", "php" },
|
||||
pl = { "Perl", "perl" },
|
||||
plist = { "Property List", "markup" },
|
||||
postcss = { "PostCSS", "postcss" },
|
||||
proto = { "Protobuf", "protobuf" },
|
||||
ps1 = { "PowerShell", "powershell" },
|
||||
psd1 = { "PowerShell", "powershell" },
|
||||
psm1 = { "PowerShell", "powershell" },
|
||||
purs = { "PureScript", "purescript" },
|
||||
py = { "Python", "python" },
|
||||
r = { "R", "r" },
|
||||
raku = { "Raku", "raku" },
|
||||
rakudoc = { "Raku", "raku" },
|
||||
rakumod = { "Raku", "raku" },
|
||||
rakutest = { "Raku", "raku" },
|
||||
rb = { "Ruby", "ruby" },
|
||||
re = { "Reason", "reason" },
|
||||
res = { "ReScript", "rescript" },
|
||||
rkt = { "Racket", "racket" },
|
||||
rs = { "Rust", "rust" },
|
||||
sass = { "Sass", "sass" },
|
||||
scala = { "Scala", "scala" },
|
||||
scm = { "Scheme", "scheme" },
|
||||
scss = { "Sass", "scss" },
|
||||
sh = { "Shell script", "shell" },
|
||||
shrc = { "Shell config", "shell" },
|
||||
snap = { "Jest Snapshot", "jest" },
|
||||
sql = { "SQL", "database" },
|
||||
ss = { "Scheme", "scheme" },
|
||||
svelte = { "Svelte", "svelte" },
|
||||
svg = { "SVG", "markup" },
|
||||
swift = { "Swift", "swift" },
|
||||
tcl = { "Tcl", "tcl" },
|
||||
tex = { "LaTeX", "latex" },
|
||||
text = { "Text file", "text" },
|
||||
tf = { "Terraform", "terraform" },
|
||||
tk = { "Tcl/Tk", "tcl" },
|
||||
tl = { "Teal", "teal" },
|
||||
toml = { "TOML", "toml" },
|
||||
ts = { "TypeScript", "typescript" },
|
||||
tsx = { "React", "react" },
|
||||
txt = { "Text file", "text" },
|
||||
uc = { "UnrealScript", "unreal" },
|
||||
v = { "Vlang", "vlang" },
|
||||
vsh = { "Vlang shell script", "vlang" },
|
||||
vb = { "Visual Basic", "visual_basic" },
|
||||
vbp = { "Visual Basic project file", "visual_basic" },
|
||||
vim = { "Vim", "vim" },
|
||||
viml = { "Vim", "vim" },
|
||||
vue = { "Vue", "vue" },
|
||||
wasm = { "WebAssembly", "webassembly" },
|
||||
wast = { "WebAssembly", "webassembly" },
|
||||
wat = { "WebAssembly", "webassembly" },
|
||||
xml = { "XML", "markup" },
|
||||
xsd = { "XML Schema", "markup" },
|
||||
xslt = { "XSLT", "markup" },
|
||||
yaml = { "YAML", "yaml" },
|
||||
yml = { "YAML", "yaml" },
|
||||
zig = { "Zig", "zig" },
|
||||
zsh = { "Zsh script", "shell" },
|
||||
zu = { "Zimbu", "zimbu" },
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
-- Different neovim file explorer names keyed by filetype or buffer name
|
||||
return {
|
||||
["NvimTree"] = "NvimTree",
|
||||
["NERD_tree_"] = "NERDTree",
|
||||
["[defx] default-"] = "Defx",
|
||||
["netrw"] = "Netrw",
|
||||
["TelescopePrompt"] = "Telescope",
|
||||
['neo-tree'] = 'Neotree',
|
||||
['fern'] = 'Fern'
|
||||
["NvimTree"] = "NvimTree",
|
||||
["NERD_tree_"] = "NERDTree",
|
||||
["[defx] default-"] = "Defx",
|
||||
["netrw"] = "Netrw",
|
||||
["TelescopePrompt"] = "Telescope",
|
||||
["neo-tree"] = "Neotree",
|
||||
["fern"] = "Fern",
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
|||
-- Different plugin manager names
|
||||
return {
|
||||
["packer"] = "packer",
|
||||
["vim-plug"] = "vim-plug",
|
||||
["packer"] = "packer",
|
||||
["vim-plug"] = "vim-plug",
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue