我正在尝试将单词与vim-tabular对齐,但它们之间没有分隔符,如逗号或冒号。例如:
int x = 1;
float y = 2;
char z = 3;
我需要用什么表达来对齐这样的文字?
答案 0 :(得分:2)
对齐第一个单词
Margin
如需更多帮助,请参阅:<DataTemplate x:Key="MyDataTemplate2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Slider Grid.Column="0" Name="sliderColumn" VerticalAlignment="Center" HorizontalAlignment="Left" TickPlacement="None"
Minimum="0" Maximum="50" Value="1" Style="{StaticResource SliderStyle}" Width="70" TickFrequency="1" IsSnapToTickEnabled="True"/>
<TextBlock Grid.Column="1" Margin="5,0,0,0" Text="{Binding Path=Value, ElementName=sliderColumn, StringFormat={}x{0}}" FontSize="11" Foreground="black"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
</Grid>
</DataTemplate>
。