uncrustify


Ⅰ. 插件描述

Vim plugin for uncrustify

Ⅱ. 基本信息

创建日期:  2018-05-04
使用用户:  2
Github星:  3
插件作者:  Markus Braun

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'embear/uncrustify-the-heights'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'embear/uncrustify-the-heights'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'embear/uncrustify-the-heights'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/embear/vim-uncrustify

Ⅳ. 文档说明

# Uncrustify

This plugin provides functions and commands to ease the use of uncrustify
within Vim.

The plugin can be found on [Bitbucket], [GitHub] and [VIM online].

Commands

The Uncrustify command

Run uncrustify to format the current buffer.

Functions

The Uncrustify function

Run uncrustify to format the current buffer. This function can be used to add
an autocommand that formats the code automatically on write.

autocmd BufWritePre <buffer> if (&filetype == 'cpp') | call Uncrustify() | endif

Settings

The g:uncrustify_command setting

Command that will be run.

  • Default: "uncrustify" ]

If the buffer local variable b:uncrustify_command is set this value will be
used instead of the global value.

The g:uncrustify_config_file setting

Configuration that will be used to run uncrustify.

  • Default: "~/.uncrustify.cfg" ]

If the buffer local variable b:uncrustify_config_file is set this value will
be used instead of the global value.

The g:uncrustify_language_mapping setting

Dictionary that contains the mapping from Vim buffer file type to uncrustify
language.

  • Default: { "c": "c", "cpp": "cpp", "objc": "oc", "objcpp": "oc+", "cs": "cs", "java": "java" }

If the buffer local variable b:uncrustify_language_mapping is set this value
will be used instead of the global value.

The g:uncrustify_debug setting

Debug level for this script.

  • Default: 0

Contribute

To contact the author (Markus Braun), please send an email to <markus.braun@krawel.de>

If you think this plugin could be improved, fork on [Bitbucket] or [GitHub] and
send a pull request or just tell me your ideas.

Credits

  • Alexander Shukaev for his post on stack overflow about uncrustify and Vim

Changelog

v0.0.1 : 2018-05-15

  • initial release.

添加新评论