w!! cmap makes w lag #484

Closed
tpope opened this Issue Dec 4, 2012 · 5 comments

Comments

Projects
None yet
4 participants
@tpope
Contributor

tpope commented Dec 4, 2012

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.
@reinh

This comment has been minimized.

Show comment
Hide comment
@reinh

reinh Dec 4, 2012

👍 eunuch.vim and, for that matter, basically every other @tpope plugin ever.

reinh commented Dec 4, 2012

👍 eunuch.vim and, for that matter, basically every other @tpope plugin ever.

@kalbasit

This comment has been minimized.

Show comment
Hide comment
@kalbasit

kalbasit Dec 4, 2012

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?

Thanks

Member

kalbasit commented Dec 4, 2012

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?

Thanks

@kalbasit kalbasit closed this in 87dec49 Dec 4, 2012

@tpope

This comment has been minimized.

Show comment
Hide comment
@tpope

tpope Dec 4, 2012

Contributor

Looks like you beat me to it!

Contributor

tpope commented Dec 4, 2012

Looks like you beat me to it!

@kalbasit

This comment has been minimized.

Show comment
Hide comment
@kalbasit

kalbasit Dec 4, 2012

Member

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

Member

kalbasit commented Dec 4, 2012

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

@tpope tpope referenced this issue Dec 20, 2012

Merged

Remove w!! #493

kalbasit pushed a commit that referenced this issue Dec 20, 2012

Remove w!!
Really closes #484.
@ivanalejandro0

This comment has been minimized.

Show comment
Hide comment
@ivanalejandro0

ivanalejandro0 Jun 24, 2013

Contributor

to avoid the delay you could use:

ca w!! w !sudo tee % >/dev/null
Contributor

ivanalejandro0 commented Jun 24, 2013

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