I have this mapping in my .vimrcnnoremap <silent><leader>vlc :exe !open -a vlc '.getline('.').'<CR>It does work great with some files, but I'm getting error message with files that have single quote in it:/Users/dude/Downloads/check/39min tpope's Vim Config and  Plugins-MGmIJyTf8pg.mp4The error message:/bin/bash: -c: line 0: unexpected EOF while looking for matching `''/bin/bash: -c: line 1: syntax error: unexpected end of fileshell returned 2Press ENTER or type command to continue
How to escape single quote in Vim
vimscript;external command
Rather than add quotes yourself, use the shellescape() function, which should take care or all edge cases::nnoremap <silent><leader>vlc :exe !open -a vlc  . shellescape(getline('.'))<CR>Another way is to use the %:S filename modifier::echo fnamemodify(Hello 'world, '')Hello 'world:echo fnamemodify(Hello 'world, ':S')'Hello '\''world':echo expand('%')hello 'world:echo expand('%:S')'hello '\''world'In this particular case shellescape() probably makes more sense, but :S is useful especially when you want to combine it with other filename modifiers.