Raised This Month: $ Target: $400
 0% 

Notepad++ Tips and Tricks


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 09:57.


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