PDA

View Full Version : AMXX Keywords for Syntax Highlighting


fysiks
03-05-2009, 05:12
Keywords for Highlighting:

With the attached files you can create your own syntax highlighting if your favorite source code editor allows user defined syntax highlighting. Also, I've created specific collections for DOD and CS. With these two I have included my syntax highlighting I use for Notepad++ (http://notepad-plus.sourceforge.net/uk/site.htm).

Seta00 has created syntax highlighting to be like it is in Pawn Studio if you prefer it's colors and can be found here (http://forums.alliedmods.net/showpost.php?p=1136448&postcount=25). Or, if you prefer the tag colors you can get that here (http://forums.alliedmods.net/showpost.php?p=1146969&postcount=62).

Notepad++ Auto-Completion and Hints:

Notepad++ has a feature to autocomplete functions and show the arguments and description for a function. I made the required xml file to make this work for AMX Mod X functions to go with the syntax highlighting. Counter-Srike is the only MOD that I've done so far. If you would like another MOD specifc one I can do it. Also, if you find anything missing let me know.

Installation:
Close Notepad++.
Put the .xml file in PathToProgramFiles\Notepad++\plugins\APIs\
Make sure to name the file exactly as the syntax highlighting is named.
Start Notepad++ and turn on Auto-Complete and/or Hints (it is off by default): Settings > Preferences > Backup/Auto-Completion > Auto-Completion




-

UPDATED: v2, Added xs functions to "AMX". Added macros (Thanks for reminding me stupok).

UPDATE: v3, I didn't realize xs wasn't a "mod" so I updated DOD and CS (including syntax highlighting).

EDIT: If you wanted my php scripts, PM me and I will send them to you.

Tags: notepad plus plus syntax highlight highlighting

XxAvalanchexX
03-05-2009, 23:39
Awesome, thanks! I use a text editor which it seems like not very many other people do, so there aren't any AMXX/Pawn definitions for it yet. I've always wanted to put one together, and this should help me out a lot!

Cheers!

BOYSplayCS
03-06-2009, 06:58
I like this, good idea! How long did this take?

Avalanche, where the hell have you been?

fysiks
03-06-2009, 08:44
It took a few days to write the php code with regex to catch everything that had a "regular" format (constants were the hardest :)). I had to learn regex at that point (lots of testing).

After I got those scripts to work, I had to weed out any duplicates. And then I had to find the few things that were found as constants but were functions. Then I put them in Notepad++ and went through all the includes to make sure everything that needed highlighting had it. I was always missing the kRender constants :). So added them manually.

Anyway, the days that I spent actually working on this probably took me about a week maybe shorter. I did most of the work back in November or December.

xPaw
03-06-2009, 12:17
hmm i placed userDefinedLang.xml in Notepad++ (i didnt had userDefinedLang.xml before), and it didnt worked.

iNspiratioN
03-06-2009, 14:19
hmm i placed userDefinedLang.xml in Notepad++ (i didnt had userDefinedLang.xml before), and it didnt worked.

Try to place it in C:\Documents and Settings\%username%\Application Data\Notepad++\ i think you will see userDefineLang.xml so replace it with current one and RENAME from "userDefinedLang.xml" -> "userDefineLang.xml".

xPaw
03-06-2009, 14:32
yeap thanks with name now it worked ;)

fysiks
03-06-2009, 19:25
Ok, I fixed the Notepad++ filename and I changed the instructions. On my computer it doesn't work if I put it in Application Data. It only works if I put it in Program Files. The first time I installed it I think it worked that way but not this time. Maybe it's because I installed as UNICODE but replaced the files with the ANSI version (to get the plugins to work :)).

Thanks guys.

danielkza
03-06-2009, 21:00
Any change you can release that script? The keywords helped me a lot, but functions do not have their prototypes, and SciTE doesn't recognize them.

fysiks
03-06-2009, 23:21
Any change you can release that script? The keywords helped me a lot, but functions do not have their prototypes, and SciTE doesn't recognize them.

