'Loading view file (created by mkview!) not being sourced/loaded by an autocommand event
Refering to this post load views from specific files I'd like to retain/keep all my folds when copying my files to different machines by saving and than sourcing the viewfile automatically by an autocommand.
augroup WriteAndSourceViews
autocmd!
" this one here works perfect fine and every time the mkview command is executed and the file created
autocmd BufWritePre *.* execute "mkview! " . expand('<afile>:p:h') . "/." . expand('<afile>:t') . ".vimview"
" this command doesn't work with any of the events... manually by command line it work fine though...
autocmd BufRead,BufWinEnter,BufReadPost,FilereadPost *.* execute "silent! source " . expand('%:p:h') . "/." . expand('%:t') . ".vimview"
augroup END
Why no of the events for sourcing the file are working?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
