Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Indentation doesn't work when syntax is off #61

Closed
wayneashleyberry opened this issue Sep 28, 2016 · 4 comments
Closed

Indentation doesn't work when syntax is off #61

wayneashleyberry opened this issue Sep 28, 2016 · 4 comments

Comments

@wayneashleyberry
Copy link

I thought this might be a vim limitation, but when I have syntax off indentation works fine for javascript and Go.

With syntax off, indentation using the = key or using o to enter a new line doesn't indent at all.

@wayneashleyberry wayneashleyberry changed the title Indentation doesn't work with syntax off Indentation doesn't work when syntax is off Sep 28, 2016
@StanAngeloff
Copy link
Owner

StanAngeloff commented Sep 28, 2016

How can I reproduce this? Did you turn syntax off with :syntax off<CR>?

What use case do you have for preserving indentation, but turning the syntax off?

@wayneashleyberry
Copy link
Author

wayneashleyberry commented Sep 28, 2016

Yeah, by default my syntax is on... I used :syntax off to disable it. My use case is that I'm starting to leave syntax off in terminal vim for performance reasons. This really wouldn't bother me if not for finding other languages seem to work fine.

If you consider the following code:

<?php

function test() {
}

When my cursor is over function and I hit o, with syntax on my cursor moves here:

function test() {
    |
}

After disabling syntax and trying the same thing my cursor moves here:

function test() {
|
}

If I turn syntax back on and try again it works as expected and indents the cursor.

@StanAngeloff
Copy link
Owner

StanAngeloff commented Sep 28, 2016

There isn't anything in this plug-in that relates to indentation. There are various hooks for folding. I wonder if another Vim built-in plugin relies on syntax groups being defined to perform the indentation?

EDIT: Looks like this is the case.

@wayneashleyberry
Copy link
Author

That's it @StanAngeloff! I'll add an issue over there - thanks :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants