mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-02-23 05:00:55 +01:00
Major refactor to the modularity between shells
This commit: - Moves aliases to .aliases.sh. Aliases can now be used with both zsh and fish. - Adds the ability to automatically create an upstream remote with the hub function. - Finalizes the fish prompt to be consistent with zsh.
This commit is contained in:
parent
8f5ac166e5
commit
ce70ea53e9
@ -1,22 +1,5 @@
|
||||
##################################################################################
|
||||
#
|
||||
# New Start: A modern Arch workflow built with an emphasis on functionality.
|
||||
# Copyright (C) 2017 Donovan Glover
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
##################################################################################
|
||||
# New Start: A modern Arch workflow built with an emphasis on functionality.
|
||||
# Copyright (C) 2017-2018 Donovan Glover
|
||||
|
||||
####################################################################
|
||||
# Sudo and other system aliases
|
||||
@ -42,7 +25,6 @@ alias ls="exa"
|
||||
|
||||
alias l="exa -1" # Show each output from ls on a separate line
|
||||
alias lsa="exa -a" # Show hidden files (also known as dotfiles)
|
||||
alias type="type -a" # Easily see what the command you want to run points to
|
||||
|
||||
####################################################################
|
||||
# Volume aliases
|
@ -1,25 +1,14 @@
|
||||
#set -U fish_greeting ""
|
||||
#set -U fish_history ""
|
||||
#set -U fish_user_paths
|
||||
#set -x BROWSER "waterfox"
|
||||
# New Start: A modern Arch workflow built with an emphasis on functionality.
|
||||
# Copyright (C) 2017-2018 Donovan Glover
|
||||
|
||||
fish_vi_key_bindings
|
||||
set -U fish_greeting ""
|
||||
set -U fish_history ""
|
||||
set -U fish_user_paths
|
||||
set -x BROWSER "waterfox"
|
||||
|
||||
alias c="clear"
|
||||
alias cf="tput reset"
|
||||
alias pls="sudo"
|
||||
alias rm="rm -i"
|
||||
alias mkdir="mkdir -p"
|
||||
fish_default_key_bindings
|
||||
|
||||
alias exa="exa --group-directories-first"
|
||||
alias ls="exa"
|
||||
alias l="ls -l"
|
||||
alias lsa="ls -a"
|
||||
alias tree="exa --long --tree"
|
||||
alias t="tree -L 1"
|
||||
|
||||
alias todo="rg TODO"
|
||||
alias pwd="pwd | sed -e 's!$HOME!~!g'"
|
||||
source ~/.aliases.sh
|
||||
|
||||
# Start X at login
|
||||
if status --is-login
|
||||
|
@ -1,37 +1,17 @@
|
||||
set __fish_git_prompt_showdirtystate 'yes'
|
||||
set __fish_git_prompt_showstashstate 'yes'
|
||||
set __fish_git_prompt_showupstream 'yes'
|
||||
set __fish_git_prompt_color_branch magenta
|
||||
|
||||
set __fish_git_prompt_char_dirtystate '! '
|
||||
set __fish_git_prompt_char_stagedstate '→ '
|
||||
set __fish_git_prompt_char_stashstate '↩ '
|
||||
set __fish_git_prompt_char_upstream_ahead '↑ '
|
||||
set __fish_git_prompt_char_upstream_behind '↓ '
|
||||
# New Start: A modern Arch workflow built with an emphasis on functionality.
|
||||
# Copyright (C) 2017-2018 Donovan Glover
|
||||
|
||||
function fish_prompt
|
||||
set -l color_cwd
|
||||
set -l suffix
|
||||
set host (prompt_hostname)
|
||||
set pwd (basename $PWD)
|
||||
|
||||
if [ $pwd = $USER ]
|
||||
set pwd "~"
|
||||
end
|
||||
switch "$USER"
|
||||
case root toor
|
||||
if set -q fish_color_cwd_root
|
||||
set color_cwd $fish_color_cwd_root
|
||||
else
|
||||
set color_cwd $fish_color_cwd
|
||||
end
|
||||
set suffix '#'
|
||||
case '*'
|
||||
set color_cwd $fish_color_cwd
|
||||
set suffix ""
|
||||
end
|
||||
|
||||
set git (__fish_git_prompt)
|
||||
# $USER@$host
|
||||
echo -n "$pwd$git ➤➤➤ "
|
||||
# printf '%s@%s %s%s%s%s> ' (whoami) (hostname) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal) (__fish_git_prompt)
|
||||
set_color magenta; echo -n "$pwd"
|
||||
set_color white; echo -n " "
|
||||
set_color red; echo -n "➤"
|
||||
set_color green; echo -n "➤"
|
||||
set_color blue; echo -n "➤"
|
||||
set_color white; echo -n " "
|
||||
end
|
||||
|
@ -1,22 +1,5 @@
|
||||
##################################################################################
|
||||
#
|
||||
# New Start: A modern Arch workflow built with an emphasis on functionality.
|
||||
# Copyright (C) 2017 Donovan Glover
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
##################################################################################
|
||||
# New Start: A modern Arch workflow built with an emphasis on functionality.
|
||||
# Copyright (C) 2017-2018 Donovan Glover
|
||||
|
||||
####################################################################
|
||||
# Screen resolution functions (also changes DPI, but not for the
|
||||
@ -59,9 +42,13 @@ function 4k() {
|
||||
####################################################################
|
||||
|
||||
# Easily clone and cd into GitHub repositories
|
||||
# Usage: hub username/repository [upstream]
|
||||
function hub() {
|
||||
git clone ssh://git@github.com/$1.git
|
||||
cd $(basename "$1")
|
||||
if [[ $2 ]]; then
|
||||
git remote add upstream ssh://git@github.com/$2/$(basename "$1").git
|
||||
fi
|
||||
}
|
||||
|
||||
# Do the same for GitLab
|
@ -1,22 +1,5 @@
|
||||
##################################################################################
|
||||
#
|
||||
# New Start: A modern Arch workflow built with an emphasis on functionality.
|
||||
# Copyright (C) 2017 Donovan Glover
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
##################################################################################
|
||||
# New Start: A modern Arch workflow built with an emphasis on functionality.
|
||||
# Copyright (C) 2017-2018 Donovan Glover
|
||||
|
||||
export VISUAL="nvim"
|
||||
export EDITOR="nvim"
|
||||
@ -35,7 +18,7 @@ export PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH" # Add ruby gems to $PATH
|
||||
|
||||
# Add custom software to $PATH
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
export PATH="$HOME/Home/new-start/bin:$PATH"
|
||||
export PATH="$HOME/bin:$PATH"
|
||||
|
||||
export FZF_DEFAULT_OPTS='--height 40% --reverse --border --color=16'
|
||||
|
||||
@ -60,8 +43,8 @@ zstyle ':completion:*:default' menu 'select=0'
|
||||
zstyle ':completion:*' list-colors "=(#b) #([0-9]#)*=36=31"
|
||||
|
||||
# Source our aliases first, then our functions (some functions rely on aliases)
|
||||
source ~/.zsh/aliases.zsh
|
||||
source ~/.zsh/functions.zsh
|
||||
source ~/.aliases.sh
|
||||
source ~/.zsh_functions.zsh
|
||||
|
||||
# Source our dircolors
|
||||
eval "$(dircolors ~/.dircolors)"
|
Loading…
Reference in New Issue
Block a user