Skip to content


w!! cmap makes w lag #484

tpope opened this Issue · 5 comments

4 participants


From mappings.vim:

cmap w!! %!sudo tee > /dev/null %

Using a cmap for this means that every press to a w lags for a full second while Vim waits on the rest of the map. Even after I figured out what was going on, this was pretty disorienting.

The proper way to achieve this involves creating a :command. This would involve changing the interface to something like :SudoW (unfortunate, but not a tragedy in my book.) Two suggestions:

  1. Add eunuch.vim. cough
  2. Copy and paste the implementation of :SudoW from eunuch.vim.

:+1: eunuch.vim and, for that matter, basically every other @tpope plugin ever.

carlhuda member

Hey @tpope eunuch.vim looks quite nice to me, actually this mapping is a plain copy/paste from my own config and I haven't noticed the delay because honestly I am used to it, been using it for years now, nice catch!

Mind pushing a pull request to add eunuch.vim that closes this issue?


@kalbasit kalbasit added a commit that closed this issue
@kalbasit kalbasit Add tpope's eunuch plugin
closes #484
@kalbasit kalbasit closed this in 87dec49

Looks like you beat me to it!

carlhuda member

Yea I feel in a giving mode this morning Ha! :)

@tpope tpope referenced this issue

Remove w!! #493

@kalbasit kalbasit pushed a commit that referenced this issue
@tpope tpope Remove w!!
Really closes #484.

to avoid the delay you could use:

ca w!! w !sudo tee % >/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.