I have a system to insert a single character in vim- I use :nmap <Space> i_<Esc>r
.
However, for some reason, this seems to be interfering with my remapping of escape. I remapped escape with :imap kj <Esc>
.
Whenever I push kj
, vim inserts a _
just before my cursor and then changes what it like I pressed space. I cannot figure out why these things are interacting like this. Can somebody shed some light on the matter? I appreciate it.
Here's my entire vimrc
"general settings
syntax on
filetype plugin on
set number
set smd
set ru
"Leader
let mapleader=','
nmap <Leader>w :w<Enter>
nmap <leader>e :wq<Enter>
nmap <leader>q :q!<Enter>
"remappings
nmap ; :
imap kj <Esc>
nmap <Space> i_<Esc>r
"au comands
au Filetype python source ~/.vim/scripts/python.vim
au Filetype ruby source ~/.vim/scripts/ruby.vim
au Filetype c source ~/.vim/scripts/c.vim
Change every nmap
to nnoremap
and every imap
to inoremap
and see if the problem persists.
Check that you don't have any trailing whitespace.
Read :h 40.1
in full.
Read the chapter on "Strict mapping" in Learn Vimscript the Hard Way.