vim-clang-format-py


Ⅰ. 插件描述

Ⅱ. 基本信息

创建日期:  2016-10-04
使用用户:  1
Github星:  1
插件作者:  Sebastian Woelke

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'aufgang001/vim-clang-format-py'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'aufgang001/vim-clang-format-py'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'aufgang001/vim-clang-format-py'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/aufgang001/vim-clang-format-py

Ⅳ. 文档说明

## Clang-format.py Wrapper
This plugin wraps the file clang-format.py and can now be used with plugin manager tools like Vundle or vim-plug.

Why not using vim-clang-format or vim-autoformat instead of wrap a python script.
Because both tools wipes the jump list, which makes the usage feel like a torment.

Install

Install this plugin with your favorite plugin-manager or manual with the following commands:


git clone https://github.com/aufgang001/vim-clang-format-py.git  ~/.vim/vim-clang-format-py.git

Requirements

Your vim must support Python 3, which can be checked in vim by the commands

:version
:python3 print("test")

You have to install clang-format. For example with the command:

sudo apt-get install clang-format-3.8

Add the following line to your .vimrc file:

let g:clang_format_path = "clang-format-3.8"

Finally, bind the new command ClangFormat to a key:

noremap <F12> :ClangFormat<CR>

Usage

Mark a block of code or position the cursor to a specific line and enter your previously defined shortcut.

添加新评论