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

Allow option to generate template to scratch buffer instead of editing ftplugin #87

Closed
comfortablynick opened this issue Jun 3, 2020 · 8 comments
Assignees
Labels
feature New feature or request

Comments

@comfortablynick
Copy link

Is your feature request related to a problem? Please describe.
I do not have my vim/nvim files under ~/.vim, so the current command creates a file in the wrong place.

Describe the solution you'd like
I would like the template to be opened in a scratch buffer. I don't like the idea of a plugin editing my ftplugin files. Failing that, I would at least like to be able to customize the path.

@comfortablynick comfortablynick changed the title Allow option not to create/edit ~/.vim/after/ftplugin/{&ft}.vim when generating template Allow option to generate template to scratch buffer instead of editing ftplugin Jun 3, 2020
@kkoomen
Copy link
Owner

kkoomen commented Jun 4, 2020

Hi,

where do you keep your vim files then if it's not in ~/.vim? And what would be the reason for you to not use ~/.vim or ~/.nvim?

@comfortablynick
Copy link
Author

I primarily use nvim; mine are located at ~/.config/nvim. That works well for me because most of my ~/.config folder is in my dotfiles repo.

@kkoomen
Copy link
Owner

kkoomen commented Jun 5, 2020

What about just adding a symlink ln -s ~/.config/nvim ~/.nvim? This would fix your problem, right?

@comfortablynick
Copy link
Author

Obviously I could; I guess it would be nice if DoGe could load the template in a scratch buffer and not try to edit my ftplugin files. I can't think of any other plugins that do this.

If you're interested I can send a PR with an option for it, if not feel free to close.

@kkoomen
Copy link
Owner

kkoomen commented Jun 5, 2020

Actually, there's no reason to write it indeed. I only need to remove the write command and remove that is pre-created the directory path. I think that'd be okay to support. Then you can choose to save it differently, but by default we keep the current path as a suggestion when vim-doge presents you with the new template.

kkoomen added a commit that referenced this issue Jun 5, 2020
@kkoomen
Copy link
Owner

kkoomen commented Jun 5, 2020

Pushed to master. Can you test it and let me know? If approved I'll do a new release.

@comfortablynick
Copy link
Author

Thanks, great solution! Works fine when I try it.

@kkoomen kkoomen self-assigned this Jun 6, 2020
@kkoomen kkoomen added the feature New feature or request label Jun 6, 2020
@kkoomen
Copy link
Owner

kkoomen commented Jun 6, 2020

This feature has been merged and released in v2.4.2.

Feel free to submit any new issues if you experience any unwanted behavior in the future. Thanks for your contribution.

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

No branches or pull requests

2 participants