The keyboard mapping I wrote failed, and vim is using bash’s hotkey.
This is what led my vim to do now.
In insert mode
Ctrl-w deletes a word before the cursor
Ctrl-L typed l
CTRL-J line feed
How can I use keyboard mapping for normal configuration?
My vim has two plug-ins, youcompleteme and vundle.
My system is ubuntu gnome
My own vimrc is like this
"Basic Settings
set nu
set tabstop=4
set bg=dark
set expandtab
set cursorline
set softtabstop=4
set hls
set shiftwidth=4
set fdm=syntax
set foldlevelstart=99
set autoindent
au filetype c,cpp set cindent
"Keyboard mapping
map <S-Right> <Esc>:tabn<CR>
imap <S-Right> <Esc>:tabn<CR>i
map <S-Left> <ESC>:tabp<CR>
imap <S-Left> <ESC>:tabp<CR>i
map <C-o> <Esc>:tabnew
imap <C-o> <Esc>:tabnew
map <F5> <Esc>:w<CR>:! g++ % -o %<<CR>
imap <F5> <Esc>:w<CR>:! g++ % -o %<<CR>
map <C-F5> <Esc>:w<CR>:! g++ % -o %< && ./%<<CR>
imap <C-F5> <Esc>:w<CR>:! g++ % -o %< && ./%<<CR>
map <C-s> <Esc>:w<CR>
imap <C-s> <Esc>:w<CR>i
map <C-w> <Esc>:wq<CR>
imap <C-w> <Esc>:wq<CR>
"Color
set t_Co=256
color darkburn
"vundle settings
set nocompatible
set backspace=2
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" My bundles here:
" original repos on GitHub
Bundle 'Valloric/YouCompleteMe'
"Bundle 'tpope/vim-fugitive'
"Bundle 'Lokaltog/vim-easymotion'
"Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
"Bundle 'tpope/vim-rails.git'
" vim-scripts repos
"Bundle 'L9'
"Bundle 'FuzzyFinder'
" non-GitHub repos
"Bundle 'git://git.wincent.com/command-t.git'
" Git repos on your local machine (i.e. when working on your own plugin)
"Bundle 'file:///Users/gmarik/path/to/plugin'
" ...
filetype plugin indent on " required!
"YCM settings
Set completeopt=longest,menu "Turn off preview of completion
Letg: ycm _ global _ ycm _ extra _ conf =' ~/.ycm _ extra _ conf.py' "default configuration
Let g:ycm_confirm_extra_conf = 0 "no manual confirmation required
I haven’t made any changes to bash’s configuration file.
Ask how to set up this problem to solve it.
The keyboard mapping I wrote failed, and vim is using bash’s hotkey.
This is what led my vim to do now.
In insert mode
Ctrl-w deletes a word before the cursor
Ctrl-L typed l
CTRL-J line feedThis is just a coincidence. In fact vim does not use bash’s hotkey, but its own default hotkey. Please refer to the help document.
:h i_CTRL-w
. The correct approach here is to usenoremap
To override the default hotkey.noremap <C-w> <Esc>:wq<CR> inoremap <C-w> <Esc>:wq<CR>
Other key combinations are similar.Ctrl-w is an important hotkey for window navigation by default, which is not recommended by individuals.