When you did :w (:write), write an another file with the same file content.
For Vim/Neovim.
If you want to write ~/.dotfiles/AutoHotkey.ahk when /mnt/c/Users/you/Desktop/AutoHotkey.ahk:
- Configure your .vimrc
" Also paths like '~/' are available.
" These are expanded by `expand()`
let g:write_sync_lists = [
\ [
\ '~/.dotfiles/AutoHotkey.ahk',
\ '/mnt/c/Users/you/Desktop/AutoHotkey.ahk',
\ ]
\ ]- (Confirm that the file to be synchronized does not yet exist)
$ ls /mnt/c/Users/you/Desktop/AutoHotkey.ahk
ls: cannot access '/mnt/c/Users/you/Desktop/AutoHotkey.ahk': No such file or directory
# Or
$ cat /mnt/c/Users/you/Desktop/AutoHotkey.ahk
(an another content)
- Edit a synchronized source file
$ vim ~/.dotfiles/AutoHotkey.ahk
~/.dotfiles/AutoHotkey.ahk
# You wrote some content.
# ...- Check the another file
$ cat /mnt/c/Users/you/Desktop/AutoHotkey.ahk
# You wrote some content.
# ...
Good.
" Notify result by `:echo` when file synchronization (simultaneous writes) is finished (default: v:false)
let g:write_sync_echo_success_on_write = v:true" Create the file to write if this is `v:true` and the file does not exist (default: v:true)
let g:write_sync_create_file_if_not_exists = v:true- Example for dein.vim.
- See dein#add()
~/.vimrc
call dein#begin(s:dein_base)
" ...
call dein#add('aiya000/vim-write-sync')
" ...
call dein#end()Then, do call dein#install().
Please submit issue in a light hearted manner! We welcome this!
- e.g., "Doesn't work on my Neovim", "Doesn't work on my Vim version XXX"
