Tool Vim Syntax Highlighting with Functions

Sevion

The DIY Ninja
Reaction score
413
Description

I've just started using Vim for programming and was disappointed with the (v)JASS highlighting from jass.vim in Vexorian's signature. as it used default highlighting (or close to it) as TESH. Which is one I don't like.

Also, the attached settings file makes Vim startup defaulting ir_black and (v)JASS as well as defaulting Consolas 9pt font and the window maximized, which if you've used Vim before, is defaulted to not maximize on startup.

And why use Vim? Because it's a hell of a lot better than most (if not all) editors out there and is (to me) on par with Notepad++ depending on what I'm using them for. Also, Bespin :D

Trust me, once you get the hang of Vim, you'll love it. Plus, editing is such a breeze to learn. I've only really used Vim for maybe 6 hours. All that time was spent MAKING THIS TOOL. That's how intuitive this program is. When you see the syntax for configuration, it's very easy to pick up and understand.

My TESH is setup to look like:

Capture-1.jpg

Preview

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>C:\Windows\System32\Untitled.html</title>
<meta name="Generator" content="Vim/7.2">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#000000" text="#7c7c7c"><font face="monospace">
<span style="background-color: #000000"><font color="#3d3d3d">&nbsp;1 </font></span><font color="#ffffff"><b>scope</b></font><font color="#cd3700">&nbsp;</font><span style="background-color: #000000"><font color="#7c7c7c">Test</font></span><font color="#cd3700">&nbsp;</font><font color="#ffffff"><b>initializer</b></font><font color="#cd3700">&nbsp;</font><span style="background-color: #000000"><font color="#7c7c7c">Ini</font></span><br>
<span style="background-color: #000000"><font color="#3d3d3d">&nbsp;2 </font></span><font color="#cd3700">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#ffffff">private</font><font color="#cd3700">&nbsp;</font><font color="#ffffff"><b>struct</b></font><font color="#cd3700">&nbsp;</font><span style="background-color: #000000"><font color="#7c7c7c">s</font></span><br>
<span style="background-color: #000000"><font color="#3d3d3d">&nbsp;3 </font></span><font color="#cd3700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0055aa"><b>unit</b></font><font color="#cd3700">&nbsp;</font><span style="background-color: #000000"><font color="#7c7c7c">u</font></span><br>
<span style="background-color: #000000"><font color="#3d3d3d">&nbsp;4 </font></span><font color="#cd3700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0055aa"><b>player</b></font><font color="#cd3700">&nbsp;</font><span style="background-color: #000000"><font color="#7c7c7c">p</font></span><br>
<span style="background-color: #000000"><font color="#3d3d3d">&nbsp;5 </font></span><font color="#cd3700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0055aa"><b>item</b></font><font color="#cd3700">&nbsp;</font><span style="background-color: #000000"><font color="#7c7c7c">i</font></span><br>
<span style="background-color: #000000"><font color="#3d3d3d">&nbsp;6 </font></span><font color="#cd3700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#ffffff"><b>static</b></font><font color="#cd3700">&nbsp;</font><font color="#ffffff"><b>method</b></font><font color="#cd3700">&nbsp;</font><span style="background-color: #000000"><font color="#7c7c7c">create</font></span><font color="#cd3700">&nbsp;</font><font color="#ffffff">takes</font><font color="#cd3700">&nbsp;</font><font color="#0055aa"><b>nothing</b></font><font color="#cd3700">&nbsp;</font><font color="#ffffff">returns</font><font color="#cd3700">&nbsp;</font><font color="#0055aa"><b>thistype</b></font><br>
<span style="background-color: #000000"><font color="#3d3d3d">&nbsp;7 </font></span><font color="#cd3700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#ffffff">local</font><font color="#cd3700">&nbsp;</font><font color="#0055aa"><b>thistype</b></font><font color="#cd3700">&nbsp;</font><span style="background-color: #000000"><font color="#7c7c7c">dat</font></span><font color="#cd3700">&nbsp;= </font><font color="#0055aa"><b>thistype</b></font><font color="#0055aa">.</font><span style="background-color: #000000"><font color="#7c7c7c">allocate</font></span><font color="#cd3700">()</font><br>
<span style="background-color: #000000"><font color="#3d3d3d">&nbsp;8 </font></span><br>
<span style="background-color: #000000"><font color="#3d3d3d">&nbsp;9 </font></span><font color="#cd3700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#ffffff">set</font><font color="#cd3700">&nbsp;</font><span style="background-color: #000000"><font color="#7c7c7c">dat</font></span><font color="#0055aa">.</font><span style="background-color: #000000"><font color="#7c7c7c">u</font></span><font color="#cd3700">&nbsp;= </font><font color="#008080">CreateUnit</font><font color="#cd3700">(</font><font color="#008080">GetLocalPlayer</font><font color="#cd3700">()</font><font color="#cd3700">, </font><font color="#ffff00"><b><i><u>'hfoo'</u></i></b></font><font color="#cd3700">, </font><font color="#0055aa">0</font><font color="#cd3700">, </font><font color="#0055aa">0</font><font color="#cd3700">, </font><font color="#0055aa">0</font><font color="#cd3700">)</font><br>
<span style="background-color: #000000"><font color="#3d3d3d">10 </font></span><font color="#cd3700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#ffffff">set</font><font color="#cd3700">&nbsp;</font><span style="background-color: #000000"><font color="#7c7c7c">dat</font></span><font color="#0055aa">.</font><span style="background-color: #000000"><font color="#7c7c7c">p</font></span><font color="#cd3700">&nbsp;= </font><font color="#008080">GetLocalPlayer</font><font color="#cd3700">()</font><br>
<span style="background-color: #000000"><font color="#3d3d3d">11 </font></span><font color="#cd3700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#ffffff">set</font><font color="#cd3700">&nbsp;</font><span style="background-color: #000000"><font color="#7c7c7c">dat</font></span><font color="#0055aa">.</font><span style="background-color: #000000"><font color="#7c7c7c">i</font></span><font color="#cd3700">&nbsp;= </font><font color="#008080">CreateItem</font><font color="#cd3700">(</font><font color="#ffff00"><b><i><u>'i000'</u></i></b></font><font color="#cd3700">, </font><font color="#0055aa">0</font><font color="#cd3700">, </font><font color="#0055aa">0</font><font color="#cd3700">)</font><br>
<span style="background-color: #000000"><font color="#3d3d3d">12 </font></span><br>
<span style="background-color: #000000"><font color="#3d3d3d">13 </font></span><font color="#cd3700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#ffffff">return</font><font color="#cd3700">&nbsp;</font><span style="background-color: #000000"><font color="#7c7c7c">dat</font></span><br>
<span style="background-color: #000000"><font color="#3d3d3d">14 </font></span><font color="#cd3700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#ffffff"><b>endmethod</b></font><br>
<span style="background-color: #000000"><font color="#3d3d3d">15 </font></span><font color="#cd3700">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#ffffff"><b>endstruct</b></font><br>
<span style="background-color: #000000"><font color="#3d3d3d">16 </font></span><br>
<span style="background-color: #000000"><font color="#3d3d3d">17 </font></span><font color="#cd3700">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#ffffff">private</font><font color="#cd3700">&nbsp;</font><font color="#ffffff"><b>function</b></font><font color="#cd3700">&nbsp;</font><span style="background-color: #000000"><font color="#7c7c7c">Ini</font></span><font color="#cd3700">&nbsp;</font><font color="#ffffff">takes</font><font color="#cd3700">&nbsp;</font><font color="#0055aa"><b>nothing</b></font><font color="#cd3700">&nbsp;</font><font color="#ffffff">returns</font><font color="#cd3700">&nbsp;</font><font color="#0055aa"><b>nothing</b></font><br>
<span style="background-color: #000000"><font color="#3d3d3d">18 </font></span><font color="#cd3700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#ffffff">local</font><font color="#cd3700">&nbsp;</font><span style="background-color: #000000"><font color="#7c7c7c">s</font></span><font color="#cd3700">&nbsp;</font><span style="background-color: #000000"><font color="#7c7c7c">dat</font></span><font color="#cd3700">&nbsp;= </font><span style="background-color: #000000"><font color="#7c7c7c">s</font></span><font color="#0055aa">.</font><span style="background-color: #000000"><font color="#7c7c7c">create</font></span><font color="#cd3700">()</font><br>
<span style="background-color: #000000"><font color="#3d3d3d">19 </font></span><br>
<span style="background-color: #000000"><font color="#3d3d3d">20 </font></span><font color="#cd3700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#ffffff">call</font><font color="#cd3700">&nbsp;</font><font color="#008080">KillUnit</font><font color="#cd3700">(</font><span style="background-color: #000000"><font color="#7c7c7c">dat</font></span><font color="#0055aa">.</font><span style="background-color: #000000"><font color="#7c7c7c">u</font></span><font color="#cd3700">)</font><br>
<span style="background-color: #000000"><font color="#3d3d3d">21 </font></span><font color="#cd3700">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#ffffff"><b>endfunction</b></font><br>
<span style="background-color: #000000"><font color="#3d3d3d">22 </font></span><font color="#ffffff"><b>endscope</b></font><br>
<span style="background-color: #000000"><font color="#3d3d3d">23 </font></span><br>
</font></body>
</html>

