s into Source Insight

Source Insight can integrate different kinds of source control tool into it, this document only describe how to integrate ClearCase as an example.

Step 1:

OptionsCustom Commands…

Step 2:

Select ‘Check Out’ command and edit new command “cleardlg /checkout %f” in the ‘Run’ field:

Figure 1 - Configure the Check Out Command

Step 3:

If you want to use the source control icon in the tool bar, you can select it as following:

ViewToolbarsSource Control

Figure 2 - Show Source Control Toolbar

The following toolbar will be added to the GUI:

Figure 3 – The Source Control Toolbar

Select ‘Check In’ command and edit new command “cleardlg /checkin %f” in the ‘Run’ field:

Figure 4 - Configure the Check In Command

Select ‘Undo Check Out’ command and edit new command “cleardlg /uncheckout %f” in the ‘Run’ field:

Figure 5 - Configure the Undo Check Out Command

Select ‘Sync File to Source Control Project’ command and edit new command “clearviewupdate -pname %r” in the ‘Run’ field:

Figure 6 - Sync File to Source Control Project

Select ‘Sync to Source Control Project’ command and edit new command “clearviewupdate -pname %j” in the ‘Run’ field:

Figure 7 - Sync to Source Control Project

There is no ‘Version Tree’ command in the default custom commands. We need to add it manually.

Step 1:

OptionsCustom Commands…→Add

Step 2:

Edit new command name ‘Version Tree’ in the field:

Figure 8 - Add New Custom Command

Step 3:

Select ‘Version Tree’ command and edit new command “clearvtree %f” in the ‘Run’ field:

- Configure the Version Tree Command

Step 4:

If you want run the new command in the ‘Work’ menu, please click the ‘Menu…’ button in the dialog of Figure 9, or do it as following:

OptionsMenu Assignments

Step 5:

1. Select ‘Custom Cmd: Version Tree’ in the ‘Command’ field

2. Select ‘Work’ in the ‘Menu’ field

3. Click ‘Insert’ button (need click the ‘Menu Contents’ field first)

4. Use ‘Up’ or ‘Down’ to set the menu’s position

- Configure the Work Menu

outs

Figure 11 - Configure the Find Checkout Command

Previous Version

Figure 12 - Configure the Compare Command

Figure 13 - Configure the ClearCase Explorer Command

Figure 14 - Configure the History Command

Figure 15 - Configure the Properties of Version Command

Figure 16 - Configure the Properties of Element Command

Suggestion:

All the commands should be inserted into the ‘Work’ menu by using the step4 and step5 methods introduced by section 1.6, and then you can use them conveniently. After configure the menu, you will get a work menu like following:

Figure 17- Work Menu

For more information about ClearCase’s cleardlg, you can run command “cleardlg /?” in DOS prompt:

Figure 18 - More Information about cleardlg

The following table shows all the custom commands, just for copy and paste.

Table 1 Custom Commands

 

Command

Run

1

Clear Case Explorer

clearexplorer

2

Find Checkouts

clearfindco

3

Check Out

cleardlg /checkout %f

4

Check In

cleardlg /checkin %f

5

Undo Check Out

cleardlg /uncheckout %f

6

History

clearhistory %f

7

Version Tree

clearvtree %f

8

Compare with Previous Version

cleardlg /diffpred %f

9

Properties of Version

cleardescribe %f

10

Properties of Element

cleardescribe %f@@

11*

Sync File to Source Control Project

clearviewupdate -pname %r

12*

Sync to Source Control Project

clearviewupdate -pname %j

* is for snapshot view only

The default tool used to compare files in ClearCase is cleardiffmrg.exe, if you want to use some other software to do the same job, here is how to configure it:

Step 1:

Open file: “C:/Program Files/Rational/ClearCase/lib/mgrs/map”

Step 2:

Find the line:

text_file_delta xcompare ../../bin/cleardiffmrg.exe

And edit the tool’s path like following:

text_file_delta xcompare C:/Software/r-Beyond.Compare/BC2.exe

Note:

C:/Software/r-Beyond.Compare/BC2.exe is my compare tool’s path, and you should set the correct path of yourself.

Shift + F8

Ctrl + o

Esc to close the dialog box

Ctrl + /

Ctrl + m

F5

F9

F10

OptionsDocument Options

Figure 19 - Document Options Setting

In the Coding Style for ECDS [2], indentation should be made with spaces rather than with tab characters. Source Insight could expand tab to spaces automatically by selecting ‘Expand tabs’ and setting ‘Tab width’ like following:

Figure 20 - Document Options Setting

In the Coding Style for ECDS [2], it is recommended that line length should no longer than 79 characters. Source Insight could show the margin by selecting ‘Show right margin’ and setting ‘Margin width’ like following:

Figure 21 - Document Options Setting

OptionsPreferences

Figure 22 - Preferences Setting

OptionsDocument Options…→Auto Indent

It is suggested that select ‘Smart’ in the ‘Auto Indent Type’ field, and do not select the ‘Indent Open Brace’ and ‘Indent Close Brace’ options in the ‘Smart Indent Options’ field.

Figure 23 - Auto Indenting

Like the VBA for Word or Excel, Source Insight provides a C-like macro language, which is useful for scripting commands, inserting specially formatted text, and automating editing operations.

This document only introduces a simple way of how to edit the macro file and run macros by shortcut key.

and utils.em file

The Base project is automatically created when the first time you run Source Insight. And the Base project is a good place to add your favorite Source Insight editor macro files.

The default file in the Base project is utils.em, open the file and add following codes to it. The function is open the corresponding .cpp or .h file of current file.

   1: // Open the corresponding .cpp or .h file
   2: macro OpenCorrespondingCppOrHFile()
   3: {
   4:     hCurrentBuf = GetCurrentBuf ()
   5:     bname = GetBufName (hCurrentBuf)
   6:     len = strlen (bname)
   7:     
   8:     if (".cpp" == strmid (bname, len-4, len))
   9:     {
  10:         filename = strmid (bname, 0, len-4)#".h"
  11:     }
  12:     else if (".h" == strmid (bname, len-2, len))
  13:     {
  14:         filename = strmid (bname, 0, len-2)#".cpp"
  15:     }
  16:     else
  17:     {
  18:         filename = Nil
  19:     }
  20:     if (filename != Nil)
  21:     {
  22:         hbufnext = OpenBuf (filename)
  23:         if (hbufnext != hNil)
  24:         {
  25:             SetCurrentBuf (hbufnext)
  26:         }
  27:     }
  28: }

OptionsKey Assignments

Choose the “Macro: OpenCorrespondingCppOrHFile” in the Command field and press “Assign New Key…” button. I suggest assigning “Alt + ~” to this macro.

After these setting, you can open another project and test the “Alt + ~” shortcut key then.

Figure 24 - Assign Keystrokes to macro

[1] Source Insight Help

Effective Source Insight相关推荐

  1. Source Insight 基本使用(1)-使用Source Insight查看Android Framework 源码

    一.下载framework源码: google已经把framework源码托管在了gitHub上:  https://github.com/android/platform_frameworks_ba ...

  2. Source Insight 经典教程

    Source Insight实质上是一个支持多种开发语言(java,c ,c 等等)的编辑器,只不过由于其查找.定位.彩色显示等功能的强大,常被我们当成源代码阅读工具使用. 作为一个开放源代码的操作系 ...

  3. Source Insight 有用设置配置

    转:http://blog.csdn.net/goldfighter/article/details/7847168 目录 source insight代码对齐Tab键终极版 source insig ...

  4. Source Insight技巧收集

    Source Insight技巧收集 1.背景色选择     要改变背景色Options->preference->windows background->color设置背景色 2. ...

  5. source insight 里编辑的时候,每次粘贴后,光标停留在粘贴内容的左面

    在source insight 里编辑的时候,每次粘贴后,光标停留在粘贴内容的左面. 我想把它设定为 粘贴后,光标移动倒粘贴内容的右面. 该怎么做? 这是个设置问题,按照下面的步骤设定就可以了. Op ...

  6. Source Insight乱码的解决方案,SI不支持UTF-8字符编码乱码

    最近使用source insight查看一些开源代码,显示中文就乱码,据说是因为source insight不支持utf-8编码,默认编码方式为ANSI码.所以需要将utf-8等非ANSI码的文件转换 ...

  7. Source Insight 3.X 标签插件v1.0发布

    Source Insight可以说是一款程序员必备的开发/阅读源码工具,美中不足的是SI没有标签栏,多个源码之间切换很不方便,于是我就乘闲暇之余写了该作品sihook:标签插件;不过严格意义上来说si ...

  8. 介绍linux下Source Insight强大代码编辑器sublime_text_3

    Centos6.4下安装Sublime Text 3 背景 1 一. 运行环境 1 二.安装环境配置 1 三.创建快捷方式 1 四.配置全局环境 2 五.操作界面 3 背景 在windows操作系统系 ...

  9. source insight快捷键及使用技巧

    2019独角兽企业重金招聘Python工程师标准>>> 原文转自http://lucjn.blog.163.com/blog/static/925911520091116843548 ...

最新文章

  1. 【错误记录】Android Studio 运行报错 ( There is not enough memory to perform the requested operation. )
  2. JZOJ 5183. 【NOIP2017提高组模拟6.29】小T的钢琴
  3. 【Python】简约而不简单|值得收藏的Numpy小抄表(含主要语法、代码)
  4. sqlserver的触发器练习实例
  5. C++STL的map/ multimap容器
  6. linux mysql操作知识--收藏
  7. js高级 — ES6
  8. 02.并发编程(2)Thread类源码分析
  9. 用户与系统(unix)
  10. YOLOv3的批量图片检测以及批量输出(windows下)
  11. Android Tombstone/Crash的log分析和定位(墓碑文件)
  12. 如何配置线上生产服务器环境(密匙登录、防火墙 、Node、Nginx、MongoDB、Redis、Mysql、PHP、JDK、Tomcat等)
  13. Win7 文件加密存储操作后,如何在事后备份证书、秘钥
  14. DateTime.ToString()的用法
  15. php文件更名,php如何批量给文件改名
  16. 【MMDetection 源码解读之yolov3】Neck - FPN
  17. 2021.03.27_网易云登录params、encSecKey参数详解
  18. HTTP - get/post请求详解与本质区别总结
  19. 保持健康和活力 - 腰间盘突出康复指南
  20. requireJs笔记

热门文章

  1. i5 1035g1和r5 3550h对比 哪个好
  2. 疯跑结束,在线英语赛道拐点已至
  3. Markdown第一次使用笔记
  4. 收藏ORACLE ERP实施公司
  5. PS7 修改替换手写签字
  6. 51单片机 点阵显示器显示设计 点阵控制器 16*16点阵 广告牌 proteus 仿真
  7. SQL Server 变更数据捕获(CDC)vs 更改跟踪(Chang Tracking)
  8. 各大IT公司的起名缘由
  9. 程序员版的“鱿鱼游戏”趣图来了!
  10. MyBatis-映射文件06-多表联合查询