Skip to content

(Neo)Vim 'w' behaves like 'W' in a certain scenario #1595

@Zeta611

Description

@Zeta611

Issue
Vim word movements like 'w', 'e', 'b', etc. suddenly behave like their capital counterparts 'W', 'E', 'B', etc., when a quickfix list pops out and if the cursor is on the end-of-a-line-}.
This issue has been nagging me for a few years, and I finally had a time to investigate it.

iskeyword seems to be fine:

 iskeyword=@,48-57,_,192-255,:

This issue is always reproducible with the following minimal.vim & minimal.tex on my Macs.

minimal.vim

let &runtimepath  = '~/.local/share/nvim/plugged/vimtex,' . &runtimepath
let &runtimepath .= ',~/.local/share/nvim/plugged/vimtex/after'

minimal.tex

% Below 'articl' is an intended typo
\documentclass{articl}
\begin{document}
\TeX
\end{document}

Commands/Input
Put the cursor on the closing curly bracket } in {acticl}.
Then start a continuous compile mode via \ll.

Observed Behaviour
The missing 'e' opens the quickfix list, and if you try to move using w, it would behave like W.

This also breaks a 3rd party plugin like easymotion, only showing the starts of Words (delimited by spaces).

Expected Behaviour
It should still act like a normal w(, e, b, etc.).

Output from VimtexInfo

System info
  OS: Mac OS X 10.15.3 (19D76)
  Vim version: NVIM v0.4.3
  Has clientserver: true
  Servername: /var/folders/cs/7bfzsfzx7bn67bhxn0pgzk1w0000gn/T/nvim72gwdA/0

vimtex project: minimal
  base: minimal.tex
  root: /Users/jay/vimtex
  tex: /Users/jay/vimtex/minimal.tex
  out: /Users/jay/vimtex/minimal.pdf
  log: /Users/jay/vimtex/minimal.log
  aux: /Users/jay/vimtex/minimal.aux
  fls: /Users/jay/vimtex/minimal.fls
  compiler: latexmk
    backend: nvim
    output: /var/folders/cs/7bfzsfzx7bn67bhxn0pgzk1w0000gn/T/nvim72gwdA/1
    configuration: 
      continuous: 1
      callback: 1
      latexmk options:
        -verbose
        -file-line-error
        -synctex=1
        -interaction=nonstopmode
      latexmk engine: -pdf
  viewer: General
  qf: LaTeX logfile
    config: 
      packages: 
        default: 1
      default: 1
  document class: article

Output from chechhealth

health#vimtex#check
========================================================================
## vimtex
  - OK: Vim version should have full support!
  - OK: General viewer should work properly!
  - WARNING: pstree is not available
    - ADVICE:
      - vimtex#view#reverse_goto is better if pstree is available.
  - WARNING: Compiler callbacks will not work!
    - ADVICE:
      - `neovim-remote` / `nvr` is required for callbacks to work with neovim
      - Please also set |g:vimtex_compiler_progname| = 'nvr'
      - For more info, see :help |vimtex-faq-neovim|

health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $TERM_PROGRAM='iTerm.app'
  - INFO: $COLORTERM='truecolor'

## tmux
  - OK: escape-time: 0ms
  - INFO: $TERM: tmux-256color

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: pbcopy

## Python 2 provider (optional)
  - INFO: pyenv: Path: /usr/local/Cellar/pyenv/1.2.16/libexec/pyenv
  - INFO: pyenv: $PYENV_ROOT is not set. Infer from `pyenv root`.
  - INFO: pyenv: Root: /Users/jay/.pyenv
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          /Users/jay/.pyenv/shims/python2 does not exist: pyenv: python2: command not found
          
          The `python2' command exists in these Python versions:
          2.7.17
          2.7.17/envs/neovim-python2
          neovim-python2
          
          
          /Users/jay/.pyenv/shims/python2.7 does not exist: pyenv: python2.7: command not found
          
          The `python2.7' command exists in these Python versions:
          2.7.17
          2.7.17/envs/neovim-python2
          neovim-python2
          
          
          python2.6 not found in search path or not executable.
          /Users/jay/.pyenv/shims/python is Python 3.8 and cannot provide Python 2.
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - INFO: pyenv: Path: /usr/local/Cellar/pyenv/1.2.16/libexec/pyenv
  - INFO: pyenv: $PYENV_ROOT is not set. Infer from `pyenv root`.
  - INFO: pyenv: Root: /Users/jay/.pyenv
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 3:
          /Users/jay/.pyenv/shims/python3 does not have the "neovim" module. :help |provider-python|
          /usr/local/bin/python3.7 does not have the "neovim" module. :help |provider-python|
          python3.6 not found in search path or not executable.
          python3.5 not found in search path or not executable.
          python3.4 not found in search path or not executable.
          python3.3 not found in search path or not executable.
          /Users/jay/.pyenv/shims/python does not have the "neovim" module. :help |provider-python|
  - INFO: Executable: Not found

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
  - INFO: Host: /Users/jay/.rbenv/shims/neovim-ruby-host
  - OK: Latest "neovim" gem is installed: 0.8.1

## Node.js provider (optional)
  - INFO: Node.js: v13.7.0
  - INFO: Neovim node.js host: /usr/local/lib/node_modules/neovim/bin/cli.js
  - OK: Latest "neovim" npm/yarn package is installed: 4.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions