Skip to content

Gist should set the filetype on uploaded gists #185

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

Closed
lilyball opened this issue May 27, 2015 · 6 comments
Closed

Gist should set the filetype on uploaded gists #185

lilyball opened this issue May 27, 2015 · 6 comments

Comments

@lilyball
Copy link
Contributor

I just ran :Gist from an unnamed buffer with the swift filetype and was rather surprised to see the created gist defaulted to Plain Text. It should use the &filetype as the file type of the uploaded gist if it has no filename for it. There should also be a flag to override this explicitly.

@mattn
Copy link
Owner

mattn commented May 28, 2015

it doesn't work because gist server doesn't handle file extension.

https://gist.github.com/mattn/614b1b9c863c95bf05f9#file-gistfile1-switf

This is a post that i just posted. see the filename but not syntax highlighted.

@lilyball
Copy link
Contributor Author

You typo'd the extension. It's "swift", not "switf". And it doesn't work because :Gist didn't even set a file extension at all, the file I pasted show up as gistfile1.txt (the default if you don't provide a filename).

To clarify: I'm posting from an unnamed scratch buffer for which I've set the 'filetype' to swift. :Gist should generate a filename based on the filetype for me and post it as gistfile1.swift instead of posting it without a name.

@mattn
Copy link
Owner

mattn commented May 29, 2015

Ah, okay. please add below into your vimrc.

let g:gist_extmap = { ".swift": "swift" }

https://gist.github.com/mattn/94c90ed66771dd55dff2

@mattn
Copy link
Owner

mattn commented May 29, 2015

however, I'll add swift into default extmap. so if you will want to new file extension, please do it for new.

@mattn mattn closed this as completed in 9e5fe4e May 29, 2015
@lilyball
Copy link
Contributor Author

Can you please document g:gist_extmap as well? It's not currently documented, so I didn't know it existed.

@mattn
Copy link
Owner

mattn commented May 29, 2015

okay, will do

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