For using the terminal while working with Rust. I've added this config (NVIM) (TTerm one).
command Ter vsplit term://zsh
command Tter tabe term://zsh
command Terminal vert term
command TerminalTab tab ter
It opens the terminal in a different tab as expected. Normally with other tabs, we can use the <C-p> to navigate to previous tabs. But I cannot use the <C-p> or :tabprevious as it types it in the terminal. Any options?
(This answer pertains to neovim specifically. If you find anything conflicting with vim, let me know and I'll edit the answer.)
:h term operates in a separate mode: the terminal model. It's somewhat like the insert mode in that you have to ESC out of it before you can go into command-line mode with : key. Only to get out of the terminal mode, instead of pressing ESC, you press <C-\><C-N>. Go through :h vim-modes for a complete understanding.
Control-P by default moves cursor a line up. If it switches tabs instead, then it is due to custom mapping.
Vim is all about modes. An "ordinary" buffer may be in Normal or Insert. While in Insert mode, no Normal mappings/keys apply. The same is for a Terminal buffer, except it may be in Normal or Terminal mode. Hence, you need either switch to Normal manually (ctrl-backslash ctrl-n) and then use Normal keys, or create special Terminal mode mapping(s), see help for tmap command and such.