How to Preview

Open your resident text editor (most commonly Notepad on Windows users' pc's).

Copy the code in the tags into it.

Save it as an html file (Replace .txt with .html and select All File Types then save)

Open it with your internet browser.

How to Install

Move _vimrc into PROGRAM FILES DIR\Vim\

Move jass.vim and cjass.vim and ir_black.vim into PROGRAM FLES DIR\Vim\vim72\colors\

NOTE: "vim72" is subject to change according to the installed version of Vim.

How to Edit

Don't like the current colors?

Then, edit it. It's fairly simple.

Go into ir_black.vim to change the colors and such.

Go into jass.vim or cjass.vim to change the words for highlighting.

Go into _vimrc to change stuff like fonts and start maximized.

_vimrc also contains the default syntax.

ir_black.vim will contain the colors for highlighting in the format:

Code:
hi Normal           guifg=#7C7C7C     guibg=black       gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE

Change "Normal" to the name of the color type (HiLink GROUP to COLORTYPE).

Change guifg to the Hex color of your choosing. 7C7C7C is grayish. guibg=black is the background color. gui=NONE is effects like Bold, Underline, and Italics. ctermfg=NONE I have no idea. ctermbg=NONE I also have no idea. cterm=NONE No idea. I've not worked with them as of yet.

