Git Product home page Git Product logo

bash_profiles's Introduction

Author License - MIT

.bash_profiles

This folder contains scripts and settings that will be loaded when you open a terminal.

The scripts and settings were created for use within an OSX environment.

Installation

Download, unpack and move the folder to /Users/<your username> rename the folder to .bash_profiles so it becomes a hidden folder.

Or clone this repository within your home folder (/Users/<your username>).

$ git clone https://github.com/zero2one/bash_profiles.git ~/.bash_profiles

Replace the .bash_profile file within your home folder (/Users/<your username>/.bash_profile) by removing the original file and replace it with a symlink to the bash_profile.sh script in the .bash_profiles folder.

$ mv ~/.bash_profile ~/.bash_profile.BAK
$ ln -s ~/.bash_profiles/bash_profile.sh ~/.bash_profile

Close and reopen the terminal window or reload the .bash_profile by running the following command:

$ source ~/.bash_profile

Enable scripts

This package has a set of predefined scripts. They are not defined by default. You can enable them by creating a symlink from the .bash_profiles/enabled/ folder to the script in the .bash_profiles/available/ folder:

$ cd ~/.bash_profiles/enabled
$ ln -s ../available/<script name>.sh 

You need to reload the .bash_profile folder (or close and reopen the terminal) to get the changes applied:

$ source ~/.bash_profile

The .bash_profile script will be loaded and will scan the enabled folder to load all *.sh files.

Add aliases

The .bash_profile script will also load automatically all scripts in the .bash_profiles/aliases folder.

This folder is meant to hold scripts that define aliases, but you can put here whatever script you like to be loaded in the command line interface.

Make sure that each script starts with a shebang line (#!/bin/bash)

Script included in the package

The .bash_profiles/availablefolder contains a set of predefined scripts. See Enable scripts how to enable them.

This is an overview of all available scripts:

bash_history.sh

Override the default history command settings for keeping and showing the bash history.

It will keep the last 100 000 commands you run trough CLI.

composer.sh

Add the composer bin directory to the $PATH variable so packages installed globally by composer can be run without using the full path (e.g. phpunit, โ€ฆ).

drupal_coder.sh

Run php code sniffer specific for Drupal.

Usage:

$ phpcsd /path/to/file_or_folder to check.

The command will:

  • Use the Drupal standard.
  • Show progress.
  • Output the results in color.
  • Exclude files that are generated by features.

NOTE: You need to have the coder package installed & configured using composer:

$ composer global require drupal/coder
$ phpcs --config-set installed_paths ~/.composer/vendor/drupal/coder/coder_sniffer

git.sh

Support for latest git version.

X-Code comes with an outdated version of GIT. Replace it with a manual updated version.

  1. Download the latest version from http://git-scm.com/download/mac
  2. Run the installer.

This script will adds the manual installed GIT bin path to the $PATH variable.

Cleaner Git log output

Alias to have a nicer log output from GIT. See https://coderwall.com/p/euwpig/a-better-git-log

Use following command to see the nicer output:

$ git lg

homebrew.sh

Brew autocomplete (including support for git).

You need to have following installation done:

  1. Install homebrew.

  2. Install autocomplete support for the brew and git commands:

    $ brew install git bash-completion
    

    (Note: If this install fails with a 404 error, and you already have git installed, just remove the git part of this brew install).

    $ brew install bash-completion
    

java.sh

Force starting java jar files from cli in the background (e.g. Tomcat, Solr, Tika).

mongodb.sh

Adds the MongoDB bin directory to the $PATH variable.

mysql.sh

Add the bin directory, of the manually installed MySQL server, to the $PATH variable.

php_debug.sh

Enable/Disable debugging of PHP scripts when they are run in command line. Use an IDE (like PhpStorm) that support PHP debugging.

Enable debugger by running:

$ php-debug-on

Disable debugger by running:

$ php-debug-off

prompt.sh

Pimp the command prompt by:

  • Add colors to it.
  • Add extra info to it like current user, hostname & full path
  • Put the prompt on 2 lines: 1 with the info, 2dn to enter command.
  • Show the current GIT branch name (if any).

bash_prompt

tar.sh

Exclude OSX hidden files, created due to the extended attributes, from tarballs.

terminal_window.sh

Add the current path to the terminal window & tab.

This will lookup the current path, create a shorter version out of it and add it as title to the terminal window & tab.

terminal_window

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.