-
Notifications
You must be signed in to change notification settings - Fork 25
Developing with common editors
Everyone has their favorite editor (we will not be re-legislating VI vs. emacs here), and nearly all of them support syntax highlighting and other basic programming functions. However, getting them to do more for you, such as code completion often requires extra configuration and tricks. This document collects some of those tricks. If you work out tricks for other editors, please let us know so we can help others.
-
VIM: We've put in a bit of support to improve code completion in VIM. If you install the "YouCompleteMe" VIM package, code completion should work for you reasonably well, because we've included .ycm_extra_conf files in the src/ and Tools/ directories. However, the files do make some assumptions about libraries and locations of things on your filesystem. If it doesn't seem to be working, take a look at the
flags
variable set right at the top of the two files. It specifies the compile commands used by clang behind the scenes, which you may need to customize. It also helps files opened in the Tools/ directory know about the src/ directory. If you are developing outside the LOOS tree, you should probably copy this file and modify the search path so it can find LOOS. This eventually should be configured via scons. -
Atom: These days, atom is my preferred editor. I've added a bunch of packages to make development easier for me, and some additional support files are present in the LOOS tree to help others.
- autocomplete-clang (requires clang installed on your system)
- autocomplete-python
- build
- build-scons
You can also use linter (with linter-clang and linter-flake8) but I've found them to be a bit too "in your face" for me. The build packages are useful for C++ development, because they let you compile and look for errors without leaving the editor (F9 on my keyboard). If you have linter turned on, you can then click on errors to go to the offending code. You may need to create .clang_complete
in the top-level LOOS directory with the contents
-I.
-I./src
and .atom-build.json
with the following contents (note, the -j8
is optional, telling scons to run 8 processes at once).
{
"cmd": "scons",
"name": "all",
"args": [ "-j8"],
"warningMatch": "(?<file>[\\/0-9a-zA-Z\\._-]+):(?<line>\\d+):(?<col>\\d+).*w
arning:(?<message>.+)",
"errorMatch": "(?<file>[\\/0-9a-zA-Z\\._-]+):(?<line>\\d+):(?<col>\\d+).*error:(?<message>.+)",
"targets": {
"core": {
"cmd": "scons",
"name": "core",
"args": [ "-j8", "core"],
"warningMatch": "(?<file>[\\/0-9a-zA-Z\\._-]+):(?<line>\\d+):(?<col>\\d+).*warning:(?<message>.+)",
"errorMatch": "(?<file>[\\/0-9a-zA-Z\\._-]+):(?<line>\\d+):(?<col>\\d+).*error:(?<message>.+)"
},
"tools": {
"cmd": "scons",
"name": "tools",
"args": [ "-j8", "tools"],
"warningMatch": "(?<file>[\\/0-9a-zA-Z\\._-]+):(?<line>\\d+):(?<col>\\d+).*warning:(?<message>.+)",
"errorMatch": "(?<file>[\\/0-9a-zA-Z\\._-]+):(?<line>\\d+):(?<col>\\d+).*error:(?<message>.+)"
}
}
}