Reorganised ZSH, Tmux and Vim into Configs directory

This commit is contained in:
Alicia Sykes 2022-11-06 23:02:32 +00:00
parent ee0b762f4f
commit c02a492972
30 changed files with 210 additions and 47 deletions

38
.github/README.md vendored
View File

@ -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 ### 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 Variable | Location
--- | --- --- | ---
@ -189,11 +189,13 @@ Once the repo is cloned, you can modify whatever files you like before running t
<pre> <pre>
~ ~
└──. └──.
├── <a href="https://github.com/Lissy93/dotfiles/tree/master/bash">bash/</a> # Bash (shell) config ├── <a href="https://github.com/Lissy93/dotfiles/tree/master/config">config/</a> # All configuration files
├── <a href="https://github.com/Lissy93/dotfiles/tree/master/tmux">tmux/</a> # Tmux (multiplexer) config │ ├── <a href="https://github.com/Lissy93/dotfiles/tree/master/bash">bash/</a> # Bash (shell) config
├── <a href="https://github.com/Lissy93/dotfiles/tree/master/vim">vim/</a> # Vim (text editor) config │ ├── <a href="https://github.com/Lissy93/dotfiles/tree/master/tmux">tmux/</a> # Tmux (multiplexer) config
├── <a href="https://github.com/Lissy93/dotfiles/tree/master/zsh">zsh/</a> # ZSH (shell) config │ ├── <a href="https://github.com/Lissy93/dotfiles/tree/master/vim">vim/</a> # Vim (text editor) config
├── <a href="https://github.com/Lissy93/dotfiles/tree/master/config">config/</a> # All other config files │ ├── <a href="https://github.com/Lissy93/dotfiles/tree/master/zsh">zsh/</a> # ZSH (shell) config
│ ├── <a href="https://github.com/Lissy93/dotfiles/tree/master/macos">macos/</a> # Config files for Mac-specific apps
│ └── <a href="https://github.com/Lissy93/dotfiles/tree/master/desktop-apps">desktop-apps/</a> # Config files for GUI apps
├── <a href="https://github.com/Lissy93/dotfiles/tree/master/scripts">scripts/</a> # Bash scripts for automating tasks ├── <a href="https://github.com/Lissy93/dotfiles/tree/master/scripts">scripts/</a> # Bash scripts for automating tasks
│ ├── <a href="https://github.com/Lissy93/dotfiles/tree/master/scripts/installs">installs/</a> # Scripts for software installation │ ├── <a href="https://github.com/Lissy93/dotfiles/tree/master/scripts/installs">installs/</a> # Scripts for software installation
│ │ ├── <a href="https://github.com/Lissy93/dotfiles/blob/master/scripts/installs/Brewfile">Brewfile</a> # Package installs for MacOS via Homebrew │ │ ├── <a href="https://github.com/Lissy93/dotfiles/blob/master/scripts/installs/Brewfile">Brewfile</a> # Package installs for MacOS via Homebrew
@ -223,7 +225,7 @@ The setup script ([`install.sh`](https://github.com/Lissy93/dotfiles/blob/master
- **Setup** - **Setup**
- Print welcome message, and a summary of proposed changes, and prompt user to continue - Print welcome message, and a summary of proposed changes, and prompt user to continue
- Ensure that core dependencies are met (git, zsh, vim) - 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** - **Dotfiles**
- If dotfiles not yet present, will clone from git, otherwise pulls latest changes - 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 - 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 ### 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 #### 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: 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:
<summary><b>Git Aliases</b></summary> <summary><b>Git Aliases</b></summary>
> [`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 Alias | Description
---|--- ---|---
@ -353,7 +355,7 @@ Alias | Description
<summary><b>Flutter Aliases</b></summary> <summary><b>Flutter Aliases</b></summary>
> [`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 Alias | Description
---|--- ---|---
@ -379,7 +381,7 @@ Alias | Description
<summary><b>Node.js Aliases</b></summary> <summary><b>Node.js Aliases</b></summary>
> [`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 ##### Yarn
@ -443,7 +445,7 @@ Alias | Description
<summary><b>General Aliases</b></summary> <summary><b>General Aliases</b></summary>
> [`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) ##### 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 ### 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
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)). 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: The following plugins are being used:
@ -973,9 +975,9 @@ The following plugins are being used:
### Tmux ### 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` + <kbd>I</kbd> 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` + <kbd>I</kbd> from within Tmux, and they will be cloned int `~/.tmux/plugins/`.
##### Plugins ##### Plugins
@ -994,7 +996,7 @@ Tmux plugins are managed using [TMP](https://github.com/tmux-plugins/tpm) and de
// TODO // 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.
--- ---

6
.gitignore vendored
View File

@ -4,9 +4,9 @@ tmp/*
dotbot/* dotbot/*
# Auto-generated files # Auto-generated files
zsh/.zcompcache/* config/zsh/.zcompcache/*
zsh/*/*.zwc config/zsh/*/*.zwc
zsh/.zsh_sessions/* config/zsh/.zsh_sessions/*
installs/.Brewfile.lock.json installs/.Brewfile.lock.json
# Linux # Linux

9
config/config.fish Normal file
View File

@ -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

164
config/starship.toml Normal file
View File

@ -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)\]'

View File

@ -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='history' # Shows full history
alias h-search='fc -El 0 | grep' # Searchses for a word in terminal 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 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 # Clearing terminal
if command_exists hr ; then 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 cointop ; then; alias crypto='cointop'; fi
if command_exists gotop ; then; alias gto='gotop'; 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 # Random lolz
alias cls='clear;ls' # Clear and ls alias cls='clear;ls' # Clear and ls
alias plz="fc -l -1 | cut -d' ' -f2- | xargs sudo" # Re-run last cmd as root alias plz="fc -l -1 | cut -d' ' -f2- | xargs sudo" # Re-run last cmd as root

View File

@ -7,36 +7,18 @@
- shell: - shell:
- description: Set XDG environmental variables - description: Set XDG environmental variables
command: source ./zsh/.zshenv command: source ./config/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
# Symlink locations for files / directories # Symlink locations for files / directories
- link: - link:
# Essential configs (ZSH, Vim, Tmux) # Essential configs (ZSH, Vim, Tmux)
~/.zshenv: { path: zsh/.zshenv, force: true } ~/.zshenv: { path: config/zsh/.zshenv, force: true }
${XDG_CONFIG_HOME}/zsh: zsh ${XDG_CONFIG_HOME}/zsh: config/zsh
${XDG_CONFIG_HOME}/vim: vim ${XDG_CONFIG_HOME}/vim: config/vim
${XDG_CONFIG_HOME}/nvim: vim ${XDG_CONFIG_HOME}/nvim: config/vim
${XDG_CONFIG_HOME}/tmux: tmux ${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/tpm: lib/tpm
${XDG_DATA_HOME}/tmux/plugins/tpm: lib/tpm ${XDG_DATA_HOME}/tmux/plugins/tpm: lib/tpm