当涉及java泛型时,如何使Align.vim \ adec正常工作?

时间:2010-06-27 16:48:36

标签: java generics vim alignment

Align插件非常棒,但是在处理泛型泛型时遇到问题:

HashMap<String, Object> session = new HashMap();
ArrayList<String> names = new ArrayList();
String banana = "Yo banana boy";
int count = 0;

在\ adec之后变为:

HashMap<String, Object> session = new HashMap();
ArrayList<String> names                         = new ArrayList();
String banana                                   = "Yo banana boy";
int count                                       = 0;

但我真的在期待:

HashMap<String, Object> session = new HashMap();
ArrayList<String>       names   = new ArrayList();
String                  banana  = "Yo banana boy";
int                     count   = 0;

甚至更好:

HashMap   <String, Object> session = new HashMap();
ArrayList <String>         names   = new ArrayList();
String                     banana  = "Yo banana boy";
int                        count   = 0;

如何让Align.vim按照描述行事?

1 个答案:

答案 0 :(得分:1)

看起来这是Align.vim中的一个错误。我能得到的最接近的是:

:Align < =
:Align =

但是,公平地说,vim.org上的Align.vim页面说它是用于对齐C声明。 http://www.vim.org/scripts/script.php?script_id=294