IAR默认的编辑器看着眼睛痛, 缺少典型配色方案, 逐个改每个元素太繁琐. 索性直接引用配置好的外置编辑器, 例如sublime text或者notepad++.
官方的做法
参见iar官方的例子:
Introduction
How do I get the external editor to jump to the specific code line of my compilation warning or error?
Solution
Give the correct command line arguments for the external editor you are using.
Example using Notepad++
In IAR Embedded Workbench, open the settings dialog: Tools > Options... > Editor > External Editor
- Tick 'Use External Editor'
- Type: Command Line
- Editor: C:\Program Files (x86)\Notepad++\notepad++.exe
- Arguments: "$FILE_PATH$" -n$CUR_LINE$
Details
For other editors you have to look in the documentation of that editor to see what the specific arguments for your editor should be.
将多个文件在一个窗口中显示
使用外置编辑器后, 外置编辑器不会嵌入到iar的环境中. 每次在项目的文件树中点开文件时, 都是单独激活一个编辑器程序, 每个窗口显示一个文件.
PS: 我目前使用的是sublime text, 后面抽空研究一下如何在sublime界面中增量显示新打开的文件.
感谢一个国外的工程师提供了正确答案, https://stackoverflow.com/questions/30446877/sublime-text-as-an-external-editor-for-iar-ewb, 应该使用正确的参数:
$FILE_PATH$:$CUR_LINE$
最终的做法
调试的时候不能在外置编辑器上设置断点. 最后还是切换回iar自带的编辑器, 然后用sublime text额外打开源代码工程及源文件. 回归最原始的做法.
这真tmd是从入门到放弃的过程.