rampage644 / sublime-rtags

Sublime Text 3 Rtags plugin. See https://github.com/Andersbakken/rtags
18 stars 6 forks source link

About

Sublime Text 3 C/C++ code completion, navigation plugin. It is based on rtags.

Installation

Make sure you Install rtags:

git clone https://github.com/Andersbakken/rtags
cd rtags
mkdir build && cd build && cmake ..
make install

Via Package Control

Manually

cd <sublime-text-Packages-dir>
git clone https://github.com/rampage644/sublime-rtags

Features

Usage

It is a very unstable plugin. There are a number of limitations:

So, the typical workflow is:

  1. Start rdm
  2. Supply it with JSON compilation codebase via rc -J or several rc -c calls.
  3. Start Sublime Text 3

Default keybindings

Keybindings inspired by Qt Creator.

Customization

Keybindings

Customize 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" },
]

Settings

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"
    }
  ]