diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index 89e5da37..c51a05d1 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -2284,6 +2284,26 @@ For configuration information, visit the [bash-git-prompt repository](https://gi **Note** You can configure Oh My ZSH by editing the `/home/laradock/.zshrc` in running container. +> With the ZSH autosuggestions plugin. + +[ZSH autosuggestions plugin](https://github.com/zsh-users/zsh-autosuggestions) suggests commands as you type based on history and completions. + +1 - Enable ZSH as described previously + +2 - Set `SHELL_OH_MY_ZSH_AUTOSUGESTIONS` to `true` + +3 - Rebuild and use ZSH as described previously + +> With bash aliases loaded. + +Laradock provides aliases through the `aliases.sh` file located in the `laradock/workspace` directory. You can load it into ZSH. + +1 - Enable ZSH as described previously + +2 - Set `SHELL_OH_MY_ZSH_ALIASES` to `true` + +3 - Rebuild and enjoy aliases +
## PHPStorm Debugging Guide diff --git a/docker-compose.yml b/docker-compose.yml index 20f6c3f1..650ea4db 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -63,6 +63,8 @@ services: args: - CHANGE_SOURCE=${CHANGE_SOURCE} - SHELL_OH_MY_ZSH=${SHELL_OH_MY_ZSH} + - SHELL_OH_MY_ZSH_AUTOSUGESTIONS=${SHELL_OH_MY_ZSH_AUTOSUGESTIONS} + - SHELL_OH_MY_ZSH_ALIASES=${SHELL_OH_MY_ZSH_ALIASES} - UBUNTU_SOURCE=${UBUNTU_SOURCE} - BASE_IMAGE_TAG_PREFIX=${WORKSPACE_BASE_IMAGE_TAG_PREFIX} - LARADOCK_PHP_VERSION=${PHP_VERSION} diff --git a/env-example b/env-example index 94026caa..2796e476 100644 --- a/env-example +++ b/env-example @@ -83,6 +83,8 @@ DOCKER_SYNC_STRATEGY=native_osx # If you want to use "Oh My ZSH!" with Laravel autocomplete plugin, set SHELL_OH_MY_ZSH to true. SHELL_OH_MY_ZSH=false +SHELL_OH_MY_ZSH_AUTOSUGESTIONS=false +SHELL_OH_MY_ZSH_ALIASES=false ########################################################### ################ Containers Customization ################# diff --git a/workspace/Dockerfile b/workspace/Dockerfile index c0279b0d..2d0a70dd 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -1424,6 +1424,9 @@ RUN if [ ${SHELL_OH_MY_ZSH} = true ]; then \ apt install -y zsh \ ;fi +ARG SHELL_OH_MY_ZSH_AUTOSUGESTIONS=false +ARG SHELL_OH_MY_ZSH_ALIASES=false + USER laradock RUN if [ ${SHELL_OH_MY_ZSH} = true ]; then \ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh) --keep-zshrc" && \ @@ -1439,7 +1442,21 @@ bindkey "^[[3~" delete-char\n\ bindkey "^[[4~" end-of-line\n\ bindkey "^[[5~" up-line-or-history\n\ bindkey "^[[6~" down-line-or-history\n\ -bindkey "^?" backward-delete-char\n' >> /home/laradock/.zshrc \ +bindkey "^?" backward-delete-char\n' >> /home/laradock/.zshrc && \ + if [ ${SHELL_OH_MY_ZSH_AUTOSUGESTIONS} = true ]; then \ + sh -c "git clone https://github.com/zsh-users/zsh-autosuggestions /home/laradock/.oh-my-zsh/custom/plugins/zsh-autosuggestions" && \ + sed -i 's~plugins=(~plugins=(zsh-autosuggestions ~g' /home/laradock/.zshrc && \ + sed -i '1iZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20' /home/laradock/.zshrc && \ + sed -i '1iZSH_AUTOSUGGEST_STRATEGY=(history completion)' /home/laradock/.zshrc && \ + sed -i '1iZSH_AUTOSUGGEST_USE_ASYNC=1' /home/laradock/.zshrc && \ + sed -i '1iTERM=xterm-256color' /home/laradock/.zshrc \ + ;fi && \ + if [ ${SHELL_OH_MY_ZSH_ALIASES} = true ]; then \ + echo "" >> /home/laradock/.zshrc && \ + echo "# Load Custom Aliases" >> /home/laradock/.zshrc && \ + echo "source /home/laradock/aliases.sh" >> /home/laradock/.zshrc && \ + echo "" >> /home/laradock/.zshrc \ + ;fi \ ;fi USER root