- View in browser: You can easily view your open HTML file in a browser by clicking on Run. Choose from IE, Firefox, Chrome and Safari. Or select Run... and browse to another executable. You can also update the shortcuts.xml file to add another browser, or change the location of a browser executable.
- Basic version control: By turning on Verbose backup (Settings > Backup/Auto-Completion) you can set up Notepad++ to implement very basic revision control. Every time you save a file, Notepad++ will save a "clean" version in a backup sub-folder called nppBackup. That is, the version that you last saved, with none of your recent changes. The backup filename is appended with a date and timestamp so you end up with a new backup for every change. It probably goes without saying that it's a good idea to periodically delete the ones you don't want. Even if you're using some kind of version control this can be useful between check-ins.
- Auto-completion: Whilst you're in the Backup/Auto-Completion screen set it to auto-complete functions.
- Create templates: Notepad++ doesn't have the concepts of templates but I decided to set up my own. I created a templates folder and saved a few varieties of basic HTML files, including DOCTYPE, external CSS and JS calls, and an empty body tag. I did this for XHTML Strict and HTML4 Strict, with variations for JQuery and CSS 960grid. I open the relevant template and then Save As... to create my new file.
- Close tags: You can use TextFX to automatically close any XHTML tags. Go to TextFX > TextFX > Settings > Autoclose XHTML/XML
. There are a whole host of other useful TextFX features, such as converting case and quotes, escaping and unescaping characters, submitting to W3 validators, running HTMLTidy and a whole host of other features I haven't yet found a need for. - Create new tab group: Similar to Visual Studio's New Vertical Tab Group, you can view documents (or tabbed groups of documents) side-by-side using View > Move/Clone Current Document > Move to Other View. F8 then toggles between these views. Choosing to Clone effectively implements split screen and any changes made to one view of the document will be replicated in the other.
- Use bookmarks to navigate large documents: When reading through large code files I often spend much of my time scrolling between two or more parts of the file. Clicking between the line number and the line adds a bookmark. I can then easily navigate from one bookmark to the next using F2 (down) and Shift+F2 (up).
Tuesday, May 4, 2010
Notepad++ Tips and Tricks
As regular readers will know, I'm a great fan of free software. I use Notepad++ for most of my code editing. Here are a few useful tips and tricks I've picked up along the way. Much of this stuff is standard for a text editor but not necessarily that easy to find in Notepad++.
Subscribe to:
Post Comments (Atom)
Which auto completion do you use? There's function and word but I find the assistance of either varies from language to language. I think I prefer function auto completion in HTML/CSS/Javascript.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteWhen I started writing this I was using function (hence "set it to auto-complete functions"). Now I'm trying word. I haven't quite decided which one is most useful but word seems to be working okay.
ReplyDeleteThanks for your tips. Is there any way to implement "Create new tab group" with 3 documents ? In my case, the third one moves between the 2 that are already created.
ReplyDeleteHi Anonymous,
ReplyDeletethanks for your comment and sorry for my delayed reply.
I don't think you can have more than 2 views. But I also wonder how useful a third view would be as it would significantly limit how much you can see on screen at any one time. (Unless, of course, you have a massive monitor, which I, sadly, do not.)
Do you know of any other editors that allow more than 2 views? My Visual C# Express only allows 2 views as well.
One good thing that I have discovered since writing this post is that you can toggle between vertical tab groups and horizontal tab groups. To do this click on the dotted lines between the views and select one of the rotate options. Play around with this feature to see how you can swap tab groups around.
Thanks for the tips... notepad++ is so much more than you can see on the surface... if I could just figure out code highlighting for .erb files now!
ReplyDeleteI don't code with Ruby on Rails but there is built-in language highlighting for "Ruby". Have you tried this with your .erb files? There are loads of other tips for using Notepad++ with Ruby. Check out these links:
ReplyDeletehttp://www.praj.com.au/notepad-plus-plus-editor/
http://balagan.org.uk/software-development/ruby-on-rails/which-editor-or-ide-on-windows.htm
http://therubyway.wordpress.com/2009/01/08/rails-on-notepad-2-plugins-for-notepad/
I appreciate the links... the ruby language is supported very well. ERB (embedded ruby) would need to be a hybrid of HTML and Ruby - which I have not had luck working with. It's not a killer, still using notepad++, I suppose it will come some day ;)
ReplyDeleteSee this is 3 years old and don't use Ruby but - if you go to Settings|Style Configurator, Select Ruby then select INSTRUCTION you can add User Defined Keywords.
DeleteNote that this same type of problem exists for MySQLi in the SQL section of the Configurator. But in this case use KEYWORD to add your User Defined Keywords.
I was wondering was there a setting that could change the following. When you must select a length of content from a long line of code, if i go above or below the line the cursor returns to the far left of back to the start of the line. Can you change this so that screen does not move back to the start of the line?
ReplyDeleteDecember 1, 2010 5:25 AM response
ReplyDeleteclick View then Word wrap
About tip #1: Wouldn't it be a lot simpler if Notepad++ just included a "View in Browser" command on its View menu, as many other high-class text editors do? You know---you click that command and it opens your (presumably browser-displayable) document in your system's default browser. This is not hard to do.
ReplyDeleteWell, I know you don't actually develop NP++... I guess I'm just venting, as I suggested this several years ago to NP++'s developers and they apparently ignored me.
Oh, never mind---It's on NP++'s "Run" menu: "Launch in Firefox", "Launch in IE", etc.
ReplyDelete(And maybe I'm just being dense, but I still have no idea what you're talking about in Tip #1.)
Very useful tips. It was too helpful for us. Thanks for sharing it. Keep it up.
ReplyDeleteI cannot stand comment username spammers, maybe you didn't see the no-follow tag?? are you thick?? your only wasting your own time.
DeleteAmazing tips. You might be a great author. Thanks for your time. Keep posting like this.
ReplyDeleteHey Ander, what do you mean you have no idea what I'm talking about in Tip #1? I am pretty much just saying what you said in your two comments, i.e what other text editors call "View in browser" can be achieved by clicking "Run" etc. And this is customisable - so if the browser you want to use doesn't appear in the list you can either run the .exe as a one off, or update shortcuts.xml to add it permanently. I hope that makes things more clear for you.
ReplyDeleteA folder called 'nppBackup' continuously appears on my Desktop when using Notepad++. I have a location specified for the temp file saves already, so I don't understand why it would keep creating this folder in locations that I have not specified. Any ideas?
ReplyDeletegreat post thanks for sharing
ReplyDeletehttps://neilpatel.com/blog/loud-is-weak/
ReplyDeletewhatever you do, dont click on the link above, it's a website that tries to load malware unto your computer!!!
DeleteThe vital information in this blogs has allured me.
ReplyDeleteWIKIPEDIA
ReplyDeleteHi, Very nice article. I hope you will publish again such type of post. Thank you!
Corporate gifts ideas | Corporate gifts
Corporate gifts singapore | Corporate gifts in singapore
Promotional gifts singapore | Corporate gifts wholesale Singapore
Forex Signals, MT4 and MT5 Indicators, Strategies, Expert Advisors, Forex News, Technical Analysis and Trade Updates in the FOREX IN WORLD
ReplyDeleteForex Signals Forex Strategies Forex Indicators Forex News Forex World
I see the greatest contents on your blog and I extremely love reading them.
ReplyDeletewebsite design company San Francisco
Continue the good work; keep posting more n more n more.
ReplyDeleteUI design firms
Shield Security Solutions Offers Security Guard License Training across the province of Ontario. Get Started Today!
ReplyDeleteSecurity Guard License | Security License | Ontario Security license | Security License Ontario | Ontario Security Guard License | Security Guard License Ontario
Another point : is there a user way to remove buttons from the TabBar, in other words to customize this TabBar ?
ReplyDeleteI really enjoyed this post !
ReplyDeleteBest Preschools in Gurgaon
Nursery Schools in Gurgaon | Best Nursery School in Gurgaon
Top Nursery Schools in Gurugram
Best Playschools in Gurgaon
very useful and interesting article please get to know more
ReplyDelete