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

Support for :setf[iletype] #218

Open
robertquitt opened this issue Jun 8, 2018 · 0 comments
Open

Support for :setf[iletype] #218

robertquitt opened this issue Jun 8, 2018 · 0 comments

Comments

@robertquitt
Copy link

As I am mainly a user of vim, my instinct for changing filetype is using :setf. It would be nice if there were a way to open the "grammar menu" and set the Atom grammar immediately.

I am very new to the Atom editor, but I think this would be helpful. Hitting <C-L> is a bit counter-intuitive for me.

Here is the description of how :setf works from the Vim documentation. Basically, Atom's "grammar" is equivalent to Vim's filetype.


:setf[iletype] [FALLBACK] {filetype} :setf :setfiletype

Set the 'filetype' option to {filetype}, but only if not done yet in a sequence of (nested) autocommands. This is short for

:if !did_filetype()
:  setlocal filetype={filetype}
:endif

This command is used in a filetype.vim file to avoid setting the 'filetype' option twice, causing different settings and syntax files to be loaded.

When the optional FALLBACK argument is present, a later :setfiletype command will override the 'filetype'. This is to used for filetype detections that are just a guess. did_filetype() will return false after this command.

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

1 participant