UltraEdit中Matlab語法高亮顯示的操作方法

常用UltraEdit編輯Matlab程序,但其中沒有語法高亮顯示,偶然在網上得到一個,做了適當修改,有興趣的可以試試.

需求:
UltraEdit作爲文本編輯器有許多其他編輯器所沒有的功能,現在有一個好的功能—語法着色
最近需要看一點Matlab程序.m文件,需要UltraEdit支持這種文件。

說明:
UltraEdit14.*版本的語法着色已經不是worldfile.txt了,是worldfile.uew。
但是到現在15.*版本,wordfile的形式再次發生改變了,具體的是wordfiles/*.uew。

獲取相應的.uew文件
有兩種方式:
1.從UltraEdit官方網站下載wordfile擴展文件包:ALL WORDFILES IN ONE ,下載地址爲http://www.ultraedit.com/files/wf/wf.zip。
2.Google baidu也可以找到。

配置UltraEdit
1.把獲取到的.uew拷貝到wordfiles/文件夾裏。
2.wordfiles/文件夾有兩個,
第一個在C:\Documents and Settings\你的個人用戶名\Application Data\IDMComp\UltraEdit;

unregistered@yeah的博客注: 我嘗試放到第個UltraEdit安裝目錄下,配置了N次結果還是不行,最後放到第一個目錄纔可以

                                                      Application Data文件夾有可能屬性爲隱藏的。

第二個在UltraEdit安裝目錄下 第二個在UltraEdit安裝目錄下。
UltraEdit默認使用的是第一個。
個人建議放在第二個目錄中,以後重裝系統還可用不用再調整設置了。
然後在UltraEdit裏菜單---高級Advanced---配置Configration---編輯器顯示---語法着色---詞列表的完整路徑。 把目錄名稱改爲.\wordfiles就可以了,這樣以後即使重裝系統也不要再設置了。最後,別忘了“確定”或者“應用”。

   在UltraEdit-32中,我們用 VIEW 菜單下 View as (Highlighting file type) 可選擇高亮顯示 C/C++文件、VB、HTML、PERL、PHP、JAVA、XML等多種文件的關鍵字,爲編程和閱讀帶來方便。但軟件沒有爲我們設置Matlab語言 關鍵字的高亮顯示,十分不便。現在,將以下代碼粘貼到UltraEdit-32目錄下的 WRODFILE文件中,將代碼複製到任意一個你用不到的語言,比如說rudy.uew文檔裏(注意備份哦),即可高亮顯示Matlab語言 關鍵字,喜歡用UltraEdit-32的可以試試:


/L20"MATLAB 6" Nocase Line Comment = % String Chars = ' File Extensions = m M
/Function String = "%[ ^t]++function*=[ ^t]++^([a-z0-9_]+^)"
/Function String 1 = "%[ ^t]++function[ ^t]+^([a-z0-9_]+^)[ ^t]++[~=]"
/Delimiters = ~!@$^&*()-+=|\/{}[]:;"'<> , .?
/C1
break
case catch
else elseif end
for function
global
if
otherwise
persistent
return
switch
try
while
/C2
abs acos acosh add_annotation add_block add_line add_param all and any asin asinh assignin atan atan2 atanh
balance beep bitand bitcmp bitget bitor bitset bitshift bitxor builtin
callstats cat cd ceil cell cell2struct cellhorzcat cells char chdir check_system chol cholinc cholupdate class clc clear clock close_system colon compare_system computer 
conj contourc conv2 copyobj cos cosh cputime ctranspose cumprod cumsum
dbclear dbcont dbdown dbquit dbstack dbstatus dbstep dbstop dbtype dbup delete delete_annotation delete_block delete_line delete_param det diag diary diff disp display 
dongarra dos double dragrect drawnow
echo eig eps eq error errortrap eval evalc evalin exist exit exp expm eye
fclose feature feof ferror feval fft fftn fftw fgets fieldnames fields filesep fill fill3 filter find find_system findpackage findstr findtype finite fix floor fopen 
format fprintf frame2im fread fscanf fschange fseek ftell full func2str functions functionscalled fwrite
ge getenv getframe gs_get_buttonmotion gt
handle handle2struct hardcopy hcreate help hess hittest home horzcat hregister
i ieee ifft ifftn im2frame imag import inf Inf inferiorto inmem input inputname int16 int32 int8 inv isa iscell ischar isempty isequal isfinite isglobal ishandle isieee 
isinf isjava isletter islogical isnan isreal isruntime isspace issparse isstr isstudent
j java javaArray javaMethod javaObject java_array java_method java_object
keyboard
lasterr lastwarn ldivide le length license load log log2 logical loglog lookfor lower lt ltitr lu luinc
magic matlabpath matlabroot max methods mexext mfilename mimofr min minus mislocked mldivide mlock mod more movie mpower mrdivide mtimes munlock
nan NaN nargin nargout ndims ne new_system norm not numel
ones open_system or
pack pause permute pfile pi plot plot3 plus pow2 power prod
qr qrupdate quit qz
rand randn rbbox rcond rdivide real rehash rem reset reshape rmappdata round rtwgen runtime
save save_system schur selectmoveresize semilogx semilogy setappdata setstr sign sim simulink simver sin single sinh size sldebug sort sparse sparsfun sprintf sqrt sscanf 
str2func strcmp strcmpi strfind string strncmp strncmpi strrep struct struct2cell struct2handle subsasgn subsindex subsref sum superiorto svd system system_dependent
tan tanh tic times toc transpose tril triu trmginput type
u_convert_to_gobject  uigetfile uimenufcn uint16 uint32 uint8 uipushtool uiputfile uisetcolor uisetfont uitoggletool uitoolbar uminus unix uplus upper
version vertcat vms
waitfor waitforbuttonpress warning what which who whos
xlate
zeros
/C3
axes
dir
figure findobj
gcbf gcbo gcf gco get get_param gcbh
image
light line
patch pwd
rectangle
set set_param sf surface
text
uicontrol uimenu uicontextmenu
/C4
+
-
=
// /
\
%
&
>
<
^
!
{
}
|

發佈了21 篇原創文章 · 獲贊 3 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章