Package Details: zsh-zim-git r548.74367b8-3

Git Clone URL: https://aur.archlinux.org/zsh-zim-git.git (read-only, click to copy)
Package Base: zsh-zim-git
Description: ZIM - Zsh IMproved
Upstream URL: https://github.com/zimfw/zimfw
Keywords: improved plugin theme vim zim zsh
Licenses: MIT
Submitter: ishitatsuyuki
Maintainer: carbolymer
Last Packager: carbolymer
Votes: 19
Popularity: 0.000048
First Submitted: 2015-12-28 02:13
Last Updated: 2021-01-26 17:22

Pinned Comments

carbolymer commented on 2021-01-11 21:41

Ugh, it was a PITA to create this package. Please note that errors are silenced, so if you have any issues with zim, remove &>/dev/null from your /etc/zshrc - https://aur.archlinux.org/cgit/aur.git/tree/zshrc?h=zsh-zim-git&id=5a378e94d516c57d39629de545b78b0f020d86a4

I had to do it this way: $ZIM_HOME is only writable by root and zim constantly tries to update & recompile itself (=write to $ZIM_HOME), which results in permission errors when starting zsh as a normal user.

If you want to add/remove a module:

  1. Add a respective zmodule in /etc/zsh/zimrc
  2. Run as root: zimfw install && zsh

Latest Comments

1 2 3 4 5 6 ... Next › Last »

carbolymer commented on 2021-01-26 17:24

@Rhinoceros, thanks for debugging and reporting it here! You're right, it is imported twice. I've removed unnecessary line from zshrc:

source ${ZIM_HOME}/init.zsh &>/dev/null

In my opinion this /usr/lib/zim/templates/zshrc works fine, I took it from zimfw repo (which recommends it for enabling zim).

Rhinoceros commented on 2021-01-25 06:14

Ah, so modules are being sourced twice because /etc/zsh/zshrc contains two lines

source ${ZIM_HOME}/templates/zshrc &>/dev/null
source ${ZIM_HOME}/init.zsh &>/dev/null

but /usr/lib/zim/templates/zshrc also contains source ${ZIM_HOME}/init.zsh. I'm not sure if this is an error from upstream? I also had a look through /usr/lib/zim/templates/zshrc, and it had a bunch of options in there that I overwrite in ~/.zshrc anyway. It also contained the very nasty HIST_IGNORE_ALL_DUPS, which wrecked my history file! I just removed the first line in /etc/zsh/zshrc and replaced it with

source ${ZIM_HOME}/zimfw.zsh init -q &>/dev/null

This seems to work fine.

Rhinoceros commented on 2021-01-24 07:03

No worries @carbolymer. Thanks for the hint. That works great! One other thing is still bugging me… any idea how to stop (e.g.) /usr/lib/zim/modules/environment/init.zsh being sourced twice with each new terminal?

carbolymer commented on 2021-01-22 07:50

@Rhinoceros Sorry, I've made a mistake in the patch, I forgot to make chmod run recursively. Now the rights should be correct. Regarding adding/removing modules, you can add/remove them to /etc/zsh/zimrc. I've added steps to my pinned comment.

Rhinoceros commented on 2021-01-22 07:09

Ugh… I've spent another few hours trying to figure out how to specify what modules are loaded. At the moment, some are loaded twice. e.g. edit /usr/lib/zim/modules/environment/init.zsh and put echo foo at the top, and a new terminal will show foo twice. I also want to disable some, e.g. git. I couldn't see zmodule git in any of the installed files, but there are a few references to git in /usr/lib/zim/init.zsh. Just to test, I removed these references, then did the mandatory touch ~/.zimrc as before. I also noticed that /usr/lib/zim/init.zsh is owned by root:root with 600 permissions, so to avoid errors I had to make it 644 instead (is that a bug?). This seemed to work, in that the git module was no longer active.

1) What is the best way to load/unload modules?

2) Is the fact that /usr/lib/zim/init.zsh is not user-readable correct?

Rhinoceros commented on 2021-01-15 07:42

Thanks again @carbolymer for your continued assistance. I can appreciate that this is a very fiddly package, so thanks for staying with it.

Your suggestion for zshmarks works perfectly. This command modifies /usr/lib/zim/init.zsh. I feel like it may be better to modify a user-owned file, but I think by default there is only one init.zsh. I can see /usr/lib/zim/init.zsh is sourced by /etc/zsh/zshrc. I wonder if a better solution is for users to copy init.zsh to somewhere in their home directory, with /etc/zsh/zshrc sourcing this file instead? I guess since /etc/zsh/zshrc is in the PKGBUILD's backup array, users can always do this themselves. Or is it better for the PKGBUILD to do this? I haven't delved too deeply in it, but a possible positive of making init.zsh (and other things?) is that there will be no errors? But a possible negative is that zimfw might try to automatically update (although this could be disabled by default).

carbolymer commented on 2021-01-13 18:15

I've cloned zshmarks to /usr/lib/zim/modules then added zmodule zshmarks to /etc/zsh/zimrc, then sudo zsh then zimfw install && zsh and it works.

The command which causes

mv: cannot move '/usr/lib/zim/init.zsh' to '/usr/lib/zim/init.zsh.old': Permission denied

is zrecompile which is necessary I think. The only workaround is to silence this error.

I've added a patch for part of force update you suggested though, thanks for the hint!

Rhinoceros commented on 2021-01-13 03:22

Another bit of weirdness. After updating the package, I have to touch ~/.zimrc in order for it to be sourced in the future at all. It might be related to line 55 of /usr/lib/zim/zimfw.zsh?

  # Force update of init.zsh if it's older than .zimrc

This might need to be patched for installation by a package manager.

Also, regarding the general suppression of error messages, I wonder if a cleaner way would be to patch out the specific command that causes the error

mv: cannot move '/usr/lib/zim/init.zsh' to '/usr/lib/zim/init.zsh.old': Permission denied

FWIW I only ever get this one error. I had a brief look, and I think the command might also be in /usr/lib/zim/zimfw.zsh.

Rhinoceros commented on 2021-01-12 09:31

Thanks again @carbolymer! Manually sourceing powerlevel10k works perfectly. By your GitHub link, did you mean this alternative would require installing powerlevel10k without pacman? I'd much prefer for the package manager to keep everything updated, so if so I'll just use the manual way instead.

On a related note, might you have any suggestions for how to get zshmarks working? I'm the maintainer. Previously I just symlinked the entire project directory into /usr/lib/zim/modules/zshmarks, then edited ~/.zimrc to add zshmarks to the zmodules array, but this no longer works. I tried zmodule zshmarks instead, but this also fails.

Actually, the post after your link suggests this should work, but it doesn't seem to be working for me.

carbolymer commented on 2021-01-12 08:25

@Rhinoceros, thanks for the hint. I've added it to the package.

I've checked powerlevel10k, and it works fine without zim interaction i.e. I've installed aur package and added

source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme

to /etc/zsh/zshrc below lines sourcing zim.

If you would like to use zim, this also works for me: https://github.com/zimfw/zimfw/issues/368#issuecomment-631520836 but you need to add this zmodule to /etc/zsh/zimrc (which is symlinked by ~root/.zimrc) and then do zimfw install