jass.vim includes the words in this format:

Code:
syn keyword jassType agent

syn declares a group, keyword declares the type of group, jassType is the name and agent the word to look for.

At the bottom of jass.vim there is also:

Code:
HiLink jassType	Type

This links jassType to the hi (hi in ir_black.vim) Type. If you add new groups, be sure to also remember to link them.

In _vimrc the only part you need to worry about is:

Code:
colorscheme ir_black
set guifont=Consolas:h9
set nu!
set ai!
syntax on
au GUIEnter * simalt ~x 
colorscheme jass

colorscheme ir_black makes it the black theme.
set guifont=Consolas:h9 makes the font Consolas with size 9.
set nu! enables line numbers.
set ai! enables autoindent.
syntax on enables syntax highlighting.
au GUIEnter * simalt ~x maximizes the window.
colorscheme jass enables JASS text highlighting.

Edit as you wish.

Other User Created JASS Schemes

  1. cJASS

NOTE: You better damn be grateful if you use Vim. And there better be a damn large Vim user community who codes in JASS. I broke my fingers editing those like 4000 lines. And I still have many more lines in Blizzard.j and common.ai to work through.
 

Attachments

  • JASS.zip
    21.2 KB · Views: 279

Steel

Software Engineer
Reaction score
109
Not going to knock you for doing this for VIM, but there are so many other tools better than VIM. Eclipse is definitely leaps and bounds better.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
I never could get the hang of Vim. I originally tried it on a friend's computer (he uses Debian, and in order to move around in the file you had to use the wasd keys, which is completely retarded).

I tried it out again later, and still couldn't figure out many basic things that I could do easily in PSPad (my current editor of choice).

I also tried Notepad++, but I was annoyed at the way the Preferences were set up.

My only problem with PSPad is its limited custom syntax highlighting.

Personally, the only thing I would like that TESH currently doesn't have, is an auto-complete for the code you've already written (without having to manually add it to the custom.j or whatever).
 

ReVolver

Mega Super Ultra Cool Member
Reaction score
608
Yea, don't credit the person who helped you out :D
 

Sevion

The DIY Ninja
Reaction score
413
Why are you saving random files to your System32 directory :p

I'm not :p It's just what Vim generates when I convert it to HTML (which is very nice :D)

>Okay, stupid question. What's Vim?

I even linked it >_> It's like the 8th word on post 1. Vim with a link XD

I would certainly like to add AutoComplete. It's not something I've looked into yet, but I will ^_^

Steel, that's just your opinion :p I did this because I like Vim and because IMHO, the other jass.vim was incomplete :-/

>ReV

>_> All you did was introduce me to ir_black :p I was going to originally use darkblue since it kind of matched my TESH setup already. But black does look good too ^_^

Darthfett, I don't use WASD keys >_> Though, I like it, not only for the syntax highlighting, but for the command console ^_^ It's really nice :D

Anywho, I seriously think you should try Vim again :-/ It's actually really nice once you get the hang of it.

I really didn't like PSPad :-/

Also, Notepad++ what do you find bad about it? I personally like it :D
 

Nestharus

o-o
Reaction score
84
The fact still stands that this is a fantastic resource for Vim users.

Not going to knock you for doing this for VIM, but there are so many other tools better than VIM. Eclipse is definitely leaps and bounds better.

All these mentions about other tools here are kind of... pointless because this was made for Vim, not for those other tools.

I guess if you like to use Vim and what not, then this is a great tool for you.

If you use other tools, then it's obviously useless, lol.

Let's not get into wars over which is better and what not =).

So Vim Users Rejoice, you now have great syntax highlighting : D.
 

Sevion

The DIY Ninja
Reaction score
413
Good point, let's stop all talk about other editors.

Comments?

Also, would anyone actually like to help me do the BJ's ._.'
 

Sevion

The DIY Ninja
Reaction score
413
Update: New cJASS syntax highlighting has been added ;) Uses the same highlighting as my (v)JASS does with the added cJASS keywords.
 

Sevion

The DIY Ninja
Reaction score
413
Update: Both (v)JASS and cJASS syntax highlighting have been updated to include all BJ functions and the "hook" keyword!

Plus some fixes on some highlighting bugs.

Anyone else want to make more styles?
 

Romek

Super Moderator
Reaction score
963
I really dislike your TESH style. o_O
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/
  • The Helper The Helper:
    Here is another comfort food favorite - Million Dollar Casserole - https://www.thehelper.net/threads/recipe-million-dollar-casserole.193614/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top