kak foo.pyclass Foo:
pass
The second line rapidly disappears off to the right side of the screen
This, uh, not happening? :p
There is a x key in the last try statement of the python-indent-on-new-line command in python.kak. It should be replaced by <a-x>.
I'm having a problem with python indentation after colons. So far I've only had this happen in python files.
I'm not doing anything special with tabs in my kakrc except a couple standard hooks for tab completion, removing them doesn't change the behavior. Removing my python filetype hooks doesn't change anything either.
Steps
This happens in insert mode when I press enter from a line ending in colon or I add lines underneath from normal mode (using o).
Outcome
The new indented line has four spaces prepended to it even though I'm using tabs in the file, like so:
(. is a space, >------- is a tab)
>------->-------if foo:
....>--->-------# indent ends here
Expected
>------->-------if foo:
>------->-------# indent ends here
or
>------->-------if foo:
>------->------->-------# indent ends here, even better
Kakoune has two relevant settings you might want to check: tabstop sets the width of each tab character (inserted with the <tab> key), and indentwidth sets the number of spaces inserted or removed by the > and < commands.
If you're the kind of person who hates tabs for indentation and only wants to use spaces, you'll probably want to map <tab> to something else, and control the amount of indenting by setting indentwidth.
If you're the kind of person who hates spaces for indentation and only wants to use tabs, you'll probably want to set indentwidth to 0 (which means "indent with a tab, not spaces") and control the amount of indenting by setting tabstop.
C.f. #2168
@Screwtapello
Works perfectly, thanks!
Mind if I quote your answer on the wiki page on Indentation and Tabulation? Might save people time in the future
Go ahead!
Most helpful comment
Kakoune has two relevant settings you might want to check:
tabstopsets the width of each tab character (inserted with the<tab>key), andindentwidthsets the number of spaces inserted or removed by the>and<commands.If you're the kind of person who hates tabs for indentation and only wants to use spaces, you'll probably want to map
<tab>to something else, and control the amount of indenting by settingindentwidth.If you're the kind of person who hates spaces for indentation and only wants to use tabs, you'll probably want to set
indentwidthto 0 (which means "indent with a tab, not spaces") and control the amount of indenting by settingtabstop.