{"id":16843954,"url":"https://github.com/swilgosz/shell-config","last_synced_at":"2025-03-18T05:44:36.544Z","repository":{"id":83124455,"uuid":"54909705","full_name":"swilgosz/shell-config","owner":"swilgosz","description":"This is the config I use to work with.","archived":false,"fork":false,"pushed_at":"2023-10-19T20:54:58.000Z","size":740,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-24T12:32:14.785Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swilgosz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-28T17:23:01.000Z","updated_at":"2023-10-19T20:55:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"cc379a4d-3290-421d-9b26-162aaaad37d0","html_url":"https://github.com/swilgosz/shell-config","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swilgosz%2Fshell-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swilgosz%2Fshell-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swilgosz%2Fshell-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swilgosz%2Fshell-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swilgosz","download_url":"https://codeload.github.com/swilgosz/shell-config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244166641,"owners_count":20409178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T12:54:16.896Z","updated_at":"2025-03-18T05:44:36.525Z","avatar_url":"https://github.com/swilgosz.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shell-config\n\nThis is the config I use to work with web applications. Designed to make my terminal as productive as possible. This is tested and designed for iTerm2\nterminal.\n\n## Installation\n\n1. clone this repository with all plugins included\n\n    ```shell\n    git clone --recursive -j8 https://github.com/wilgoszpl/shell-config.git ~/bin\n    ```\n\n2. install [iterm2](https://www.iterm2.com/index.html)\n\n\n### Tmux\n\nAll tmux specific config is stored in `~/tmux` directory.\n\n1. install tmux\n    ```shell\n    brew install tmux\n    ```\n2. in your create `~/.tmux.conf` file and add this line there:\n    ```shell\n    source ~/bin/tmux/.tmux.conf`\n    ```\n3. clone all plugins run tmux and install plugins:\n    ```shell\n    tmux\n    Ctrl+q, I (shift i)\n    ```\n\n### ZSH (Recommended)\n\nWe strongly recommend to use ZSH shell with this config. To change your default shell into ZSH, just type `chsh -s /usr/zsh` in your terminal.\n\n1. Copy .zshrc from ~/bin/dotfiles/.zshrc\n\n2. Install [.oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)\n\n    ```shell\n    export ZSH=$HOME/bin/.zshrc; sh -c \"$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)\"\n    ```\n3. Add those lines in your newly created `~.zshrc` file. Please, ensure, that you have zsh plugins before `oh-my-zsh` file loaded, and `.zshrc` after that.\n\n    ```shell\n    source $HOME/bin/.zsh_plugins\n    source $ZSH/oh-my-zsh.sh\n    source $HOME/bin/.zshrc\n    ```\n\n4. You may need to set gem paths to get rid of warning when starting terminal.\n\n    ```shell\n    export GEM_HOME=\"$HOME/.gem\"\n    export GEM_PATH=\"$HOME/.gem\"\n\n    ```\n\n\n### BASH\n2. Add this line to your `~/.bash_profile` file\n\n    ```shell\n    source ~/bin/.bashrc\n    ```\n\n## Script list\n\n1. Git branch color\n2. Git command autocomplete\n3. Git aliases\n4. Git rewrite author\n5. Project specific script structurization\n6. Shell color schemes\n7. TMUX runtime script\n\n### 1. Git branch color\n\nIf there is a git repository in current folder, it shows the current branch name, and color it to green/red depending of uncommitted changes\n\n### 2. Git completion\n\nBased on http://gitweb.hawaga.org.uk/ . This script autocompletes git commands after pressing \u003cTAB\u003e key.\n\n### 3. Git aliases\n\nI use several shortcuts for git to improve my speed of repository management. For now I didn't updated `git autocomplete script` to work with\naliases, so I use shell aliases only for commands without need to autocomplete branches.\n\n``` shell\nalias ga='git add -p'\nalias gaa='git add -A'\nalias gc='git commit -m' #this allows me to use 'gc \"Commit message\"'\nalias gca='git commit --amend'\nalias gl='git pull -r'   #always pull and rebase actuall branch\nalias gm='git merge'\nalias go='git checkout'\nalias gp='git push'      #always push actual branch.\nalias gs='git status'\nalias gr='git rebase master' #I often rebase with master and almost never with other branches.\nalias gri='git rebase -i'\n```\n\n### 4. Git rewrite author\n\nThis script is extracted from [This repository](https://github.com/davidfokkema/git-rewrite-author) just to keep things simple\n\n### 5. Project specific scripts\n\nIf you want to add commands for project specific environment setup, just add `project-specific/private.sh` and list sources of private files there.\n\nI name private project_files started from `_` - those files are also ingnored in this repository.\n\nExample:\n\n```shell\nFILE: project-specific/private.sh\n\nsource $HOME/bin/project-specific/_wpl.sh\n```\n\n```shell\nFILE project-specific/_wpl.sh\n\n#HERE you can provide scripts to setup your project environment\n#\n\n\nwpl(){\n  cd $HOME/Projects/wilgoszpl/source\n  rvm use 2.3.0@wpl\n}\n\nwpls(){\n  wpl\n  RAILS_ENV=development rails s\n}\n```\n\nThis configuration allows me to simply use `wpls` to *immediately start* rails server inside of my project with proper gemset set. I use separeate file\nfor each project and keep them private.\n\n### 7. Tmux runtime script\n\nThis script immediately opens terminal with two windows with 3 panels ond first one, runs vim, server, console, and prepare project-specific\nenvironment.\n\nTo use it, just setup those environment variables. I place them inside of my project-specific files in `twpl` command. After configuring environment\nin this way, typing `twpl` in your terminal will do everything you need - just start coding.\n\n\n```shell\nFILE project-specific/_wpl.sh\n\n#HERE you can provide scripts to setup your project environment\n#\n\n#prepare project specific environment\nwpl(){\n  cd $HOME/Projects/wilgoszpl/source\n  rvm use 2.3.0@wpl\n}\n\n#run server with project specific environment\nwpls(){\n  wpl\n  RAILS_ENV=development rails s\n}\n\n#run tmux environment auto setup\ntwpl(){\n  export prcmd=wpl\n  export scmd=wpls\n  export session=wilgoszpl\n  export window1=${session}:shell\n  export window2=${session}:vim\n  ~/bin/.tmux/rails-dev.sh\n}\n```\n##Contribution\n\n1. Fork it\n2. Create Pull request.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswilgosz%2Fshell-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswilgosz%2Fshell-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswilgosz%2Fshell-config/lists"}