Giter Site home page Giter Site logo

vim-rtags-1's Introduction

Vim Rtags

Vim bindings for rtags.

https://github.com/Andersbakken/rtags

Requirements

  1. Vim built with +python.

Installation

Vundle

Add the following line to .vimrc

Plugin 'lyuts/vim-rtags'

then while in vim run:

:source %
:PluginInstall

NeoBundle

Add the following line to .vimrc

NeoBundle 'lyuts/vim-rtags'

then while in vim run:

:source %
:NeoBundleInstall

Pathogen

$ cd ~/.vim/bundle
$ git clone https://github.com/lyuts/vim-rtags

Configuration

This plugin interacts with RTags by invoking rc commands and interpreting their results. You can override the path to rc binary by setting g:rcCmd variable. By default, it is set to rc, expecting it to be found in the $PATH.

Out of box this plugin provides mappings. In order to use custom mappings the default mappings can be disabled:

let g:rtagsUseDefaultMappings = 0

By default, search results are showed in a location list. Location lists are local to the current window. To use the vim QuickFix window, which is shared between all windows, set:

let g:rtagsUseLocationList = 0

Usage

Mappings

Mapping rc flag Description
<Leader>ri -U Symbol info
<Leader>rj -f Follow location
<Leader>rS -f Follow location (open in horizontal split)
<Leader>rV -f Follow location (open in vertical split)
<Leader>rT -f Follow location open in a new tab
<Leader>rp -U --symbol-info-include-parents Jump to parent
<Leader>rf -e -r Find references
<Leader>rn -ae -R Find references by name
<Leader>rs -a -F Find symbols by name
<Leader>rr -V Reindex current file
<Leader>rl -w List all available projects
<Leader>rw -e -r --rename Rename symbol under cursor
<Leader>rv -k -r Find virtuals

Unite sources

This plugin defines three Unite sources:

  • rtags/references - list references (i.e., <Leader>rf).
  • rtags/symbol - find symbol (i.e., <Leader>rs). Use rtags/symbol:i for case insensitibe search.
  • rtags/project - list/switch projects.

Code completion

Code completion functionality uses completefunc (i.e. CTRL-X CTRL-U). If completefunc is set, vim-rtags will not override it with RtagsCompleteFunc. This functionality is still unstable, but if you want to try it you will have to set completefunc by

set completefunc=RtagsCompleteFunc

Notes

  1. This plugin is wip.
  2. Code completion with rtags is not done yet. Completion does not work when invoked right after '.' (dot), '::' (scope resolution operator), therefore requires typing at least one character before invocation.

Development

Unit tests for some plugin functions can be found in tests directory. To run tests, execute:

$ vim tests/test_rtags.vim +UnitTest

vim-rtags-1's People

Contributors

lyuts avatar asenac avatar bbannier avatar leeor avatar joeroback avatar sasq64 avatar pdavydov108 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.