Project

General

Profile

Gedit » History » Revision 2

Revision 1 (iri, 09/24/2012 09:03 PM) → Revision 2/3 (iri, 09/24/2012 09:09 PM)

h1. Gedit 

 "Gedit":http://projects.gnome.org/gedit/ is the official text editor of the GNOME desktop environment. Other systems like MS Windows are also supported. 

 h2. The syntax highlighting 

 * Download this archive : "language-specs.tar.gz":http://www.irizone.net//dl/gtksv/language-specs.tar.gz 
 The following files are supported : **.scol* and **.scm* (launcher), **.pkg* (package), **.dmc* (SCS), **.dms* (file descriptor for DMS application), **m3d* (legacy 3d Scol engine). The new 3d descriptor files are already supported by Gedit (xml). 
 * To install them on GNU/Linux, extract the archive : @tar -zxvf language-specs.tar.gz@ 
 * To install them on MS Windows, extract the archive 
 * Copy all files in /usr/share/gtksourceview-2.0/language-specs (GNU/Linux): 
 <pre> 
 cd repertoire/language-specs 
 mv *.lang /usr/share/gtksourceview-2.0/language-specs 
 </pre> 
 or _gtksourceview-3.0_ if you use Gnome3. 
 If you want to install to one user only : 
 <pre> 
 cd repertoire/language-specs 
 mv *.lang .local/share/gtksourceview-3.0/language-specs 
 </pre> 
 * Copy all files in \%AppInstall%\share\gtksourceview-2.0\language-specs (MS Windows) 
 where _\%AppInstall%\_ is the install directory of Gedit, by default 'C:\Program Files\gedit\'. 
 * Copy all files in -\gtksourceview-2.0\language-specs (MacOSX) 

 h2. Scol reference 

 The ScolReference is a plugin. It adds an item of the _Help_ menu to access easily to the official reference of the Scol language. This plugin is under GNU GPL2.0 license. 

 To install it,  

 # download the archive "scolreference.tar.gz":http://www.irizone.net//dl/gnome/gedit/scolreference.tar.gz 
 # extract _scolreference.gedit-plugin_ and _scolreference.py_ files 
 # on GNU/Linux, copy them in 
 @/usr/share/gedit-2/plugins/@ 
 or, for one user only, in 
 @/home/login_user/.gnome2/gedit/plugins/@ 
 # on MS Windows, copy them in 
 @%INSTALL_PATH%/lib/gedit-2/plugins/@ 
 where _\%AppInstall%\_ is the install directory of Gedit, by default 'C:\Program Files\gedit\'. Gedit 2.29 or + is required on MS Windows. 
 # Launch Gedit. Go to _Edition_ menu and choose _Preferences_. 
 # Select the _Addons_ tab. Check "Scol Language Reference 1.00". Note : you can change the default url by clicking on the _Configuration_ button. Save your choice. 

 h2. Scol completion 

 The code completion is provided by this plugin. If you want, it can give you the full typing of the Scol functions. It is under GNU GPL 2 license. 

 To install it : 

 # Download the "scolcompletion.tar.gz":http://www.irizone.net//dl/gnome/gedit/scolcompletion.tar.gz file 
 # Extract the archive 
 # on GNU/Linux, copy _scolcompletion.py_ and _scolcompletion.gedit-plugin_ files in 
 @/usr/share/gedit-2/plugins/@ 
 or, for one user only, in 
 @/home/login_user/.gnome2/gedit/plugins/@ 
 # on MS Windows, copy _scolcompletion.py_ and _scolcompletion.gedit-plugin_ files in 
 @%INSTALL_PATH%/lib/gedit-2/plugins/@ 
 where _\%AppInstall%\_ is the install directory of Gedit, by default 'C:\Program Files\gedit\'. Gedit 2.29 or + is required on MS Windows. 
 # Copy the _scolcompletion_ folder in the same directory (on GNU/Linux) or in %INSTALL_PATH%/share/gedit-2/plugins/ on MS Windows. 
 # Launch Gedit. Go to _Edition_ menu and choose _Preferences_. 
 # Select the _Addons_ tab. Check "Scol Completion 1.00". Note : you can change the default url by clicking on the _Configuration_ button. Save your choice. 

 h2. Help Scol function 

 This plugin opens automatically the help page of the selected function (selection from your source file) 
 By exemple, select any Scol function like __ADDlist_ or __CRwindow_ and press simultaneously on CTRL and F11. The help page will open in your web browser. 
 This plugin does *not* work on MS Windows. 

 In /home/your_login/.gnome2/gedit/tools directoy, create the file _help-scol-function_ (it must be executable) 
 Edit it and add this : 
 <pre> 
 #!/bin/bash 
 # [Gedit Tool] 
 # Comment=Opens the help page of any Scol function in your browser 
 # Name=Help Scol Function 
 # Shortcut=F11 
 # Applicability=all 
 # Output=output-panel 
 # Input=selection 

 # Copyright (C) 2010 Stéphane Bisaro, aka iri  
 # More informations available on : http:/www.irizone.net 

 BASEURL='http://www.scolring.org/files/doc_html/' 
 SUFFIXE='.html' 
 read fun 
 xdg-open ${BASEURL}$(echo $fun | tr 'A-Z' 'a-z')${SUFFIXE} 
 </pre> 

 You can change the shortcut if you want. Relaunch Gedit, if any. 

 h2. Scol script launcher 

 Scol Script Launcher allows you to launch a launcher (.scol) from Gedit. 
 It opens a Scol VM, loads and runs the application. Press on CTRL+F12 to launch. This plugin does *not* work on MS Windows. 

 In the /home/votre_login/.gnome2/gedit/tools directory, create a file named _scol-script-launcher_ (it must be executable). 
 Edit it and add thes lines : 

 <pre> 
 #!/bin/bash 
 # [Gedit Tool] 
 # Comment=Run Scol script 
 # Name=Scol Script Launcher 
 # Shortcut=<Control>F12 
 # Applicability=local 
 # Output=output-panel 
 # Input=document 

 # Copyright (C) 2010 Stéphane Bisaro, aka iri <iri AT irizone.net> 
 # More informations available on : http://solutions.irizone.net 

 SUFFIXE='scol' 
 CMDPATH=$HOME'/scol' 
 BOOL=0 

 for uri in $GEDIT_DOCUMENTS_URI 
 do 
	 bname=$(basename $uri) 
	 ext=${bname##*.} 
	 # name=${bname%.*} 
	 if [ $ext = $SUFFIXE ] 
	 then 
		 BOOL=1 
		 pscol=${uri#*partition/} 
		 cmd=${CMDPATH}${pscol} 
		 $cmd 
	 fi 	
 done 	

 if [ $BOOL = 0 ] 
 then 
	 echo 'no scol script found' 
	 exit 1 
 fi 
 exit 0 
 </pre> 

 !http://www.irizone.net/img/app_gedit_lang_screen2.png!