diff --git a/.github/README.md b/.github/README.md index 667a5e8..c3f806d 100644 --- a/.github/README.md +++ b/.github/README.md @@ -45,7 +45,7 @@ It's not hard to create your own dotfile repo, it's great fun and you'll learn a ### XDG Directories -The location of most config files can be defined using the [XDG base directory specification](https://specifications.freedesktop.org/basedir-spec), which is honored by most apps. This lets you specify where config, log, cache and data files are stored, keeping your top-level home directory free from clutter. You can do this by setting environmental variables, usually within the [`.zshenv`](https://github.com/Lissy93/dotfiles/blob/master/zsh/.zshenv) file. +The location of most config files can be defined using the [XDG base directory specification](https://specifications.freedesktop.org/basedir-spec), which is honored by most apps. This lets you specify where config, log, cache and data files are stored, keeping your top-level home directory free from clutter. You can do this by setting environmental variables, usually within the [`.zshenv`](https://github.com/Lissy93/dotfiles/blob/master/config/zsh.zshenv) file. Variable | Location --- | --- @@ -189,11 +189,13 @@ Once the repo is cloned, you can modify whatever files you like before running t
~ └──. - ├── bash/ # Bash (shell) config - ├── tmux/ # Tmux (multiplexer) config - ├── vim/ # Vim (text editor) config - ├── zsh/ # ZSH (shell) config - ├── config/ # All other config files + ├── config/ # All configuration files + │ ├── bash/ # Bash (shell) config + │ ├── tmux/ # Tmux (multiplexer) config + │ ├── vim/ # Vim (text editor) config + │ ├── zsh/ # ZSH (shell) config + │ ├── macos/ # Config files for Mac-specific apps + │ └── desktop-apps/ # Config files for GUI apps ├── scripts/ # Bash scripts for automating tasks │ ├── installs/ # Scripts for software installation │ │ ├── Brewfile # Package installs for MacOS via Homebrew @@ -223,7 +225,7 @@ The setup script ([`install.sh`](https://github.com/Lissy93/dotfiles/blob/master - **Setup** - Print welcome message, and a summary of proposed changes, and prompt user to continue - Ensure that core dependencies are met (git, zsh, vim) - - Set variables by reading any passed parameters, or fallback to sensible defaults (see [`.zshenv`](https://github.com/Lissy93/dotfiles/blob/master/zsh/.zshenv)) + - Set variables by reading any passed parameters, or fallback to sensible defaults (see [`.zshenv`](https://github.com/Lissy93/dotfiles/blob/master/config/zsh/.zshenv)) - **Dotfiles** - If dotfiles not yet present, will clone from git, otherwise pulls latest changes - Setup / update symlinks each file to it's correct location on disk @@ -261,7 +263,7 @@ The install script can accept several flags and environmental variables to confi ### Configuring -The locations for all symlinks are defined in [`symlinks.yaml`](https://github.com/Lissy93/dotfiles/blob/master/symlinks.yaml). These are managed using [Dotbot](https://github.com/anishathalye/dotbot), and will be applied whenever you run the [`install.sh`](https://github.com/Lissy93/dotfiles/blob/master/install.sh) script. The symlinks set locations based on XDG paths, all of which are defined in [`.zshenv`](https://github.com/Lissy93/dotfiles/blob/master/zsh/.zshenv). +The locations for all symlinks are defined in [`symlinks.yaml`](https://github.com/Lissy93/dotfiles/blob/master/symlinks.yaml). These are managed using [Dotbot](https://github.com/anishathalye/dotbot), and will be applied whenever you run the [`install.sh`](https://github.com/Lissy93/dotfiles/blob/master/install.sh) script. The symlinks set locations based on XDG paths, all of which are defined in [`.zshenv`](https://github.com/Lissy93/dotfiles/blob/master/config/zsh/.zshenv). --- @@ -284,7 +286,7 @@ You can view a list of defined aliases by running `alias`, or search for a speci #### My Aliases -All aliases in my dotfiles are categorised into files located in [`zsh/aliases/`](https://github.com/Lissy93/dotfiles/blob/master/zsh/aliases/) which are imported in [`zsh/.zshrc`](https://github.com/Lissy93/dotfiles/blob/master/zsh/.zshrc#L9-L14). +All aliases in my dotfiles are categorised into files located in [`zsh/aliases/`](https://github.com/Lissy93/dotfiles/blob/master/config/zsh/aliases/) which are imported in [`zsh/.zshrc`](https://github.com/Lissy93/dotfiles/blob/master/config/zsh/.zshrc#L9-L14). The following section lists all (or most) the aliases by category: @@ -292,7 +294,7 @@ The following section lists all (or most) the aliases by category:Git Aliases -> [`zsh/aliases/git.zsh`](https://github.com/Lissy93/dotfiles/blob/master/zsh/aliases/git.zsh) +> [`zsh/aliases/git.zsh`](https://github.com/Lissy93/dotfiles/blob/master/config/zsh/aliases/git.zsh) Alias | Description ---|--- @@ -353,7 +355,7 @@ Alias | DescriptionFlutter Aliases -> [`zsh/aliases/flutter.zsh`](https://github.com/Lissy93/dotfiles/blob/master/zsh/aliases/flutter.zsh) +> [`zsh/aliases/flutter.zsh`](https://github.com/Lissy93/dotfiles/blob/master/config/zsh/aliases/flutter.zsh) Alias | Description ---|--- @@ -379,7 +381,7 @@ Alias | DescriptionNode.js Aliases -> [`zsh/aliases/node-js.zsh`](https://github.com/Lissy93/dotfiles/blob/master/zsh/aliases/node-js.zsh) +> [`zsh/aliases/node-js.zsh`](https://github.com/Lissy93/dotfiles/blob/master/config/zsh/aliases/node-js.zsh) ##### Yarn @@ -443,7 +445,7 @@ Alias | DescriptionGeneral Aliases -> [`zsh/aliases/general.zsh`](https://github.com/Lissy93/dotfiles/blob/master/zsh/aliases/general.zsh) +> [`zsh/aliases/general.zsh`](https://github.com/Lissy93/dotfiles/blob/master/config/zsh/aliases/general.zsh) ##### Single-Letter Frequently-Used Commands (only set if not already in use) @@ -883,11 +885,11 @@ If you choose to run any of these scripts, take care to read it through first, t ### Vim -The entry point for the Vim config is the [`vimrc`](https://github.com/Lissy93/dotfiles/blob/master/vim/vimrc), but the main editor settings are defined in [`vim/editor.vim`](https://github.com/Lissy93/dotfiles/blob/master/vim/editor.vim) +The entry point for the Vim config is the [`vimrc`](https://github.com/Lissy93/dotfiles/blob/master/config/vim/vimrc), but the main editor settings are defined in [`vim/editor.vim`](https://github.com/Lissy93/dotfiles/blob/master/config/vim/editor.vim) #### Vim Plugins -Vim plugins are managed using [Plug](https://github.com/junegunn/vim-plug) defined in [`vim/plugins.vim`](https://github.com/Lissy93/dotfiles/blob/master/vim/setup-vim-plug.vim). +Vim plugins are managed using [Plug](https://github.com/junegunn/vim-plug) defined in [`vim/plugins.vim`](https://github.com/Lissy93/dotfiles/blob/master/config/vim/setup-vim-plug.vim). To install them from GitHub, run `:PlugInstall` (see [options](https://github.com/junegunn/vim-plug#commands)) from within Vim. They will also be installed or updated when you run the main dotfiles setup script ([`install.sh`](https://github.com/Lissy93/dotfiles/blob/d4b8426629e7fbbd6d17d0b87f0bb863d6618bfd/install.sh#L132-L134)). The following plugins are being used: @@ -973,9 +975,9 @@ The following plugins are being used: ### Tmux -Fairly standard Tmux configuration, strongly based off Tmux-sensible. Configuration is defined in [`.tmux.conf`](https://github.com/Lissy93/dotfiles/blob/master/tmux/tmux.conf) +Fairly standard Tmux configuration, strongly based off Tmux-sensible. Configuration is defined in [`.tmux.conf`](https://github.com/Lissy93/dotfiles/blob/master/config/tmux/tmux.conf) -Tmux plugins are managed using [TMP](https://github.com/tmux-plugins/tpm) and defined in [`.tmux.conf`](https://github.com/Lissy93/dotfiles/blob/master/tmux/tmux.conf). To install them from GitHub, run `prefix` + I from within Tmux, and they will be cloned int `~/.tmux/plugins/`. +Tmux plugins are managed using [TMP](https://github.com/tmux-plugins/tpm) and defined in [`.tmux.conf`](https://github.com/Lissy93/dotfiles/blob/master/config/tmux/tmux.conf). To install them from GitHub, run `prefix` + I from within Tmux, and they will be cloned int `~/.tmux/plugins/`. ##### Plugins @@ -994,7 +996,7 @@ Tmux plugins are managed using [TMP](https://github.com/tmux-plugins/tpm) and de // TODO -Git aliases for ZSH are located in [`/zsh/aliases/git.zsh`](https://github.com/Lissy93/dotfiles/blob/master/zsh/aliases/git.zsh), and are documented under the [Aliases](https://github.com/lissy93/dotfiles#my-aliases) section, above. +Git aliases for ZSH are located in [`/zsh/aliases/git.zsh`](https://github.com/Lissy93/dotfiles/blob/master/config/zsh/aliases/git.zsh), and are documented under the [Aliases](https://github.com/lissy93/dotfiles#my-aliases) section, above. --- diff --git a/.gitignore b/.gitignore index 0f2bade..b21dcda 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,9 @@ tmp/* dotbot/* # Auto-generated files -zsh/.zcompcache/* -zsh/*/*.zwc -zsh/.zsh_sessions/* +config/zsh/.zcompcache/* +config/zsh/*/*.zwc +config/zsh/.zsh_sessions/* installs/.Brewfile.lock.json # Linux diff --git a/config/config.fish b/config/config.fish new file mode 100644 index 0000000..f81856e --- /dev/null +++ b/config/config.fish @@ -0,0 +1,9 @@ + +if status is-interactive + # Commands to run in interactive sessions can go here +end + +# If starship is installed, initialize it +if type -q starship + starship init fish | source +end diff --git a/config/starship.toml b/config/starship.toml new file mode 100644 index 0000000..51ea664 --- /dev/null +++ b/config/starship.toml @@ -0,0 +1,164 @@ +[aws] +format = '\[[$symbol($profile)(\($region\))(\[$duration\])]($style)\]' + +[bun] +format = '\[[$symbol($version)]($style)\]' + +[c] +format = '\[[$symbol($version(-$name))]($style)\]' + +[cmake] +format = '\[[$symbol($version)]($style)\]' + +[cmd_duration] +format = '\[[⏱ $duration]($style)\]' + +[cobol] +format = '\[[$symbol($version)]($style)\]' + +[conda] +format = '\[[$symbol$environment]($style)\]' + +[crystal] +format = '\[[$symbol($version)]($style)\]' + +[daml] +format = '\[[$symbol($version)]($style)\]' + +[dart] +format = '\[[$symbol($version)]($style)\]' + +[deno] +format = '\[[$symbol($version)]($style)\]' + +[docker_context] +format = '\[[$symbol$context]($style)\]' + +[dotnet] +format = '\[[$symbol($version)(🎯 $tfm)]($style)\]' + +[elixir] +format = '\[[$symbol($version \(OTP $otp_version\))]($style)\]' + +[elm] +format = '\[[$symbol($version)]($style)\]' + +[erlang] +format = '\[[$symbol($version)]($style)\]' + +[gcloud] +format = '\[[$symbol$account(@$domain)(\($region\))]($style)\]' + +[git_branch] +format = '\[[$symbol$branch]($style)\]' + +[git_status] +format = '([\[$all_status$ahead_behind\]]($style))' + +[golang] +format = '\[[$symbol($version)]($style)\]' + +[haskell] +format = '\[[$symbol($version)]($style)\]' + +[helm] +format = '\[[$symbol($version)]($style)\]' + +[hg_branch] +format = '\[[$symbol$branch]($style)\]' + +[java] +format = '\[[$symbol($version)]($style)\]' + +[julia] +format = '\[[$symbol($version)]($style)\]' + +[kotlin] +format = '\[[$symbol($version)]($style)\]' + +[kubernetes] +format = '\[[$symbol$context( \($namespace\))]($style)\]' + +[lua] +format = '\[[$symbol($version)]($style)\]' + +[memory_usage] +format = '\[$symbol[$ram( | $swap)]($style)\]' + +[meson] +format = '\[[$symbol$project]($style)\]' + +[nim] +format = '\[[$symbol($version)]($style)\]' + +[nix_shell] +format = '\[[$symbol$state( \($name\))]($style)\]' + +[nodejs] +format = '\[[$symbol($version)]($style)\]' + +[ocaml] +format = '\[[$symbol($version)(\($switch_indicator$switch_name\))]($style)\]' + +[openstack] +format = '\[[$symbol$cloud(\($project\))]($style)\]' + +[package] +format = '\[[$symbol$version]($style)\]' + +[perl] +format = '\[[$symbol($version)]($style)\]' + +[php] +format = '\[[$symbol($version)]($style)\]' + +[pulumi] +format = '\[[$symbol$stack]($style)\]' + +[purescript] +format = '\[[$symbol($version)]($style)\]' + +[python] +format = '\[[${symbol}${pyenv_prefix}(${version})(\($virtualenv\))]($style)\]' + +[raku] +format = '\[[$symbol($version-$vm_version)]($style)\]' + +[red] +format = '\[[$symbol($version)]($style)\]' + +[ruby] +format = '\[[$symbol($version)]($style)\]' + +[rust] +format = '\[[$symbol($version)]($style)\]' + +[scala] +format = '\[[$symbol($version)]($style)\]' + +[spack] +format = '\[[$symbol$environment]($style)\]' + +[sudo] +format = '\[[as $symbol]\]' + +[swift] +format = '\[[$symbol($version)]($style)\]' + +[terraform] +format = '\[[$symbol$workspace]($style)\]' + +[time] +format = '\[[$time]($style)\]' + +[username] +format = '\[[$user]($style)\]' + +[vagrant] +format = '\[[$symbol($version)]($style)\]' + +[vlang] +format = '\[[$symbol($version)]($style)\]' + +[zig] +format = '\[[$symbol($version)]($style)\]' diff --git a/tmux/tmux.conf b/config/tmux/tmux.conf similarity index 100% rename from tmux/tmux.conf rename to config/tmux/tmux.conf diff --git a/vim/setup-vim-plug.vim b/config/vim/setup-vim-plug.vim similarity index 100% rename from vim/setup-vim-plug.vim rename to config/vim/setup-vim-plug.vim diff --git a/vim/vimrc b/config/vim/vimrc similarity index 100% rename from vim/vimrc rename to config/vim/vimrc diff --git a/zsh/.p10k.zsh b/config/zsh/.p10k.zsh similarity index 100% rename from zsh/.p10k.zsh rename to config/zsh/.p10k.zsh diff --git a/zsh/.zlogin b/config/zsh/.zlogin similarity index 100% rename from zsh/.zlogin rename to config/zsh/.zlogin diff --git a/zsh/.zlogout b/config/zsh/.zlogout similarity index 100% rename from zsh/.zlogout rename to config/zsh/.zlogout diff --git a/zsh/.zshenv b/config/zsh/.zshenv similarity index 100% rename from zsh/.zshenv rename to config/zsh/.zshenv diff --git a/zsh/.zshrc b/config/zsh/.zshrc similarity index 100% rename from zsh/.zshrc rename to config/zsh/.zshrc diff --git a/zsh/aliases/alias-tips.zsh b/config/zsh/aliases/alias-tips.zsh similarity index 100% rename from zsh/aliases/alias-tips.zsh rename to config/zsh/aliases/alias-tips.zsh diff --git a/zsh/aliases/flutter.zsh b/config/zsh/aliases/flutter.zsh similarity index 100% rename from zsh/aliases/flutter.zsh rename to config/zsh/aliases/flutter.zsh diff --git a/zsh/aliases/general.zsh b/config/zsh/aliases/general.zsh similarity index 97% rename from zsh/aliases/general.zsh rename to config/zsh/aliases/general.zsh index edde455..ca78817 100644 --- a/zsh/aliases/general.zsh +++ b/config/zsh/aliases/general.zsh @@ -117,6 +117,7 @@ alias ff='find . -type f -name' # Find a file by name within current directory alias h='history' # Shows full history alias h-search='fc -El 0 | grep' # Searchses for a word in terminal history alias top-history='history 0 | awk '{print $2}' | sort | uniq -c | sort -n -r | head' +alias histrg='history -500 | rg' # Rip grep search recent history # Clearing terminal if command_exists hr ; then @@ -169,6 +170,11 @@ alias ports='netstat -tulanp' if command_exists cointop ; then; alias crypto='cointop'; fi if command_exists gotop ; then; alias gto='gotop'; fi +# Copy / pasting +alias cpwd='pwd | pbcopy' # Copy current path +alias pa='pbpaste' # Paste clipboard contents + + # Random lolz alias cls='clear;ls' # Clear and ls alias plz="fc -l -1 | cut -d' ' -f2- | xargs sudo" # Re-run last cmd as root diff --git a/zsh/aliases/git.zsh b/config/zsh/aliases/git.zsh similarity index 100% rename from zsh/aliases/git.zsh rename to config/zsh/aliases/git.zsh diff --git a/zsh/aliases/node-js.zsh b/config/zsh/aliases/node-js.zsh similarity index 100% rename from zsh/aliases/node-js.zsh rename to config/zsh/aliases/node-js.zsh diff --git a/zsh/helpers/import-plugins.zsh b/config/zsh/helpers/import-plugins.zsh similarity index 100% rename from zsh/helpers/import-plugins.zsh rename to config/zsh/helpers/import-plugins.zsh diff --git a/zsh/helpers/misc-stuff.zsh b/config/zsh/helpers/misc-stuff.zsh similarity index 100% rename from zsh/helpers/misc-stuff.zsh rename to config/zsh/helpers/misc-stuff.zsh diff --git a/zsh/helpers/setup-antigen.zsh b/config/zsh/helpers/setup-antigen.zsh similarity index 100% rename from zsh/helpers/setup-antigen.zsh rename to config/zsh/helpers/setup-antigen.zsh diff --git a/zsh/lib/colors.zsh b/config/zsh/lib/colors.zsh similarity index 100% rename from zsh/lib/colors.zsh rename to config/zsh/lib/colors.zsh diff --git a/zsh/lib/completion.zsh b/config/zsh/lib/completion.zsh similarity index 100% rename from zsh/lib/completion.zsh rename to config/zsh/lib/completion.zsh diff --git a/zsh/lib/cursor.zsh b/config/zsh/lib/cursor.zsh similarity index 100% rename from zsh/lib/cursor.zsh rename to config/zsh/lib/cursor.zsh diff --git a/zsh/lib/expansions.zsh b/config/zsh/lib/expansions.zsh similarity index 100% rename from zsh/lib/expansions.zsh rename to config/zsh/lib/expansions.zsh diff --git a/zsh/lib/history.zsh b/config/zsh/lib/history.zsh similarity index 100% rename from zsh/lib/history.zsh rename to config/zsh/lib/history.zsh diff --git a/zsh/lib/key-bindings.zsh b/config/zsh/lib/key-bindings.zsh similarity index 100% rename from zsh/lib/key-bindings.zsh rename to config/zsh/lib/key-bindings.zsh diff --git a/zsh/lib/navigation.zsh b/config/zsh/lib/navigation.zsh similarity index 100% rename from zsh/lib/navigation.zsh rename to config/zsh/lib/navigation.zsh diff --git a/zsh/lib/surround.zsh b/config/zsh/lib/surround.zsh similarity index 100% rename from zsh/lib/surround.zsh rename to config/zsh/lib/surround.zsh diff --git a/zsh/lib/term-title.zsh b/config/zsh/lib/term-title.zsh similarity index 100% rename from zsh/lib/term-title.zsh rename to config/zsh/lib/term-title.zsh diff --git a/symlinks.yaml b/symlinks.yaml index 5856da4..f1bcc7b 100644 --- a/symlinks.yaml +++ b/symlinks.yaml @@ -7,36 +7,18 @@ - shell: - description: Set XDG environmental variables - command: source ./zsh/.zshenv - - description: Check that $XDG_CONFIG_HOME is set - command: > - if [ -z ${XDG_CONFIG_HOME+x} ]; then; \ - echo "XDG_CONFIG_HOME is not yet set. Will use ~/.config"; \ - XDG_CONFIG_HOME="${HOME}/.config"; \ - fi - stdin: false - stdout: true - stderr: true - quiet: true - - description: Check that $XDG_DATA_HOME is set - command: > - if [ -z ${XDG_DATA_HOME+x} ]; then; \ - echo "XDG_DATA_HOME is not yet set. Will use ~/.local/share"; \ - XDG_DATA_HOME="${HOME}/.local/share"; \ - fi - stdin: false - stdout: true - stderr: true - quiet: true + command: source ./config/zsh/.zshenv # Symlink locations for files / directories - link: # Essential configs (ZSH, Vim, Tmux) - ~/.zshenv: { path: zsh/.zshenv, force: true } - ${XDG_CONFIG_HOME}/zsh: zsh - ${XDG_CONFIG_HOME}/vim: vim - ${XDG_CONFIG_HOME}/nvim: vim - ${XDG_CONFIG_HOME}/tmux: tmux + ~/.zshenv: { path: config/zsh/.zshenv, force: true } + ${XDG_CONFIG_HOME}/zsh: config/zsh + ${XDG_CONFIG_HOME}/vim: config/vim + ${XDG_CONFIG_HOME}/nvim: config/vim + ${XDG_CONFIG_HOME}/tmux: config/tmux + + ${XDG_CONFIG_HOME}/fish/config.fish: config/config.fish ${XDG_DATA_HOME}/tmux/tpm: lib/tpm ${XDG_DATA_HOME}/tmux/plugins/tpm: lib/tpm