Ignore:
Timestamp:
Jun 13, 2012, 5:12:15 PM (13 years ago)
Author:
bird
Message:

kdev.e: one time slickedit config.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VSlickMacros/kdev.e

    r2413 r2583  
    33303330}
    33313331
    3332 
     3332static _str aCLikeIncs[] =
     3333{
     3334    "c", "ansic", "java", "rul", "vera", "ch", "as", "idl", "asm", "s", "imakefile", "rc", "lex", "yacc", "antlr"
     3335};
     3336
     3337static _str aMyLangIds[] =
     3338{
     3339    "ansic",
     3340    "antlr",
     3341    "as",
     3342    "asm",
     3343    "c",
     3344    "csh",
     3345    "css",
     3346    "ch",
     3347    "conf",
     3348    "d",
     3349    "docbook",
     3350    "dtd",
     3351    "html",
     3352    "idl",
     3353    "imakefile",
     3354    "ini",
     3355    "java",
     3356    "js",
     3357    "lex",
     3358    "mak",
     3359    "masm",
     3360    "phpscript",
     3361    "powershell",
     3362    "py",
     3363    "rexx",
     3364    "rc",
     3365    "rul",
     3366    "tcl",
     3367    "s",
     3368    "unixasm",
     3369    "vbs",
     3370    "xhtml",
     3371    "xml",
     3372    "xmldoc",
     3373    "xsd",
     3374    "yacc"
     3375};
     3376
     3377#if __VERSION__ >= 17.0
     3378# require "se/lang/api/LanguageSettings.e"
     3379using se.lang.api.LanguageSettings;
     3380#endif
     3381
     3382/**
     3383 * Loads the standard bird settings.
     3384 */
     3385_command void kdev_load_settings()
     3386{
     3387    typeless nt1;
     3388    typeless nt2;
     3389    typeless nt3;
     3390    typeless nt4;
     3391    typeless nt5;
     3392    typeless nt6;
     3393    typeless i7;
     3394    _str sRest;
     3395    _str sTmp;
     3396
     3397    /*
     3398     * Generl stuff.
     3399     */
     3400    _default_option('A', '0');          /* ALT menu */
     3401    def_alt_menu = 0;
     3402    _default_option('R', '130');        /* Vertical line in column 130. */
     3403    def_mfsearch_init_flags = 2 | 4;    /* MFSEARCH_INIT_CURWORD | MFSEARCH_INIT_SELECTION */
     3404    def_line_insert = 'B';              /* insert before */
     3405    def_file_types='All Files (*),'     /** @todo make this prettier */
     3406                   'C/C++ Files (*.c;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.h;*.hh;*.hpp;*.hxx;*.inl;*.xpm),'
     3407                   'Assembler (*.s;*.asm;*.mac;*.S),'
     3408                   'Makefiles (*;*.mak;*.kmk)'
     3409                   'C# Files (*.cs),'
     3410                   'Ch Files (*.ch;*.chf;*.chs;*.cpp;*.h),'
     3411                   'D Files (*.d),'
     3412                   'Java Files (*.java),'
     3413                   'HTML Files (*.htm;*.html;*.shtml;*.asp;*.jsp;*.php;*.php3;*.rhtml;*.css),'
     3414                   'CFML Files (*.cfm;*.cfml;*.cfc),'
     3415                   'XML Files (*.xml;*.dtd;*.xsd;*.xmldoc;*.xsl;*.xslt;*.ent;*.tld;*.xhtml;*.build;*.plist),'
     3416                   'XML/SGML DTD Files (*.xsd;*.dtd),'
     3417                   'XML/JSP TagLib Files (*.tld;*.xml),'
     3418                   'Objective-C (*.m;*.mm;*.h),'
     3419                   'IDL Files (*.idl),'
     3420                   'Ada Files (*.ada;*.adb;*.ads),'
     3421                   'Applescript Files (*.applescript),'
     3422                   'Basic Files (*.vb;*.vbs;*.bas;*.frm),'
     3423                   'Cobol Files (*.cob;*.cbl;*.ocb),'
     3424                   'JCL Files (*.jcl),'
     3425                   'JavaScript (*.js;*.ds),'
     3426                   'ActionScript (*.as),'
     3427                   'Pascal Files (*.pas;*.dpr),'
     3428                   'Fortran Files (*.for;*.f),'
     3429                   'PL/I Files (*.pl1),'
     3430                   'InstallScript (*.rul),'
     3431                   'Perl Files (*.pl;*.pm;*.perl;*.plx),'
     3432                   'Python Files (*.py),'
     3433                   'Ruby Files (*.rb;*.rby),'
     3434                   'Java Properties (*.properties),'
     3435                   'Lua Files (*.lua),'
     3436                   'Tcl Files (*.tcl;*.tlib;*.itk;*.itcl;*.exp),'
     3437                   'PV-WAVE (*.pro),'
     3438                   'Slick-C (*.e;*.sh),'
     3439                   'SQL Files (*.sql),'
     3440                   'SAS Files (*.sas),'
     3441                   'Text Files (*.txt),'
     3442                   'Verilog Files (*.v),'
     3443                   'VHDL Files (*.vhd),'
     3444                   'SystemVerilog Files (*.sv;*.svh;*.svi),'
     3445                   'Vera Files (*.vr;*.vrh),'
     3446                   'Erlang Files (*.erl;*.hrl),'
     3447                   ;
     3448
     3449    def_updown_col=0;                   /* cursor movement */
     3450    def_cursorwrap=0;                   /* ditto. */
     3451    def_click_past_end=1;               /* ditto */
     3452    def_start_on_first=1;               /* vs A B C; view A. */
     3453    def_vc_system='Subversion'          /* svn is default version control */
     3454#if __VERSION__ >= 16.0
     3455    def_auto_unsurround_block=0;        /* Delete line, not block. */
     3456#endif
     3457
     3458    /* Make it grok:  # include <stuff.h> */
     3459    for (i = 0; i < aCLikeIncs._length(); i++)
     3460        replace_def_data("def-":+aCLikeIncs[i]:+"-include",
     3461                         '^[ \t]*(\#[ \t]*include|include|\#[ \t]*line)[ \t]#({#1:i}[ \t]#|)(<{#0[~>]#}>|"{#0[~"]#}")');
     3462    replace_def_data("def-m-include", '^[ \t]*(\#[ \t]*include|\#[ \t]*import|include|\#[ \t]*line)[ \t]#({#1:i}[ \t]#|)(<{#0[~>]#}>|"{#0[~"]#}")');
     3463    replace_def_data("def-e-include", '^[ \t]*(\#[ \t]*include|\#[ \t]*import|\#[ \t]*require|include)[ \t]#(''{#0[~'']#}''|"{#0[~"]#}")');
     3464
     3465    /* Replace the default unicode proportional font with the fixed oned. */
     3466    _str sCodeFont = _default_font(CFG_SBCS_DBCS_SOURCE_WINDOW);
     3467    _str sUnicodeFont = _default_font(CFG_UNICODE_SOURCE_WINDOW);
     3468    if (pos("Default Unicode", sUnicodeFont) > 0 && length(sCodeFont) > 5)
     3469        _default_font(CFG_UNICODE_SOURCE_WINDOW,sCodeFont);
     3470    if (machine()=='INTELSOLARIS' || machine()=='SPARCSOLARIS')
     3471    {
     3472        _default_font(CFG_MENU,'DejaVu Sans,10,0,0,');
     3473        _default_font(CFG_DIALOG,'DejaVu Sans,10,0,0,');
     3474    }
     3475
     3476    /* Not so important. */
     3477    int fSearch = 0x400400; /* VSSEARCHFLAG_WRAP | VSSEARCHFLAG_PROMPT_WRAP */;
     3478    _default_option('S', (_str)fSearch);
     3479
     3480
     3481#if __VERSION__ >= 17.0
     3482    /*
     3483     * Language settings via API.
     3484     */
     3485    _str sLangId;
     3486    foreach (sLangId in aMyLangIds)
     3487    {
     3488        LanguageSettings.setIndentCaseFromSwitch(sLangId,   true);
     3489        LanguageSettings.setBeginEndStyle(sLangId,          BES_BEGIN_END_STYLE_2);
     3490        LanguageSettings.setIndentWithTabs(sLangId,         false);
     3491        LanguageSettings.setUseAdaptiveFormatting(sLangId,  true);
     3492
     3493        /* C/C++ setup, wrap at column 80 not 64. */
     3494        sTmp = LanguageSettings.getCommentWrapOptions(sLangId);
     3495        if (length(sTmp) > 10)
     3496        {
     3497            typeless ntBlockCommentWrap, ntDocCommentWrap, ntFixedWidth;
     3498            parse sTmp with ntBlockCommentWrap ntDocCommentWrap nt3 nt4 nt5 ntFixedWidth sRest;
     3499            if ((int)ntFixedWidth < 80)
     3500                LanguageSettings.setCommentWrapOptions('c', ntBlockCommentWrap:+' ':+ntDocCommentWrap:+' ':+nt3:+' ':+nt4:+' ':+nt5:+' 80 ':+sRest);
     3501            //replace_def_data("def-comment-wrap-c",'0 1 0 1 1 64 0 0 80 0 80 0 80 0 0 1 '); - default
     3502            //replace_def_data("def-comment-wrap-c",'0 1 0 1 1 80 0 0 80 0 80 0 80 0 0 0 '); - disabled
     3503            //replace_def_data("def-comment-wrap-c",'1 1 0 1 1 80 0 0 80 0 80 0 80 0 0 1 '); - enable block comment wrap.
     3504        }
     3505    }
     3506    LanguageSettings.setIndentWithTabs('mak', true);
     3507
     3508#endif
     3509
     3510    /** @todo
     3511     *  def_save_options
     3512     *   */
     3513
     3514    message("Please restart SlickEdit.")
     3515}
    33333516
    33343517/**
Note: See TracChangeset for help on using the changeset viewer.