GithubHelp home page GithubHelp logo

zap-zsh / zap Goto Github PK

View Code? Open in Web Editor NEW
907.0 10.0 32.0 173 KB

:zap: Zap is a minimal zsh plugin manager

Home Page: https://www.zapzsh.com/

License: GNU General Public License v3.0

Shell 100.00%
plugin-manager sh shell zsh zshell

zap's People

Contributors

5c077m4n avatar abrahamparayil avatar andrew15-5 avatar antpeixe avatar chrishrb avatar christianchiarulli avatar cobalt-inferno avatar codehia avatar dotzenith avatar dtomvan avatar erkattak avatar granddave avatar itznesbrodev avatar loneexile avatar mamaraddio avatar mannguyen0107 avatar mattmc3 avatar mmorys avatar pheon-dev avatar rishabh672003 avatar trimclain avatar umop3plsdn avatar undg avatar wintermi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zap's Issues

Create templates for issues and pull requests

provides higher quality issues and pull requests and makes the pr or issue more clear.

for example in pull requests ask for

  1. short description
  2. what this pull request changes
    etc...

Plug not working for WSL2 Ubuntu 22.04

This is my .zshrc

[ -f "$HOME/.local/share/zap/zap.zsh" ] && source "$HOME/.local/share/zap/zap.zsh"

HISTFILE=~/.zsh_history

source "$ZDOTDIR/functions.zsh"

zshsource "exports"
zshsource "aliases"

# Example install plugins
plug "zap-zsh/supercharge"
plug "zsh-users/zsh-autosuggestions"
plug "zap-zsh/zap-prompt"

# Manually source since zap plug doesnt work
source "$HOME/.local/share/zap/plugins/zap-prompt/zap-prompt.zsh-theme"
source "$HOME/.local/share/zap/plugins/supercharge/supercharge.plugin.zsh"
source "$HOME/.local/share/zap/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"

zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'

zshsource "git"

zshsource "keymaps"

Everything in this file works except lines with plug. zshsource does nothing special other than sourcing those files.

Defining function based on alias update

Trying to set up on my M1 mac and when I source zap.zsh I get errors

source "$HOME/.local/share/zap/zap.zsh"
/Users/John.Costanzo/.local/share/zap/zap.zsh:42: defining function based on alias `update'
/Users/John.Costanzo/.local/share/zap/zap.zsh:42: parse error near `()'

zapcmp fails on zsh-users/zsh-completions

The structure of files/directories isn't that expected by the function.

Also, should zapcmp be zapcomp? It's more consistent with zsh: compinit, compdef, etc. And cmp always means compare to me, not complete.

$ZDOTDIR not being read properly?

my ZDOTDIR is set in .zshenv file in home directory, when running the command on zap website another .zshrc was created in home directory with commands to source zap. I'm assuming this was likely because ZDOTDIR was not picked up by the install script?

Problem sourcing the spaceship-promt theme

Describe the bug

I tried installing the spaceship-promt theme and got the message that it wasn't activated. After going through the code I found out,
that when zap sources the plugin, it uses the plugin name and the extension to find the file to source. In case of spaceship-promt the file is actually called spaceship.zsh-theme.

Steps to reproduce

plug "spaceship-prompt/spaceship-prompt"

Expected behavior

Install and enable the theme

Screenshots and recordings

No response

OS / Linux distribution

Ubuntu 22.04

Zsh version

5.8.1

Zap version

v0.2.0 on commit 3564bef

Terminal emulator

kitty

If using WSL on Windows, which version of WSL

None

Additional context

No response

Zsh opens to / instead of $PWD when using systemd-homed with subvolume storage

Describe the bug

I'be been having an odd issue with zsh lately. I use WezTerm as my choice terminal emulator running zsh. I can open wezterm and zsh opens in my home directory, after that I'll click new tab or run zsh in my current session. The child instance opens to / instead, and the same issue happens in the tty. I've noticed it only happens when my /zshrc contains plug lines. If I remove them it no longer has the issue with opening to /. I've also tested it in a vm and had the same issue. You can find my zsh configuration on my dotfiles repo under the zsh folder.

Steps to reproduce

Create a systemd-homed user using subvolume storage and use https://raw.githubusercontent.com/thomascft/dotfiles/stow/zsh/.zshrc

Expected behavior

Zsh should open to $PWD

Screenshots and recordings

No response

OS / Linux distribution

Arch Linux

Zsh version

5.9

