Python splitting and indentation
jamespeapen opened this issue · 2 comments
I just installed the plugin and tried it on my python script, but I'm not sure if I'm getting correct splitting. The first item stays on the same line when split and indentation is off.
a = (1, 2, 3, 4)
b = {1:1, 2:2, 3:3, 4:4}
c = [1, 2, 3]
a = (1,
2,
3,
4)
b = {
1:1,
2:2,
3:3,
4:4
}
c = [1,
2,
3]
It is, however, working with R.
a <- function(a, b, c) {
b <- c(1, 2, 3)
}
a <- function(a,
b,
c) {
b <- c(
1,
2,
3
)
}
I'm using neovim 7.2 and tried it both with and without my other plugins.
Indentation is something that the plugin doesn't handle (with some minor exceptions) -- the code that is split is auto-indented however Vim indents the code using ==
. In your examples, if you try to reindent the split code, I think it will stay as it is. If you'd like to change that, you could use a different indent expression -- This one might work as you'd expect, but I don't really use python, so I'm not sure what the "correct" way is: https://github.com/Vimjas/vim-python-pep8-indent
As for the brackets, try using this setting:
splitjoin.vim/doc/splitjoin.txt
Lines 1803 to 1828 in 956d67c
That works - thanks!