From 6ac0b5fb18999881a6351d3268cd4e358d5839af Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sat, 9 Nov 2019 23:47:24 +0100 Subject: [PATCH 1/8] Added Emacs Lisp support --- resources/elisp.ascii | 15 +++++++++++++++ src/language.rs | 6 ++++++ 2 files changed, 21 insertions(+) create mode 100644 resources/elisp.ascii diff --git a/resources/elisp.ascii b/resources/elisp.ascii new file mode 100644 index 000000000..9c7584bef --- /dev/null +++ b/resources/elisp.ascii @@ -0,0 +1,15 @@ +{0} ':r\iv7i|r:' +{0} :LFaZZZaaaoooo2t\: +{0} ^]aZZZZaaw9DN{1}Q@Q{0}gojjv; +{0} ,vaZZZaX69KOHRW#{1}@@@{0}Ouuuu/, +{0} _[ZZaaa{1}Q@@@@QBNMRD{0}dEuuufFFl, +{0}.7aaaooo{1}wB@@#{0}h2jjuuuufFF]]]]|- +{0}:yooooSSS2S${1}gQ@Q{0}8hjfFF]]]][tz" +{0};oooSS2ed#{1}Q@@@@@Q{0}N{0}Do]]][[ttt[: +{0}:uSS2mQ{1}@@@@Q{0}deuF]]]][[ttt[[[z~ +{0}-/yjjO{1}@@@@Q{0}uFF]]][[tttt[[]]]?` +{0} ,vuuue&{1}Q@@@QQ#NNggg{0}&D9u[]i' +{0} '/ffFF]]jek99OR{1}#Q@@Q{0}Hj]]|' +{0} `;c]]][uaXUKO$wo]]]]L:` +{0} `,>i1tt[[]]]]ti>,` +{0} `.~;^>??>^;,-` diff --git a/src/language.rs b/src/language.rs index 229d6470b..53153aa93 100644 --- a/src/language.rs +++ b/src/language.rs @@ -18,6 +18,7 @@ pub enum Language { CSS, D, Dart, + Elisp, Elixir, Elm, Erlang, @@ -74,6 +75,7 @@ impl std::fmt::Display for Language { Language::CSS => write!(f, "CSS"), Language::D => write!(f, "D"), Language::Dart => write!(f, "Dart"), + Language::Elisp => write!(f, "Emacs Lisp"), Language::Elixir => write!(f, "Elixir"), Language::Elm => write!(f, "Elm"), Language::Erlang => write!(f, "Erlang"), @@ -131,6 +133,7 @@ impl From for Language { tokei::LanguageType::Css => Language::CSS, tokei::LanguageType::D => Language::D, tokei::LanguageType::Dart => Language::Dart, + tokei::LanguageType::Elisp => Language::Elisp, tokei::LanguageType::Elixir => Language::Elixir, tokei::LanguageType::Elm => Language::Elm, tokei::LanguageType::Erlang => Language::Erlang, @@ -187,6 +190,7 @@ impl Language { Language::CSS => include_str!("../resources/css.ascii"), Language::D => include_str!("../resources/d.ascii"), Language::Dart => include_str!("../resources/dart.ascii"), + Language::Elisp => include_str!("../resources/elisp.ascii"), Language::Elixir => include_str!("../resources/elixir.ascii"), Language::Elm => include_str!("../resources/elm.ascii"), Language::Erlang => include_str!("../resources/erlang.ascii"), @@ -242,6 +246,7 @@ impl Language { Language::CSS => vec![Color::Blue, Color::White], Language::D => vec![Color::Red], Language::Dart => vec![Color::BrightBlue, Color::BrightCyan], + Language::Elisp => vec![Color::BrightMagenta, Color::White], Language::Elixir => vec![Color::Magenta], Language::Elm => vec![Color::BrightBlack, Color::Green, Color::Yellow, Color::Cyan], Language::Erlang => vec![Color::BrightRed], @@ -364,6 +369,7 @@ fn get_all_language_types() -> Vec { tokei::LanguageType::D, tokei::LanguageType::Dart, tokei::LanguageType::Elixir, + tokei::LanguageType::Elisp, tokei::LanguageType::Elm, tokei::LanguageType::Erlang, tokei::LanguageType::Forth, From 096ced1cabc23e3cb559c48b501c94f25577e2f5 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sat, 9 Nov 2019 23:48:08 +0100 Subject: [PATCH 2/8] Fixed display name for Org --- src/language.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/language.rs b/src/language.rs index 53153aa93..3049d5eb5 100644 --- a/src/language.rs +++ b/src/language.rs @@ -96,7 +96,7 @@ impl std::fmt::Display for Language { Language::Nim => write!(f, "Nim"), Language::ObjectiveC => write!(f, "Objective-C"), Language::OCaml => write!(f, "OCaml"), - Language::Org => write!(f, "Org-mode"), + Language::Org => write!(f, "Org"), Language::PureScript => write!(f, "PureScript"), Language::Python => write!(f, "Python"), Language::R => write!(f, "R"), From b3bd63ec262dcd894a61f1decd0a546fdaff4007 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sun, 10 Nov 2019 00:54:02 +0100 Subject: [PATCH 3/8] renamed elisp.ascii to emacslisp.ascii --- resources/{elisp.ascii => emacslisp.ascii} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename resources/{elisp.ascii => emacslisp.ascii} (100%) diff --git a/resources/elisp.ascii b/resources/emacslisp.ascii similarity index 100% rename from resources/elisp.ascii rename to resources/emacslisp.ascii From 06393244c9bcbb416da93a6b2afd9d7b68500989 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sun, 10 Nov 2019 00:59:47 +0100 Subject: [PATCH 4/8] fixed issue with option `-a emacslisp`, moved elisp.ascii to emacslisp.ascii MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed the display of Elisp from "Emacs Lisp" to "EmacsLisp", apparently onefetch doesn’t handle spaces in language names well. Also adding the serialization with strum helped avoiding thread panic. For consistency with the displayed name, `elisp.ascii` was renamed `emacslisp.ascii`. --- src/language.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/language.rs b/src/language.rs index 3049d5eb5..30ca5714e 100644 --- a/src/language.rs +++ b/src/language.rs @@ -18,6 +18,7 @@ pub enum Language { CSS, D, Dart, + #[strum(serialize = "emacslisp")] Elisp, Elixir, Elm, @@ -75,7 +76,7 @@ impl std::fmt::Display for Language { Language::CSS => write!(f, "CSS"), Language::D => write!(f, "D"), Language::Dart => write!(f, "Dart"), - Language::Elisp => write!(f, "Emacs Lisp"), + Language::Elisp => write!(f, "EmacsLisp"), Language::Elixir => write!(f, "Elixir"), Language::Elm => write!(f, "Elm"), Language::Erlang => write!(f, "Erlang"), @@ -190,7 +191,7 @@ impl Language { Language::CSS => include_str!("../resources/css.ascii"), Language::D => include_str!("../resources/d.ascii"), Language::Dart => include_str!("../resources/dart.ascii"), - Language::Elisp => include_str!("../resources/elisp.ascii"), + Language::Elisp => include_str!("../resources/emacslisp.ascii"), Language::Elixir => include_str!("../resources/elixir.ascii"), Language::Elm => include_str!("../resources/elm.ascii"), Language::Erlang => include_str!("../resources/erlang.ascii"), From 029cc0cab14f16c3b4360dbdc9712f731655515b Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sun, 10 Nov 2019 01:02:47 +0100 Subject: [PATCH 5/8] Added support for the fish shell language --- resources/fish.ascii | 15 +++++++++++++++ src/language.rs | 6 ++++++ 2 files changed, 21 insertions(+) create mode 100644 resources/fish.ascii diff --git a/resources/fish.ascii b/resources/fish.ascii new file mode 100644 index 000000000..2616e9cae --- /dev/null +++ b/resources/fish.ascii @@ -0,0 +1,15 @@ +{0} ___ +{0} ___======____=-{1}-{0}-=) +{0}/T \_{1}--={0}==) +{0}[ \ ({1}0{0}) \~ \_{1}-={0}=) +{0} \ / )J~~ \{1}-={0}) +{0} \\___/ )JJ~{1}~~{0} \) +{0} \_____/JJJ~~{1}~~{0} \ +{0} / \ {1}, \{0}J~~~{1}~~{0} \ +{0} (-{1}\){0}\=|{1}\\\{0}~~{1}~~{0} L_{1}_ +{0} (\\) ({1}\{0}\\)_ {1}\==__ +{0} \V \\\) ===_____ {1}\\\\{0}\\ +{0} \V) \_) \\{1}\\JJ\{0}J\) +{0} /J{1}\J{0}T\JJJJ) +{0} (JJJ| \UUU) +{0} (UU) diff --git a/src/language.rs b/src/language.rs index 30ca5714e..3b6a1ac02 100644 --- a/src/language.rs +++ b/src/language.rs @@ -23,6 +23,7 @@ pub enum Language { Elixir, Elm, Erlang, + Fish, Forth, #[strum(serialize = "fortran")] FortranModern, @@ -80,6 +81,7 @@ impl std::fmt::Display for Language { Language::Elixir => write!(f, "Elixir"), Language::Elm => write!(f, "Elm"), Language::Erlang => write!(f, "Erlang"), + Language::Fish => write!(f, "Fish"), Language::Forth => write!(f, "Forth"), Language::FortranModern => write!(f, "Fortran"), Language::FSharp => write!(f, "FSharp"), @@ -138,6 +140,7 @@ impl From for Language { tokei::LanguageType::Elixir => Language::Elixir, tokei::LanguageType::Elm => Language::Elm, tokei::LanguageType::Erlang => Language::Erlang, + tokei::LanguageType::Fish => Language::Fish, tokei::LanguageType::Forth => Language::Forth, tokei::LanguageType::FortranModern => Language::FortranModern, tokei::LanguageType::FSharp => Language::FSharp, @@ -195,6 +198,7 @@ impl Language { Language::Elixir => include_str!("../resources/elixir.ascii"), Language::Elm => include_str!("../resources/elm.ascii"), Language::Erlang => include_str!("../resources/erlang.ascii"), + Language::Fish => include_str!("../resources/fish.ascii"), Language::Forth => include_str!("../resources/forth.ascii"), Language::FortranModern => include_str!("../resources/f90.ascii"), Language::FSharp => include_str!("../resources/fsharp.ascii"), @@ -251,6 +255,7 @@ impl Language { Language::Elixir => vec![Color::Magenta], Language::Elm => vec![Color::BrightBlack, Color::Green, Color::Yellow, Color::Cyan], Language::Erlang => vec![Color::BrightRed], + Language::Fish => vec![Color::Red, Color::Yellow], Language::Forth => vec![Color::BrightRed], Language::FortranModern => vec![ Color::BrightWhite, @@ -373,6 +378,7 @@ fn get_all_language_types() -> Vec { tokei::LanguageType::Elisp, tokei::LanguageType::Elm, tokei::LanguageType::Erlang, + tokei::LanguageType::Fish, tokei::LanguageType::Forth, tokei::LanguageType::FortranModern, tokei::LanguageType::FSharp, From 7c58540514e8f5083b1229185da551928ec4f886 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sun, 10 Nov 2019 01:17:06 +0100 Subject: [PATCH 6/8] Added CMake support --- resources/cmake.ascii | 13 +++++++++++++ src/language.rs | 8 +++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 resources/cmake.ascii diff --git a/resources/cmake.ascii b/resources/cmake.ascii new file mode 100644 index 000000000..1fc210288 --- /dev/null +++ b/resources/cmake.ascii @@ -0,0 +1,13 @@ +{0} ;e{2}` +{0} ;QD{2}?` +{0} ;B#R{2}1r` +{0} ;WRMK{2}S|r` +{0} :O9KOK{2}S\\*` +{0} :keXPk6{2}Zc7v|` +{0} :ajyoaZe{3}m{2}JJ{]\` +{0} :]z1x}f9{3}@@{2}yujSoc` +{0} "7\/LvU{3}Q@@@{2}XoZemXv` +{0} ,\**v{1}oo{3}qMBBB{2}kmXEkU9z` +{0} ,\*}{1}Sx\||?|cFf{2}okqOdHDx` +{0} ,L]{1}jc\\\||?*>rr^^|zo{2}$MN]` +{0}-v{1}7????*>>rrr^^^;;;;;;^\{2}F^` diff --git a/src/language.rs b/src/language.rs index 3b6a1ac02..595bb2818 100644 --- a/src/language.rs +++ b/src/language.rs @@ -10,6 +10,7 @@ pub enum Language { Assembly, C, Clojure, + CMake, CoffeeScript, #[strum(serialize = "c++")] Cpp, @@ -71,6 +72,7 @@ impl std::fmt::Display for Language { Language::Assembly => write!(f, "Assembly"), Language::C => write!(f, "C"), Language::Clojure => write!(f, "Clojure"), + Language::CMake => write!(f, "CMake"), Language::CoffeeScript => write!(f, "CoffeeScript"), Language::Cpp => write!(f, "C++"), Language::Csharp => write!(f, "C#"), @@ -130,6 +132,7 @@ impl From for Language { tokei::LanguageType::Assembly => Language::Assembly, tokei::LanguageType::C => Language::C, tokei::LanguageType::Clojure => Language::Clojure, + tokei::LanguageType::CMake => Language::CMake, tokei::LanguageType::CoffeeScript => Language::CoffeeScript, tokei::LanguageType::Cpp => Language::Cpp, tokei::LanguageType::CSharp => Language::Csharp, @@ -188,6 +191,7 @@ impl Language { Language::Assembly => include_str!("../resources/assembly.ascii"), Language::C => include_str!("../resources/c.ascii"), Language::Clojure => include_str!("../resources/clojure.ascii"), + Language::CMake => include_str!("../resources/cmake.ascii"), Language::CoffeeScript => include_str!("../resources/coffeescript.ascii"), Language::Cpp => include_str!("../resources/cpp.ascii"), Language::Csharp => include_str!("../resources/csharp.ascii"), @@ -245,6 +249,7 @@ impl Language { Language::Assembly => vec![Color::Cyan], Language::C => vec![Color::BrightBlue, Color::Blue], Language::Clojure => vec![Color::BrightBlue, Color::BrightGreen], + Language::CMake => vec![Color::Blue, Color::BrightGreen, Color::Red, Color::BrightBlack], Language::CoffeeScript => vec![Color::Red], Language::Cpp => vec![Color::Yellow, Color::Cyan], Language::Csharp => vec![Color::White], @@ -262,7 +267,7 @@ impl Language { Color::BrightGreen, Color::BrightBlue, Color::BrightYellow, - Color::BrightRed + Color::BrightRed, ], Language::FSharp => vec![Color::BrightBlue, Color::Cyan], Language::Go => vec![Color::White], @@ -368,6 +373,7 @@ fn get_all_language_types() -> Vec { tokei::LanguageType::Assembly, tokei::LanguageType::C, tokei::LanguageType::Clojure, + tokei::LanguageType::CMake, tokei::LanguageType::CoffeeScript, tokei::LanguageType::Cpp, tokei::LanguageType::CSharp, From 4475bf4a935f352d0a6c90f80457a6f9cb9f1074 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sun, 10 Nov 2019 01:36:33 +0100 Subject: [PATCH 7/8] Added support for Nix --- resources/nix.ascii | 12 ++++++++++++ src/language.rs | 13 ++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 resources/nix.ascii diff --git a/resources/nix.ascii b/resources/nix.ascii new file mode 100644 index 000000000..9e4f2b7e6 --- /dev/null +++ b/resources/nix.ascii @@ -0,0 +1,12 @@ +{1} `kdF` `D@@j `O@Q- +{1} :qOe' 2@@DQ@@* +{1} /2yyPOKUf]}{{0}a@@@Q, ; +{1} ;\\\\akEj|||?*{0};Q@@^ `jDo +{0} J@@D- `H@@ {1}XHK: +{0}kkkEE&@@{0}2 a$OOazz1; +{0}999#@@@{0}Z> ?9qjvvvzz; +{0} ^@@Q {0}Ek{` `zk6* +{0} g@M- {1}:E9e{0};ujyy2UDDKoooo* +{0} \ {1}.eKKq{0}ZDDRR@@@QMMMo +{1} :UOXfHH/ ,Q@@> +{1} `PHj` \HDj` `H@Q- diff --git a/src/language.rs b/src/language.rs index 595bb2818..6cc54b974 100644 --- a/src/language.rs +++ b/src/language.rs @@ -41,6 +41,7 @@ pub enum Language { Lua, Markdown, Nim, + Nix, #[strum(serialize = "objective-c")] ObjectiveC, OCaml, @@ -99,6 +100,7 @@ impl std::fmt::Display for Language { Language::Lua => write!(f, "Lua"), Language::Markdown => write!(f, "Markdown"), Language::Nim => write!(f, "Nim"), + Language::Nix => write!(f, "Nix"), Language::ObjectiveC => write!(f, "Objective-C"), Language::OCaml => write!(f, "OCaml"), Language::Org => write!(f, "Org"), @@ -159,6 +161,7 @@ impl From for Language { tokei::LanguageType::Lua => Language::Lua, tokei::LanguageType::Markdown => Language::Markdown, tokei::LanguageType::Nim => Language::Nim, + tokei::LanguageType::Nix => Language::Nix, tokei::LanguageType::ObjectiveC => Language::ObjectiveC, tokei::LanguageType::OCaml => Language::OCaml, tokei::LanguageType::Org => Language::Org, @@ -218,6 +221,7 @@ impl Language { Language::Lua => include_str!("../resources/lua.ascii"), Language::Markdown => include_str!("../resources/markdown.ascii"), Language::Nim => include_str!("../resources/nim.ascii"), + Language::Nix => include_str!("../resources/nix.ascii"), Language::ObjectiveC => include_str!("../resources/objectivec.ascii"), Language::OCaml => include_str!("../resources/ocaml.ascii"), Language::Org => include_str!("../resources/org.ascii"), @@ -249,7 +253,12 @@ impl Language { Language::Assembly => vec![Color::Cyan], Language::C => vec![Color::BrightBlue, Color::Blue], Language::Clojure => vec![Color::BrightBlue, Color::BrightGreen], - Language::CMake => vec![Color::Blue, Color::BrightGreen, Color::Red, Color::BrightBlack], + Language::CMake => vec![ + Color::Blue, + Color::BrightGreen, + Color::Red, + Color::BrightBlack, + ], Language::CoffeeScript => vec![Color::Red], Language::Cpp => vec![Color::Yellow, Color::Cyan], Language::Csharp => vec![Color::White], @@ -288,6 +297,7 @@ impl Language { Language::Lua => vec![Color::Blue], Language::Markdown => vec![Color::BrightWhite, Color::BrightRed], Language::Nim => vec![Color::Yellow, Color::BrightWhite], + Language::Nix => vec![Color::BrightBlue, Color::Blue], Language::ObjectiveC => vec![Color::BrightBlue, Color::Blue], Language::OCaml => vec![Color::Yellow], Language::Org => vec![Color::Green, Color::Red, Color::White], @@ -400,6 +410,7 @@ fn get_all_language_types() -> Vec { tokei::LanguageType::Lua, tokei::LanguageType::Markdown, tokei::LanguageType::Nim, + tokei::LanguageType::Nix, tokei::LanguageType::ObjectiveC, tokei::LanguageType::OCaml, tokei::LanguageType::Org, From 36fcc8624ce8789f1c54e583e34deabe65b6a8cb Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Mon, 11 Nov 2019 11:52:05 +0100 Subject: [PATCH 8/8] Removed strum line that shouldn't have been there --- src/language.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/language.rs b/src/language.rs index e5b56523d..6cc54b974 100644 --- a/src/language.rs +++ b/src/language.rs @@ -45,7 +45,6 @@ pub enum Language { #[strum(serialize = "objective-c")] ObjectiveC, OCaml, - #[strum(serialize = "org-mode")] Org, Perl, Php,