diff --git a/dotfiles/.zsh/aliases.zsh b/aliases/.aliases.sh similarity index 80% rename from dotfiles/.zsh/aliases.zsh rename to aliases/.aliases.sh index ae3b0463..3b143a18 100644 --- a/dotfiles/.zsh/aliases.zsh +++ b/aliases/.aliases.sh @@ -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 . -# -################################################################################## +# 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 diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish index 91323c05..a56c0ec0 100644 --- a/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -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 diff --git a/fish/.config/fish/functions/fish_prompt.fish b/fish/.config/fish/functions/fish_prompt.fish index 850a2956..f8f9766f 100644 --- a/fish/.config/fish/functions/fish_prompt.fish +++ b/fish/.config/fish/functions/fish_prompt.fish @@ -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 diff --git a/dotfiles/.zsh/functions.zsh b/functions/.zsh_functions.zsh similarity index 69% rename from dotfiles/.zsh/functions.zsh rename to functions/.zsh_functions.zsh index ec96fb06..245baf74 100644 --- a/dotfiles/.zsh/functions.zsh +++ b/functions/.zsh_functions.zsh @@ -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 . -# -################################################################################## +# 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 @@ -36,8 +19,8 @@ function 4k() { local display=$(xrandr | grep -Eo ".{0,20} connected" | awk '{print $1}') # Get the default mode name for 4k - local mode=$(cvt 3840 2160 | grep "Modeline" | awk '{print $2}') - + local mode=$(cvt 3840 2160 | grep "Modeline" | awk '{print $2}') + # If the 4k mode hasn't been added yet if [[ !(xrandr | grep -q 3840x2160) ]]; then @@ -47,7 +30,7 @@ function 4k() { # Add the new mode to the display with xrandr xrandr --addmode ${display} ${mode} - fi + fi xrandr --output ${display} --mode ${mode} # Change the resolution to 4k sed -i '/Xft.dpi/c\Xft.dpi: 180' ~/.Xresources # Change the dpi line to 180 @@ -58,10 +41,14 @@ function 4k() { # Git functions #################################################################### -# Easily clone and cd into GitHub repositories +# 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 diff --git a/dotfiles/.zshrc b/zsh/.zshrc similarity index 58% rename from dotfiles/.zshrc rename to zsh/.zshrc index 634de7a4..a7c4e941 100644 --- a/dotfiles/.zshrc +++ b/zsh/.zshrc @@ -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 . -# -################################################################################## +# 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,14 +43,14 @@ 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)" # Use our dircolors for the autocompletion feature of zsh so everything looks consistent -zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} +zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} # Add syntax highlighting to zsh source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh