" Vimball Archiver by Charles E. Campbell, Jr., Ph.D. UseVimball finish syntax/modeasy.vim [[[1 203 " Vim syntax file " ======================================================================== " Language: Modeleasy + " Maintainer: Massimiliano Tripoli " Last Change: gio 27 set 2012, 20:29 " Filenames: *.deck " NOTE: The highlighting of modeleasy functions is defined in the " syntax/modeleasyfunctions.vim and syntax/modeasy.vim " The utilities of plugin are defined in the " plugin/modeleasyutilities.vim " URL: http://www.vim.org/scripts/script.php?script_id=3827 " ======================================================================== " " Some lines of code were borrowed from " Jakson Aquino (r-vimplugin) " " " if exists("g:disable_modeasy_ftplugin") finish endif if exists("b:current_syntax") finish endif setlocal iskeyword=@,48-57,_,. syn case ignore " Comment syn match modeasyComment contains=@Spell "\$.*" syn match modeasyStrError display contained "\\." " string enclosed in double quotes syn region modeasyString contains=modeasySpecial,@Spell start=/"/ skip=/\\\\\|\\"/ end=/"/ " string enclosed in single quotes syn region modeasyString contains=modeasySpecial,@Spell start=/'/ skip=/\\\\\|\\'/ end=/'/ " New line, carriage modeasyreturn, tab, backspace, bell, feed, vertical tab, backslash syn match modeasySpecial display contained "\\\(n\|r\|t\|b\|a\|f\|v\|'\|\"\|s\)\|\\\\" " Hexadecimal and Octal digits syn match modeasySpecial display contained "\\\(x\x\{1,2}\|[0-8]\{1,3}\)" " Unicode characters syn match modeasySpecial display contained "\\u\x\{1,4}" syn match modeasySpecial display contained "\\U\x\{1,8}" syn match modeasySpecial display contained "\\u{\x\{1,4}}" syn match modeasySpecial display contained "\\U{\x\{1,8}}" " Modeasy special options syn keyword modeasyOption add all arrays1d arrays2d auto automatic ave backfill baseout blank bottom ca syn keyword modeasyOption charlits cleanup clear colhead color cumulated datafiles decimals disp display syn keyword modeasyOption drop dynamic everything far forecast fullnewton henceforth impact instrument syn keyword modeasyOption interim interp jacobi linear logarithmic mgs modelfile namelits nave near newton syn keyword modeasyOption nsum num objectives off on only outunit print printnull rationalize rep syn keyword modeasyOption replace rowhead show significance static stock sum suppress system timeseries syn keyword modeasyOption title top trace user width word zero split syn keyword modeasyOption absolute address adf align almon angle autocdef autordef autoscale autotitle autozero syn keyword modeasyOption behavioral betac betak bootstrap borders box browse by bycol byrow syn keyword modeasyOption chow co coeff commas comment compile count covar cumulate syn keyword modeasyOption degrees deviation distlag doline dollars dw elasticities equation syn keyword modeasyOption error factor first fitorig fitted fortpl from full fullline global gls syn keyword modeasyOption het hold hours include instruments syn keyword modeasyOption inunit job junk kclass lagendogenous latex leadendogenous leadingzero left level syn keyword modeasyOption like liml linkule live local maxpoints mccarthy syn keyword modeasyOption message minpoints models module multicol new nobox noheader noleadingzero nomarker nomessage nonum syn keyword modeasyOption noprint norationalize norm normallog nosplit noxlines noylines numbered old oldfullline ols syn keyword modeasyOption onepoint order over parenerr pl printall syn keyword modeasyOption printglobal probability programs protect protected pw syn keyword modeasyOption reciprocal recur recurb rescheck reset resid reside residu residv syn keyword modeasyOption revtex rho right rsq samescale saveseed scaled scalefac separate syn keyword modeasyOption source statistics status stderr stdreg stdrho syn keyword modeasyOption systemread systemwrite target targetinstrument targetobjective test threesls through to syn keyword modeasyOption twosls uniformlog units unprotect unscaled userread userwrite var syn keyword modeasyOption varcov vectorize vendog vexog vname white xback xcenter yback ycenter syn keyword modeasyOption yhatrho yhatsig syn match modeasyBackSpace contained "\s\+" " Match error at beginning of the text syn region modeasyStartError contains=modeasyBackSpace start=/\%^/ end=/\/he=s-7 " Match error in if then block syn region modeasyIfThenError start="then"hs=s+4 contains=modeasyThen,modeasyBackSpace,modeasyComment end="$" oneline " Syntax highlighting until end statement syn region modeasyEndProgram start="\"hs=s+3 contains=modeasyEnd end="\%$" " Statement syn keyword modeasyStatement break syn keyword modeasyRepeat for in repeat while do next endloop endfor endwhile syn keyword modeasyPause pause syn keyword modeasyConditional if else endif where goto as syn match modeasyunitHeader display"\" syn match modeasyunitHeader display "\" syn match modeasyunitHeader display "\" syn match modeasyunitHeader display "\" syn match modeasyunitHeader display "\" syn match modeasyThen display contained "\" syn match modeasyEnd display contained "\" " Constant syn keyword modeasyConstant pi piover2 piover180 180overpi sqrtpi log10e lnofsqrtof2 " integer syn match modeasyInteger "\<\d\+L" syn match modeasyInteger "\<0x\([0-9]\|[a-f]\|[A-F]\)\+L" syn match modeasyInteger "\<\d\+[Ee]+\=\d\+L" " number with no fractional part or exponent syn match modeasyNumber "\<\d\+\>" " hexadecimal number syn match modeasyNumber "\<0x\([0-9]\|[a-f]\|[A-F]\)\+" " floating point number with integer and fractional parts and optional exponent syn match modeasyFloat "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\=" " floating point number with no integer part and optional exponent syn match modeasyFloat "\<\.\d\+\([Ee][-+]\=\d\+\)\=" " floating point number with no fractional part and optional exponent syn match modeasyFloat "\<\d\+[Ee][-+]\=\d\+" " Complex number syn match modeasyComplex "\<\d\+i" syn match modeasyComplex "\<\d\++\d\+i" syn match modeasyComplex "\<0x\([0-9]\|[a-f]\|[A-F]\)\+i" syn match modeasyComplex "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\=i" syn match modeasyComplex "\<\.\d\+\([Ee][-+]\=\d\+\)\=i" syn match modeasyComplex "\<\d\+[Ee][-+]\=\d\+i" " Operators syn match modeasyOperator '-' syn match modeasyOperator '*\{1,2}' syn match modeasyOperator '+' syn match modeasyOperator '=' syn match modeasyOperator '=>' syn match modeasyOperator "[|!<>^~`/@]" " Boolean syn match modeasyBoolean display contained '\.\(true\|false\)\.' syn match modeasyBoolean display contained '\.\(and\|or\|not\)\.' syn match modeasyBoolean display contained '\.\(ge\|et\|eq\|le\|gt\|ne\|lt\)\.' " Delimiter syn match modeasyDelimiter "[,;:&]" syn match modeasyDelimiter "[,;:&]" contained " Error syn region modeasyRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,modeasyError,modeasyBraceError,modeasyCurlyError syn region modeasyRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,modeasyError,modeasyBraceError,modeasyParenError syn region modeasyRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,modeasyError,modeasyCurlyError,modeasyParenError syn match modeasyError "[)\]}]" syn match modeasyBraceError "[)}]" contained syn match modeasyCurlyError "[)\]]" contained syn match modeasyParenError "[\]}]" contained syn match modeasyOperatorError "*\{3,}" syn match modeasyOperatorError "+\{2,}" syn match modeasyOperatorError "-\{2,}" syn match modeasyOperatorError "/\{3,}" syn match modeasyError "[\]}]" contained syn match modeasyOperatorError "\$\{2,}" " source list of Modeleasy + functions. runtime syntax/modeleasyfunctions.vim " Name of object with spaces syn region modeasyNameWSpace start="`" end="`" " Define the default highlighting. hi def link modeasyBoolean Boolean hi def link modeasyBraceError Error hi def link modeasyComment Comment hi def link modeasyComplex Number hi def link modeasyConditional Conditional hi def link modeasyConstant Constant hi def link modeasyCurlyError Error hi def link modeasyFloat Float hi def link modeasyFunction Function hi def link modeasyunitHeader PreProc hi def link modeasyInteger Number hi def link modeasyNameWSpace Normal hi def link modeasyNumber Number hi def link modeasyOperator Operator hi def link modeasyParenError Error hi def link modeasyRepeat Repeat hi def link modeasySpecial SpecialChar hi def link modeasyStatement Statement hi def link modeasyString String hi def link modeasyStrError Error hi def link modeasyPause Todo hi def link modeasyOperatorError Error hi def link modeasyStartError Error hi def link modeasyDelimiter Delimiter hi def link modeasyBackSpace Normal hi def link modeasyIfThenError Error hi def link modeasyThen Conditional hi def link modeasyEndProgram Normal hi def link modeasyEnd PreProc hi def link modeasyStart PreProc hi def link modeasyOption SpecialChar let b:current_syntax="modeasy.vim" doc/modeasy.txt [[[1 249 modeleasy-plugin.txt* *modeleasy-plugin* Modeleasy-Vim-plugin~ Plugin to work with Modeleasy~ Author: Massimiliano Tripoli Version: 1.2 For Vim version 7.3 1. Overview |modeleasy-plugin-overview| 2. Installation |modeleasy-plugin-installation| 3. Map |modeleasy-plugin-map| 4. Test |modeleasy-plugin-test| ====================================================================================================================== *modeleasy-plugin-overview* 1. Overview~ This plugin provides syntax highlighting for Modeleasy + improving Vim's support for editing Modeleasy + code in both normal and visual mode. The plugin (since 1.2v) also provides a own indent script that works by adding the correct option on vimrc file (see later). This plugin uses some codes lines borrowed from Jakson A. Aquino (vim-rplugin). Modeleasy + is an econometric modelling package available for different operating systems. Form more information visit http://www.modeleasy.com/. The plugin includes: * Syntax highlighting for - Special characters support; - Key Statement functions; - Modeleasy + functions. * Key map to comment and uncomment lines. * Indentation (since 1.2v) * Some others utilities such as insert a pause useful to debug a program or convert character from lower case to upper case and viceversa. Please submit bug reports and feature requests to Massimiliano Tripoli . ====================================================================================================================== *modeleasy-plugin-installation* 2. Installation~ Download and install the last vim (gvim) release and copy the Vimball archive "modeleasy-vim-plugin-*.vba" in a temporary directory. Open the file with vim and do: > :so % :q < Create a vimrc file if you don't have one yet and add the following lines: > set number set nocompatible syntax enable filetype plugin on filetype indent on < Open vim and do: > :helptags ~/.vim/doc < It builds the tags file for this plugin (and others ones that eventually are in the same directory). Start to open a '.deck' file or create a new one to check if the plugin work properly. ====================================================================================================================== *modeleasy-plugin-map* 3. Map~ If you want the Italian Menu add this line to your vimrc file: > let g:modeasy_lang_it = 1 < This plugin has some very basic functions such as comment (uncomment) lines or insert a pause but if you want to disable them add this following line to your vimrc file: > let map_modeasy = 0 < If you want to use key map to comment/uncomment type lines both in visual or normal mode or use simply the menu button. To insert a tail comment, go to the line to comment and type . To insert a pause in your program type , the plugin will insert at the beginning of the current line " " pause;~ with a prompt in insert mode to insert whatever label as string. To switch from lower to upper case and viceversa you can use / . There is an help map of modeleasy functions that works simply by using the a key map. Put the cursor at the beginning of the word for which you need some help and type . To work properly it must set the correct help modeleasy directory and your current file browser by adding two global variables to your .vimrc file. The browser variable must be set only for *nix operating system. For example if your browser is firefox and your operating system is linux you should have the following two lines in your vimrc file: > let g:modeasy_dir_help = "path to help directory" let g:browser = "firefox" < Otherwise if your operating system is Win32 you must only set the g:modeasy_dir_help. Note: Pay attention using a double backslash "\\" as path separator. If you want to disable modeleasy-vim plugin you should add the following > let disable_modeasy_ftplugin = 0 < to your vimrc file. ====================================================================================================================== *modeleasy-plugin-test* 4. Test~ If you want to test the modeleasy-vim-plugin create a file test.deck or test.dec and copy and paste the following lines: > program $ Program to test Modeleasy vim plugin $ Author : Massimiliano Tripoli $ $ ***********************************************************; $ Test conditions x = 2 if (x .eq. 2) then type("x = 2") test2(a, b, c, d, ans) ab = a * b if ( c .ne. 0 ) then abc = ab/c ans = abc * d else if goto = label1 endif U+0000 $ Special char "\s" str = "String Character" library ( mylib "/home/user/speakez/mylib") $ Try to comment by in visual mode the 3 following lines: first line to comment second line to comment third line to comment $ Try to comment by in normal mode the following line: comment at the bottom $ Try to insert a pause by in normal mode after this line: $ This is wrong 10 *** 5 $ This is correct 10 * 5 $ ******************************************************************************************************* cd("/home/user/speakez") $ These are some modeleasy functions: keepdif x :replace norows(x) assign(18,"x.txt") write(18,fmt:x) end < ====================================================================================================================== ftdetect/modeasy.vim [[[1 25 " Modeleasy autodetect files *.deck or *.dec " ========================================================================= " Language: Modeleasy + " Maintainer: Massimiliano Tripoli " Last Change: mar 24 apr 2012, 22:05 " ========================================================================= if exists("g:disable_modeasy_ftplugin") finish endif function Checkfiledeck() if getline(1) !~ '^\(program\>\|subroutine\>\|model\>\|data\>\)\|^\s\+\(program\>\|subroutine\>\|model\>\|data\>\)' echo "WARNING no PROGRAM statement found" endif " if v:lang =~ 'it_IT' " let g:modeasy_lang = 'IT' " endif runtime plugin/modeleasyutilities.vim endfunction autocmd BufNewFile,BufRead *.deck,*.dec set ft=modeasy autocmd BufRead *.deck,*.dec call Checkfiledeck() syntax/modeleasyfunctions.vim [[[1 194 " Modeleasy list of functions " ==================================================================== " Language: Modeleasy (linux) " Maintainer: Massimiliano Tripoli " Last Change: sab 26 nov 2011, 10:07 " ==================================================================== syn keyword modeasyFunction a1toa8 a3d2d a8toa1 addconto addfillc addscale addtopanel aggrcols syn keyword modeasyFunction a2d a2dts abs accuracy acos acot addbox addcontour syn keyword modeasyFunction addcurve addfillcurve addgraph addraw3d adgraphe adjoint afam alpharanker syn keyword modeasyFunction aggrrows aggrts alpharan and append arrays1 arrays2 asciicha syn keyword modeasyFunction angles annotate annual annvar answer arg argument array syn keyword modeasyFunction annul argname array2d ascii asciichar asforz asin ask syn keyword modeasyFunction askchar asklist askname assign asymmat atan atan2 atomicbe syn keyword modeasyFunction atomicnu autoexec autoprin autotab axisword backspac barchart barlegen syn keyword modeasyFunction atomicnum autocor autocov autoexecute autokept autoprint average backspace syn keyword modeasyFunction b34s b34scomm b34sio backfill bimean bound brange breaker syn keyword modeasyFunction bargraph barlegend base baseout bell bessel besseli besselk syn keyword modeasyFunction beginfil beginfill binomran borderch buildgra c2d cards72 syn keyword modeasyFunction besseln binned binomrandom borderchar boxin calendar cd ceiling syn keyword modeasyFunction breakkey buildmod cat catcols catenate catrows cdvhelp charrepl syn keyword modeasyFunction cards80 change characte charsize checkpoint chiprobi chirando chisquar syn keyword modeasyFunction center character chiprob chiprobinverse chirandom chisquared cincgamma class syn keyword modeasyFunction checkmod checkpoi choldeco chowpar chrepl clipboar clpostsc coeffsen syn keyword modeasyFunction cincgamm cleardat cleardata clearexc colors combinat computer comsatgr syn keyword modeasyFunction clear clearexcept clebsch closelib cofactor colarray colindex colmat syn keyword modeasyFunction collatin conj conjugat converge convlive cov covarian cpostscr syn keyword modeasyFunction colmax colmin color colwidth combinations complex conjugate constrain syn keyword modeasyFunction constrai continue contourp contribu conversi copy correlat coulombp syn keyword modeasyFunction contour contourplot correl correlation cos cosh cot coulomb syn keyword modeasyFunction coulombphase covariance cross crosshair crosshatch crosstabulate cuberoot cummax syn keyword modeasyFunction cpusecon crosscor crosshai crosshat crosstab cumprodc cumprodr cumsumco syn keyword modeasyFunction cummin cumprod cumprodcols cumprodrows cumsum cumsumcols cumsumrows cursor syn keyword modeasyFunction cumsumro data datatype dataword dates dayofmon dayofwee debuggin syn keyword modeasyFunction curve date datebase dateform daynumber dayofweek decimal definecolor syn keyword modeasyFunction dawson dayno daynum daynumbe dec del delay delta syn keyword modeasyFunction decimals decompos decompose define definea1 definea2 defineco defineke syn keyword modeasyFunction definekey defineword deletewindow deqbbf deqgaf deql1am deql1s deql2bfd syn keyword modeasyFunction definepanel definewi definewindow definewo definobj delete deleteitem deletepanel syn keyword modeasyFunction deletewi deltap denton deq2solv deqsolve devicecl deviceop syn keyword modeasyFunction deql2iam deql2is derivative determinant deviceclose deviceopen deviceput diagels syn keyword modeasyFunction deriv derivati det determ determin diffe1ic diffe2bc diffe2ic syn keyword modeasyFunction devicepu devices dir diffequa discrand displaypanel dividete dividetest dodos syn keyword modeasyFunction diagmat discrandom document doublefactorial dounix down draw3d syn keyword modeasyFunction disaggr distfreq dmat domain dowin drop edate editdate syn keyword modeasyFunction dontlist doublefa echo edit editmode editor eigenval eigenvec syn keyword modeasyFunction dump eigenvalues eigenvectors elimcols elimels eliminat elimrows ellipe syn keyword modeasyFunction elastici elimcol elimel elimrow errdistr estimate export extract syn keyword modeasyFunction elementa endautop endfill endgraph erase errortra syn keyword modeasyFunction ellipk endpunch endread endwrite eone epsilon erf erfc syn keyword modeasyFunction errortrap excesser execute executio exit exportal exportall exportli syn keyword modeasyFunction examine example excess excesserror exp extrema factorial fft syn keyword modeasyFunction exportlist eyepos factoria false fameclos famefin fft2dinv syn keyword modeasyFunction family fftinv fftinver fillform fillvars fisher fit fitnames syn keyword modeasyFunction fft2d fft2dinverse fftcos fftcosq fftcosqinv fftinverse fftsimp fftsimpinv syn keyword modeasyFunction fftcosqi fftpack fftsimpi fftsinqi fftsinqinv fileclos fillcurv fillpatt syn keyword modeasyFunction fftsin fftsinq figure3d fileclose fillcurve findword firstline fix syn keyword modeasyFunction financia find finish firstlin fitting fixprog fmt syn keyword modeasyFunction fixkey fixword floor fortfun fortpl1 fortsub fprob fprobinverse syn keyword modeasyFunction footnote frac frbday frbweek fsedit gather geninv genschur syn keyword modeasyFunction fortio fprobinv fractopo framefig freekeys futureva gammaran gaussinv syn keyword modeasyFunction fracpart fractopoly framefigure frandom free freeif freekey freeword syn keyword modeasyFunction freqdist ftcoscub ftsincub function fname futurevalue gamma gammarandom syn keyword modeasyFunction gauss gaussinverse geigen get getdeck getlist gmfac gminv syn keyword modeasyFunction getdif getfame getpanel getsca graph98 graphcol syn keyword modeasyFunction getmult getrando getseed ghostscr graphics graphs graphz groupdev syn keyword modeasyFunction gmsolv graph graphe graphlocation graphstatus grid hankelmatrix hatch syn keyword modeasyFunction graphdev grapheas graphica graphinf graphing graphini graphinp graphloc syn keyword modeasyFunction graphmis graphres graphspe graphsta graphtex graphwin h_label syn keyword modeasyFunction groupope gs gsdebug head hexin highwide hiwide hmat syn keyword modeasyFunction hatcher help henceforth hermite hermmat hexof hidewindow hideword syn keyword modeasyFunction henderso henderson hidewind hierarch histoleg history hlabel howboerr syn keyword modeasyFunction histo histolegend hmfac hminv hmsolv howboerror howbound hypgeorandom syn keyword modeasyFunction h_maxsiz h_positi h_scale h_size hankelma hardcopy heading hencefor syn keyword modeasyFunction hscale hsize hypgeora ifthen ifthenel implicit importal importall syn keyword modeasyFunction htabula imag imagtest import index inner innerpro syn keyword modeasyFunction ieqabf imagpart incgamma indexer innerproduct inputcol insertcols insertels syn keyword modeasyFunction importli importlist indexnum indexnumbers informat inout inplacen inplacename syn keyword modeasyFunction inputs insert insertco insertel insertro instantr instantread integrat syn keyword modeasyFunction insertrows int2 int4 integers integral interpolate intersection intpart syn keyword modeasyFunction integ interest interp interpcu interpfr interpla interpol intrpcub syn keyword modeasyFunction interpli interplinear intersec intrando intwords iowords jones syn keyword modeasyFunction intrandom intrpcubic intrpfra intrpfrac intrplagrange inverse join3d keep syn keyword modeasyFunction intrplag ints invar invar1 invar2 irr iterlimi iterlive syn keyword modeasyFunction itoa itoascii join journal keepall keepdef keepdefi keepdefs syn keyword modeasyFunction keepdeck keepdefinitions kept keptdeck keptdefinitions keptlist keyword kind syn keyword modeasyFunction keepdif keeppanel keylist keyopera kolmogor label laserjet le syn keyword modeasyFunction keeping keeplist keepmult keptall keptdef keptdefi keptdefs keptdif syn keyword modeasyFunction keys keywords klass kron lagvar lghostsc lgs lgsdebug syn keyword modeasyFunction kolmogorov kurtosis l2norm laguerre leftjustify legend legendline libindex syn keyword modeasyFunction leftjust legendli lib libnames librarie libraryn lin linecode syn keyword modeasyFunction library linedocument linehelp linehistogram lineplot lines linesize linewidth syn keyword modeasyFunction libraryo linkstat lj250 ln lngamma loc locmatch locsmval syn keyword modeasyFunction linedocu lineedit linehist linequat linewidt linkules linkwrit linpack syn keyword modeasyFunction listfonts load loaddata locmax locmin locmvals locs log syn keyword modeasyFunction list listfont listprog litchara litconve literals litnames litwords syn keyword modeasyFunction loadpanel locinter locintersect locrows logging logic longname loop syn keyword modeasyFunction log10 loggamma lowertriangular lowerwindow lpassign lpassnag lpmax lpmaxnag syn keyword modeasyFunction logical lookfile lowercas lpostscr mad makeb34s mat max syn keyword modeasyFunction lowercase lowertri lowerwin lp lptransp mykeep syn keyword modeasyFunction lpmin lpminnag lptranag lptransportation lsqpol machine makebandmatrix makedate syn keyword modeasyFunction makeband makeglob makeloca makesca mannwhit manual math matrices syn keyword modeasyFunction makeform makeglobal makelocal makename mannwhitney margins marker matrank syn keyword modeasyFunction matrixde matrixop menuinf merge minfdf minimize minjaf minloc syn keyword modeasyFunction matrix maximum maxof maxofcol maxofrow meanabsdeviation median meld syn keyword modeasyFunction maxiter maxobs_ maxrange mdlhelp mean meanabsd menusamp min syn keyword modeasyFunction meldname member merge3d mfam minimum minof minofcol minofrow syn keyword modeasyFunction minor mode modeprint modulo month months moshinsky movingaverage syn keyword modeasyFunction miscella modeprin modes more moshinsk move movingav syn keyword modeasyFunction missingv missvalu mod modeleas modeling monthly mplhelp multcall syn keyword modeasyFunction multcopy multfft multipli multmatr myhelp names neumann newlpass syn keyword modeasyFunction multihatch multiregression mvdelete mvreplace namelist namelit niceaddgraph nicegraph syn keyword modeasyFunction multihat multireg multrena multrename mvreplac mydocs mydriver myexam syn keyword modeasyFunction myfort myfuncs mykept mylinks newgraph newolsq newpage syn keyword modeasyFunction newlpmax newlpmin newlptra nicegrap noblank nocolors nopad nozeros syn keyword modeasyFunction news niceaddg noecho nonblank nonblanks nonparam noration syn keyword modeasyFunction ninej nocols nodims noels normal normrandom noroots norows syn keyword modeasyFunction normrand noshow not notabs nullline nullpoin nullset numbers syn keyword modeasyFunction nscheck numcolor numperio numprd optimize optmode ordered orderer syn keyword modeasyFunction numeric object onerror openwrite oscillator outerproduct paint3d painter syn keyword modeasyFunction numperiod objectna objects oldtek olsq omitclas onedimfu openread syn keyword modeasyFunction openwrit oprlist optimiza or oscillat outputs overlay pi syn keyword modeasyFunction outer outerpro outputop pack paintjet paramete pdllag pleg syn keyword modeasyFunction paintfig panelmsg panelname partiala permutat physics pieexplo syn keyword modeasyFunction paintfigure parameter partialauto pdfac pdfacdd pdfacud pdinv pdsolv syn keyword modeasyFunction percent periods permutations phase piechart pieexplode pl1fort plegendre syn keyword modeasyFunction plegendr portable postscri printer printf printfil printinf psfit syn keyword modeasyFunction plotcoe plottext poissran presentv printcla printerg printgra printnul syn keyword modeasyFunction plot poissrandom polyroot polyval presentvalue print printfile printinfinity syn keyword modeasyFunction printnull printsize printspecs probit prod prodcols prodrows prompt syn keyword modeasyFunction printsiz printspe procedur products progname syn keyword modeasyFunction protecti pseudoin psfootno psfootnote pskeepde pskeepdeck publicat putfame syn keyword modeasyFunction protect protection pseudoinverse punch qlegendre qrfac qrsolv racah syn keyword modeasyFunction psjoint pslandsc pstabula pstitler pwd qleg qlegendr qpmin syn keyword modeasyFunction quarterl quarterly quit raisewin randomnu ratechan ratechange rational syn keyword modeasyFunction raisewindow random range ranked ranker rationalize read readdata syn keyword modeasyFunction randomor real regopt regressi ren renorm renum renumber syn keyword modeasyFunction real4 real8 realpart reclass reflect reflectcols reflectrows refyear syn keyword modeasyFunction reedit reflectc reflectr regoptio reqpanel reserved restrict resume syn keyword modeasyFunction relcomp remove rename reportio request resetkey restart retry syn keyword modeasyFunction repeat replica_ restore rref runb34s scanf scatter seed_ syn keyword modeasyFunction retab rightjus rollrigh round roundeps run saving scalars syn keyword modeasyFunction rightjustify rms rolldown rollleft rollright rollup roman roots syn keyword modeasyFunction rotatex rotatey rotatez rounded roundepsilon roundoff rowarray rowindex syn keyword modeasyFunction rowmat rowmax rowmin scanfile seasondiff seats select selectadd syn keyword modeasyFunction schur screenma seasondi selectad selectwi semiannu semiannual sendasci syn keyword modeasyFunction seg sendterm setgauss setinfin setinver setlegen setrando setseed syn keyword modeasyFunction selectwindow sendascii set setarglfree setarglsize setchar setcolor setfont syn keyword modeasyFunction setarglf setargls sethermi setinvar setjacob setlague setmissi setolsq syn keyword modeasyFunction sethermite setjacobi setlaguerre setlegendre setnull setrange settitle settypeline syn keyword modeasyFunction setpanel setrandom sets settypel setwindo setxlabe setxscal setylabe syn keyword modeasyFunction setwindow setxaxis setxlabel setxscale setyaxis setylabel setyscale shiftdown syn keyword modeasyFunction setyscal shift shiftdow shiftlef shiftrig showgrap showlink showspac syn keyword modeasyFunction shiftleft shiftright shiftup showkey showmval showwindow showword sign syn keyword modeasyFunction shillag shock show showall showkeys simeq simequat simopt syn keyword modeasyFunction showwind sigma signific simoptio singleva sminv sort spaceleft syn keyword modeasyFunction significance sin sinh sixj size skewness slide3d slosh syn keyword modeasyFunction simulate smat smfac smsolv solmetho spacefre spacelef spacenow syn keyword modeasyFunction smooth space sphbes sphbesn sqrt stacked stackedbar standdeviation syn keyword modeasyFunction spacepea spacepeak special spread stackedb staging standdev standerr syn keyword modeasyFunction sscanf sscanfil statefor stochsim strucfor sumlist suppleme support syn keyword modeasyFunction standerror step straightline stringwidth sname subset sum syn keyword modeasyFunction start state statisti straight stringwi strippro structur syn keyword modeasyFunction substrin substring sumofdig sumprod sums sumsqcol sumsqrow symbols syn keyword modeasyFunction sumcols sumofdigits sumrows sumsq sumsqcols sumsqrows svd symmat syn keyword modeasyFunction svdcm tabula take tension terminal testopt textput thelp syn keyword modeasyFunction system tabit tabkey tailorin tek4510 tekwords testopti textheig syn keyword modeasyFunction tabs tabulate tan tanh text textheight textin textout syn keyword modeasyFunction textread textwidth threej ticks tile timeseries tindept toeplitz syn keyword modeasyFunction textwidt tilecolo time tolowerc toupperc tprobinv tracepat tracepath syn keyword modeasyFunction threedgr tics timegrid timeseri titler toclipbo totalint totint syn keyword modeasyFunction tolowercase totalintegral touppercase tprob tprobinverse trace tramo trandom syn keyword modeasyFunction tput transp truncate tseries tsfreq tsjoint tsmeld tsredef syn keyword modeasyFunction trafac transfam transpos tregress true tsadd tsaddgra tscomman syn keyword modeasyFunction transpose trelate trfac trinv trsolv tsa2d tsaddgraph tsamppop syn keyword modeasyFunction tscopy tsdadd tsdates tsdiff tsdisplay tsdiv tsgraph tsgraphz syn keyword modeasyFunction tsdispla tsoperat tsprints tsprojec tsrange tsretitl tstabula tswindow syn keyword modeasyFunction tsindex tsinform tsjoin tslag tslead tslocs tsmult tspow syn keyword modeasyFunction tsprintspecs tsproject tsredefine tsretitle tssource tstabulate tstitle tsunits syn keyword modeasyFunction tsredefi tswhere umat unpack uppercas usemembe varclas varnames syn keyword modeasyFunction tutorial twodimfu unique2d unix unprotec uppercase uppertri useraxis syn keyword modeasyFunction type typeline union unique unitmat unload unmodulo unprotect syn keyword modeasyFunction up uppertriangular use variable variance vbarchart vbarlegend vector syn keyword modeasyFunction usergrou users v_label v_maxsiz v_positi v_scale v_size vbarchar syn keyword modeasyFunction vbarlege vectorde vectorop vectors vlabel vocabula vscale vsize syn keyword modeasyFunction vec vectorsi verif wait weight wherever whoa whoops syn keyword modeasyFunction verify version vi vstackedbar whatis where wilcoxon write syn keyword modeasyFunction vstacked whatproc widthtes widthtest window windowna windownames workspac syn keyword modeasyFunction win32 words xedit xwindows yeartot yharmoni ylm zeros syn keyword modeasyFunction x11arima x11arobj x11aropt x11artab xlocatio year ylocatio syn keyword modeasyFunction xlocation yharmonic ylocation zerol zerou zscorecols zscorerows a1d syn keyword modeasyFunction z_scale zeroloc zeronbf zscale zscoreco zscorero allupper amat plugin/modeleasyutilities.vim [[[1 157 " Vim Utilities function file " ==================================================================== " Language: Modeleasy + " Maintainer: Massimiliano Tripoli " Last Change: lun 19 nov 2012, 20:38 " The following functions and key mappings allow for writing " modeleasy programs inside Vim. " ==================================================================== " " CONFIGURATION " if you don't want the key map " add your vimrc file: " " let map_modeasy = 0 " if exists("g:disable_modeasy_ftplugin") finish endif if exists("s:utilities_modeasy") finish endif if &ft != "modeasy" finish endif if !exists("g:modeasy_lang_it") if v:lc_time =~ 'it_IT' let g:modeasy_lang_it = 1 endif endif if !exists("g:map_modeasy") || g:map_modeasy == 1 noremap :call CommentLines() noremap A $ noremap :call Pause() i noremap U noremap u noremap :call HelpModeleasy() endif " Function to comment (uncomment) lines function CommentLines() range let nrow = line(".") let ncol = col(".") for line_number in range(a:firstline, a:lastline) let line = getline(line_number) " Comment lines if line !~ '\$' let replline = substitute(line, '^', "$ ", "") call setline(line_number, replline) call cursor(nrow,ncol-1) else " Uncomment lines let replline = substitute(line, '\$\s\|\$', "", "g") call setline(line_number, replline) call cursor(nrow,ncol-1) endif endfor endfunction " Insert a pause function Pause() let line_current = getline(".") let newline = substitute(line_current,"^","\" \" pause; ","") call setline(".", newline) call cursor(".",1) endfunction " Start Modeleasy help function HelpModeleasy() if !exists("g:modeasy_dir_help") echo "ERROR set g:modeasy_dir_help before in vimrc file (see documentation)" return endif let a:fileword = tolower(expand(":h")) let a:filehelp = g:modeasy_dir_help . strpart(a:fileword, 0 , 8) . ".html" if filereadable(a:filehelp) if has("win32") exec "!" . "start explorer " . a:filehelp else if !exists("g:browser") " echo "Error set g:browser on vimrc before (see documentation)" call confirm("please set g:browser on vimrc before (see documentation)", 'OK') return endif exec "!" . g:browser . " " . a:filehelp endif else echo "ERROR no help file found" endif endfunction " Menu if (has("gui_running")) if !exists("g:map_modeasy") || g:map_modeasy == 1 " English Menu (Default) if (!exists("g:modeasy_lang_it") ) || (g:modeasy_lang_it == 0 ) :amenu Modeleasy+.Help.Plugin :help modeleasy-plugin :amenu Modeleasy+.Help.Function\ Modeleasy\ :call HelpModeleasy() :nmenu Modeleasy+.Edit.Comment/\ Uncomment\ lines\ :call CommentLines() :vmenu Modeleasy+.Edit.Comment/\ Uncomment\ lines\ :call CommentLines() :nmenu Modeleasy+.Edit.Tail/\ comment\ A $ :amenu Modeleasy+.Edit.Insert\ Pause\ :call Pause() i :vmenu Modeleasy+.Edit.Upper/\ to\ lower\ case\ u :vmenu Modeleasy+.Edit.Lower/\ to\ Upper\ case\ U endif " Italian Menu if ( exists("g:modeasy_lang_it")) && ( g:modeasy_lang_it == 1 ) :amenu Modeleasy+.Help.Plugin :help modeleasy-plugin :amenu Modeleasy+.Help.Funzione\ Modeleasy\ :call HelpModeleasy() :nmenu Modeleasy+.Edit.Commentare/\ Decommmentare\ linee\ :call CommentLines() :vmenu Modeleasy+.Edit.Commentare/\ Decommentare\ linee\ :call CommentLines() :nmenu Modeleasy+.Edit.Commentare/\ alla\ fine\ della\ linea\ A $ :amenu Modeleasy+.Edit.Inserisci\ Pausa\ :call Pause() i :vmenu Modeleasy+.Edit.Da\ Maiuscolo/\ a\ minuscolo\ u :vmenu Modeleasy+.Edit.Da\ Minuscolo\ a\ maiuscolo\ U endif endif endif " Execute this script only once let s:utilities_modeasy = 1 indent/modeasy.vim [[[1 72 " Modeleasy indent file " ==================================================================== " Language: Modeleasy + " Maintainer: Massimiliano Tripoli " Last Change: lun 19 nov 2012, 22:03 " URL: http://www.vim.org/scripts/script.php?script_id=3827 " " Some lines of code were borrowed from Ajit J. Thakkar ; " Only load this indent file when no other was loaded. if exists("b:did_modeasy_indent") finish endif let b:did_modeasy_indent = 1 setlocal indentkeys+==~end,=~if,=~else,=~then,=~next setlocal indentkeys+=~for,=~endloop,=~endfor,=~endif,=~endwhile,=~do,=~while,=~enddo setlocal indentexpr=GetModeasyIndent() " Only define the function once. if exists("*GetModeasyIndent") finish endif function! s:PrevNonCommentlnum( line_number ) let nline = a:line_number while nline > 0 let nline = prevnonblank(nline-1) " Skip lines starting with a comment if getline(nline) !~? '^\s*\$' break endif endwhile return nline endfunction function! GetModeasyIndent() let plnum = s:PrevNonCommentlnum( v:lnum ) let indp = indent( plnum ) let cline = getline(v:lnum) let pline = getline(plnum) " Strip tail comment let plinenew = substitute(pline, '\$.*$', '', '') if plinenew =~? '^\s*\(for\|do\|while\)\s*\a*\s*\(=\|in\)\s*\d*' let indp = indp + &sw endif if cline =~? '^\s*\(endif\|endloop\|endfor\|endwhile\|enddo\|next\)\s*\a*' let indp = indp - &sw endif "Add a shiftwidth to statements following if, else if plinenew =~? '^\s*else\s*\>' || plinenew =~? '^\s*if\s*\a*' let indp = indp + &sw " Remove unwanted indent after logical and arithmetic ifs if plinenew =~? '\' && plinenew !~? '\' let indp = indp - &sw endif endif "Subtract a shiftwidth from else if cline =~? '^\s*else\s*\>' let indp = indp - &sw endif return indp endfunction