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

refactor for clarity and faster loading #66

Closed
Konfekt opened this issue Aug 6, 2016 · 6 comments
Closed

refactor for clarity and faster loading #66

Konfekt opened this issue Aug 6, 2016 · 6 comments

Comments

@Konfekt
Copy link

Konfekt commented Aug 6, 2016

Currently the whole plug-in resides in a single vim file. How about moving all autocmd's of the form

exe "autocmd BufReadCmd " . g:GPGFilePattern .  " call s:GPGInit(1) |" .
                                                \ " call s:GPGDecrypt(1)"
  exe "autocmd FileReadCmd " . g:GPGFilePattern . " call s:GPGInit(0) |" .
\ " call s:GPGDecrypt(0)"

to a ftdetect/gpg.vim file that defines a gpg filetype, along with a ftplugin/gpg.vim file?

Then the various script functions such as

function s:GPGEditRecipients()

go into a autoload/gpg.vim file and are named gpg#EditRecipients() and alike. This loads them only when called for.

@lucc
Copy link

lucc commented Sep 14, 2016

Part of this is done in #52 you just have to wait for @jamessan to merge it or urge him to do so.

@Konfekt
Copy link
Author

Konfekt commented Sep 14, 2016

This Puts the functions into an autoload file. Should the Transfer of the filetype detection and plugin file go into a separate issue then ?

@lucc
Copy link

lucc commented Sep 14, 2016

Yes (into a seperate PR).

As jamessan mentioned in #52 it will take some more time till #52 will be merged. But I think you can (now or then) build your transfer to the filetype folders on top of the PR #52. That way you don't have to redo the work and jamessan doesn't have to handle the "same" code changes twice.

@jamessan
Copy link
Owner

I agree with Bram's comment in vim/vim#1077 that there shouldn't be a filetype for this plugin. The autocmds are fine in plugin/.

@Konfekt
Copy link
Author

Konfekt commented Sep 17, 2016

Ok. One might consider outsourcing them to ftdetect/.. and leave the filetype unchanged, but that's only to make the plugin/.. file leaner.

@jamessan
Copy link
Owner

Yeah, I'm not sure it's worth splitting them out. They have to be loaded anyway and plugin/ files are automatically loaded.

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