mirror of
https://github.com/junegunn/vim-easy-align.git
synced 2025-11-18 06:43:40 -05:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9f593fdf8 | ||
|
|
d87ea32cfe | ||
|
|
11a6b03e7e | ||
|
|
ba54df53ca | ||
|
|
d041e17bba | ||
|
|
2ab86911cb |
13
.travis.yml
Normal file
13
.travis.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
language: vim
|
||||
|
||||
before_script: |
|
||||
git clone https://github.com/junegunn/vader.vim.git
|
||||
|
||||
script: |
|
||||
vim -Nu <(cat << VIMRC
|
||||
filetype off
|
||||
set rtp+=vader.vim
|
||||
set rtp+=.
|
||||
set rtp+=after
|
||||
filetype plugin indent on
|
||||
VIMRC) -c 'Vader! test/*' > /dev/null
|
||||
@@ -83,12 +83,7 @@ try these commands:
|
||||
Notice that the commands are repeatable with `.` key if you have installed
|
||||
[repeat.vim](https://github.com/tpope/vim-repeat). Install
|
||||
[visualrepeat](https://github.com/vim-scripts/visualrepeat) as well if you want
|
||||
to repeat in visual mode. Or you can add the following mapping to your .vimrc.
|
||||
|
||||
```vim
|
||||
" Repeat alignment in visual mode with . key
|
||||
vmap . <Plug>(EasyAlignRepeat)
|
||||
```
|
||||
to repeat in visual mode.
|
||||
|
||||
Usage
|
||||
-----
|
||||
@@ -630,8 +625,6 @@ daisy = 4
|
||||
eggplant = 5
|
||||
```
|
||||
|
||||
Notice that `idt` is fuzzy-matched to `indentation`.
|
||||
|
||||
In interactive mode, you can change the option value with `CTRL-I` key.
|
||||
|
||||
### Alignments over multiple occurrences of delimiters
|
||||
|
||||
@@ -67,9 +67,9 @@ let s:shorthand = {
|
||||
\ 'mode_sequence': 'm', 'ignores': 'ig', 'filter': 'f'
|
||||
\ }
|
||||
|
||||
if exists("*strwidth")
|
||||
if exists("*strdisplaywidth")
|
||||
function! s:strwidth(str)
|
||||
return strwidth(a:str) + len(matchstr(a:str, '^\t*')) * (&tabstop - 1)
|
||||
return strdisplaywidth(a:str)
|
||||
endfunction
|
||||
else
|
||||
function! s:strwidth(str)
|
||||
|
||||
@@ -117,4 +117,26 @@ Expect:
|
||||
n2gv = {}
|
||||
n2vt = {}
|
||||
|
||||
Given (Tab-indented code (#20)):
|
||||
class MyUnitTest(unittest.TestCase):
|
||||
def test_base(self):
|
||||
# n2f= {}
|
||||
## n2v= {}
|
||||
# f2v = {}
|
||||
## n2gv = {}
|
||||
# n2vt = {}
|
||||
|
||||
Execute:
|
||||
set tabstop=12
|
||||
%EasyAlign=
|
||||
|
||||
Expect:
|
||||
class MyUnitTest(unittest.TestCase):
|
||||
def test_base(self):
|
||||
# n2f = {}
|
||||
## n2v = {}
|
||||
# f2v = {}
|
||||
## n2gv = {}
|
||||
# n2vt = {}
|
||||
|
||||
Include: include/teardown.vader
|
||||
|
||||
15
test/run
15
test/run
@@ -1,18 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
VIMRC=$TMPDIR/mini-vimrc
|
||||
SOURCE=$(dirname $BASH_SOURCE)/..
|
||||
cd $(dirname $BASH_SOURCE)
|
||||
|
||||
cat > $VIMRC << EOF
|
||||
set nocompatible
|
||||
vim -Nu <(cat << EOF
|
||||
syntax on
|
||||
|
||||
for dep in ['vader.vim', 'vim-repeat']
|
||||
execute 'set rtp+=' . finddir(dep, expand('~/.vim').'/**')
|
||||
endfor
|
||||
set rtp+=$SOURCE
|
||||
EOF
|
||||
|
||||
vim -u $VIMRC +Vader*
|
||||
|
||||
rm -f $VIMRC
|
||||
set rtp+=..
|
||||
EOF) +Vader*
|
||||
|
||||
Reference in New Issue
Block a user