Monkey-VIM

Monkey Archive Forums/Monkey Discussion/Monkey-VIM

arcsrc(Posted 2011) [#1]
I created a vim syntax file for monkey.

This is how it looks using the 'blue' color scheme:


https://github.com/rawsource/Monkey-VIM


UPDATE
https://github.com/michaelcontento/Monkey-VIM
michaelcontento has an improved fork with extra features:
- Pathogen / Vundle compatible
- Proper indentation definition
- Auto capitalization of keywords (by minke)
- Basic CTags support (minke)


Have fun...


matt(Posted 2011) [#2]
nicely done!


Samah(Posted 2011) [#3]
Noooooooooooooo now you'll make me want to use gVim for it! D:


arcsrc(Posted 2011) [#4]
Here are some commands to put in your .vimrc to compile and run your code:

map ;1 :exe ":!trans_winnt -target=html5 -run " . getreg("%")<cr>
map ;2 :exe ":!trans_winnt -target=glfw -run " . getreg("%")<cr>
map ;3 :exe ":!trans_winnt -target=android -run " . getreg("%")<cr>


I use these for my default project:

map ;0 :exe ":!trans_winnt -target=glfw -run c:/path/to/main.monkey"<cr>
map ;00 :exe ":!trans_winnt -target=html5 -run c:/path/to/main.monkey"<cr>


The directory containing trans_winnt.exe has to be in your PATH, but you could hardcode that one also.

Now all you have to do is: ;0 to compile your default project for your default target :)


TheRedFox(Posted 2011) [#5]
Hey, fantastic!


slenkar(Posted 2011) [#6]
what advantages does it have over Monk?


Brucey(Posted 2011) [#7]
what advantages does it have over Monk?

For you? None at all.

Unless you are willing to learn a whole new (or rather old) way of editing, better stay away from it. It harks from the days long before mice or even desktops were the norm...


Spacehunter(Posted 2011) [#8]
Dude you rock!!!

Now I can go back and use MacVim!


slenkar(Posted 2011) [#9]
before mice or even desktops were the norm...



I like my mouse/keyboard interface :)


charlie(Posted 2011) [#10]
Someone should do an Emacs syntax file. Everyone know Emacs is better than vim ;p

Cheers
Charlie


Samah(Posted 2011) [#11]
@charlie Someone should do an Emacs syntax file. Everyone know Emacs is better than vim ;p

Does Emacs have an editor yet? Last I heard it was an operating system. ;)


TheRedFox(Posted 2011) [#12]
Having something that provides a code structure window and an intellisense ala CTags would be awesome. I use something like this for PHP, maybe is it possible to adapt for Monkey.

Vi is great for a lot of manipulations. And I hate C-X C-anything.


Halfdan(Posted 2012) [#13]
I made a plugin that auto-capitalizes keywords outside comments and strings; like Monk.

Eg "global var:int" becomes "Global var:Int" as you type. Use ^Xu to undo the capitalization. Very good for the pinky.

Install (Unix)
Paste the code in ~/.vim/ftplugin/monkey.vim (create directory if needed).

Not sure where to host so I'll just post the code



michaelcontento(Posted 2012) [#14]
@minke: As rawsource does not seem to be pretty active on this .. would you add your addition to this active fork of rawsource/Monkey-VIM?

It's basically rawsource/Monkey-VIM but ...
* .. Pathogen / Vundle compatible
* .. contains a proper indentation definition


Halfdan(Posted 2012) [#15]
Ok I didn't know about that repo, I'll make a push request tomorrow.

I also implemented basic CTags/Tagbar support, but it needs a language definition in ~/.ctags, so it won't fit in a plugin I think.


michaelcontento(Posted 2012) [#16]
very cool and thanks in advance! :)


arcsrc(Posted 2012) [#17]
great stuff michaelcontento and minke, i updated the first post to point users to your fork.

@minke: i'm very interested in your CTags definition.

I'll try to update the syntax definition with all the new keywords/classes/methods this weekend.


Halfdan(Posted 2012) [#18]
Sorry guys, the capitalization also happened outside .monkey files! I made new pull request that fixes this.

Also added basic tagbar support. I think it's better than taglist.

Unfortunately there is no scope detection (methods and field don't show under their corresponding classes).

@arcsrc: you can generate tags with "ctags --options=MONKEY_VIM_PATH/ctags/monkey.cnf -R ."

Now it just needs SnipMate snippets and compiling in a vsplit buffer. Vim can be the best editor for Monkey :)


MonoDesire(Posted 2016) [#19]
This is an old thread, but as a long time Vim user, I appreciate all work done with Monkey-Vim! :-)

I manage to generate a tags file using the syntax mentioned by Halfdan above. However, how do you set up tagbar to work? I guess I need to set g:tagbar_ctags_bin in my .vimrc to something, but I am not sure exactly what. I need to point out the ctags binary of course, but I also guess I need to point out the monkey.cnf file too, or?

Any hints are welcome!