Zap version

v0.2.0 on commit ca9e52d

Terminal emulator

Wezterm

If using WSL on Windows, which version of WSL

None

Additional context

I don't have any issues on zplug I'm showing similar issues under zplug, not sure where to post though

RFC: Nvim like setup function standard for zap plugin ecosystem

I know this may sound unorthodox, but it would provide easy ways to provide config instead of having vars set in random places, and control when plugins are loaded.
An example:

zapplug "plugin" # Loads plugin
plugin_name::setup arg arg2 # setup plugin
# could also be a bash associative array

and the plugin could look like so

plugin_name::setup() {
	local some_arg=$1 # load arguments
	local args=$@ # load all args
	do_something_with_args somearg args # do something with them
}

Some people may not like this but hey its just my idea ;)

How to install plugins that in ohmyzsh project?

If the feature request is for a plugin or theme, specify it here.

ohmyzsh extract plugin

If the feature solves a problem you have, specify it here.

No response

Describe the proposed feature.

I' wanna get a way to install plugins that is apart of other project, such as ohmyzsh plugins. The present README doesn't tell me about that.

Describe alternatives you've considered

No response

Additional context

No response

Related Issues

No response

no such file or directory: /home/$USER/.local/share/zap/installed_plugins

After adding the following lines to .zshrc, I got:

plug:26: no such file or directory: /home/$USER/.local/share/zap/installed_plugins
plug:26: no such file or directory: /home/$USER/.local/share/zap/installed_plugins
plug:26: no such file or directory: /home/$USER/.local/share/zap/installed_plugins
plug:26: no such file or directory: /home/$USER/.local/share/zap/installed_plugins
plug:26: no such file or directory: /home/$USER/.local/share/zap/installed_plugins

The problem was fixed by commenting 50-52 in $ZAP_DIR/zap.zsh.

zsh-history-substring-search not working.

zsh-history-substring-search trows this error

_history-substring-search-up-history:zle:13: widgets can only be called when ZLE is active
zsh-syntax-highlighting: error: $region_highlight is not defined
zsh-syntax-highlighting: (Check whether zsh-syntax-highlighting was installed according to the instructions.)

end of my config

[ -f "$HOME/.local/share/zap/zap.zsh" ] && source "$HOME/.local/share/zap/zap.zsh"

plug "zsh-users/zsh-autosuggestions"
plug "zsh-users/zsh-syntax-highlighting"
plug "zsh-users/zsh-history-substring-search"
zmodload zsh/terminfo
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down

According to the instructions it should be loaded after syntax plugin which it is but it is not working the way it should.
Using the keybindings just goes up normally and highlight the part of text searched for example his only when it comes in history.

Some popular Zsh plugins expect themselves to be added to `fpath` (sindresorhus/pure)

Describe the bug

Many Zsh plugins expect themselves to be added to fpath. One example of a plugin that won't work properly if it's not added to fpath is the popular prompt plugin pure.

Other plugin managers do this for users automatically:

Steps to reproduce

# zshrc
plug sindresorhus/pure

Error when not in fpath:

prompt_pure_setup:22: async: function definition file not found
prompt_pure_async_init:6: command not found: async_start_worker
prompt_pure_async_init:7: command not found: async_register_callback
prompt_pure_async_init:8: command not found: async_worker_eval
prompt_pure_async_tasks:7: command not found: async_worker_eval
prompt_pure_async_tasks:27: command not found: async_job

Expected behavior

Zsh plugin managers should add loaded plugins to fpath.

Screenshots and recordings

No response

OS / Linux distribution

All

Zsh version

All

Zap version

Any

Terminal emulator

Any

If using WSL on Windows, which version of WSL

None

Additional context

No response

Feature Request: Allow multiple plugins from one repository

Hi there!

Currently zap tends you to create repository for each plugin you need. It's OK for some kind of public plugins but when you develop your own config usually you want to put all plugins in one place. In this case it would be nice to have a command that allows to "bundle" all plugins from the repository. For example, I have a repo with files:

├ my-exa.plugin.zsh
├ my-vim.plugin.zsh
├ my-work-prompt.plugin.zsh
└ my-home-prompt.plugin.zsh

And somewhere in the .zshrc I just simply write:

…
bundle "username/zap-config"

And all these plugins should be sourced.


