You are not logged in.

#1 2012-01-02 00:58:00

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,896
Website

[SOLVED] sudo in zsh: vim autocorrecting to .vim

Hey guys. Recently, (possibly as of zsh 4.3.15), whenever I'm in ~, zsh has been prompting me to autocorrect

sudo vim $filename

to

sudo .vim $filename

Without "sudo", zsh makes no attempt to uncorrect "vim", which vaguely reminds me of having a sudo="sudo " alias in bash to get autocompletion working for sudo commands. Alas, that alias doesn't seem to have any effect on this zsh problem.

I can avoid the problem by unsetopt-ing correctall, but I'd rather avoid that if possible; setopt correct just doesn't do enough for me.

I was wondering if anyone else has experienced this, and has found a better solution to avoiding it.

Here's my .zshrc, in case I've got setopt anallyretentivecorrect in there somewhere, and I'm just not seeing it.

# Lines configured by zsh-newuser-install
setopt extendedglob
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/wormzy/.zshrc'

autoload -Uz compinit
compinit
# End of lines added by compinstall
export PS1="%n@%M[%l]:%~$ "
export HISTSIZE=2000
export HISTFILE="$HOME/.history"
export SAVEHIST=$HISTSIZE
export EDITOR=/usr/bin/vim
export PAGER=/usr/bin/vimpager
setopt hist_ignore_all_dups
setopt hist_ignore_space
setopt autocd
setopt correctall
bindkey "\e[1~" beginning-of-line
bindkey "\e[2~" quoted-insert
bindkey "\e[3~" delete-char
bindkey "\e[4~" end-of-line
bindkey "\e[5~" beginning-of-history
bindkey "\e[6~" end-of-history
bindkey "\e[7~" beginning-of-line
bindkey "\e[8~" end-of-line
bindkey "\e[H" beginning-of-line
bindkey "\e[F" end-of-line
bindkey "\eOH" beginning-of-line
bindkey "\eOF" end-of-line
bindkey "\eOd" backward-word
bindkey "\eOc" forward-word
bindkey "\e[1;5D" backward-word
bindkey "\e[1;5C" forward-word
bindkey "^[[A" history-search-backward
bindkey "^[[B" history-search-forward

alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias ls='ls --color=auto'
alias :q='exit'
alias u='echo "yaourt -Syyu"; yaourt -Syyu'
alias ua='echo "yaourt -Syyua"; yaourt -Syyua'
alias yaourtS="yaourt -S"
alias yaourtR="yaourt -Rnssu"
alias yaourtU="yaourt -U"
alias yaourtQ="yaourt -Q"
alias yaourtG="yaourt -G"
alias yaourtSs="yaourt -Ss"
alias yaourtSsa="yaourt -Ssa"
alias yaourtQs="yaourt -Qs"
alias yaourtQl="yaourt -Ql"
alias yaourtQo="yaourt -Qo"
alias yaourtQi="yaourt -Qi"
alias df="di -f SMbuvpT"

clear

Any help would be appreciated.

Last edited by WorMzy (2015-10-30 18:06:37)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#2 2012-01-02 03:36:53

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: [SOLVED] sudo in zsh: vim autocorrecting to .vim

Not perfect (won't correct paths after sudo) but...

alias sudo='nocorrect sudo'

Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#3 2012-01-03 23:07:00

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,896
Website

Re: [SOLVED] sudo in zsh: vim autocorrecting to .vim

Cheers, that'll have to do for now.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2015-10-30 17:28:44

manuelschneid3r
Member
From: Germany
Registered: 2013-04-14
Posts: 152

Re: [SOLVED] sudo in zsh: vim autocorrecting to .vim

Is there a better way for this? This will not complete paths after sudo, which you will need for vim.


Please feel free to correct my english.

Offline

#5 2015-10-30 18:06:10

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,896
Website

Re: [SOLVED] sudo in zsh: vim autocorrecting to .vim

I currently use

export CORRECT_IGNORE_FILE='.*'

See 'man zshoptions' for details.

If you still have trouble with this, please open a new topic about it, and link back to this one.

https://wiki.archlinux.org/index.php/Fo … bumping.22

Closing.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB