You are not logged in.
Before installing zsh-completions, I have installed oh-my-zsh and powerlevel10k theme.
I have followed the ArchWiki page to do it: https://wiki.archlinux.org/index.php/Zs … completion
I have added all of them to .zshrc, but when I type "sudo pacman -Rs f" and press TAB, it returns nothing.
Last edited by laichiaheng (2021-01-26 13:39:57)
Offline
zsh doesn't require zsh-completions for basic completions and /usr/share/zsh/site-functions/_pacman is provided by pacman.
post your .zshrc but I'll just blame
I have installed oh-my-zsh
because that's the usual way for users to break their zsh.
Does the completion work w/o "sudo"?
Online
post your .zshrc but I'll just blame
I have installed oh-my-zsh
because that's the usual way for users to break their zsh.
Yes, agreed. Remove that shit. If you want some nice zsh stuff, install grml-zsh-config which plays nice with stuff.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
zsh doesn't require zsh-completions for basic completions and /usr/share/zsh/site-functions/_pacman is provided by pacman.
post your .zshrc but I'll just blame
I have installed oh-my-zsh
because that's the usual way for users to break their zsh.
Does the completion work w/o "sudo"?
No, it doesn't work without sudo
Here is my .zshrc
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
ZSH=/usr/share/oh-my-zsh/
ZSH_THEME="powerlevel10k/powerlevel10k"
DISABLE_AUTO_UPDATE="true"
ZSH_CUSTOM=/usr/share/zsh
plugins=(
git
zsh-syntax-highlighting
zsh-autosuggestions
zsh-completions
history-substring-search
)
ZSH_CACHE_DIR=$HOME/.cache/oh-my-zsh
if [[ ! -d $ZSH_CACHE_DIR ]]; then
mkdir $ZSH_CACHE_DIR
fi
source $ZSH/oh-my-zsh.sh
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
Last edited by laichiaheng (2021-01-24 10:51:16)
Offline
seth wrote:post your .zshrc but I'll just blame
I have installed oh-my-zsh
because that's the usual way for users to break their zsh.
Yes, agreed. Remove that shit. If you want some nice zsh stuff, install grml-zsh-config which plays nice with stuff.
I don't see a tutorial or manual for that.
By the way, I accidentally reported you just because I was trying to click reply.
Last edited by laichiaheng (2021-01-24 10:44:10)
Offline
Please use code tags for shell IO and file contents, https://bbs.archlinux.org/help.php#bbcode
Your zshrc doesn't compinit at all, but just revolves around a lot of OMZ stuff that, while I don't know, looks wrong™
https://grml.org/zsh/grmlzshrc.html
It also comes w/ a bunch of help functions for its styling capacity.
nb. that OMZ is NOT required to have a powerline promt at all.
If the bbs doesn't eat the UTF-8, this will get you some powerline prompt on top of the grmlrc (using only private codepoints that are covered by several unpatched fonts incl. SourceCodePro)
zstyle ':prompt:grml:*:items:user' pre '%F{cyan}'
zstyle ':prompt:grml:*:items:path' pre '%F{6}┃%K{6}%F{black} '
zstyle ':prompt:grml:*:items:path' post '%k%b%F{6}│%f '
zstyle ':prompt:grml:*:items:vcs' pre '%F{13}%f%K{13}'
zstyle ':prompt:grml:*:items:time' pre '%F{3}%F{black}%K{3}'
zstyle ':prompt:grml:*:items:host' pre '%F{6}%F{black}%K{6}'
zstyle ':prompt:grml:*:items:host' post '%k%F{6}┃%f%b'
zstyle ':prompt:grml:left:setup' items change-root path
zstyle ':prompt:grml:right:setup' items rc vcs time host
But to be very clear: not even that is required and the more elaborate powerline features come w/ a daemon.
See https://wiki.archlinux.org/index.php/Powerline
Online
It seems like the completion works for other applications, except pacman.
Why is it?
Offline
OMZ…
pacman -Qo /usr/share/zsh/site-functions/_pacman
pacman -Qikk pacman
Online
OMZ…
pacman -Qo /usr/share/zsh/site-functions/_pacman pacman -Qikk pacman
How do you know to do this?
Offline
seth wrote:OMZ…
pacman -Qo /usr/share/zsh/site-functions/_pacman pacman -Qikk pacman
How do you know to do this?
Why is it missing?
Do we need to manually add it for every program?
Last edited by laichiaheng (2021-01-24 15:15:49)
Offline
I know this because it's always OMZ.
Please post the required output and don't bump - just edit your post is nobody has replied so far.
Online
I know this because it's always OMZ.
Please post the required output and don't bump - just edit your post is nobody has replied so far.
I did try to remove everything about zsh and the OMZ stuff, then install zsh again, but there is no such file by default.
Offline
no what file?
Please post the required output.
Online
You were asked for specific output and seem to be refusing to provide it. What are you trying to hide?
Offline
You were asked for specific output and seem to be refusing to provide it. What are you trying to hide?
You mean my command?
I remember I did these commands.
sudo pacman -Rs oh-my-zhs-git zsh <and all packages related to zsh>
sudo rm -rf /usr/share/oh-my-zsh /usr/share/zsh
sudo pacman -S zsh
git clone git://github.com/zsh-users/zsh-completions.git
sudo vim .zshrc
<insert fpath=(path/to/zsh-completions/src $fpath) in it>
rm -f ~/.zcompdump; compinit
zsh
Last edited by laichiaheng (2021-01-24 15:41:02)
Offline
pacman -Qo /usr/share/zsh/site-functions/_pacman pacman -Qikk pacman
Online
seth wrote:pacman -Qo /usr/share/zsh/site-functions/_pacman pacman -Qikk pacman
❯ LANG=C pacman -Qo /usr/share/zsh/site-functions/_pacman
/usr/share/zsh/site-functions/_pacman is owned by pacman 5.2.2-1
❯ LANG=C pacman -Qikk pacman
Name : pacman
Version : 5.2.2-1
Description : A library-based package manager with dependency support
Architecture : x86_64
URL : https://www.archlinux.org/pacman/
Licenses : GPL
Groups : base-devel
Provides : libalpm.so=12-64
Depends On : bash glibc libarchive curl gpgme pacman-mirrorlist archlinux-keyring
Optional Deps : perl-locale-gettext: translation support in makepkg-template
Required By : appstream-glib base pamac-all pkgfile yay-bin
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 4.43 MiB
Packager : Allan McRae <allan@archlinux.org>
Build Date : Wed Jul 1 09:52:38 2020
Install Date : Sun Jan 24 23:00:05 2021
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
backup file: pacman: /etc/makepkg.conf (Modification time mismatch)
backup file: pacman: /etc/pacman.conf (Modification time mismatch)
backup file: pacman: /etc/pacman.conf (Size mismatch)
pacman: 369 total files, 0 altered files
I have manually added that file, so I'm not sure if you can see where the problem is.
I did it because this guy told me this way.
https://github.com/zsh-users/zsh-comple … -766343627
Last edited by laichiaheng (2021-01-24 15:46:37)
Offline
How did you "manually" add that file??
It's owned by the pacman package and that package is intact.
If you had tampered w/ it, the -Qikk output would reveal that.
Please post your current zshrc.
Edit: also, are we talking abotu "pacman" or "yay" here? That's not the same.
Last edited by seth (2021-01-24 15:48:50)
Online
And is this still Antergos?
Offline
How did you "manually" add that file??
It's owned by the pacman package and that package is intact.
If you had tampered w/ it, the -Qikk output would reveal that.Please post your current zshrc.
Edit: also, are we talking abotu "pacman" or "yay" here? That's not the same.
Just copy the raw zsh_completion.in in that link, and use vim to paste it in /usr/share/zsh/site-functions/_pacman
My pacman and yay have the same problem.
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Start configuration added by Zim install {{{
#
# User configuration sourced by interactive shells
#
# -----------------
# Zsh configuration
# -----------------
#
# History
#
# Remove older command from the history if a duplicate is to be added.
setopt HIST_IGNORE_ALL_DUPS
#
# Input/output
#
# Set editor default keymap to emacs (`-e`) or vi (`-v`)
bindkey -e
# Prompt for spelling correction of commands.
setopt CORRECT
# Customize spelling correction prompt.
#SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? '
# Remove path separator from WORDCHARS.
WORDCHARS=${WORDCHARS//[\/]}
# --------------------
# Module configuration
# --------------------
#
# completion
#
# Set a custom path for the completion dump file.
# If none is provided, the default ${ZDOTDIR:-${HOME}}/.zcompdump is used.
#zstyle ':zim:completion' dumpfile "${ZDOTDIR:-${HOME}}/.zcompdump-${ZSH_VERSION}"
#
# git
#
# Set a custom prefix for the generated aliases. The default prefix is 'G'.
#zstyle ':zim:git' aliases-prefix 'g'
#
# input
#
# Append `../` to your input for each `.` you type after an initial `..`
#zstyle ':zim:input' double-dot-expand yes
#
# termtitle
#
# Set a custom terminal title format using prompt expansion escape sequences.
# See http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes
# If none is provided, the default '%n@%m: %~' is used.
#zstyle ':zim:termtitle' format '%1~'
#
# zsh-autosuggestions
#
# Customize the style that the suggestions are shown with.
# See https://github.com/zsh-users/zsh-autosuggestions/blob/master/README.md#suggestion-highlight-style
#ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'
#
# zsh-syntax-highlighting
#
# Set what highlighters will be used.
# See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
# Customize the main highlighter styles.
# See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/main.md#how-to-tweak-it
#typeset -A ZSH_HIGHLIGHT_STYLES
#ZSH_HIGHLIGHT_STYLES[comment]='fg=10'
# ------------------
# Initialize modules
# ------------------
if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZDOTDIR:-${HOME}}/.zimrc ]]; then
# Update static initialization script if it does not exist or it's outdated, before sourcing it
source ${ZIM_HOME}/zimfw.zsh init -q
fi
source ${ZIM_HOME}/init.zsh
# ------------------------------
# Post-init module configuration
# ------------------------------
#
# zsh-history-substring-search
#
# Bind ^[[A/^[[B manually so up/down works both before and after zle-line-init
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
# Bind up and down keys
zmodload -F zsh/terminfo +p:terminfo
if [[ -n ${terminfo[kcuu1]} && -n ${terminfo[kcud1]} ]]; then
bindkey ${terminfo[kcuu1]} history-substring-search-up
bindkey ${terminfo[kcud1]} history-substring-search-down
fi
bindkey '^P' history-substring-search-up
bindkey '^N' history-substring-search-down
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
# }}} End configuration added by Zim install
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
alias lowlatency='lowlatency'
function lowlatency(){
streamlink --player mpv --twitch-low-latency --hls-live-edge=1 $1 best &exit
}
By the way, it has been working since I added that file.
There are only 2 files in the directory now
❯ ls /usr/share/zsh/site-functions
_pacman _yay
Last edited by laichiaheng (2021-01-24 16:13:49)
Offline
And is this still Antergos?
Hasn't Antergos died for a long time?
Offline
There's no compinit in that zshrc…
Writing /usr/share/zsh/site-functions/_pacman should cause a timestamp warning?
(Maybe it doesn't, but the action was at best idempotent)
To be sure:
md5sum /usr/share/zsh/site-functions/_pacman
Online
There's no compinit in that zshrc…
Writing /usr/share/zsh/site-functions/_pacman should cause a timestamp warning?
(Maybe it doesn't, but the action was at best idempotent)To be sure:
md5sum /usr/share/zsh/site-functions/_pacman
It did cause timestamp warning before, or not, I forgot.
❯ md5sum /usr/share/zsh/site-functions/_pacman
85c32287a91ba1b4c677a7bff0005cf3 /usr/share/zsh/site-functions/_pacman
Last edited by laichiaheng (2021-01-24 16:20:33)
Offline
Did you understand
There's no compinit in that zshrc…
As of now, no extended autocompletion should™ work for you.
Online
Did you understand
seth wrote:There's no compinit in that zshrc…
As of now, no extended autocompletion should™ work for you.
So all I need is to add compinit in my zshrc?
Offline