Using Notepad++ with Visual foxpro as real editor.

Published on by Yousfi Benameur

in preview post have show how to make notepad++ working in tandem with visual foxpro as completely external application.
this tutorial show how to customize notepad++ to work as a part of vfp environment.
Assuming that free notepad++ is downloaded and installed.
to add visual foxpro language highlighter to notepad++ for editing prg based text files (modi file), this is  the method:

1-Read this page :
choose visual foxpro in the list and open the xml-download this file :
can save it as :userdefinelang_visualfoxpro.xml
this xml is defined for prg files exclusively.

modify the line
 <UserLang name="Visual FoxPro" ext="prg" udlVersion="2.1">
 <UserLang name="Visual FoxPro" ext="prg mpr h log mem txt xml " udlVersion="2.1">
to highlight other files opened with 'modi file' than prg.
can also make this line as (add txt based files you want to highlight):
 <UserLang name="Visual FoxPro" ext="prg mpr h log mem txt xml htm html" udlVersion="2.1">
All these steps  can be shorted by downloading the userDefineLang.xml file below .see the procedure to install.
this file appears after installation in [ addbs(getenv("appdata"))+"Notepad++"]

in my system its the directory :C:\Users\yousfi\AppData\Roaming\Notepad++
re start notepad++and go to the see automatically visual it.
and voila,its all.
if you open any file (edited traditionaly with visual foxpro editor with modify comm or modify file) with notepad++, its edited and appears as vfp syntax colored.
Independently of vfp,if you choose in explorer any file as described above and click on "open with notepad++" its rendered with vfp highlight syntax.

Note: can install vfp user defined language with the procedure  at the begining chapter below .its the best way because formatting can deform the xml file in this page.

Main files concerned by "modify command" or  "modify file" statement are :
prg, mpr,h, can add in xml file (first line): txt,html,htm,xml and so on.
you can configure notepad++ as described in previous article (main menu---parameters---preferences and set for ex: single instance (default),show menu or no,show toolbar or no,show tabs or no (if no only one file is viewed), convenience).

All this is working with notepad++ as external tool and preserving the native vfp editor.

but what if you want to make notepad++ as visual foxpro  default editor ?
this is described in next chapter2.

2-Using notepad++ as default visual foxpro editor
to make notepad++ as vfp default editor simply create (or modify if exists) a file config.fpw in your vfp install directory:

modi comm   "c:\program files\microsoft visual foxpro 9\config.fpw"
and copy this line (change folder if the case)

TEDIT =/N C:\PROGRAM FILES\Notepad++\notepad++.exe

and save.
of course the xml file must be copied in C:\Users\yousfi\AppData\Roaming\Notepad++ to make notepad++ read configuration in this file.

restart vfp.exe and modi comm any prg ,txt,html,htm,h,mpr...all text based files configured are rendered as vfp syntax highlighter XML.

TEDIT [/N] editor
Specifies the name of the text editor used when you edit program files with MODIFY COMMAND or MODIFY FILE.
Include the optional clause /N with TEDIT to specify a Windows text edit.
Default: Visual FoxPro editor

Note 1 :the config.fpw is always executed at vfp start..
to specify a configuration file, use a command line such as:
C:\Program Files\Microsoft Visual FoxPro 9.exe -CC:\ "somePath\config.FPW"
run as administator to avoid problems.

also can make any based text editor in config.fpw to transform it on vfp editor (text based as above).ex:pspad,notepad,...
additionnaly can set themes (there is too themes) in notepad++ main work well as vfp editor set the default theme only (stylers.xml).

problems i encoutered:
-assuming you have configured syntax highlighter for files prg,mpr,h,txt,h,mem,htm,html,xml,log
if you issue "modi file (getfile('prg|mpr|h|mem|txt|htm|html|xml|log') the notepad++ fires and works correctly
but if you add other statement as noedit or nomodify....these dont work because  there is no command to dig in notepad++ but if you quit notepad++ and there is modifications it asks to save changes....
-for ex.Indent is in the notepad++ menu/edition/indent (applied to a selection)----increase indent(TAB); decrease indent (Shift+tab)
-all vfp/menu/format is not supported but its builtin notepad++
-the vfp editor is more fast loaded (because light) but notepad++ have many points of interest.
-of cource notepad++ as editor is avaiable only for text based files.
it have no longer for form (scx) or class (vcx) ,menus(mnx) or reports(frx).these stay edited with visual foxpro default editor.
-vfp9.exe must work as administrator privelege (as my test confirm).maybe i am wrong or forget some thing!I guess because its my vfp install stays in "program files" declared readonly by preveleges elevations.

-can restore defaut vfp editor with simply cutting the line above TEDIT..." or deleting the config.fpw if it contains this single setting.

-Native scctext.prg Contains routines for creating text representations of .SCX, .VCX,.MNX, .FRX, and .LBX files for the purpose of supporting merge capabilities in source control systems.

Click on code to select [then copy] -click outside to deselect

this is the best procedure to install vfp user defined language in notepad++

1-download in the link below the userDefineLang.xml.
save this xml file on your disc.

2-open Notepad++-----menu---language----define your language----a form appears
  click on the button "import" , point to your saved xml in dialog box.
  a message "import successfull" appears.
3-restart notepad++---menu---langage: you see visual foxpro at the on
thats all.

4-try to open a prg file you see the syntax highlighted as defined in the xml file.

below is the xml file but it can be deformed with formatting page.its very sensitive.

 Using Notepad++ with Visual foxpro as real editor.
 Using Notepad++ with Visual foxpro as real editor.
 Using Notepad++ with Visual foxpro as real editor.
 Using Notepad++ with Visual foxpro as real editor.
*Important:*the code above is tested on visual foxpro 9 sp2-under windows 10 pro and Notepad++ v6.9
Please come back with any bug.correct code is usefull to all readers.

To be informed of the latest articles, subscribe:

Comment on this post

Ivan 05/23/2017 16:23

Niiice, thank you ! was a bit tired of foxpro IDE...

Do you know any way to modify classes files .VCT/.VCX with another editor ?

Yousfi Benameur 05/23/2017 16:42

read the introduction of my post.Notepad++ editor works only with text based files (prg|mpr|h|mem|txt|htm|html|xml|log)
infortunatly modify class uses only the native vfp editor.(a class have memo field because its a normal table).

ddifx 04/15/2016 09:58

clicking on your article for selecting text, highlights entire piece, and forced to copy total text, can't select just part of it, what to do if i just want to select and copy a few word, sentence, url ... it's annoying sir ... thx

Yousfi Benameur 04/15/2016 11:36

Click on leftmouse and select what you want from the section and maintain the mousedown button pressed, then
issue 'CTRL+C" and free get the just text wanted in clipboard (not all section).

kukur 03/03/2016 19:05