I think you will have to overwrite the mapping.
autocmd filetype netrw call Netrw_mappings()
function! Netrw_mappings()
noremap <buffer>% :call CreateInPreview()<cr>
endfunction
In this function you will have to rebuild the netrw function, but it is not that hard:
function! CreateInPreview()
let l:filename = input("please enter filename: ")
execute 'pedit ' . b:netrw_curdir.'/'.l:filename
endf
Note: this only opens the buffer in the preview. It does not save the file.
If you just want to create the file, without opening it anywhere, you can use the external command touch
(At least in Unix systems).
function! CreateInPreview()
let l:filename = input("please enter filename: ")
execute 'silent !touch ' . b:netrw_curdir.'/'.l:filename
redraw!
endf
:Lexplore
to have a little window at the side withnetrw
in it. This behaviour ruins my workflow too! – Bilingualv
and if I already have a pane, I press<cr>
to change my file. – Barbe