Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using an Auto Completion Pop Up script.

When I place the cursor

left:(here) 218px !important;

or

left: (here) 218px !important;

the pop up menu automatically appears as usual, then I press Ctrl + S and it pastes :w. I think it is trying to complete : for :w.

Any suggestions to fix this?

I have this in my vimrc:

" Use CTRL-S for saving, also in Insert mode
noremap <C-S> :w<CR>
vnoremap <C-S> <C-C>:w<CR>
imap <C-S> <C-O>:w<CR>
share|improve this question
add comment

2 Answers 2

Using <Esc> instead of <C-O> solved the problem.

noremap <C-S> :w!<CR>
vnoremap <C-S> <Esc>:w!<CR>
inoremap <C-S> <Esc>:w!<CR>
share|improve this answer
add comment

The Auto Completion script provided there doesn't work for me so I can't give a correct way to actually fix the problem, but as far as I can tell the issue is as follows.

The CTRL+S command that you use doesn't do anything more than enter :w followed by Carriage Return in vim's Normal Mode. :w + Enter is the actual way of saving a file in vim, your CTRL+S is a shortcut to that.

I'm led to believe that that pop up plugin somehow prevents the shortcut to make a quick switch to normal mode, thus inserting :w into your actual document.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.