prototypes? Do you mean native, public, and stock? (Those three are grouped together.

danielkza
03-06-2009, 23:46
prototypes? Do you mean native, public, and stock? (Those three are grouped together.
No, the arguments that each function takes.

fysiks
03-07-2009, 01:41
No, the arguments that each function takes.

Oh, ok. I'll look into that :). If I don't come up with something soon I will post my current php files so you can use/modify them as you like.

stupok
03-08-2009, 14:49
Here's my attempt. (Attached as ini rather than txt to get past the filesize limit.)

My regex:

Function:
^(?:stock Handle:| XS_LIBFUNC_ATTRIB bool:| XS_LIBFUNC_ATTRIB Float:| XS_LIBFUNC_ATTRIB | stock Float:| stock bool:| stock |stock Float:|stock bool:|forward |native bool:|native Float:|native |public |stock |Float:|bool:)?([\w_\-\d]+)[\s]?(\(.*?\))

Constant:
^(?:#define|new const)\s+([^_][A-Z\d_]+)

Macro:
^(?:#define|new const)\s+([^_][\w\d_]+\(.*?\))

enum: (Once I've collected all the enums sloppily, I use this to refine the collection.)
^\s([\w\d_-]{2,64})


EDIT: Added some enums

fysiks
03-09-2009, 00:14
Only 800 constants? There are like 2000. I think you missed all the enum's.

Are you using POSIX Extended or PCRE?

I didn't know what XS_LIBFUNC_ATTRIB meant. I guess I will have to add that to my regex :)

-

stupok
03-09-2009, 00:57
I did miss all the enums. Have a look at my regular expressions. I'm pretty sure they catch everything, but I'm not going to check.

I bet there's a way to do this without searching through the amxx includes.

POSIX Extended or PCRE?
I don't know.

fysiks
03-09-2009, 01:13
This is what I came up with for Danielkza here (http://www.beougher.com/nathan/amx/funcs.php?mod=ALL).

I bet there's a way to do this without searching through the amxx includes.


How? Using the func wiki maybe but I don't have access to that code :).


POSIX Extended or PCRE?
I don't know.

POSIX is a standard (syntax) for regex basically. PCRE = Perl Compatible Regular Expression. I think you are using POSIX because you don't escape the underscore (_).

danielkza
03-09-2009, 17:28
This is what I came up with for Danielkza here (http://www.beougher.com/nathan/amx/funcs.php?mod=ALL).



How? Using the func wiki maybe but I don't have access to that code :).



POSIX is a standard (syntax) for regex basically. PCRE = Perl Compatible Regular Expression. I think you are using POSIX because you don't escape the underscore (_).
I don't think underscore is a special character in PCRE, and even if it was, it looses the special meaning inside a char. class.

YamiKaitou
03-10-2009, 10:44
Darn, found 1 thing bad about the PortableApps.com version of NP++, I had to add all of this manually (using the user define option in the menus). Oh well, at least I can use a menu feature to edit the colour scheme instead of editing a file each time (the changes take effect immediately with the menu)

EDIT: Hm, I found the location, guess I had issues with that install as it works on a reinstall (I was putting it in that location, but it wasn't working for some reason). Also, I got a compiler working for NotePad++, here is how you can do it to.

In the same location as the userDefineLang.xml, there should be a file named shortcuts.xml. Edit that file and put this (full file contents shown, place it appropriatly in your file)

<NotepadPlus>
<UserDefinedCommands>
<Command name="Compile Plugin" Ctrl="yes" Alt="no" Shift="yes" Key="67">cmd /k .\..\..\..\..\..\Compiler\amxxpc.exe -o$(CURRENT_DIRECTORY)\$(NAME_PART).amxx $(FULL_CURRENT_PATH)</Command>
</UserDefinedCommands>
</NotepadPlus>

Change ".\..\..\..\..\..\Compiler\amxxpc.exe" to the location of your amxxpc.exe file. Since I use PortableApps, I can't use a exact path but you can if you want. This will compile the current active window and place the AMXX file in the same folder as the SMA file. This also leaves the cmd window open.

Default shortcut key is SHIFT+CTRL+C. You can change this in Settings>Shorcut Mapper...>Run Commands>Compile Plugin (or whatever the name of the command is)

fysiks
03-10-2009, 13:22
Sweet! I've been hoping for a way to compile my plugins this way.

Although, now, I do all my compiling on my linux server with a script that will move the amxx to my plugins directory automatically if it compiles successfully.

YamiKaitou
03-10-2009, 14:14
You can always use it to test plugins as you are writing them. Surely all of your plugins don't compile 100% of the time when you put them on your server.

fysiks
03-10-2009, 16:10
You can always use it to test plugins as you are writing them. Surely all of your plugins don't compile 100% of the time when you put them on your server.

No, it rarely compiles on my first try, but with my compile script it's really easy. Especially since I just ssh in and hit <uparrow> <enter> then it shows the errors if it didn't compile. Oh, and did I mention that I don't need ftp, the server is on LAN and I have the it mapped as a network drive so I edit the sma directly on the linux box :).

Also, when I have done it on my windows machine it was much harder to read the errors when they are output. I think it's because the filepath is shown (unlike in linux).

Yami, is there any real difference between the Notepad++ Portable and the actual program? I'm thinking of trying out this PortableApps thing so I can take Notepad++ with me :).

YamiKaitou
03-10-2009, 18:15
Yami, is there any real difference between the Notepad++ Portable and the actual program? I'm thinking of trying out this PortableApps thing so I can take Notepad++ with me :).

Not that I have seen yet. Though, it is about 9.4MB on my drive (Firefox is about 55MB)

fysiks
03-13-2009, 13:03
Ok, it's updated, again. I didn't realize xs.inc wasn't for a "mod".

biggzsizzle
04-17-2009, 00:13
I'm sorry but where do I put the *.txt files found in the "Keywords_DOD" and "Keywords_AMX" folders?

fysiks
04-17-2009, 07:10
I'm sorry but where do I put the *.txt files found in the "Keywords_DOD" and "Keywords_AMX" folders?

You can do whatever you wish with the txt files (I used them to make my Notepad++ custom highlighting). They are just lists of words. If you are using Notepad++ you can use the xml file to add the syntax highlighting. There is no xml file for the AMX version because there is too many words to put into a custom syntax highlighting scheme afaik.

Gizmo
06-25-2009, 02:28
This sounds intresting, do you want to share that script?

Sweet! I've been hoping for a way to compile my plugins this way.

Although, now, I do all my compiling on my linux server with a script that will move the amxx to my plugins directory automatically if it compiles successfully.

fysiks
06-25-2009, 18:38
This script must be in the scripting folder. Also, you will likely have to use "./<filename>" (my file is called "mkplugin") to execute the script.

#!/bin/bash

filename=$1
to_web=$2
web_directory="/var/www/html/dod/plugins/"

echo -e "\E[35m*** BEGIN *** BEGIN *** BEGIN *** BEGIN *** BEGIN *** BEGIN ***\E[37m"

if [ -f "$filename.sma" ]
then
./amxxpc "$filename.sma"
chmod 644 "$filename.sma"
else
echo -e "\E[36mDOES NOT EXIST ----> \E[33m$filename.sma\E[36m <---- DOES NOT EXIST\E[37;40m"
fi

if [ -f "$filename.amxx" ]
then
chmod 755 "$filename.amxx"
if [ "$to_web" == "1" ]
then
cp "$filename.amxx" "$web_directory"
cp "$filename.sma" "$web_directory"
echo -e "\E[33mFiles copied to $web_directory\E[37;40m"
fi
mv "$filename.amxx" ../plugins/
echo -e "\E[34;42m*** SUCCESS *** SUCCESS *** SUCCESS *** SUCCESS *** SUCCESS ***\E[37;40m"
else
echo -e "\E[30;41m*** FAILURE *** FAILURE *** FAILURE *** FAILURE *** FAILURE ***\E[37;40m"
fi

Gizmo
06-27-2009, 08:09
Thank you.
Do you have the pluginsfolder for the server at the webserver folder?

EDIT: I just saw that you just copy it to a web folder also :)

fysiks
06-27-2009, 13:22
Thank you.
Do you have the pluginsfolder for the server at the webserver folder?

EDIT: I just saw that you just copy it to a web folder also :)

I just copy it as you said. I added that when I wanted to share my plugins with a friend by him just browsing to my webserver. It was much easier than manually moving it, especially using only a command line to do it :).

Gizmo
06-27-2009, 17:52
Ok, i like that function :)
I wounder how hard it would be to make a script that would upload the plugin to an other server at an other location also :)
I manage 4 game server on 2 diffrent servers, 1 at my home and 1 at a friend.

Owyn
11-12-2009, 16:26
looked at your custom thingy,

- you can't close and open {} functions /* */ comments etc xml-like + , -

- some things are green just like comments

- pragma and include not gold

anyway, why not use C++ highlighting?

btw, how do i use all that cs_const.txt cs_macro.txt etc things in notepad++ for syntacsys hints like in studio?

fysiks
11-12-2009, 18:39
- you can't close and open {} functions /* */ comments etc xml-like + , -


I've never used those and I'm not quite sure if we can't use that functionality in user defined syntaxes. You could try and search for how to add it.


- some things are green just like comments


Uh? What things. In my color scheme I have constants like PLUGIN_HANDLED as bold and green.


- pragma and include not gold


#pragma and #include are highlighted as they should be in mine. Do you want it like C++ syntax where the whole line is the color of the directive? If so, I don't know how to do that or if it's even possible.


anyway, why not use C++ highlighting?


It doesn't have AMX Mod X functions in it. I like my functions highlighted when they are included in AMX Mod X.


btw, how do i use all that cs_const.txt cs_macro.txt etc things in notepad++ for syntacsys hints like in studio?

The .txt files are just lists of the words that I got from my script. You can use them how ever you want to create your own syntax highlighting scheme or do whatever you want with them (I don't know many other use for them :)).

xOR
12-31-2009, 21:11
i've been using notepad++ for my AMXX scripting since i started it, so it's great to find you've created this highlighting scheme.
C++ highlighting was quite good already but having the functions highlighted as well is much better.

so thank you for this. will give karma as soon as i can :wink:

minimiller
12-31-2009, 21:21
i couldnt get it to work
ill try again 2moro
gj anyway <3

fysiks
01-01-2010, 01:02
i couldnt get it to work
ill try again 2moro
gj anyway <3

Are you using userDefineLang.xml as is or are you trying to modify the existing one?

minimiller
01-01-2010, 06:20
i only installed n++ yesterday and it didnt have 1 so i just whacked yours in the languages folder (i think)

xOR
01-01-2010, 10:44
i didn't have this file yet.
i am running windows 7, so i put it directly in C:\Users\x0R\AppData\Roaming\Notepad++

worked just fine for me.

minimiller
01-01-2010, 15:35
oh appdata my bad
i put it in notepad/languages
ill try that l8er

fysiks
01-01-2010, 18:12
%appdata%/Notepad++/ is the best place to put it.

xOR
01-01-2010, 18:31
btw speaking of notepad++ tuning: if you want to be able to start compiling your plugin directly from notepad++ by pressing F9 (as it is in AMXX/Pawn Studio and other IDEs) then do the following in npp:

in main menu click Run and select Run...
enter this command line:
cmd.exe /k ""C:\Path\To\amxxpc.exe" "$(FULL_CURRENT_PATH)" "-D$(CURRENT_DIRECTORY)""
click the Save... button
enter a name (e.g. "AMXX compile")
select F9 from the dropdown list or whatever hotkey you want
click OK
close the "Run" dialog
enjoy compiling from npp by pressing F9 :wink:


it is set so that the .amxx file is created in the same directory where the .sma file is. if you want a different output directory simply replace $(CURRENT_DIRECTORY) with the directory you want it to be saved to.

i prepended cmd.exe /k so that the cmd box stays open and you can see possible compile errors. if you don't want that you have to remove the entire cmd.exe /k part from the command line and make single quotes (") out of the double quotes ("").

EDIT: updated the command to work with spaces in path names

minimiller
01-01-2010, 18:52
thx xOR. I got the syntax working and ill do the compiler l8er
thx for ur help. I got annoyed with pawn studio crashing all the time

fysiks
01-02-2010, 03:49
btw speaking of notepad++ tuning: if you want to be able to start compiling your plugin directly from notepad++ by pressing F9 (as it is in AMXX/Pawn Studio and other IDEs) then do the following in npp:

in main menu click Run and select Run...
enter this command line:
cmd.exe /k ""C:\Path\To\amxxpc.exe" "$(FULL_CURRENT_PATH)" "-D$(CURRENT_DIRECTORY)""
click the Save... button
enter a name (e.g. "AMXX compile")
select F9 from the dropdown list or whatever hotkey you want
click OK
close the "Run" dialog
enjoy compiling from npp by pressing F9 :wink:



The way I have it set up is that it compiles relative to the file that you have open. It's super nice when you are editing files on different servers and want to use the same button for both. It also outputs the .amxx to the /plugins/ folder. If that particular .amxx file exists it is overwritten (NO MORE DRAGGING!)

For this I use:

cmd /k ""$(CURRENT_DIRECTORY)\amxxpc.exe" -o"$(CURRENT_DIRECTORY)\..\plugins\$(NAME_PART). amxx" "$(FULL_CURRENT_PATH)""


With this, I have it use Windows executables on my Linux server! to compile my plugins directly on to the linux box. :)

minimiller
01-02-2010, 09:54
ok its all working =]
is there a way to make the compiled file go into a folder where the source was?

e.g. source: \scripting\
compiled: \scripting\compiled\

i tried this, but it didnt work =[

cmd.exe /k ""Z:\Program Files\Pawn Studio\scripting\amxxpc.exe" "$(FULL_CURRENT_PATH)\compiled\" "-D$(CURRENT_DIRECTORY)""

xOR
01-02-2010, 11:22
ok its all working =]
is there a way to make the compiled file go into a folder where the source was?

e.g. source: \scripting\
compiled: \scripting\compiled\

i tried this, but it didnt work =[

cmd.exe /k ""Z:\Program Files\Pawn Studio\scripting\amxxpc.exe" "$(FULL_CURRENT_PATH)\compiled\" "-D$(CURRENT_DIRECTORY)""


you have edited the wrong path (source file path instead of output directory path).

try this:
cmd.exe /k ""Z:\Program Files\Pawn Studio\scripting\amxxpc.exe" "$(FULL_CURRENT_PATH)" "-D$(CURRENT_DIRECTORY)\compiled""

i don't know whether this folder is automatically created by amxxpc.exe if it doesn't exist. so if it doesn't work try creating the "compiled" subfolder by hand first.

minimiller
01-02-2010, 11:43
sick
it worked
thx <3

wrecked_
02-07-2010, 18:13
Great job. Just got it to work (damn those hidden folders). Looks amazing.

Kreation
02-07-2010, 19:12
Great job. I saw it for the first time and I'll never go back to amxx studio or pawn studio.

fysiks
02-07-2010, 20:45
you can't close and open {} functions /* */ comments etc xml-like + , -


I found how to do it but it remove previous functionality.

If you put the braces in the "open/close" setting then they it won't highlight the matching brace when your cursor is next to it.

If you put the block comment characters in the open/close setting then the comment block won't be highlighted as a comment.

ehha
02-26-2010, 17:53
Any idea on how to change the color of func_one in both cases?
Like AMXX studio? :)


new tmp1, tmp2;
public func_one( arg1, arg2 )
{
// do stuff with atg1 & arg2
}

func_one( tmp1, tmp2 );

fysiks
02-26-2010, 17:55
The User Defined syntax highlighting is not that sophisticated.

ehha
02-26-2010, 17:58
Thanks for the uber fast response, I hoped it can be done.

Kreation
02-26-2010, 18:57
fysiks, I think I might love you forever and ever if you make a syntax highlighting that resembles the [pawn] highlighting on the forums. If there is already one could someone show me?

Seta00
02-26-2010, 19:51
I'll see if I can make a plugin to add Pawn functionatilites to Eclipse.

stupok
02-27-2010, 02:27
Seta00, do it. I've been thinking about it, too, but I haven't had the time to research how it's done.

drekes
03-22-2010, 06:14
How can i delete the saved run options, i messed up a couple of times when adding the compiler and now i got 4 amxx compilers

Kreation
03-22-2010, 16:50
Settings > Shortcut Mapper > Run Commands

Then right click the one you want to delete and select Delete.

drekes
03-22-2010, 17:26
Settings > Shortcut Mapper > Run Commands

Then right click the one you want to delete and select Delete.

Thnx dude

Seta00
04-02-2010, 11:09
Notepad++ Highlighting with Pawn Studio colors (http://forums.alliedmods.net/showthread.php?p=1136448#post1136448)

Kreation
04-04-2010, 12:44
Notepad++ Highlighting with Pawn Studio colors (http://forums.alliedmods.net/showthread.php?p=1136448#post1136448)

Do you know the [pawn] tags here on the forums?
Do you know what orgasm's sound like?
If you make the [pawn] highlighting for N++, I will show you what it does sound like. Lol.

Code:
#include < amxmodx >

new const sexy[] = "OMG LOOK AT IT <----";
static const plxdoso[] = "HOLYSHIT ITS SOO HOT!";

const wink[] = "-.^";

public plugin_init( )
{
register_plugin( "Do it Seta", "0.0.1", "<3" )
}

EDIT: ew. fail.

Seta00
04-07-2010, 06:54
I'll do it as soon as I get home.

But no, I don't want to hear your orgasm.

Kreation
04-07-2010, 16:42
I'll do it as soon as I get home.

But no, I don't want to hear your orgasm.


Alright. :|

Seta00
04-11-2010, 10:05
Ops, almost forgot about the request :oops:
Here ya go, Notepad++ Syntax Highlighting with [pawn] tag colors xD
Note: It isn't possible to make preprocessor lines green, since their color is different from the comment color. Only the preprocessor keywords (#include, #define) are green.

Kreation
04-19-2010, 16:00
Ops, almost forgot about the request :oops:
Here ya go, Notepad++ Syntax Highlighting with [pawn] tag colors xD
Note: It isn't possible to make preprocessor lines green, since their color is different from the comment color. Only the preprocessor keywords (#include, #define) are green.

I forgot too, then I saw your name in this thread for recent posts or w/e and I was like OHH YEAH, thanks so much.

andy_viper
06-06-2010, 17:15
Thank you very usefull!

Alucard^
06-19-2010, 04:20
mMm... i didn't understand the installation, i tried adding the .xml into the notepad++ folder when is installed and now how i can active that? i tried with some things but without any resut.

drekes
06-19-2010, 07:23
On win xp:
Place it in c:/documents and settings/yourname/appdata/roaming/notepad++ or
c:/program files/notepad++.

on vista/7:
c:/users/yourname/appdata/roaming/notepad++ or
c:/program files/notepad++.

The path depends on the installation configuration. Then look in syntaxis in the menu above. There should be CS and that's it.

Alucard^
06-19-2010, 10:02
On win xp:
Place it in c:/documents and settings/yourname/appdata/roaming/notepad++ or
c:/program files/notepad++.

on vista/7:
c:/users/yourname/appdata/roaming/notepad++ or
c:/program files/notepad++.

The path depends on the installation configuration. Then look in syntaxis in the menu above. There should be CS and that's it.

http://img153.**************/img153/9975/syntaxis.png

does not appear :(

drekes
06-19-2010, 10:19
Did you try both the paths i gave in my previous post?
It should appear on the bottom of the list above "Definido por el usuario"

fysiks
06-19-2010, 13:16
In XP the path is:

C:\Documents and Settings\<user>\Application Data\Notepad++

drekes
06-19-2010, 13:40
It's been a while since i worked on xp, i thought it was the same.

fysiks
06-19-2010, 13:53
It's been a while since i worked on xp, i thought it was the same.

You can get to "C:\Documents and Settings\<user>\Application Data" using just "%appdata%" btw.

Alucard^
06-20-2010, 02:56
Thanks, now work perfect :p i am using pawn syntax highlighting :E

Now i have a question... cuz i am new using notepad++. Is possible to add the "autocomplete" thing that pawn studio and AMXX studio have? when you are writing a function you can see the complete name with parameters.

Thanks

drekes
06-20-2010, 07:03
I don't know, i use the funcwiki code on the first page if i'm not sure of something

Alucard^
06-20-2010, 12:20
Yeah i know, i use it too or .incs but, well... will be more fast and good if i have an autocomplete in notepad++

And another question... the program have the function that pawn studio have using CTRL+I? (auto indent code)

Emp`
06-20-2010, 12:40
And another question... the program have the function that pawn studio have using CTRL+I? (auto indent code)

TextFX -> TextFX Edit -> Reindent C++ code

drekes
06-20-2010, 12:43
TextFX -> TextFX Edit -> Reindent C++ code

Now that is an awesome thing. Thanks Emp`

fysiks
06-20-2010, 12:50
TextFX -> TextFX Edit -> Reindent C++ code

I've used this too. It does switches weird though and I've had it crash the program on huge files. :(

Auto-Completion: Settings :arrow: Preferences :arrow: Backup/Auto-Completion. I've never used it so I'm not sure if/how it works. I hate autocompletion :).

drekes
06-20-2010, 13:33
Auto-Completion doesn't work for me. If i type 1 word it works, but it doesn't show the params of a command. Like set_user_rendering.

Is that possible? Cause that would be usefull

fysiks
06-20-2010, 14:01
Auto-Completion doesn't work for me. If i type 1 word it works, but it doesn't show the params of a command. Like set_user_rendering.

Is that possible? Cause that would be usefull

That's because it doesn't know the params of anything.

Emp`
06-20-2010, 14:06
http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Auto_Completion

fysiks
06-20-2010, 14:35
http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Auto_Completion

Looks like there is more work to do :) lol.

EDIT: Are you sure this works for user defined languages? I can't get it to work as of yet.

cFG
06-28-2010, 03:47
Thanks.
Imo, it's better then C syntax highlighting :)

Kreation
07-01-2010, 20:09
Is there a way to make this work for two file types?

fysiks
07-01-2010, 21:30
Is there a way to make this work for two file types?

You can make one syntax highlighting scheme work for several different file types. Click the "User Defined Dialog" button and then choose the "language" from the drop down menu. To the right there should be a box called "Ext" where it already has sma in it. You can add to that by using a comma :arrow: "sma, inc".

Kreation
07-01-2010, 21:59
Ahh. Got it. Thanks. :D

Kreation
07-02-2010, 16:27
I've come across a problem.

I did what you said with the commas and what I have right now is 'sma, inl'. The .inl file type works fine with the highlighting, but if I open a new .sma it doesn't work.

fysiks
07-02-2010, 17:05
I've come across a problem.

I did what you said with the commas and what I have right now is 'sma, inl'. The .inl file type works fine with the highlighting, but if I open a new .sma it doesn't work.

I see that. It turns out that it is a space delimited list. Remove the comma and only have one space in between extensions.

I had it set up on a previous OS but had not changed it on this one so I forgot the specific requirements for that part :).

Kreation
07-02-2010, 20:08
Ah, okay. Thanks. :D

fysiks
08-10-2010, 22:48
Added Auto-Complete and Hints setup in the first post.

tm.
08-11-2010, 03:23
That's great. I give it a try and works perfect. Thanks.

Seta00
08-11-2010, 05:19
Can Notepad++ Highlighting with Pawn Studio colors (http://forums.alliedmods.net/showthread.php?p=1136448#post1136448)
and
63515
Be on the first post? :avast:

ConnorMcLeod
08-11-2010, 06:39
Thanks a lot !! (haven't tried yet)

tm.
08-11-2010, 07:23
Found a small bug, I think it's Notepad related and not to the CS.xml. After typing a function and the first parenthesis for the parameters the hint appears (so far, so good). If you delete (backspace) a character from the parameters the hint dissapears never reappearing until you get back to the starting point (function and first parenthesis).

ConnorMcLeod
08-11-2010, 09:10
1. Find your "userDefineLang.xml" and make a backup copy.
(C:\Documents and Settings\%username%\Application Data\Notepad++\)
Strangely mine doesn't work there. I have to put it in "C:\Program Files\Notepad++\".

That's because when you installed npp you checked "Do not use Application Data"

Arkshine
08-11-2010, 09:22
Thanks fysiks. ^^

ConnorMcLeod
08-11-2010, 09:32
Is it possible to make a template for new files ?

Arkshine
08-11-2010, 11:23
It seems there are no plugins about that. Do the plugin yourself. :p
You can also create a .txt, you will lose one or two seconds only. ^^

wrecked_
08-11-2010, 11:45
Is it possible to make a template for new files ?
Holy crap, I've been wanting that for ages. Could anyone make that?

Seta00
08-11-2010, 11:50
Is it possible to make a template for new files ?

Holy crap, I've been wanting that for ages. Could anyone make that?

http://www.fesevur.com/nppsnippets

You can save a snippet with the default text and then just click it.

Arkshine
08-11-2010, 11:55
Actually I found a list of plugins related to the coding and there is plugin named "PluginTemplate" which sounds to be the wanted plugin. This plugin has been compiled in 2007 as AINSI, and since Npp++ is as unicode now the plugin won't load. I don't know much how to (re)compile as unicode, if someone can do it, it would be nice.

http://sourceforge.net/projects/npp-plugins/files/


EDIT: Ah, well found Seta00. :)

wrecked_
08-11-2010, 12:00
http://www.fesevur.com/nppsnippets

You can save a snippet with the default text and then just click it.
Thanks, bud. :mrgreen:

tm.
08-11-2010, 14:39
...

fysiks
08-11-2010, 19:30
Can
and

Be on the first post? :avast:

I added a link to the post (I'm assuming the attachment that you posted is the same as the one in the post).


Found a small bug, I think it's Notepad related and not to the CS.xml. After typing a function and the first parenthesis for the parameters the hint appears (so far, so good). If you delete (backspace) a character from the parameters the hint dissapears never reappearing until you get back to the starting point (function and first parenthesis).

This is probably an issue with how the hints is implemented in Notepad++. You will have to tell them :).

Seta00
08-11-2010, 20:02
I added a link to the post (I'm assuming the attachment that you posted is the same as the one in the post).

Sorry, should've been more clear, the other one is with [pawn] tag colors.
Ops, almost forgot about the request :oops:
Here ya go, Notepad++ Syntax Highlighting with [pawn] tag colors xD
Note: It isn't possible to make preprocessor lines green, since their color is different from the comment color. Only the preprocessor keywords (#include, #define) are green.

analoganomaly
08-28-2010, 06:53
Very handy! Many thanks! =)

georgik57
12-12-2010, 19:49
thank you

Exolent[jNr]
12-27-2010, 22:24
A bit old thread, but could some screenshots be provided for those (like me) who want to see the syntax highlighting choices before downloading instead of trying them all?

ConnorMcLeod
12-28-2010, 04:17
http://img811.**************/img811/7742/npp.th.png (http://img811.**************/i/npp.png/)

Uploaded with ************** (http://**************)

drekes
12-28-2010, 08:02
What is that thing on the right of the editor?
With the snippet plus thing

Arkshine
12-28-2010, 08:06
It allows you to create pieces of codes under a name, then when you click on it , it's pasted on the left.

ConnorMcLeod
12-28-2010, 08:08
Predefined things, like when i press new sma i have this appear :

/* Formatright © 2010, ConnorMcLeod

This plugin is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this plugin; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
//#include <amxmisc>

//#include <engine>
//#include <fakemeta>

//#include <hamsandwich>

//#include <fun>

//#include <cstrike>

#define VERSION "0.0.1"
#define PLUGIN ""

public plugin_init()
{
register_plugin(PLUGIN, VERSION, "ConnorMcLeod")
}

When i press "Event Round End" :
register_logevent("Logevent_Round_End", 2, "1=Round_End")

Etc..


This is avaible in npp plugins list.

drekes
12-28-2010, 10:29
That is awesome, i didn't know this was possible.
Any more tricks you got ?

georgik57
12-28-2010, 10:31
notepad++ owns

Arkshine
12-28-2010, 10:33
Just look at the available plugins and see if there is something interesting for you.

It reminds a plugin (Function list) which list functions used in the current code in a panel. But AFAIK it's not maintained and it doesn't work properly using the latest version of notepadd, such plugin are fairly useful.

Shadows In Rain
02-19-2011, 06:20
I'm shocked, damn great, yarrrr!
// love np++ even more than girls

Kiske
09-02-2011, 23:04
I can't find the userDefineLang.xml
Help me :(


http://img811.**************/img811/7742/npp.th.png (http://img811.**************/i/npp.png/)

Uploaded with ************** (http://**************)
I love that, the color of the letters and everyting else :$

fysiks
09-02-2011, 23:07
I can't find the userDefineLang.xml


I don't think it exists if you don't already have a user defined language. In that case you can just put the xml file in the appropriate folder. Put it in the %appdata%\Notepad++ folder.

Kiske
09-02-2011, 23:26
I don't think it exists if you don't already have a user defined language. In that case you can just put the xml file in the appropriate folder. Put it in the %appdata%\Notepad++ folder.
I put it there, but when I open notepad++ and put public plugin_ it just appears plugin_flags and not the rest.

fysiks
09-02-2011, 23:27
I put it there, but when I open notepad++ and put public plugin_ it just appears plugin_flags and not the rest.

userDefineLang.xml only handles colors.

Kiske
09-03-2011, 00:12
userDefineLang.xml only handles colors.
Haha, thanks you and sorry for the confusion.

http://img811.**************/img811/7742/npp.th.png (http://img811.**************/i/npp.png/)

Uploaded with ************** (http://**************)
Where I can find that style, or private?.

fysiks
09-03-2011, 00:58
Where I can find that style, or private?.

That screen shot looks like my color scheme defined in userDefineLang.xml. Other than that I have no clue what you are talking about.

ConnorMcLeod
09-03-2011, 01:47
A cool npp release should happen soon (or in few years), just wait for it.

fysiks
09-03-2011, 03:07
A cool npp release should happen soon (or in few years), just wait for it.

lol. I doubt a year unless there are issues.

Arkshine
09-03-2011, 04:24
No, more or less ready. Just some details to review and making a post (so lazy).

Anyway, I've noticed how bad np++ is to handle autocompletion on each input. Really slow and the drop-down list flickering :/. I guess, by default having autocompletion on "word" and when you need to help for a function, you do ctrl + espace, would be more appropriate.

nikhilgupta345
09-03-2011, 11:32
I use np++, but the function-completion hints acts weird. If you spell something wrong, and then use a backspace, the hints disappear, and you have to go to the beginning for it to re-appear.

dark_style
09-08-2011, 00:08
Good job fysiks, I will use it for sure. But I found something wrong.. when I set my notepad++ to

settings > preferences > backup/auto-completion > enable auto-completion on each input > word completion the functions stop showing up.. what I mean is - I write cs_ and it doesn't show me the natives.. ( cs_set_user_money ) etc.. when it's not "word completion" anything works fine. Would you fix that? :)

Would someone create a syntax highlighting with the "[php]" tag colors? Please do it, thanks. :)

dark_style
10-18-2011, 02:59
Would someone create a syntax highlighting with the "[php]" tag colors? Please do it, thanks. :)

Umm... anybody?

ConnorMcLeod
10-18-2011, 11:15
It already exists in default npp, just browse languages list ;)

dark_style
10-18-2011, 12:23
It already exists in default npp, just browse languages list ;)
Hm.. I've browsed all of the default languages and none of them is with these "[php]" tag colors? :o

Arkshine
10-18-2011, 12:26
Feel free to modify the language colors.

vitorrossi
07-13-2015, 22:33
I am not sure if this has been demonstrated before, sorry if its a double post.
I just found out how to use the function list on NPP after much searching, and I didn't really find anything well documented. Here is how I did it on v6.7.9.2:

1. Open functionList.xml in Notepad++ directory ( if editing this file doesn't work, also edit the one in AppData\Roaming\Notepad++ ).
2. Underneath were it says <associationMap> is should look something like this:
<association langID="1" id="php_function"/>
<association langID="2" id="c_function"/>
<association langID="3" id="c_cpp_function"/>
<association langID="4" id="cs_function"/>
<association langID="6" id="java"/>
<association langID="9" id="xml_node"/>
<association langID="12" id="batch_label"/>
<association langID="13" id="ini_section"/>
<association langID="19" id="js_function"/>
<association langID="21" id="perl_function"/>
<association langID="22" id="python_function"/>
<association langID="26" id="bash_function"/>
<association langID="28" id="nsis_syntax"/>

Add this at the end ( if your user defined language name is not CS, change that field to the corresponding name )
<association userDefinedLangName="CS" id="pawn_function"/>Then at the end of the code, right before </parsers> add this:

<parser id="pawn_function" displayName="Pawn SMA" commentExpr="((/\*.*?\*)/|(//.*?$))">
<function
mainExpr="^[\t ]*((public|stock|static)[\s]+)?(?!(if|while|for|switch|do))[:_A-Za-z0-9]+\s*\([&quot;\s\[\]=,:_A-Za-z0-9]*\s*\)[\n\s]*\{"
displayMode="$functionName">
<functionName>
<nameExpr expr="[_A-Za-z0-9]+\s*\("/>
<nameExpr expr="[_A-Za-z0-9]+"/>
</functionName>
</function>
</parser>

So far this has worked with every function I have in the plugins I've downloaded/made, but it might be missing some exceptions. If there are more code statements that I forgot, they can be added here: (if|while|for|switch|do|STATEMENT). Any other character in function names can be added to the pink part of the code below inside the brakets, and characters inside the parenthesis to the code in orange:

<parser id="pawn_function" displayName="Pawn SMA" commentExpr="((/\*.*?\*)/|(//.*?$))">
<function
mainExpr="^[\t ]*((public|stock|static)[\s]+)?(?!(if|while|for|switch|do))[:_A-Za-z0-9]+\s*\([&quot;\s\[\]=,:_A-Za-z0-9]*\s*\)[\n\s]*\{"
displayMode="$functionName">
<functionName>
<nameExpr expr="[_A-Za-z0-9]+\s*\("/>
<nameExpr expr="[_A-Za-z0-9]+"/>
</functionName>
</function>
</parser>

HamletEagle
07-14-2015, 08:14
Thanks, it's usefull. What you forgot(maybe ?) to say is that someone need to change the language name:

<association userDefinedLangName="CS" id="pawn_function"/>

I use Notepad++ AM and the lang name is "Pawn", not "CS".

vitorrossi
07-14-2015, 11:39
Another alternative is to download SourceCookifier.
This can be downloaded in Notepad++ ---> Plugins > Plugin Manager > Show Plugin Manager
After you download and restart Notepad++, open SourceCookifier, Settings > Language Settings, under Language select C++, then under Extension type .sma in the white box then click Add.
Should do the trick.

Depresie
07-08-2016, 09:35
Please post how to install

fysiks
07-08-2016, 18:34
Please post how to install

Perhaps you should actually read my post.

Depresie
07-08-2016, 18:48
You only tell about the .xml file
You don't explain what .zip people should download and why

For a new user it is very confusing

fysiks
07-08-2016, 19:05
You only tell about the .xml file
You don't explain what .zip people should download and why

For a new user it is very confusing

If you want the keywords for CS you download the one that has those two words in it. In there, there is a Notepad++ folder. If you open that, you'll see a ReadMe.txt. Open that, it explains the installation process (as of 2010). If it has changed (which I doubt because I've never had to move it in the numerous versions that I've used) then someone would need to let me know.