I'm writing mapping, and I want to decide whether I have to do additional actions when current buffer type is a drawer called
Fern, here is my command currently
nnoremap <nowait><silent> ; \ <CR>:Fern %:h:h -drawer -width=36 -toggle -reveal=%<CR>
What I want to do is like:
nnoremap <nowait><silent><expr> ; \ buffertype(current_buffer)=='Fern'? ":w" : "" \ ."\<CR>:Fern %:h:h -drawer -width=36 -toggle -reveal=%\<CR>"
So what should be the substitute of pseudocode
buffertype(current_buffer) here? Do we really have function alike?