0

I'm running into a weird behaviour where I'm editing a file and saving it with the :w command.

The problem is it leaves behind the 'w' character after my line of edit. It doesn't do it all the time but its often enough to become a problem. The actual 'w' character isn't there because if I close and reopen the file, character disappear.

I'm not sure whats causing it.

eg.

    activate() {
        return this.productService
            .getAll()
            .then(products = this.products = products);**w**
    }

NOTE: the 'w' after the semi-colon.

:verb au BufWrite produced:

--- Auto Command ---

:verb au BufWritePost produced:

--- Auto-Commands ---
airline  BufWritePost
    */autoload/airline/themes/*.vim
              exec 'source '.split(globpath(&rtp, 'autoload/airline/themes/'.g:airline_theme.'.vim', 1), "\n")[0] | call airline#load_theme()
        Last set from ~/.vim/bundle/airline/plugin/airline.vim
CtrlPMRUF  BufWritePost
    *         cal s:record(expand('<abuf>', 1))
        Last set from ~/.vim/bundle/ctrlp/autoload/ctrlp/mrufiles.vim
gitgutter  BufWritePost
    *         if gettabvar(tabpagenr(), 'gitgutter_didtabenter') |   call settabvar(tabpagenr(), 'gitgutter_didtabenter', 0) | else |   call gitgutter#process_buffer(bufnr(''), 0) | endif
        Last set from ~/.vim/bundle/gitgutter/plugin/gitgutter.vim
syntastic  BufWritePost
    *         call s:BufWritePostHook()
        Last set from ~/.vim/bundle/syntastic/plugin/syntastic.vim
gzip  BufWritePost
    *.gz      call gzip#write("gzip")
        Last set from /usr/local/Cellar/vim/7.4.712_1/share/vim/vim74/plugin/gzip.vim
    *.bz2     call gzip#write("bzip2")
        Last set from /usr/local/Cellar/vim/7.4.712_1/share/vim/vim74/plugin/gzip.vim
    *.Z       call gzip#write("compress -f")
        Last set from /usr/local/Cellar/vim/7.4.712_1/share/vim/vim74/plugin/gzip.vim
    *.lzma    call gzip#write("lzma -z")
        Last set from /usr/local/Cellar/vim/7.4.712_1/share/vim/vim74/plugin/gzip.vim
    *.xz      call gzip#write("xz -z")
        Last set from /usr/local/Cellar/vim/7.4.712_1/share/vim/vim74/plugin/gzip.vim
BufWritePost
    <buffer=1>
              call s:JSHint()
        Last set from ~/.vim/bundle/jshint/ftplugin/javascript/jshint.vim
airline_whitespace  BufWritePost
    *         unlet! b:airline_whitespace_check
        Last set from ~/.vim/bundle/airline/autoload/airline/extensions/whitespace.vim
TagbarAutoCmds  BufWritePost
    *         call s:AutoUpdate(fnamemodify(expand('<afile>'), ':p'), 1)
        Last set from ~/.vim/bundle/tagbar/autoload/tagbar.vim
BufWritePost
    <buffer=7>
              call s:JSHint()
        Last set from ~/.vim/bundle/jshint/ftplugin/javascript/jshint.vim
    <buffer=15>
              call s:JSHint()
        Last set from ~/.vim/bundle/jshint/ftplugin/javascript/jshint.vim
    <buffer=34>
              call s:JSHint()
        Last set from ~/.vim/bundle/jshint/ftplugin/javascript/jshint.vim
    <buffer=54>
              call s:JSHint()
        Last set from ~/.vim/bundle/jshint/ftplugin/javascript/jshint.vim
    <buffer=55>
              call s:JSHint()
        Last set from ~/.vim/bundle/jshint/ftplugin/javascript/jshint.vim
    <buffer=56>
              call s:JSHint()
  • Do you have any autocommands that execute when you save? You can check by running without plugins, or by looking at the output of :verb au BufWrite and :verb au BufWritePost. (The gzip entries are expected.) – joeytwiddle Nov 17 '15 at 4:44
  • @joeytwiddle Added both entry into my question, I'm not vary familiar with these or buffers. – TheLazyChap Nov 17 '15 at 5:00
  • Hmm JSHint rings a bell. I might have had the same trouble with it myself! You could disable it to check. Failing that, try disabling Syntastic. Or a workaround might be to add your own hook to refresh the screen: :au BufWritePost * :redraw! – joeytwiddle Nov 17 '15 at 5:09
  • @joeytwiddle I'll see how it goes, but sometimes when you type, you think you've made a mistake or had extra letters but in actual fact they are not really there. It's not specifically just the 'w' character sometimes I get x or other symbols etc Thanks anyways. – TheLazyChap Nov 17 '15 at 5:16
  • 3
    This is a known issue and happens usually, when vim is busy leaving stray letters around (usually the ones you typed last) and can be cleared by Ctrl-L. – Christian Brabandt Nov 17 '15 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.