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

Feature request: settings to exclude some files #54

Open
milushov opened this issue Sep 26, 2020 · 2 comments
Open

Feature request: settings to exclude some files #54

milushov opened this issue Sep 26, 2020 · 2 comments

Comments

@milushov
Copy link

Hey, thanks for nice plugin!

I have autocmd command for auto sourcing my vimrc. And when the plugin is saving file I'm getting my vim unnecessary frozen during sourcing the config..

autocmd bufwritepost $MYVIMRC source $MYVIMRC

It would be nice to have a setting to ignore/exclude some files, smth like this:

let g:auto_save_files_ignore = [$MYVIMRC]

Btw I have these settings:

let g:auto_save = 1
" https://github.com/907th/vim-auto-save/issues/53#issuecomment-571819789
let g:auto_save_events = ["CursorHold"]
set updatetime=300

Btw2 I can donate few dollars for this feature!

@907th
Copy link
Owner

907th commented Sep 28, 2020

@milushov Hello, Roma!
I think that your feature request can be implement with a presave hook, like that:

" This will run AbortIfVimRc function before each save
let g:auto_save_presave_hook = 'call AbortIfVimRc()'
function! AbortIfVimRc()
  if <check that current file is vimrc somehow>
    let g:auto_save_abort = 1
  else
    let g:auto_save_abort = 0
  endif
endfunction

I don't know how to exactly <check that current file is vimrc>, but I believe you'll be able to google it easily yourself.
Thank you for getting in touch and for using my plugin!

@igbanam
Copy link
Collaborator

igbanam commented Aug 4, 2023

To <check that current file is vimrc somehow> you can check the ft

if &ft == "vim"

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