Snippets can be very useful and if you work with similar code that you use across various projects then if you would very easy to use a snippets in your code editor.I use Notepad++ for my php, css, html coding while testing various wordpress themes, plugins and for making code changes.There’s something that most theme don’t come which is ad placement ready and each user has to hard code the ad code into the themes, and while testing this becomes a repetitive task of inserting the ad code and snippets into theme files.
Notepad++ supports plugins which means the programs features can be extended similar to a web browser addons for added functionality, QuickText is a Notepad++ plugin which helps organize code snippets into various programming languages and insert the snippets into the working file using simple tags.These tags can be user defined and these tags are replaced with the predefined code attached to the tag into the working file.
Steps to install QuickText Notepad++ Plugin :
- Download and Extract / Install the application to a folder. ( I choose the 7z file which has the unicode version, downloaded and extracted it to a folder ).
- Download and extract the QuickText Notepad++ Plugin.
- Copy the QuickText.UNI.dll into Notepad++’s plugin directory
- Copy the QuickText.ini file into Notepad++’s directory.The directory in which you find the notepad++ exe file.
That’s it your installation is complete.Now the tags are to be defined.
Steps to define tags in the QuickText Notepad++ Plugin :
- Navigate to Options under Plugins > QuickText > Options..
- Next Define your tags using the following steps.
- Select the Programming language or just select Normal Text, if
- Define Tag Name
- Enter your code in the Substitution Text Box and Click “ Add/Modify ” Button
- You should now see the tag added under the list of Tags.
- Now to use this tag in a php file, just enter the tag is_single and press “ TAB ” and the tag is replaced by the substitution text which the code.
Note : Just incase Tab is not working after you type your tag, Check if the shortcut is mapped correctly in the shortcut mapper which can accessed under Settings > Shortcut mapper ,then click on the Plugin Commands tab and scroll to near the bottom and look for ‘ Replace Tag ’, once you’ve found it define a new shortcut.
The best advantage of this plugin is that tags/snippets can be defined for different languages which makes it easier to work with different pieces of code and have the snippets easily accessible.
Are you using a more simpler or powerful snippet manager for NotePad++, do share with us with your thoughts and experiences.