Jürgen Krämer
unread,Apr 4, 2022, 2:21:34 AM4/4/22Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vim...@googlegroups.com
Hi,
Ni Va schrieb am 02.04.2022 um 07:19:
> Is there a way to reduce, simplify and sumpup *those kind of* noremap *command?*
>
> Avoiding *:exe *(due to concatenate luafile + path)
> nnoremap lua :*exe* 'luafile ' .. expand('%:p')<CR>
>
> Avoiding *double :exe ... <CR>* command ?
> nnoremap lua *:exe* 'cd ' .. expand('%:p:h')*<CR> :exe* 'luafile ' .. expand('%:p')*<CR>*
>
you should be able to use %:p directly in an ex command, where a file name can be used (see :help :_%).
So these two commands can be written as
:nnoremap lua luafile %:p<cr>
and
:nnoremap lua cd %:p:h<bar>luafile %:p<cr>
Regards,
Jürgen
--
~
~
~
:wq