Zen Coding *Fix (2021)

  • Steps: In Notepad++ go to plugins > plugins admin then install zen coding and python scripts. They need to work together for zencoding to function. Restart notepad++ then go back to the plugins menu and click โ€˜open plugins folderโ€™. You should see the newly created ZenCoding-Python folder. Go into that folder then go into the ZenCodingPython folder. Once inside, notice the npp_zen_coding.py file. Now copy the directory it is in. It should be something like this if you use the default settings: ๐˜Š:\๐˜—๐˜ณ๐˜ฐ๐˜จ๐˜ณ๐˜ข๐˜ฎ ๐˜๐˜ช๐˜ญ๐˜ฆ๐˜ด (๐˜น86)\๐˜•๐˜ฐ๐˜ต๐˜ฆ๐˜ฑ๐˜ข๐˜ฅ++\๐˜ฑ๐˜ญ๐˜ถ๐˜จ๐˜ช๐˜ฏ๐˜ด\๐˜ก๐˜ฆ๐˜ฏ๐˜Š๐˜ฐ๐˜ฅ๐˜ช๐˜ฏ๐˜จ-๐˜—๐˜บ๐˜ต๐˜ฉ๐˜ฐ๐˜ฏ\๐˜ก๐˜ฆ๐˜ฏ๐˜Š๐˜ฐ๐˜ฅ๐˜ช๐˜ฏ๐˜จ๐˜—๐˜บ๐˜ต๐˜ฉ๐˜ฐ๐˜ฏ. Now go back to the notepad window and click plugins > python script > show console. Go to the console command line and type sys.path.append(โ€˜๐˜ฑ๐˜ข๐˜ด๐˜ต๐˜ฆ ๐˜ฅ๐˜ช๐˜ณ๐˜ฆ๐˜ค๐˜ต๐˜ฐ๐˜ณ๐˜บ ๐˜ฉ๐˜ฆ๐˜ณ๐˜ฆโ€™) then hit Enter. Finally, type import npp_zen_coding and do not include the .py extension. Thatโ€™s that! You should be able to expand abbreviations now.

    ///A temporary fix///
    npp_zen_coding.py is the file you need to make zen coding work and for some reason, python canโ€™t โ€˜findโ€™ it on its own. So you must add its pathway to get to it from the python console. This seems to be only a temporary fix because when I closed the notepad and reopened it later, zen coding stopped working again. I redid those steps which fixed the issue. Iโ€™m too lazy after a week of trying to get this thing to work to figure out a permanent system path setup. If thatโ€™s even possible. But this is the best solution for now if youโ€™ve tried everything else.

  • ///So I figured out how to permanently add zencoding to the python path which should solve the problem of it altogether! The answer came to me while I was examining the system paths listed when you type sys.path into python console within notepad++. Some of which I recall typing myself and thatโ€™s when it hit me that I could use environment variables to fix my issue.///

    Type โ€˜environment variablesโ€™ into search bar on windows. Click โ€˜edit the system environment variablesโ€™ Look for the environment variables button and click it. Check out the value list side of the system variable section. One of the variable names should have values with the same directories as seen within the python console sys.path list. Navigate to this and click edit. On the menu that comes up click new. Paste your ZenCodingPython directory into this field. Click okay and THAT is it. Go into notepad and now you can use zen coding with no more issues!

  • @Mazi-Sierra

    Thank you for sharing your findings, very much appreciated.

  • You probably can also fix the issue by adding this sys.path.append(โ€˜๐˜ฑ๐˜ข๐˜ด๐˜ต๐˜ฆ ๐˜ฅ๐˜ช๐˜ณ๐˜ฆ๐˜ค๐˜ต๐˜ฐ๐˜ณ๐˜บ ๐˜ฉ๐˜ฆ๐˜ณ๐˜ฆโ€™) to your PythonScript startup script.
    As for the bug though, I think it is related to the plugin itself. So itโ€™s best to find ZenCoding repository and create an issue there.

Log in to reply