Sublime Text 3 C/C++ code completion, navigation plugin. It is based on rtags.
Make sure you Install rtags
:
git clone https://github.com/Andersbakken/rtags
cd rtags
mkdir build && cd build && cmake ..
make install
cd <sublime-text-Packages-dir>
git clone https://github.com/rampage644/sublime-rtags
It is a very unstable plugin. There are a number of limitations:
rdm
daemon manually. Better run it before Sublime starts, because plugin creates persistent connection to daemonrdm
's project management yet. So it's your responsibility to setup project, pass compilation commands (with rc --compile gcc main.c
or rc -J
). For more info see LLVM codebase, rtags README, Bear project.So, the typical workflow is:
rdm
rc -J
or several rc -c
calls.Keybindings inspired by Qt Creator
.
F2
Ctrl+Shift+u
Ctrl+Shift+x
Ctrl+Shift+i
Alt+/
explicitly for auto-completionCustomize your own keybindings via "Preferences - Package Settings - SublimeRtags - Key Bindings - User"
[
{"keys": ["ctrl+shift+u"], "command": "rtags_location", "args": {"switches": ["--absolute-path", "-r"]} },
{"keys": ["ctrl+shift+x"], "command": "rtags_location", "args": {"switches": ["--absolute-path", "-k", "-r"]} },
{"keys": ["ctrl+shift+i"], "command": "rtags_symbol_info", "args": {"switches": ["--absolute-path", "--symbol-info"]} },
{"keys": ["f2"], "command": "rtags_location", "args": {"switches": ["--absolute-path", "-f"]} },
{"keys": ["ctrl+shift+b"], "command": "rtags_go_backward" },
]
Customize settings via "Preferences - Package Settings - SublimeRtags - Settings - User"
{
/* Path to rc utility if not found in $PATH */
"rc_path": "/home/ramp/mnt/git/rtags/build/bin/rc",
/* Seconds for rc utility communication timeout default */
"rc_timeout": 0.5,
/* Path to rdm daemon if not found in $PATH */
"rdm_path": "",
/* Max number of jump steps */
"jump_limit": 10,
/* Supported source file types */
"file_types": ["source.c", "source.c++", "source.c++.11"],
}
If you need auto-completion to trigger upon .
, ->
or ::
add following to "Preferences - Settings - User"
"auto_complete_triggers":
[
{
"characters": ".>:",
"selector": "text, source, meta, string, punctuation, constant"
}
]