rupa / z

z - jump around
Do What The F*ck You Want To Public License
16.39k stars 1.17k forks source link

can't work on macOS10.15 #268

Open kangkang59812 opened 5 years ago

kangkang59812 commented 5 years ago

when I run 'z path_name' The results are these:

common: /Users/kangkang/.oh-my-zsh/plugins 28 /Users/kangkang/.oh-my-zsh/plugins 108 /Users/kangkang/.oh-my-zsh/plugins/z

kangkang59812 commented 5 years ago

And I did the '. z.sh' An error happened.

z.sh:8: parse error near `\n'

lschwetlick commented 4 years ago

I'm also having trouble getting it to work on MacOS10.15. Added the line to my bash_profile. I'm not getting any errors, it just quietly doesn't work. It doesn't even create the data file.

Edit: Fixed it! I did get it to work now. On my machine I just needed to explicitly set

export _Z_OWNER="myusername"

That may be something to do with Catalina locking permissions on everything... Also, I needed to put it at the bottom of my bash_profile, because something (setting the prompt) seemed to be interfering.

xenoterracide commented 4 years ago

hmm... I seem to have the problem, using zsh, it was working with existing entries in the file, but it refused to add the new ones (note, I was using the oh-my-zsh version which is really old and probably should get updated) but I replaced my copy of the z.sh with the most recent from master.

> zsh --version                                                                                                                                                                                  # ~ RC=1
zsh 5.7.1 (x86_64-apple-darwin19.0)
> cd ~/IdeaProjects                                                                                                                                                                                   # ~
> z --list                                                                                                                                                                                 # IdeaProjects
> ls ~/.z                                                                                                                                                                             # IdeaProjects RC=1
ls: /Users/calebcushing/.z: No such file or directory
> cat ~/.zshrc                                                                                                                                                                        # IdeaProjects RC=1
###
#this file is generated edit ~/.config/yadm/alt/.gitconfig##template instead
###

# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="/Users/calebcushing/.oh-my-zsh"

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="typewritten"
TYPEWRITTEN_CURSOR="block"
TYPEWRITTEN_RIGHT_PROMPT_PREFIX="# "
TYPEWRITTEN_GIT_RELATIVE_PATH=true

# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to automatically update without prompting.
DISABLE_UPDATE_PROMPT="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

ZSH_COLORIZE_STYLE="monokai"

# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
  colored-man-pages
  colorize
  command-not-found
  common-aliases
  direnv
  history
  history-substring-search
  gitfast
  git-auto-fetch
  git-escape-magic
  git-flow
  gitignore
  gradle
  magic-enter
  safe-paste
  themes
  z
)

source $ZSH/oh-my-zsh.sh

# User configuration

source $HOME/.config/my/rc.sh

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
export EDITOR='vim'
export VISUAL='vim'
export _Z_OWNER=`whoami`

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.

unalias mv
unalias rm
unalias cp

# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

alias vi="vim -Xp"
alias vim="vim -Xp"

jdk() {
  version=$1
  export JAVA_HOME=$(/usr/libexec/java_home -v"$version");
  java -version
}
> env                                                                                                                                                                                      # IdeaProjects
TMPDIR=/var/folders/82/hbm4_npj2b1777zff7y7s3km0000gn/T/
XPC_FLAGS=0x0
TERM_PROGRAM_VERSION=433
LANG=en_US.UTF-8
TERM_PROGRAM=Apple_Terminal
XPC_SERVICE_NAME=0
TERM_SESSION_ID=49BBA23A-5451-432A-815D-D17D2FF4DEAD
TERM=xterm-256color
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.4yLSxUUGOO/Listeners
SHELL=/bin/zsh
HOME=/Users/calebcushing
LOGNAME=calebcushing
USER=calebcushing
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/node@10/bin/node:/Applications/Wireshark.app/Contents/MacOS
SHLVL=1
PWD=/Users/calebcushing/IdeaProjects
OLDPWD=/Users/calebcushing
LESS=-R --no-init --quit-if-one-screen
ZSH=/Users/calebcushing/.oh-my-zsh
PAGER=less
LSCOLORS=Gxfxcxdxbxegedabagacad
EDITOR=vim
VISUAL=vim
_Z_OWNER=calebcushing
_=/usr/bin/env