Codemirror: Implement the gq command for vim mode

Created on 14 Jun 2015  路  3Comments  路  Source: codemirror/CodeMirror

Most helpful comment

I think that since many downstream services use CodeMirror as a Vim emulator, it would make sense to implement at least a rudimentary version of this. Even if it just wraps lines, that would be useful.

All 3 comments

For gq to be meaningful, CodeMirror needs to have some idea of how a file should be formatted. Right now, CodeMirror has some notion of how far code should be indented. It doesn't understand how code or text should break. It doesn't understand how comments should be break. I don't believe these concepts make sense in the context of an editing component either.

So I don't think this is a feature that makes sense to add to CodeMirror. That said, VIM mode has documented APIs for extending it in the environment it's used.

I think its already enough if it just breaks. For example I use this functionality in LaTeX and it would make sense IMHO because tools like Overleaf could benefit from it!

I think that since many downstream services use CodeMirror as a Vim emulator, it would make sense to implement at least a rudimentary version of this. Even if it just wraps lines, that would be useful.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marvindanig picture marvindanig  路  5Comments

mohinishsharma picture mohinishsharma  路  3Comments

qiueer picture qiueer  路  4Comments

reachnithya18 picture reachnithya18  路  3Comments

droidenator picture droidenator  路  3Comments