Code Monkey home page Code Monkey logo

kitty's Introduction

Kitty

Kitty is just a quick console syntax highlighting tool. It was written for the .NET framework and it shows and syntax highlights source files (when it can). The approach is very simplistic (intentionally) so one shouldn't expect too great things from it, but it can at least help as a quick solution. It's set up in a modular way to support for more languages should not be that hard.

Name

The name "Kitty" is a pun to "cat", the unix tool to create and view text files. Although "cat" is not named after the animal but is merely a shortening for "conCAT", it was just a nice play to do. Oh, by the way, my beloved little girl (see picture below) is also named "Kitty"... Isn't she cute? Kitty

Usage

Kitty will normally recognize the file you want to view with it by its extension, and highlight it, if it has been recognized. It works as simple as this:

Kitty "SourceFile.c" 

Multiple files are also possible, like this:

Kitty "SourceFile.c" "HeaderFile.h"

Now Kitty has NO built-in support for wild cards, which can be a bit of a bummer in Windows unless you're using Cygwin I guess.

MacOS X and Linux

Kitty has been coded in C#, and therefore uses the .NET Framework. When you use programs like Mono, Kitty should work

mono Kitty.exe "SourceFile.c"
# Of course that is if Kitty.exe is in a directory Mono can find XD

Supported Languages

On the moment this document was updated, the next languages were supported:

Extension Language Added by: Notes:
bas BASIC/GW-BASIC/QBASIC Jeroen P. Broks Please note that due to the many variants of this language the highlight can sometimes be faulty.
bb BlitzBasic Jeroen P. Broks This includes its variants Blitz3D and BlitzPlus
bmx BlitzMax Jeroen P. Broks
bf Brainfuck Jeroen P.Broks Esolang
c/cpp/h/hpp C/C++ Jeroen P. Broks
cs C# Jeroen P. Broks
gini GINI Jeroen P. Broks
go Go Jeroen P. Broks
html/htm HTML Freezernick
ini ini/config Jeroen P. Broks
java Java Jeroen P. Broks
js JavaScript Jeroen P. Broks
json JSON Jeroen P. Broks
lua Lua Jeroen P. Broks
nil NIL isn't Lua Jeroen P. Broks
neil Neil Jeroen P. Broks
pas Pascal Jeroen P. Broks
py Python Jeroen P. Broks
saskia SAKSIA Jeroen P. Broks
scf/ssf Scyndi prototype Jeroen P. Broks This language will be entirely revised and then this format may get deprecated!
vb VisualBasic Freezernick
ws Whitespace Jeroen P. Broks Depending on the used console software, this may not work on your system or not well.
xml XML Freezernick This also triggers C# and Visual C++ projects and XAML files

More might be added later, but no promises yet ;)

kitty's People

Contributors

freezernick avatar tricky1975 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

kitty's Issues

Multiple ways to start strings

Some languages supported by Kitty, such as Scyndi, NIL, Lua and JavaScript accept both " and ' as string starts, and endings, and it won't matter which you use as long as you a consequent. Kitty will for these languages only deem " acceptable now, but of course, that's not really good, now is it?
I need to sort out how I can cover that best....

Highlight Languages

Programming languages

  • C/C++ (will be considered one language as far as Kitty is concerned)
  • Pascal
  • BlitzMax
  • BlitzBASIC / BlitzPlus / Blitz3D
  • BASIC/QBASIC
  • Scyndi
  • Python
  • Lua
  • NIL
  • C#
  • Java
  • JavaScript
  • Go
  • SASKIA
  • VisualBasic (no promises yet)
  • Assembler (no promises yet)

Configuration languages:

  • GINI
  • INI
  • JSON
  • MyData (not sure if I deem this a config language, but for now the best place to put this).

Markup languages (this will be very tricky)

  • HTML/XML
  • MarkDown

EsoLangs:

  • BrainFuck
  • WhiteSpace

If the language you desire is not listed here, feel free to suggest it. If it's doable for me, I'll add it to this list, if I know too little about the language, you may try to create a class yourself which can be added to Kitty and throw in a pull request, so I can evaluate. (Oh yeah, I guess it's obvious I'll need example code so I can test stuff out).

ANSI support

For now I'll leave it to basic .NET color support, but when used with tools such as LESS, this is not the best approach (although I guess in Unix based systems Mono does this by default?)

Different colors for base types

Base types are for strongtype languages (such as C, Pascal, etc) the types that are always present from the start... For C/C++ that would be int and char, for go that would be int, string, map, to name a few, and for C# int, char, byte, long, strong... well and so I can rant on....

These base types are currently seen as keywords, but there is always a bit of debate if they should be regarded as such by syntax highlighters.

Paging

This merely means that Kitty will be asking you to press a key after a certain set of lines, and I do plan to make it detect how many lines fit on the screen (although as a kind of security measure, it will only make this detection at the start of the viewing, so if you resize the screen while in session you can mess this up).

Base Type system

@freezernick

You did the highlight for Visual Basic back in the time. It's been too long since I used Visual Basic last, so perhaps I can best leave this one to you. I've put in "Base Type" support.... If you highlight a source written in C or C++ you'll see that words as "int", "char" and "void" which refer to the default types C and C++ offer (without including any libraries) will now light up in magenta (or purple if you like). Keywords that do not refer to types, such as "if" and "while" etc are still yellow, as they used to be. Perhaps you can take a look if you can group the base types of VB together. It works the same as with keywords... BaseTypes.Add("int"); will add "int" to the base types. And since VB is case insenstive, you need to make sure all base types are in lower case.

Make sure to set your fork up-to-date, as I had to do a few core changes in Kitty to make this all possible.

Highlighting of region / endregion?

While adding the missing unreserved keywords I realized that both C# and C++ don't have highlighting of #region or #pragma region / #pragma endregion respectively.

We will probably add this to our fork but the question would be if you want to have it too.
I will make the PR ( #11 ) for the unreserved keywords as a draft until you decide.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.