This repository contains the custom configuration files for various programs (currently including bash and vim) I am using which I think have sharing values.
These files are designed to be as portable as possible, which I am currently using on Debian, Ubuntu and Windows machines.
install.sh
is a helper script to list and copy the available files.
If run with the option -a
, it will copy all available files automatically.
This provides a customized prompt with colours similar to the Bash prompt shown below, and with user name and host name prepended before the working directory.
Add registry entry HKCU\Software\Microsoft\Command Processor
with AutoRun
as
key, REG_EXPAND_SZ
as type, and %HOMEDRIVE%%HOMEPATH%\autoexec.cmd
as value
to enable the script.
This is sourced from autoexec.cmd
to provide colours
This is modified from the default .bashrc found on Ubuntu systems, which contains the following features.
I have changed the style of the prompt from Ubuntu's default user@host:dir$
to
Fedora's [user@host dir]$
because I think the latter is more readable.
When colouring is enabled, the prompt is coloured according to the effective user of the shell:
- green if the shell is running as yourself;
- yellow if the shell is running as another user;
- red if the shell is running as root, or started as an "administrative user" under Microsoft Windows.
Moreover, to alert the user if the shell is currently accessed over an SSH
session, the host name is coloured red and printed bold if SSH related
environment variables are found, which reduce the chance of typing commands into
the wrong machine. This will not work if sudo
clears the environment variables.
.bashrc
makes use of __git_ps1
to show the current git status on the prompt.
If __git_ps1
is not found, it will attempt to load one from
~/.git-prompt.sh
. If it is still not found, a stub is defined and git
integration is not available.
If running inside a Debian chroot, the chroot is prepended into the prompt.
The current [user@host dir]
is shown on the xterm title.
This is sourced from .bashrc
to provide useful aliases and shell functions.
This is sourced from .bashrc
to define variables for colour escape sequences.
The prompt is similar to the bash prompt as describe above, with the difference that $ is replaced by > when running as non-administrator.
The prompt above uses some variables which can be used to configure the colours:
fish_color_prompt
: The prompt colour when running as a normal user. Set togreen
inconfig.fish
.fish_color_prompt_sudo
: The prompt colour when running as another user via sudo. Set toyellow
inconfig.fish
.fish_color_prompt_root
: The prompt colour when running as root. Set tored
inconfig.fish
.fish_color_cwd
: The cwd colour when running as a normal user. Set tobrblue
inconfig.fish
.fish_color_cwd_sudo
: The cwd colour when running as another user via sudo. Unset inconfig.fish
.fish_color_cwd_root
: The cwd colour when running as another user via root. Unset inconfig.fish
.fish_color_status
: The colour to show the status code of the last command. Defaults tored
.fish_color_chroot
: The colour to show the chroot. Defaults toyellow
.fish_color_user
: The colour to show the user name. Unset inconfig.fish
.fish_color_host
: The colour to show the host name. Unset inconfig.fish
.fish_color_host_root
: The colour to show the host name. If not set usefish_color_host
. Unset inconfig.fish
.fish_color_host_remote
: The colour to show the host name. If not set usefish_color_host
. Unset inconfig.fish
.fish_color_host_remote_root
: The colour to show the host name. If not set usefish_color_host_remote
,fish_color_host_root
,fish_color_host
in order. Unset inconfig.fish
.
This provides some customisations of the prompt
This overrides the default function to provide better detection for administrator rights on Windows systems.
The prompt is similar to the bash prompt as describe above, with the difference that $ or # is replaced by > multipled by the number of nested prompt.
If posh-git is installed, it will be loaded to show git info.
This loads the example vimrc
and set some configuration options which I think is
better.
This loads the example gvimrc
and set a prettier font.
This file contains a list of backup files and OS-generated files which should be
ignored by git. Apply it by git config --global core.excludesfile '~/.gitignore_global'