Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added global variable for custom browser refresh key mapping #75

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions plugin/vim-markdown-preview.vim
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ if !exists("g:vim_markdown_preview_hotkey")
let g:vim_markdown_preview_hotkey='<C-p>'
endif

if !exists("g:vim_markdown_preview_browser_fresh_key")
let g:vim_markdown_preview_browser_fresh_key="F5"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the default to ctrl+r to keep this change backwards compatible

endif

function! Vim_Markdown_Preview()
let b:curr_file = expand('%:p')

Expand Down Expand Up @@ -86,7 +90,7 @@ function! Vim_Markdown_Preview()
let curr_wid = system('xdotool getwindowfocus')
call system('xdotool windowmap ' . chrome_wid)
call system('xdotool windowactivate ' . chrome_wid)
call system("xdotool key 'ctrl+r'")
call system("xdotool key" . g:vim_markdown_preview_browser_fresh_key)
call system('xdotool windowactivate ' . curr_wid)
endif
endif
Expand Down Expand Up @@ -140,7 +144,7 @@ function! Vim_Markdown_Preview_Local()
let curr_wid = system('xdotool getwindowfocus')
call system('xdotool windowmap ' . chrome_wid)
call system('xdotool windowactivate ' . chrome_wid)
call system("xdotool key 'ctrl+r'")
call system("xdotool key" . g:vim_markdown_preview_browser_fresh_key)
call system('xdotool windowactivate ' . curr_wid)
endif
endif
Expand Down