Shortcuts for HTML



  • For the longest time, I used Homesite… which hasn’t been updated since 2005.

    One of the features I liked was that I could use keyboard shortcuts for quick editing of text. Ex: I highlight a paragraph and using CTRL+P, the <p> </p> tags would encapsulate the highlighted text. If I wanted only a few words in bold, I’d highlight those words, use CTRL+B and <strong></strong> or <b></b> would encapsulate the highlighted text (you could determine which to use in Homesite’s settings).

    I know how to code. That’s not the issue.

    What I want to do is just have a quick way to format text.

    From my searches online, there used to be a plugin called WebEdit that could help with this… but it’s old and the latest version of Notepad++ didn’t like the plugin.

    Is there a way in 2017 to do what I need?

    Thanks



  • @Chris-Popp

    Well, you could code such things within Notepad++ easily using one of the scripting languages (Pythonscript, Luascript). But if you are a tired coder that is just looking for a turnkey solution, I don’t know of one but maybe someone else does…



  • For example with Pythonscript, a bit of code for paragraph encapsulation could be as simple as:

    editor.replaceSel('<p>' + editor.getSelText() + '</p>')
    

    Bind script execution to a keycombo and you are up and running.



  • Scott’s Pythonscript suggestion is spot-on for what you asked for, but if you’re open to alternatives, take a look at “Zen Coding”. There’s a generic option to ‘wrap with abbreviation’ that will pop up a box and allow you to enter the tag you want to wrap around the highlighted text. Between that and the ability to ‘expand abbreviations’ (table>tbody>tr*3>td*6 will expand to a table with 3 rows and 6 columns), Zen is worth installing. “HTML Tags” allows you to select the tag and/or contents of the tag you’re sitting in, that’s been handy for me too.

    So if you’re looking for more than just tag wrapping, check out those two plugins, they have a lot of other options that you may find useful.



  • I went looking for ZenCoding… I found a version that was from 2010, another that was from Google, a site with a link to a video that went to some celebrity site.

    What version should I look for? Is there an official repository that I should be going to?



  • Emmet (ex-Zen Coding) is a web-developer’s toolkit that can greatly improve your HTML & CSS workflow, see
    https://github.com/emmetio/npp#readme
    , but this plugin is not available for the x64 version of N++.


Log in to reply