- Notifications
You must be signed in to change notification settings - Fork3
libclang-vim/vim-textobj-clang
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This vim plugin makes text objects for various C and C++ blocks, function, class, namespace, expression, statement and so on.
If you useneobundle.vim, you can install this plugin easily as below.
NeoBundleLazy'rhysd/libclang-vim', {\'build' : {\'windows' :'echo "Please build manually"',\'mac' :'make',\'unix' :'make',\ }\}NeoBundleLazy'rhysd/vim-textobj-clang', {\'depends' : ['kana/vim-textobj-user','rhysd/libclang-vim'],\'autoload' : {\'mappings' : [['xo','a;'], ['xo','i;']]\ }\}
Operator-pending mappingsi; anda; are available.i; selects the element under cursor.a; selects the most inner definition under cursor.
For example, see below code.
intmain(){return0;}
When the cursor is placed atreturn,i; selectsreturn 0; anda; selects wholemain() function.This is very simple example. Clang can parse more complicated source files like Boost libraries.
Screenshot:
If you setg:textobj_clang_more_mappings to1, many operator-pending mappings are defined. As a default, mappings in a below table are defined. You can control the number of the mappings withg:textobj_clang_mapping_kinds.
| Mapping | Block |
|---|---|
| i;m | select the most inner definition |
| i;c | select class blocks |
| i;f | select function blocks |
| i;e | select an expression |
| i;s | select an statement |
| i;p | select an parameter and a template parameter |
| i;n | select a namespace |
| i;u | select an element under cursor |
| i;a | select expression, statement, function, class or namespace |
The MIT License (MIT)Copyright (c) 2014 rhysdPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.About
A vim text objects for various C and C++ blocks with power of clang.
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Contributors2
Uh oh!
There was an error while loading.Please reload this page.
