tags:

views:

36

answers:

2

I seem to have something odd with either my Mac 10.6 terminal or my .vimrc.

When I type backspace on my laptop's keyboard, it only works when the cursor is at the end of the line. Trying to delete from within a line does nothing. MacVim operates normally. Google hasn't helped because I can't even figure out what to call this behavior.

All other backspace commands in my Terminal work as expected, so I am leaning towards it being Vim specific.

Here's the output of my ~/.vimrc 's mappings, I can't see anything that would make Vim in the terminal operate this way:

cflewis@coral-reef ~> egrep ".*map.*" ~/.vimrc 
"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
let mapleader = ","
map Q gq
nmap <silent> <leader>s :set nolist!<CR>
" extended '%' mapping for if/then/else/end etc
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>
nmap <silent> <C-N> :silent noh<CR>
nmap <C-E> :b#<CR>
nmap <C-P> :NERDTreeToggle<CR>
nmap <leader>p :NERDTreeFind<CR>
nmap <leader>/ :call NERDComment(0, "invert")<cr>
vmap <leader>/ :call NERDComment(0, "invert")<cr>
nmap <leader>t :TlistToggle<CR>
nmap <leader>e :e **/
nmap <Leader>b :MiniBufExplorer<cr>
nmap <Leader>sh :ConqueSplit bash<cr>
nmap <Leader>r :ConqueSplit 
" map ,y to show the yankring
nmap <leader>y :YRShow<cr>
imap <silent> <Down> <C-o>gj
imap <silent> <Up> <C-o>gk
nmap <silent> <Down> gj
nmap <silent> <Up> gk
cmap w!! %!sudo tee > /dev/null %
inoremap jj <Esc>
nnoremap JJJJ <Nop>

Any ideas would be appreciated. I tried flipping the delete key to send ^H or ^?, to no difference.

+2  A: 

This is the only explicit backspace mapping I have in my config. I do not know if it will help for your problem, but it might be worth a try?

" allow backspacing over everything in insert mode
set backspace=indent,eol,start

And please don't downvote if it's wrong. Just give a comment and I'll delete the post. :)

Johan
You got it, this worked great, but I have jamessan the answer points because he knew why. Thanks for your help!
Lewisham
+5  A: 

Most likely, the "problem" you're seeing is that you can't delete anything that was not typed during your current insert mode session. This is due to the default setting for the 'backspace' option. Adding set backspace=indent,eol,start to your ~/.vimrc is the behavior that you probably want.

jamessan
Aha, that was it. Magic. Thank you!
Lewisham