michal-h21 / vimwiki-sync Goto Github PK
View Code? Open in Web Editor NEWAutomaticaly synchronize vimwiki at startup and exit using git
Automaticaly synchronize vimwiki at startup and exit using git
For those of us that use semantic commit to generate changelogs / keep track of things, it's often helpful to have template-able commits for sync operations
Minimal viable version can be achieved by just allowing people to include a prefix for the current commit message (e.g. chore: Auto commit...
)
I don't have a lot of bandwidth atm, but can take this on in the semi-near future and PR
The commit message says:
Auto commit + push.
But I checked my github history and no commits are pushed. Is this by design or am I misunderstanding the commit message?
When shell variable is not set to bash (fish in my case), the commit log message leaves just the date
string without expanding it.
Hi, thanks for the great work!
I have vimwiki on my linux-machine and on my macbook. To sync I use Gitlab.
When I manually push and pull it works ok, but when I use your plugin, it only pushes.
I start vimwiki within vim: ww
I'm assuming this plugin is designed for vim and not neovim?
Neovim job control has jobstart
and I've seen plugins that embed async.vim to provide a consistent API, although from skimming the plugin it looks like you aren't doing anything after spawning the jobs, so maybe just an alias to starting a job that supports either would work?
I may fiddle with this to see if I can get a working solution.
Hi, sorry for noob questions/requests. Would you mind explaining how to use this plugin ? I installed it but I do not know how to use it ( I am new to Neovim). Thanks
I have had a couple instances where there is a conflict on more than one file. So I open a file in vim, fix the conflict, and then close back to the cli. But then vimwiki-sync does a commit and push, which removes other files from conflict state by adding them, and then commits them even though they have the conflict markers in them.
Can you make it where it doesn't do anything if the branch is in conflict state?
by what magic?
Since the command to add is simply git -C " . g:zettel_dir . " add .
, it will only add files at the top level of the vimwiki. Vimwiki diaries by default live in the diary/
folder at the top level, and therefore do not get added. Would be great if this could be incorporated. It is an easy fix (probably including testing if a folder at diary_rel_path
exists, then add everything in it. I can submit a PR if you want.
Reproduce
:wq
Expected behavior
Commit the added file on nvim
exit.
Neovim Information
% nvim -v
NVIM v0.7.2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/x86_64-pc-linux-gnu-gcc -O2 -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=malloc -Wsuggest-attribute=cold -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/var/tmp/portage/app-editors/neovim-0.7.2/work/neovim-0.7.2_build/config -I/var/tmp/portage/app-editors/neovim-0.7.2/work/neovim-0.7.2/src -I/usr/include -I/var/tmp/portage/app-editors/neovim-0.7.2/work/neovim-0.7.2_build/src/nvim/auto -I/var/tmp/portage/app-editors/neovim-0.7.2/work/neovim-0.7.2_build/include
Compiled by portage@localhost
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "/etc/vim/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
Run :checkhealth for more info
Additional Information
" ~/.config/nvim/init.vim
set
\ nu
\ nuw=5
\ tgc
\ et
\ ea
\ noswf
\ nohls
\ lz
\ nowb
\ smc=180
\ wig=*.o,*.pyc,*pycache*
\ nosmd
\ nowrap
\ vif=NONE
\ ls=0
\ nobk
\ noru
\ bg=dark
\ cb=unnamedplus
\ ut=1000
\ so=10
\ shm=aIF
\ ts=4
\ sts=4
\ sw=4
\ fcs=eo \ ut=1000
\ so=10
\ shm=aIF
\ ts=4
\ sts=4
\ sw=4
\ fcs=eob:\ ,
let g:vimwiki_list = [{
\ 'path': '/home/nzv/.config/nvim/wiki',
\ 'template_path': '~/.config/nvim/wiki/tpl',
\ 'template_default': 'default',
\ 'syntax': 'markdown',
\ 'ext': '.md',
\ 'path_html': '~/.cache/vimwiki_html',
\ 'template_ext': '.tpl'
\}]
au FileType vimwiki
\ setl spell wrap nonu ch=2
" Easy buffer navigation
nn <C-J> <C-W><C-J>
nn <C-K> <C-W><C-K>
nn <C-L> <C-W><C-L>
nn <C-H> <C-W><C-H>
" Remove arrow keys in some modes
for key in [
\ '<Down> <Nop>',
\ '<Left> <Nop>',
\ '<Right> <Nop>',
\ '<Up> <Nop>',
\]
for mod in ['no', 'no!', 'vn', 'ino', 'cno']
exe mod key
endfor
endfor
for p in [
\ '2html_plugin',
\ 'getscript',
\ 'getscriptPlugin',
\ 'gzip',
\ 'logipat',
\ 'matchparen',
\ 'netrw',
\ 'netrwFileHandlers',
\ 'netrwPlugin',
\ 'netrwSettings',
\ 'rrhelper',
\ 'spellfile_plugin',
\ 'sql_completion',
\ 'syntax_completion',
\ 'tar',
\ 'tarPlugin',
\ 'vimball',
\ 'vimballPlugin',
\ 'zip',
\ 'zipPlugin',
\ 'vimsyn_embed',
\]
exe 'let g:loaded_' . p . '= 1'
endfor
call plug#begin()
Plug 'hashivim/vim-terraform'
Plug 'weakish/rcshell.vim'
Plug 'tpope/vim-commentary'
Plug 'vimwiki/vimwiki'
Plug 'tpope/vim-fugitive'
Plug 'michal-h21/vimwiki-sync'
call plug#end()
syn enable | colo ocean
# cwd: /home/nzv/.config/nvim/wiki
% git remote show origin
* remote origin
Fetch URL: [email protected]:nnzv/wiki.git
Push URL: [email protected]:nnzv/wiki.git
HEAD branch: main
Remote branch:
main tracked
Local ref configured for 'git push':
main pushes to main (up to date)
Hi.
I have setup vim-zettel and vimwiki-sync. And it works.
But after a while I realized that I have autocommits in my working project. Not in zettelkasten directory.
After some investigation I have realized that function vimwiki#vars#get_wikilocal('path')
always returns $HOME/vimwiki
path.
This path is from default_wiki_settings
variable in vimwiki plugin.
And this path does not exist.
So when vimwiki-sync does pushd
it does nothing and makes commit in current directory.
Which is directory of my project.
Also I have realized that git_action
executes on every save of every file I am editing.
Environment:
I have Linux Debian 5.9.11-1 and VIM 8.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.