How can I make an insert in vim without indentation problems
This is because what you are doing is essentially like you are typing into a personal Vim symbol, and therefore it does everything it normally does.
The register *
represents the system clipboard, so you can paste it like this:
"*p
This assumes that your Vim is compiled with system clipboard support. You can check if it works vim --version | grep '+clipboard'
.
source to share
You can use :set paste
and :set nopaste
to switch to insert mode.
Alternatively, you can use keyboard shortcuts to make them easier. Update the .vimrc config file:
let mapleader = ","
"to make an additional combination.
map <leader>pp :setlocal paste!<cr>
Now that you can enter ,pp
to turn insert mode on and off.
source to share