Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A vim text objects for various C and C++ blocks with power of clang.

NotificationsYou must be signed in to change notification settings

libclang-vim/vim-textobj-clang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 

Repository files navigation

This vim plugin makes text objects for various C and C++ blocks, function, class, namespace, expression, statement and so on.

Dependencies

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;']]\  }\}

Simple operator-pending mappingsi; anda;

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:

screenshot

More complicated operator-pending mappings

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.

MappingBlock
i;mselect the most inner definition
i;cselect class blocks
i;fselect function blocks
i;eselect an expression
i;sselect an statement
i;pselect an parameter and a template parameter
i;nselect a namespace
i;uselect an element under cursor
i;aselect expression, statement, function, class or namespace

License

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp