You can use "autoread". From :help autoread
*'autoread'* *'ar'* *'noautoread'* *'noar'*
'autoread' 'ar' boolean (default off)
global or local to buffer |global-local|
{not in Vi}
When a file has been detected to have been changed outside of Vim and
it has not been changed inside of Vim, automatically read it again.
When the file has been deleted this is not done. |timestamp|
If this option has a local value, use this command to switch back to
using the global value: >
:set autoread<
I've used this for when a file has been edited outside of vim. I just tested it, and it also works for when a file's mode has been changed. It's a slightly different use-case, but hey, it works!
You might want to add :w
to the beginning, to guarantee that it will actually reload. Otherwise, you'll get different errors.
I did run into a weird problem when I tested it. It might just be my terminal+window manager setup, so you may or may not have this too. Vim would refuse to update after doing this. To fix this, you can add <C-l>
to the end of your mapping.
Putting this all together, the remapping should look like this:
nnoremap <leader>755 :w | silent !chmod 755 %<CR><C-l>