I'm trying to remap my Backspace key to do nothing in insert mode (want to start using more x and other different ways that are better for deletion in vim)
I added in my .vimrc
this line:
inoremap <BS> <Nop>
But after restarting my vim
the backspace still deletes a character.
What am I doing wrong?
This is part of my .vimrc:
set nocompatible
execute pathogen#infect()
syntax on
filetype plugin indent on
set laststatus=2
set background=dark
set number
set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab
set autochdir
set noswapfile
set backspace=indent,eol,start
set incsearch
set ignorecase
set fileencoding=utf-8
set encoding=utf-8
set gdefault
set smartcase
set scrolloff=5
let mapleader=","
map <C-n> :NERDTreeToggle<CR>
let g:ag_working_path_mode="ar"
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#fnamemod = ':t'
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
let g:ctrlp_user_command = 'find %s -type f'
set hidden
nmap <leader>T :enew<cr>
nmap <leader>l :bnext<cr>
nmap <leader>h :bprev<cr>
nmap <leader>bq :bp <BAR> bd #<CR>
nmap <leader>bl :ls<CR>
nnoremap <leader>w :w<cr>
nnoremap <leader>q :q<cr>
noremap > >><cr>
noremap < <<<cr>
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn)$|/node_modules/',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'some_bad_symbolic_links',
\ }
let g:ctrlp_dotfiles = 0
j
"autocmd BufWritePre * :normal gg=G
let g:UltiSnipsExpandTrigger="<c-j>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
let g:UltiSnipsNoPythoWarning = 1
" Syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" C tags
nmap <F8> :TagbarToggle<CR>
nnoremap <Leader>. :CtrlPTag<CR>
inoremap <leader>; <C-o>A;
nnoremap <leader>; A;
set diffopt+=vertical
inoremap <BS> <Nop>
"inoremap <Del> <Nop>
pathogen#infect()
and the mapping works correctly. So I suspect one of your plugin to cause the problem. Can you try to comment the execution of pathogen and see if the problem still occurs?