Add option to set a character which replaces spaces when creating links.

The wikilocal option links_space_char will be used to replace any spaces
when creating a new wiki link and page. This only affects link creation
with a visual selection.
This commit is contained in:
Rane Brown
2019-03-31 21:16:44 -06:00
parent 3396e87dbe
commit 41aa647aba
4 changed files with 20 additions and 2 deletions

View File

@ -2134,7 +2134,8 @@ function! s:normalize_link_syntax_v()
endif
" Put substitution in register " and change text
call setreg('"', substitute(sub, '\n', '', ''), visualmode())
let sc = vimwiki#vars#get_wikilocal('links_space_char')
call setreg('"', substitute(substitute(sub, '\n', '', ''), '\s', sc, 'g'), visualmode())
normal! `>""pgvd
finally
call setreg('"', default_register_save, registertype_save)