Also (I'm not sure if we can do it in bash) additionally it would be nice to have an option that can skip one or more plugins from the repo. For example, in my current repo I have two plugins for prompt and for my home machine I want to use only my-home-prompt.plugin.zsh by excluding my-work-prompt.plugin.zsh like this:

# my home bash config
…
bundle "username/zap-config" -e my-work-prompt my-vim # also exclude my-vim

The reason because we should add "exclude" instead of some kind of white/black lists is that "Zap is a minimal zsh plugin manager" and we should expect the default behavior as it is without any complex side effects.

Unable toinstall zap

Describe the bug

using the one line in the README to install zap it doesn't works

zsh <(curl -s https://raw.githubusercontent.com/zap-zsh/zap/master/install.zsh)

Steps to reproduce

copy

zsh <(curl -s https://raw.githubusercontent.com/zap-zsh/zap/master/install.zsh)

and paste in your zsh session

Expected behavior

Install Zap

Screenshots and recordings

No response

OS / Linux distribution

ArchLinux, Any

Zsh version

any

Zap version

v0.2.0 on commit 4928ff8

Terminal emulator

Any

If using WSL on Windows, which version of WSL

None

Additional context

Solved by PR #105

Support popular cross shell plugins like rupa/z

If the feature request is for a plugin or theme, specify it here.

rupa/z

If the feature solves a problem you have, specify it here.

Popular cross-shell (POSIX) plugins like rupa/z work in Zsh, but it does not supply a .plugin.zsh file, but instead has a .sh file. Zap won't load it.

Describe the proposed feature.

Support .sh plugin files.

Describe alternatives you've considered

No response

Additional context

PR incoming.

Related Issues

No response

Prompt not working

Hey Guys. Just started to fool around with this. But the zap-prompt plugin isn't affecting my zsh prompt. Any ideas?

Automatic formatting

To raise the standard and keep things consistent auto formatting would be a good start.

add a way to just clone the repos which do not support the standard of .plugin.zsh and updating them using a function

as we know many of the plugins dont support the standard which zapplug uses that is

Will only work with plugins that are named conventionally, this means that the plugin file is the same name as the repository with the following extensions:

    .plugin.zsh
    .zsh
    .zsh-theme

so i think we should have a function that just clones the repos when given argument like <name of org or user>/<name of the repo>
and it just clones the repo
and then i think a fuction can update these plugins with the zapplug plugins together with just a git pull
This is just a suggestion if you dont want to implement it its fine, it can be done manually just a builtin function would be nice

MacOS sed shows invalid command during installation

sed: 1: "/Users/xxx/.zshrc": invalid command code e
On MacOS Ventura 13.0.1, I got the above error during installation. This seems caused by the inconsistent versions of sed in GNU and BSD.

zap/install.sh

Lines 18 to 19 in 8d3ca00

sed -i '1 i\
[ -f "$HOME/.local/share/zap/zap.zsh" ] && source "$HOME/.local/share/zap/zap.zsh"' "$zshrc"

According to here:

On the OSX version of sed, the -i option expects an extension argument ...

One potential solusion is to use sed -i.bak, which works on both situations, but this will generate a .bak backup file. Another potential solution is to use perl instead of sed.

I'm sorry that I have limited knowledge in shell programming. Not sure which solution is cleaner and more aligned with the style of Zap, so I'd love to hear your thoughts.

Clone only latest plugin commit

If the feature request is for a plugin or theme, specify it here.

No response

If the feature solves a problem you have, specify it here.

Currently the entire repository is being pulled by plug, which is a lot of overhead if you just want to use it in a minimalistic fashion.

Describe the proposed feature.

Make use of git clone --depth 1 to only clone the latest commit / checkout.

Describe alternatives you've considered

Cloned with plug, then deleted the folders contents and recloned myself with git clone --depth 1

Additional context

No response

Related Issues

No response

Install to $ZDOTDIR/zap

I know you said it was possible to install to $ZDOTDIR, but that's only to source the .zshrc if it's located there.

I want to be able to install the entire plugin manager to e.g. ${ZDOTDIR:-$HOME/.config/zsh}/zap
I don't want to have ZAP_DIR in $HOME/.local/share/zap

bug: update is broken new plug

#36 breaks plugin update as it changes the structure of the plugins folder, from plugins/<plugin_name> to plugins/<user>/<plugin_name>

It also breaks the list of plugins to update, it shows the user instead of the plugin name.

Not sure which way should be chosen.

Typo in zap.zsh

Typo in zap.zsh

It shouldn't be .zccompdump but .zcompdump

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.