Giter Site home page Giter Site logo

si4.0config's Introduction

SI4.0Config

Configuration for Source Insight 4.0

Set a macro

utils.em is a base macro file for projects. We can add some macro and register a hotkey for it.

For example, let's add a macro CodeBlockComment for setting a block of code as comment automatically. Instructions for use:

Project -> Open Project..., then open base project Users\Documents\Source Insight 4.0\Projects\Base\Base.

Open utils.em file and add the following code at the end of it.

// Set a block of code as comment.
// Add "#if 0" in front of a block of code and add "#endif" after.
macro CodeBlockComment()  
{  
    hwnd=GetCurrentWnd()  
    sel=GetWndSel(hwnd)  
    lnFirst=GetWndSelLnFirst(hwnd)  
    lnLast=GetWndSelLnLast(hwnd)  
    hbuf=GetCurrentBuf()  
   
    if(LnFirst == 0) {  
            szIfStart = ""  
    }else{  
            szIfStart = GetBufLine(hbuf, LnFirst-1)  
    }  
    szIfEnd = GetBufLine(hbuf, lnLast+1)  
    if(szIfStart == "#if 0" && szIfEnd == "#endif") {  
            DelBufLine(hbuf, lnLast+1)  
            DelBufLine(hbuf, lnFirst-1)  
            sel.lnFirst = sel.lnFirst – 1  
            sel.lnLast = sel.lnLast – 1  
    }else{  
            InsBufLine(hbuf, lnFirst, "#if 0")  
            InsBufLine(hbuf, lnLast+2, "#endif")  
            sel.lnFirst = sel.lnFirst + 1  
            sel.lnLast = sel.lnLast + 1  
    }  
   
    SetWndSel( hwnd, sel )  
}

Now we added a macro, then we set a hotkey for it.

Options -> Key Assignments..., input CodeBlockComment in Command, then select Assign New Key... and enter your hotkey, for example, Ctrl + #. At last, select OK.

Now if you open another project, just press Ctrl + # and a block of code you selected will be set as comment.

Configuration

Files in Users\Documents\Source Insight 4.0\Settings are configuration files for Source Insight 4.0.

si4.0config's People

Contributors

heray1990 avatar

Watchers

James Cloos avatar  avatar 张子凡 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.