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

vim-pipe does not support use case when real file name or extension is required #8

Open
gamato opened this issue Jan 30, 2016 · 3 comments

Comments

@gamato
Copy link

gamato commented Jan 30, 2016

vim-pipe does not seem to support use-cases when file name or extension is important.
For instance I've got a tool that behaves depending on file extension.
Is there a way to make it work with vim-pipe ?

@krisajenkins
Copy link
Owner

vim-pipe works on filetype, which (usually) works based on extension. So if your two different extensions have two different filetypes in vim, you should just be able to set a different vim-pipe command for each type.

@gamato
Copy link
Author

gamato commented Feb 7, 2016

Unfortunately that does not help in this case. The tool cannot be explicitly told what to do, it takes action(s) based on extension(s) of file(s) passed on command line. So passing Vim buffer via stdin is no go. I need the file to be either created, like the trick with <(cat), but with real name; or I need Vim buffer to be saved and real file path passed to the tool. Is it possible, either of mentioned, please ?

@Walfisch
Copy link

Walfisch commented Mar 1, 2016

Have you tried using % as a placeholder for the current filename?

let b:vimpipe_command="echo  %"

You can use a more sophisticated File pattern to set a custom command, eg all files ending with Haha.txt:

autocmd BufNewFile,BufRead *Haha.txt let b:vimpipe_command="echo  %"

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

3 participants