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!
-
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.