Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

odd indention with vim-vue and pug files #80

Open
acidjazz opened this issue Jul 27, 2017 · 5 comments
Open

odd indention with vim-vue and pug files #80

acidjazz opened this issue Jul 27, 2017 · 5 comments

Comments

@acidjazz
Copy link

vim-vue

this happens only when i'm writing pug w/in my vue component, if i place this code in a .pug file it doesn't try to indent via {

@acidjazz
Copy link
Author

even just the enter key

vim-vue2

@adriaanzon
Copy link
Collaborator

I'm not sure how to fix this in a way that doesn't "break" indentation for other filetypes, but you can stick this in your vimrc:

autocmd BufEnter *.vue setlocal indentkeys-=*<Return> indentkeys-={

@ghost
Copy link

ghost commented Aug 23, 2017

This also breaks indentation for vim folding since it uses {{{ }}}, on style and template blocks.

@adriaanzon
Copy link
Collaborator

I can think of a few ways to solve this.

We could maybe detect what key triggered the indentation (only in insert mode) and then compare it to the &indentkeys value for the pug filetype (we will need to include that information in our indent script). If the trigger key is in pug's &indentkeys, only then use pug's indentation.

We could add a smart way of setting options using context_filetype.vim. We can use it to detect the current filetype on the CursorMoved event and change the value of &indentkeys on the fly.

@acidjazz
Copy link
Author

FYI i was finally able to solve this in m`/.vimrc with

autocmd FileType * setlocal indentkeys=o,O

This still allows indentation on new lines, which im fine with

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

No branches or pull requests

2 participants