How can I add autocomplete in notepad++ for javascript in an .html file?

31,555

Autocomplete feature is disabled by default,
but a simple Preferences setup will get you using the new auto-complete feature in no time at all. Go to Settings -> Preferences, and switch to the Backup/Auto-competion tab. At the bottom of that screen you’ll see where you can enable auto-completion, and you can optionally turn on the “show function parameters” feature as well. It works for CSS, PHP, Javascript, and html also.

Share:
31,555
Nikhil
Author by

Nikhil

Updated on September 17, 2022

Comments

  • Nikhil
    Nikhil over 1 year

    Notepad++ does auto-complete for html and also for JavaScript. but the auto-completion depends on file extension.html file supports completion for html only. Is there a way to enable auto-completion for javascript in the script tag of an html file? I mean, other than copying the auto-completion keyword list from "javascript.xml" to "html.xml" files...

    As suggested on stackoverflow, asking on superuser, as I could not find a satisfactory answer there. If anyone has any idea, please let me know! (I hope I am not the only one having this kind of an requirement! :))

    • heavyd
      heavyd about 13 years
      What's wrong with copying the auto-completion keyword list from javascript.xml into html.xml? Seems like a pretty simple solution to me.
    • Nikhil
      Nikhil about 13 years
      Agreed, its simple... but the problem in that is the list/suggestions will be displayed everywhere in the page, even in the non-javascript part..! That becomes cumbersome actually.. listing all javascript suggestions in html.. I am expecting it to handle it a bit more intelligently, if possible! :)
    • heavyd
      heavyd about 13 years
      Short of writing your own lexer as suggested in the StackOverflow answer, I doubt there is an easy way to make this happen.
    • Nikhil
      Nikhil about 13 years
      :( ohk.. So I am the only one with this requirement.. :) anyways.. thanks for your help,heavyd.. Not being a dev for windows applications find it difficult to write a lexer for npp, but if I ever do attempt to learn and try, will reply here for sure! :)
  • user3015682
    user3015682 almost 5 years
    With this turned on when I type document. into a script tag it doesn't show me options like document.write or document.getElementById.