Kevin Steiner
Kevin Steiner

Reputation: 11

Change neovim :terminal behavior to vim

I just switched to neovim from vim due to the telescope plugin, but I don't like the way neovim handles terminals. Is there a way to change the behavior of the neovim :terminal command to the standard vim behavior: Open a terminal buffer in a new split in termminal mode, ready to enter commands. I'm using NVIM v0.6.1.

I'm sure there hast to be a simple fix to it in the init.vim, but I don't know how. And when I open a terminal the buffer description is a cryptic "term://~/.config/nvim//161148:/bin/bash "

Upvotes: 0

Views: 331

Answers (1)

Achim Siebert
Achim Siebert

Reputation: 13

You may use this command:

:bo terminal

Or if you want it in a vertical split:

:vert bo terminal.

You'd still need to type "i" or "a" to be able to type in your command.
But this could be taken care of in a key mapping:

A line in your init.vim could be:

nnoremap <leader>t :bo terminal<cr>a

... or in a lua file:

vim.keymap.set('n', '<leader>t', ':bo terminal<cr>a'),

I'm using zsh and have a similar strange buffer "name". No idea if this can be changed in any way.

Upvotes: 0

Related Questions