I'd like to have to same remap to open and close my terminal.
Here is my remap to open it : nnoremap <C-s> :bel vert term<CR>
What I want is that when my terminal is already open, if I type <C-s>
again, it execute exit<CR>
I already tried a function that I found here : Toggle function in vim
let s:enable = 0
function! ToggleEasyMode()
if s:enable
nnoremap <C-s> exit<CR>
let s:enable = 0
else
nnoremap <C-s> :bel vert term<CR>
let s:enable = 0
endif
endfunction