From: codybuell Date: Mon, 26 Jun 2017 17:49:01 +0000 (-0400) Subject: Add support for another extension X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/24ee67dcb6c10a9e3a7d6651e95d300ff300ecb7?ds=sidebyside;hp=--cc Add support for another extension --- 24ee67dcb6c10a9e3a7d6651e95d300ff300ecb7 diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim index 21c9442..f5d0989 100644 --- a/ftplugin/markdown.vim +++ b/ftplugin/markdown.vim @@ -586,9 +586,15 @@ if !exists("*s:EditUrlUnderCursor") write endif if get(g:, 'vim_markdown_no_extensions_in_markdown', 0) - execute 'edit' fnamemodify(expand('%:~'), ':p:h').'/'.l:url.'.md' + " use another file extension if preferred + if exists('g:vim_markdown_auto_extension_ext') + let l:ext = '.'.g:vim_markdow_auto_extension_ext + else + let l:ext = '.md' + endif + execute 'edit' fnameescape(fnamemodify(expand('%:~'), ':p:h').'/'.l:url.l:ext) else - execute 'edit' l:url + execute 'edit' fnameescape(l:url) endif else echomsg 'The cursor is not on a link.'