Skip to content

aiya000/vim-write-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✨ write-sync.vim ✨

When you did :w (:write), write an another file with the same file content.

For Vim/Neovim.

Table of Contents

How to work

If you want to write ~/.dotfiles/AutoHotkey.ahk when /mnt/c/Users/you/Desktop/AutoHotkey.ahk:

  1. 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',
  \ ]
\ ]
  1. (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)
  1. Edit a synchronized source file
$ vim ~/.dotfiles/AutoHotkey.ahk

~/.dotfiles/AutoHotkey.ahk

# You wrote some content.
# ...
  1. Check the another file
$ cat /mnt/c/Users/you/Desktop/AutoHotkey.ahk
# You wrote some content.
# ...

Good.

Other options

" 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

Installation

~/.vimrc

call dein#begin(s:dein_base)
" ...
call dein#add('aiya000/vim-write-sync')
" ...
call dein#end()

Then, do call dein#install().

Doesn't work well

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"

About

When you did :w (:write), write an another file with the same file content.

Topics

Resources

License

Stars

Watchers

Forks

Contributors