Raised This Month: $32 Target: $400
 8% 

Notepad++ Tips and Tricks


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-07-2010 , 21:34   Notepad++ Tips and Tricks
Reply With Quote #1

I have a few custom "Run" commands that I use to make scripting a bit smoother. One of my tricks started with Yami and I modified it for my situation.

Steps to add custom commands:
  • Run > Run... (F5 by default I think).
  • Paste the code into the "Type your program to run here" text box.
  • Click Save...
  • Name the function and optionally change the shortcut key combination (this can be done at a later time through Settings > Shorcut Mapper > Run Commands).
  • Hit OK to save the command.
  • Hit Cancel to exit the Run... dialog.

Compile:
This command will compile the active file
  • - Use this when working within a AMX Mod X installation (i.e. working in the amxmodx/scripting/ folder).
    - Compiles and outputs .amxx file to amxmodx/plugins/ folder.
    - Uses the compiler that is adjacent to it.
    - If the .amxx file already exists it WILL OVERWRITE it.
    Code:
    cmd /k ""$(CURRENT_DIRECTORY)\amxxpc.exe" -o"$(CURRENT_DIRECTORY)\..\plugins\$(NAME_PART).amxx" "$(FULL_CURRENT_PATH)""
  • Generic:
    Code:
    cmd /k ""C:\path\to\compiler\folder\amxxpc.exe" -o"C:\path\to\output\folder\$(NAME_PART).amxx" "$(FULL_CURRENT_PATH)""
    - Insert the compiler folder path and the output folder path as noted in the command.
    - Remove -o"..." argument if you would like to compile to the default location.

  • A batch file for comiling and duplicating (needed due to run command length limit). Uses the Generic method above.

    Code:
    @echo off
    REM Name this file "compile_and_duplicate.bat" and put it in your scripting folder.
    
    REM Notepad++ command below
    REM cmd /k "$(CURRENT_DIRECTORY)\compile_and_duplicate "$(NAME_PART)" "$(FULL_CURRENT_PATH)""
    
    REM Set folder paths here:
    SET compiler_folder=C:\trashme\scripting
    SET plugin_folder=C:\trashme\plugins
    SET duplicate_folder=C:\trashme\other
    
    SET name_part=%1
    SET full_current_path=%2
    
    :: Remove quotes
    SET name_part=###%name_part%###
    SET name_part=%name_part:"###=%
    SET name_part=%name_part:###"=%
    SET name_part=%name_part:###=%
    
    :: Remove quotes
    SET full_current_path=###%full_current_path%###
    SET full_current_path=%full_current_path:"###=%
    SET full_current_path=%full_current_path:###"=%
    SET full_current_path=%full_current_path:###=%
    
    REM Compile
    %compiler_folder%\amxxpc.exe -o"%plugin_folder%\%name_part%.amxx" "%full_current_path%"
    REM Duplicate to duplicate_folder
    COPY "%plugin_folder%\%name_part%.amxx" "%duplicate_folder%\%name_part%.amxx"
Keyword search:
This will search the funcwiki at amxmodx.org for the word that is closest to your cursor (will highlight the whole word when command is executed). If you highlight a group of characters it will search for the highlighted sequence of characters literally.

Code:
http://www.amxmodx.org/funcwiki.php?search=$(CURRENT_WORD)&go=search
Post other Notepad++ tips or tricks here.

See Also: Notepad++ Syntax highlighting for AMX Mod X (CS or DOD).

For question regarding Notepad++ not posted here, see the NpWiki++ first.
__________________

Last edited by fysiks; 08-29-2010 at 16:36.
fysiks is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-07-2010 , 21:35   Re: Notepad++ Tips and Tricks
Reply With Quote #2

First.

WOW. That keyword search works great, that's amazing. I'll be sure to use that about 20,000 times per-plugin.

The compiler is also very useful, as I run a dedicated server to test plugins and it saves me ages of time.

Overall, great job.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT

Last edited by wrecked_; 02-07-2010 at 21:39.
wrecked_ is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 02-07-2010 , 21:53   Re: Notepad++ Tips and Tricks
Reply With Quote #3

I get some error with the compile one.

amxxpc.exe is not recognized as an internal or external command, operable program or batch file.
__________________
Hi.
Kreation is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-07-2010 , 22:04   Re: Notepad++ Tips and Tricks
Reply With Quote #4

Quote:
Originally Posted by Kreation View Post
I get some error with the compile one.

amxxpc.exe is not recognized as an internal or external command, operable program or batch file.
Is amxxpc.exe in the same folder as the .sma file?
__________________
fysiks is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 02-07-2010 , 22:05   Re: Notepad++ Tips and Tricks
Reply With Quote #5

No, so should I just make amxxpc.exe a shortcut and put it in the folder?
__________________
Hi.
Kreation is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-07-2010 , 22:09   Re: Notepad++ Tips and Tricks
Reply With Quote #6

Quote:
Originally Posted by Kreation View Post
No, so should I just make amxxpc.exe a shortcut and put it in the folder?
Shortcut will not work. It must be the .exe.

Are you working within a AMX Mod X installation? In the scripting folder?
__________________
fysiks is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 02-07-2010 , 22:10   Re: Notepad++ Tips and Tricks
Reply With Quote #7

No, I have a custom folder that I save all my .sma's to.
__________________
Hi.
Kreation is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-07-2010 , 22:33   Re: Notepad++ Tips and Tricks
Reply With Quote #8

Quote:
Originally Posted by Kreation View Post
No, I have a custom folder that I save all my .sma's to.
You will need to use the generic command (updated in first post).
__________________
fysiks is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 02-07-2010 , 22:37   Re: Notepad++ Tips and Tricks
Reply With Quote #9

Do I edit anything? Or do I copy that exact command..?

EDIT:When I use the exact command it says this -->
The system cannot find the path specified.
__________________
Hi.
Kreation is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-07-2010 , 22:40   Re: Notepad++ Tips and Tricks
Reply With Quote #10

Quote:
Originally Posted by Kreation View Post
Do I edit anything? Or do I copy that exact command..?

EDIT:When I use the exact command it says this -->
The system cannot find the path specified.
You have to edit the paths that say "C:\path\to\compiler\folder" and "C:\path\to\output\folder"
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode