mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-27 21:45:41 +00:00
Compare commits
96 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c9d0284c91 | |||
| ac8b7beb9b | |||
| 2fa6c69e4a | |||
| c1287c4ea8 | |||
| 7b63afd4f5 | |||
| e5d6cb37fd | |||
| 4492c386b6 | |||
| 5f5f79d270 | |||
| dcd042262f | |||
| 268fd35bdb | |||
| 38a6f6f8e4 | |||
| d504fc5f2b | |||
| 4b1feb16fc | |||
| 9331b2b643 | |||
| 5ce9906ff1 | |||
| dbadcc3b6c | |||
|
|
4f2fd3cfd6 | ||
| 9621c67866 | |||
| 5e59893281 | |||
| ea292de853 | |||
| d2cedd0fee | |||
| 995cc569e7 | |||
| cceeba3f8e | |||
| dd3640586e | |||
|
|
11969bf791 | ||
|
|
bb3f4a8f6c | ||
|
|
6395895beb | ||
|
|
fa3dc531a0 | ||
| bb7ba3c919 | |||
| 53d91f8248 | |||
| 745fc9b737 | |||
| dbe5ea3ce0 | |||
| 761671e7f7 | |||
| f4df8623b0 | |||
| 03aacb0639 | |||
| 04c85245cc | |||
| 2ccb74422c | |||
| 3c87ed4d2b | |||
| 4e4ff92ae5 | |||
| ef9bf3864b | |||
| cfb9aa696e | |||
| 1c75e7a53f | |||
| 6e8875e734 | |||
| 70a9237166 | |||
| 59b08f8d1f | |||
| c9bc6e597a | |||
| 5cd720cc4d | |||
| e618f64cf5 | |||
| fed9769640 | |||
|
|
95e213d407 | ||
|
|
29a289bc7b | ||
| 9f133469e0 | |||
| ba90a2e6eb | |||
|
|
af32dd6bf3 | ||
|
|
e519d98a68 | ||
| cde571de69 | |||
| b563ba5cd0 | |||
| f357d23559 | |||
|
|
b183fcbdb2 | ||
| 17ce1c6ee6 | |||
| 66de4b3323 | |||
| b55c1a17ba | |||
|
|
3d708861cf | ||
| 9dc647c4af | |||
|
|
3bd73bbbfb | ||
|
|
0a7d331a57 | ||
|
|
40b399a467 | ||
|
|
65dab98c3e | ||
|
|
64f1d7354e | ||
|
|
0d93f2dbb2 | ||
|
|
9dc1ed8b38 | ||
|
|
75b99dd117 | ||
|
|
305355beaf | ||
| 33a7de2dfc | |||
| f5f4f47655 | |||
|
|
4d8d70d390 | ||
|
|
cacc98a7d3 | ||
|
|
9c05733b5d | ||
| d4e02bbb89 | |||
| 32dbec6476 | |||
|
|
980fc9aa7d | ||
|
|
a2c3de1b3b | ||
|
|
16d455a262 | ||
|
|
9ba66c7734 | ||
|
|
86824d8c45 | ||
| 38d853aa8a | |||
|
|
34a0d7d8c4 | ||
|
|
65bf470c5b | ||
|
|
965c47efef | ||
| 410f5ac2b5 | |||
|
|
b6a18688c4 | ||
| 9f1ba5034f | |||
|
|
4cf956aa17 | ||
|
|
f9142a4780 | ||
|
|
bb921189e2 | ||
| a4eb0b0186 |
@@ -3,27 +3,7 @@ root = true
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
# indent_size = 4
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
# max_line_length = 160
|
||||
# tab_width = 4
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[{*.yaml,*.yml}]
|
||||
indent_size = 2
|
||||
|
||||
[*.sh]
|
||||
indent_size = 2
|
||||
tab_width = 2
|
||||
|
||||
shell_variant = bash # like -ln=posix
|
||||
binary_next_line = true # like -bn
|
||||
switch_case_indent = true # like -ci
|
||||
space_redirects = true # like -sr
|
||||
keep_padding = false # like -kp
|
||||
function_next_line = true # like -fn
|
||||
never_split = false # like -ns
|
||||
|
||||
[local/bin/antigen.zsh]
|
||||
ignore = true
|
||||
|
||||
8
.github/workflows/linters.yml
vendored
8
.github/workflows/linters.yml
vendored
@@ -1,30 +1,26 @@
|
||||
name: reviewdog
|
||||
on: [ push ]
|
||||
on: [push]
|
||||
jobs:
|
||||
linters:
|
||||
name: Linters
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
- name: GitHub Actions
|
||||
uses: reviewdog/action-actionlint@v1
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
reporter: github-pr-review
|
||||
|
||||
- name: detect-secrets
|
||||
uses: reviewdog/action-detect-secrets@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
reporter: github-pr-review
|
||||
|
||||
- name: markdownlint
|
||||
uses: reviewdog/action-markdownlint@v0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
reporter: github-pr-review
|
||||
|
||||
- name: shfmt
|
||||
uses: reviewdog/action-shfmt@v1
|
||||
with:
|
||||
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1 +1,6 @@
|
||||
Brewfile.lock.json
|
||||
*.log
|
||||
*-secret
|
||||
*cache
|
||||
.idea
|
||||
.vscode
|
||||
|
||||
28
.gitmodules
vendored
Normal file
28
.gitmodules
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
[submodule "dotbot"]
|
||||
path = dotbot
|
||||
url = https://github.com/anishathalye/dotbot.git
|
||||
ignore = dirty
|
||||
|
||||
[submodule "dotbot-brew"]
|
||||
path = dotbot-brew
|
||||
url = https://github.com/wren/dotbot-brew.git
|
||||
ignore = dirty
|
||||
|
||||
[submodule "dotbot-include"]
|
||||
path = dotbot-include
|
||||
url = https://gitlab.com/gnfzdz/dotbot-include.git
|
||||
ignore = dirty
|
||||
|
||||
[submodule "config/nvim"]
|
||||
path = config/nvim
|
||||
url = https://github.com/AstroNvim/AstroNvim.git
|
||||
ignore = dirty
|
||||
branch = main
|
||||
update = checkout
|
||||
|
||||
[submodule "config/astronvim/lua/user"]
|
||||
path = config/astronvim/lua/user
|
||||
url = https://github.com/ivuorinen/astronvim_config.git
|
||||
update = rebase
|
||||
branch = main
|
||||
ignore = dirty
|
||||
1
.python-version
Normal file
1
.python-version
Normal file
@@ -0,0 +1 @@
|
||||
3
|
||||
24
.yamlfmt
Normal file
24
.yamlfmt
Normal file
@@ -0,0 +1,24 @@
|
||||
formatter:
|
||||
type: basic
|
||||
indent: 2
|
||||
retain_line_breaks: false
|
||||
disallow_anchors: false
|
||||
max_line_length: 0
|
||||
scan_folded_as_literal: false
|
||||
indentless_arrays: false
|
||||
|
||||
doublestar: true
|
||||
|
||||
extensions:
|
||||
- yaml
|
||||
- yml
|
||||
|
||||
include:
|
||||
- ./*.{yml,yaml}
|
||||
- ./**/*.{yml,yaml}
|
||||
|
||||
exclude:
|
||||
- ./dotbot/**
|
||||
- ./dotbot-*/**
|
||||
- ./config/astronvim/**
|
||||
- ./config/nvim/**
|
||||
85
Brewfile
85
Brewfile
@@ -10,14 +10,21 @@ tap "homebrew/cask"
|
||||
tap "homebrew/cask-fonts"
|
||||
tap "homebrew/core"
|
||||
tap "homebrew/services"
|
||||
tap "jesseduffield/lazygit"
|
||||
tap "mongodb/brew"
|
||||
tap "shivammathur/extensions"
|
||||
tap "shivammathur/php"
|
||||
tap "teamookla/speedtest"
|
||||
# Interpreted, interactive, object-oriented programming language
|
||||
brew "python@3.11"
|
||||
# Automate deployment, configuration, and upgrading
|
||||
brew "ansible"
|
||||
# Checks ansible playbooks for practices and behaviour
|
||||
brew "ansible-lint"
|
||||
# Zstandard is a real-time compression algorithm
|
||||
brew "zstd"
|
||||
# Open Source Kubernetes Marketplace
|
||||
brew "arkade"
|
||||
# Spell checker with better logic than ispell
|
||||
brew "aspell"
|
||||
# Automatic configure script builder
|
||||
@@ -26,44 +33,48 @@ brew "autoconf"
|
||||
brew "awscli"
|
||||
# Terminal bandwidth utilization tool
|
||||
brew "bandwhich"
|
||||
# Clone of cat(1) with syntax highlighting and Git integration
|
||||
brew "bat"
|
||||
# Yet another cross-platform graphical process/system monitor
|
||||
brew "bottom"
|
||||
# Switch Apache / Valet / CLI configs between PHP versions
|
||||
brew "brew-php-switcher"
|
||||
# Core application library for C
|
||||
brew "glib"
|
||||
# Manage compile and link flags for libraries
|
||||
brew "pkg-config"
|
||||
# Open source suite of directory software
|
||||
brew "openldap"
|
||||
# Get a file from an HTTP, HTTPS or FTP server
|
||||
brew "curl"
|
||||
# Libraries to talk to Microsoft SQL Server and Sybase databases
|
||||
brew "freetds"
|
||||
# C/C++ and Java libraries for Unicode and globalization
|
||||
brew "icu4c"
|
||||
# Postgres C API library
|
||||
brew "libpq"
|
||||
# General-purpose scripting language
|
||||
brew "php"
|
||||
# Dependency Manager for PHP
|
||||
brew "composer"
|
||||
# Cross-platform make
|
||||
brew "cmake"
|
||||
# GNU File, Shell, and Text utilities
|
||||
brew "coreutils"
|
||||
# Get, unpack, build, and install modules from CPAN
|
||||
brew "cpanminus"
|
||||
# Open source suite of directory software
|
||||
brew "openldap"
|
||||
# Get a file from an HTTP, HTTPS or FTP server
|
||||
brew "curl"
|
||||
# Diff that understands syntax
|
||||
brew "difftastic"
|
||||
# Tool for exploring each layer in a docker image
|
||||
brew "dive"
|
||||
# Command-line DNS client
|
||||
brew "dog"
|
||||
# Lightning-fast linter for .env files written in Rust
|
||||
brew "dotenv-linter"
|
||||
# Tool to verify that your files are in harmony with your .editorconfig
|
||||
brew "editorconfig-checker"
|
||||
# Useful examples at the command-line
|
||||
brew "eg-examples"
|
||||
# CLI for templating and/or deploying FaaS functions
|
||||
brew "faas-cli"
|
||||
# Simple, fast and user-friendly alternative to find
|
||||
brew "fd"
|
||||
# Libraries to talk to Microsoft SQL Server and Sybase databases
|
||||
brew "freetds"
|
||||
# Monitor a directory for changes and run a shell command
|
||||
brew "fswatch"
|
||||
# Disk usage analyzer with console interface written in Go
|
||||
brew "gdu", link: false
|
||||
# GitHub command-line tool
|
||||
brew "gh"
|
||||
# Distributed revision control system
|
||||
@@ -88,8 +99,12 @@ brew "gnupg"
|
||||
brew "go"
|
||||
# Image manipulation
|
||||
brew "netpbm"
|
||||
# C/C++ and Java libraries for Unicode and globalization
|
||||
brew "icu4c"
|
||||
# OpenType text shaping engine
|
||||
brew "harfbuzz"
|
||||
# Framework for layout and rendering of i18n text
|
||||
brew "pango"
|
||||
# Library to render SVG files using Cairo
|
||||
brew "librsvg"
|
||||
# Graph visualization software from AT&T and Bell Labs
|
||||
@@ -110,8 +125,12 @@ brew "imagemagick"
|
||||
brew "jq"
|
||||
# Lazier way to manage everything docker
|
||||
brew "lazydocker"
|
||||
# Postgres C API library
|
||||
brew "libpq"
|
||||
# Linguistic software and Finnish dictionary
|
||||
brew "libvoikko"
|
||||
# Package manager for the Lua programming language
|
||||
brew "luarocks"
|
||||
# Swiss Army Knife for macOS
|
||||
brew "m-cli"
|
||||
# Mac App Store command-line interface
|
||||
@@ -120,6 +139,8 @@ brew "mas"
|
||||
brew "midnight-commander"
|
||||
# Ambitious Vim-fork focused on extensibility and agility
|
||||
brew "neovim"
|
||||
# No Nonsense Neovim Client in Rust
|
||||
brew "neovide"
|
||||
# Port scanning utility for large networks
|
||||
brew "nmap"
|
||||
# Manage multiple Node.js versions
|
||||
@@ -128,8 +149,18 @@ brew "nvm"
|
||||
brew "openjdk"
|
||||
# Generate clients, server & docs from an OpenAPI spec (v2, v3)
|
||||
brew "openapi-generator"
|
||||
# Swiss-army knife of markup format conversion
|
||||
brew "pandoc"
|
||||
# Highly capable, feature-rich programming language
|
||||
brew "perl"
|
||||
# General-purpose scripting language
|
||||
brew "php@8.1"
|
||||
# Python version management
|
||||
brew "pyenv"
|
||||
# Migrate pip packages from one Python version to another
|
||||
brew "pyenv-pip-migrate"
|
||||
# Pyenv plugin to manage virtualenv
|
||||
brew "pyenv-virtualenv"
|
||||
# Interpreted, interactive, object-oriented programming language
|
||||
brew "python@3.10"
|
||||
# Interpreted, interactive, object-oriented programming language
|
||||
@@ -144,6 +175,8 @@ brew "ruby"
|
||||
brew "shellcheck"
|
||||
# Autoformat shell script source code
|
||||
brew "shfmt"
|
||||
# Cross-shell prompt for astronauts
|
||||
brew "starship"
|
||||
# Version control system designed to be a better CVS
|
||||
brew "subversion"
|
||||
# Send macOS User Notifications from the command-line
|
||||
@@ -156,6 +189,8 @@ brew "terragrunt"
|
||||
brew "testssl"
|
||||
# Terraform version manager inspired by rbenv
|
||||
brew "tfenv"
|
||||
# Static analysis security scanner for your terraform code
|
||||
brew "tfsec"
|
||||
# Programmatically correct mistyped console commands
|
||||
brew "thefuck"
|
||||
# Simplified and community-driven man pages
|
||||
@@ -164,8 +199,14 @@ brew "tldr"
|
||||
brew "tmux"
|
||||
# Display directories as trees (with optional color/HTML output)
|
||||
brew "tree"
|
||||
# Vulnerability scanner for container images, file systems, and Git repos
|
||||
brew "trivy"
|
||||
# Modern watch command
|
||||
brew "viddy"
|
||||
# Tool for creating isolated virtual python environments
|
||||
brew "virtualenv"
|
||||
# Command-line interface to the WakaTime api
|
||||
brew "wakatime-cli"
|
||||
# Executes a program periodically, showing output fullscreen
|
||||
brew "watch"
|
||||
# Internet file retriever
|
||||
@@ -174,14 +215,14 @@ brew "wget"
|
||||
brew "wtfutil"
|
||||
# JavaScript package manager
|
||||
brew "yarn"
|
||||
# Tracks most-used directories to make cd smarter
|
||||
brew "z"
|
||||
# A vulnerability scanner for container images and filesystems
|
||||
brew "anchore/grype/grype"
|
||||
# High-performance load testing tool, written in Golang.
|
||||
brew "ddosify/tap/ddosify"
|
||||
# lets you quickly switch between multiple git user profiles
|
||||
brew "gesquive/tap/git-user"
|
||||
# A simple terminal UI for git commands, written in Go
|
||||
brew "jesseduffield/lazygit/lazygit"
|
||||
# High-performance, schema-free, document-oriented database
|
||||
brew "mongodb/brew/mongodb-community"
|
||||
# Xdebug PHP extension
|
||||
@@ -248,6 +289,8 @@ cask "qlstephen"
|
||||
cask "quicklook-json"
|
||||
# QuickLook generator for Adobe Swatch Exchange files
|
||||
cask "quicklookase"
|
||||
# Automatically hides or quits apps after periods of inactivity
|
||||
cask "quitter"
|
||||
# Move and resize windows using keyboard shortcuts or snap areas
|
||||
cask "rectangle"
|
||||
# MySQL/MariaDB database management
|
||||
@@ -266,13 +309,13 @@ cask "syntax-highlight"
|
||||
cask "visual-studio-code"
|
||||
# Multimedia player
|
||||
cask "vlc"
|
||||
# Spell-checking service for Finnish
|
||||
cask "voikkospellservice"
|
||||
# Rust-based terminal
|
||||
cask "warp"
|
||||
# View output from scripts in the menu bar
|
||||
cask "xbar"
|
||||
mas "1Password for Safari", id: 1569813296
|
||||
mas "Flow", id: 1423210932
|
||||
mas "GarageBand", id: 682658836
|
||||
mas "iMovie", id: 408981434
|
||||
mas "Keynote", id: 409183694
|
||||
mas "Numbers", id: 409203825
|
||||
mas "Pages", id: 409201541
|
||||
mas "pullBar", id: 1601913905
|
||||
mas "Tailscale", id: 1475387142
|
||||
|
||||
90
README.md
90
README.md
@@ -1,8 +1,9 @@
|
||||
# .dotfiles
|
||||
|
||||
Welcome to [ivuorinen](https://github.com/ivuorinen)'s .dotfiles repository. It's a hodgepodge of scripts
|
||||
and configurations, tests and mistakes I'm not aware of yet. As I find more interesting tools, configs and
|
||||
other stuff, this repository will live accordingly.
|
||||
Welcome to [ivuorinen](https://github.com/ivuorinen)'s .dotfiles repository.
|
||||
It's a hodgepodge of scripts and configurations, tests and mistakes I'm not
|
||||
aware of yet. As I find more interesting tools, configs and other stuff,
|
||||
this repository will live accordingly.
|
||||
|
||||
Please for the love of everything good do not use these 1:1 as your own dotfiles,
|
||||
fork or download the repo as a zip and go from there with your own configs.
|
||||
@@ -12,42 +13,34 @@ fork or download the repo as a zip and go from there with your own configs.
|
||||
### First time setup
|
||||
|
||||
1. Clone this repository to `$HOME/.dotfiles`
|
||||
2. `bash $HOME/.dotfiles/scripts/settler.sh`
|
||||
2. `./install`
|
||||
3. ???
|
||||
4. Profit
|
||||
|
||||
Note: there's a bit chicken/egg situation, because settler assumes you don't have git,
|
||||
and you need git to clone the repo. This will change soon™.
|
||||
|
||||
## Interesting files and locations
|
||||
|
||||
### Special folders
|
||||
### Interesting folders
|
||||
|
||||
| Path | Description |
|
||||
|--------------------|-------------------------------------------------------------------------------------|
|
||||
| `.github` | GitHub Repository configuration files. Not part of the dotfiles per se. |
|
||||
| `host-{hostname}/` | Host specific dotfiles. Configurations that should apply to that host only. |
|
||||
| `local/bin` | Helper scripts that I've collected or wrote to make life easier. |
|
||||
| `scripts` | Setup scripts. Some can be run many times, some are meant only for the first round. |
|
||||
| Path | Description |
|
||||
| ------------------- | -------------------------------------------- |
|
||||
| `.github` | GitHub Repository configuration files. |
|
||||
| `hosts/{hostname}/` | Configs that should apply to that host only. |
|
||||
| `local/bin` | Helper scripts that I've collected or wrote. |
|
||||
| `scripts` | Setup scripts. |
|
||||
|
||||
### dotfile folders
|
||||
|
||||
| Repo | Destination | Description |
|
||||
|-----------|-------------|------------------------------------------------------------------|
|
||||
| `config/` | `.config/` | Configurations for applications. |
|
||||
| `local/` | `.local/` | XDG Base folder, contains `bin`, `share` and `state` for example |
|
||||
| `ssh/` | `.ssh/` | SSH Configurations. |
|
||||
| Repo | Destination | Description |
|
||||
| --------- | ----------- | ------------------------------------------- |
|
||||
| `base/` | `.*` | `$HOME` level files. |
|
||||
| `config/` | `.config/` | Configurations for applications. |
|
||||
| `local/` | `.local/` | XDG Base folder: `bin`, `share` and `state` |
|
||||
| `ssh/` | `.ssh/` | SSH Configurations. |
|
||||
|
||||
### dfm - the dotfiles manager
|
||||
|
||||
`.local/bin/dfm` is a shell script that has some tools that help with dotfiles management.
|
||||
|
||||
### `scripts/install-dotfiles.sh` - dotfiles linker
|
||||
|
||||
The `scripts/install-dotfiles.sh` is a `rcm` generated shell script that does all the necessary linking.
|
||||
|
||||
To refresh the file, you can run `dfm dotfiles update`
|
||||
|
||||
## Configuration
|
||||
|
||||
The folder structure follows [XDG Base Directory Specification][xdg] where possible.
|
||||
@@ -55,29 +48,37 @@ The folder structure follows [XDG Base Directory Specification][xdg] where possi
|
||||
### XDG Variables
|
||||
|
||||
| Var | Default |
|
||||
|--------------------|----------------------|
|
||||
| Executables | `$HOME/.local/bin` |
|
||||
| ------------------ | -------------------- |
|
||||
| `$XDG_DATA_HOME` | `$HOME/.local/share` |
|
||||
| `$XDG_STATE_HOME` | `$HOME/.local/state` |
|
||||
| `$XDG_CONFIG_HOME` | `$HOME/.config` |
|
||||
| `$XDG_BIN_HOME` | `$HOME/.local/bin` |
|
||||
|
||||
- `$XDG_BIN_HOME` is a custom `env` for `.local/bin` folder.
|
||||
- `$XDG_DATA_HOME` defines the base directory relative to which user-specific data
|
||||
files should be stored. If `$XDG_DATA_HOME` is either not set or empty,
|
||||
a default equal to `$HOME/.local/share` should be used.
|
||||
- `$XDG_CONFIG_HOME` defines the base directory relative to which user-specific configuration
|
||||
files should be stored. If `$XDG_CONFIG_HOME` is either not set or empty,
|
||||
a default equal to `$HOME/.config` should be used.
|
||||
- `$XDG_STATE_HOME` defines the base directory relative to which user-specific state files should be stored.
|
||||
If `$XDG_STATE_HOME` is either not set or empty, a default equal to `$HOME/.local/state` should be used.
|
||||
- The `$XDG_STATE_HOME` contains state data that should persist between (application) restarts,
|
||||
but that is not important or portable enough to the user that it should be stored in `$XDG_DATA_HOME`.
|
||||
- `$XDG_STATE_HOME` defines the base directory relative
|
||||
to which user-specific state files should be stored.
|
||||
If `$XDG_STATE_HOME` is either not set or empty, a default
|
||||
equal to `$HOME/.local/state` should be used.
|
||||
- The `$XDG_STATE_HOME` contains state data that should persist
|
||||
between (application) restarts,
|
||||
but that is not important or portable enough to the user that
|
||||
it should be stored in `$XDG_DATA_HOME`.
|
||||
It may contain:
|
||||
- actions history (logs, history, recently used files, …)
|
||||
- current state of the application that can be reused on a restart (view, layout, open files, undo history, …)
|
||||
- User-specific executable files may be stored in `$HOME/.local/bin`. Distributions should ensure this
|
||||
directory shows up in the UNIX `$PATH` environment variable, at an appropriate place.
|
||||
- `$XDG_DATA_DIRS` defines the preference-ordered set of base directories to search for data files in addition
|
||||
to the `$XDG_DATA_HOME` base directory. The directories in `$XDG_DATA_DIRS` should be seperated with a colon ':'.
|
||||
- actions history (logs, history, recently used files, …)
|
||||
- current state of the application that can be reused
|
||||
on a restart (view, layout, open files, undo history, …)
|
||||
- User-specific executable files may be stored in `$HOME/.local/bin`.
|
||||
Distributions should ensure this directory shows up in the UNIX `$PATH`
|
||||
environment variable, at an appropriate place.
|
||||
- `$XDG_DATA_DIRS` defines the preference-ordered set of base directories
|
||||
to search for data files in addition to the `$XDG_DATA_HOME` base directory.
|
||||
The directories in `$XDG_DATA_DIRS` should be seperated with a colon ':'.
|
||||
|
||||
[xdg]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
|
||||
@@ -85,12 +86,9 @@ The folder structure follows [XDG Base Directory Specification][xdg] where possi
|
||||
|
||||
### Interesting dotfiles repos
|
||||
|
||||
- https://dotfiles.github.io/inspiration/
|
||||
- https://github.com/frdmn/dotfiles - Ansible-based dotfile setup for macOS
|
||||
- https://github.com/mvdan/dotfiles - Here be dragons
|
||||
- https://github.com/vsouza/dotfiles - 🏡 My dotfiles
|
||||
- https://github.com/freekmurze/dotfiles - My personal dotfiles
|
||||
|
||||
### Interesting dotfiles tools
|
||||
|
||||
- https://github.com/zero-sh/zero.sh - Radically simple personal bootstrapping tool for macOS.
|
||||
- [dotfiles.github.io/inspiration/](https://dotfiles.github.io/inspiration)
|
||||
- [frdmn/dotfiles](https://github.com/github.com/frdmn/dotfiles) - Ansible-based
|
||||
dotfile setup for macOS
|
||||
- [mvdan/dotfiles](https://github.com/mvdan/dotfiles) - Here be dragons
|
||||
- [vsouza/dotfiles](https://github.com/vsouza/dotfiles) - 🏡 My dotfiles
|
||||
- [freekmurze/dotfiles](https://github.com/freekmurze/dotfiles) - My personal dotfiles
|
||||
|
||||
4
add-submodules.sh
Normal file
4
add-submodules.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
git submodule add --name dotbot-brew -f https://github.com/wren/dotbot-brew.git dotbot-brew
|
||||
git submodule add --name dotbot-include -f https://gitlab.com/gnfzdz/dotbot-include.git dotbot-include
|
||||
6
base/angular-config.json
Normal file
6
base/angular-config.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"version": 1,
|
||||
"cli": {
|
||||
"analytics": false
|
||||
}
|
||||
}
|
||||
21
base/bashrc
Normal file
21
base/bashrc
Normal file
@@ -0,0 +1,21 @@
|
||||
# this is my bashrc config. there are many like it, but this one is mine.
|
||||
# shellcheck shell=bash
|
||||
|
||||
# Defaults
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
|
||||
# Run x-load-configs in your terminal to reload the files.
|
||||
function x-load-configs()
|
||||
{
|
||||
# Load the shell dotfiles, and then some:
|
||||
for file in $DOTFILES/config/{exports,alias,functions}; do
|
||||
[ -r "$file" ] && [ -f "$file" ] && source "$file"
|
||||
[ -r "$file-secret" ] && [ -f "$file-secret" ] && source "$file-secret"
|
||||
[ -r "$file-$HOSTNAME" ] && [ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME"
|
||||
[ -r "$file-$HOSTNAME-secret" ] && [ -f "$file-$HOSTNAME-secret" ] && source "$file-$HOSTNAME-secret"
|
||||
done
|
||||
}
|
||||
x-load-configs
|
||||
|
||||
# Import ssh keys in keychain
|
||||
ssh-add -A 2>/dev/null;
|
||||
19
base/ecrc
Normal file
19
base/ecrc
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"Version": "2.7.0",
|
||||
"Verbose": false,
|
||||
"Debug": false,
|
||||
"IgnoreDefaults": false,
|
||||
"SpacesAftertabs": false,
|
||||
"NoColor": false,
|
||||
"Exclude": [],
|
||||
"AllowedContentTypes": [],
|
||||
"PassedFiles": [],
|
||||
"Disable": {
|
||||
"EndOfLine": false,
|
||||
"Indentation": false,
|
||||
"InsertFinalNewline": false,
|
||||
"TrimTrailingWhitespace": false,
|
||||
"IndentSize": false,
|
||||
"MaxLineLength": false
|
||||
}
|
||||
}
|
||||
@@ -5,4 +5,3 @@ email = ismo.vuorinen@vincit.fi
|
||||
[home]
|
||||
name = Ismo Vuorinen
|
||||
email = ismo@vuorinen.net
|
||||
|
||||
@@ -5,3 +5,4 @@ export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||
|
||||
alias php="php -d error_reporting=22527"
|
||||
|
||||
16
base/plan
Normal file
16
base/plan
Normal file
@@ -0,0 +1,16 @@
|
||||
. .
|
||||
/ `. .' \
|
||||
.---. < > < > .---.
|
||||
| \ \ - ~ ~ - / / |
|
||||
~-..-~ ~-..-~
|
||||
\~~~\.' `./~~~/
|
||||
.-~~^-. \__/ \__/
|
||||
.' O \ / / \ \
|
||||
(_____, `._.' | } \/~~~/
|
||||
`----. / } | / \__/
|
||||
`-. | / | / `. ,~~|
|
||||
~-.__| /_ - ~ ^| /- _ `..-' f: f:
|
||||
| / | / ~-. `-. _||_||_
|
||||
|_____| |_____| ~ - . _ _ _ _ _>
|
||||
|
||||
|
||||
7
base/shellcheckrc
Normal file
7
base/shellcheckrc
Normal file
@@ -0,0 +1,7 @@
|
||||
# This is shellcheck configuration file.
|
||||
|
||||
# Set whether or not to follow arbitrary file
|
||||
# paths in source statements (since 0.8.0).
|
||||
external-sources=true
|
||||
includeAllWorkspaceSymbols=true
|
||||
|
||||
43
base/zshrc
Normal file
43
base/zshrc
Normal file
@@ -0,0 +1,43 @@
|
||||
# this is my zsh config. there are many like it, but this one is mine.
|
||||
# shellcheck shell=bash
|
||||
|
||||
autoload -U colors zsh/terminfo
|
||||
colors
|
||||
|
||||
# Defaults
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
# shellcheck source=shared.sh
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
|
||||
# Run x-load-configs in your terminal to reload the files.
|
||||
function x-load-configs()
|
||||
{
|
||||
# Load the shell dotfiles, and then some:
|
||||
for file in $DOTFILES/config/{exports,alias,functions}; do
|
||||
[ -f "$file" ] && source "$file"
|
||||
[ -f "$file-secret" ] && source "$file-secret"
|
||||
[ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME"
|
||||
[ -f "$file-$HOSTNAME-secret" ] && source "$file-$HOSTNAME-secret"
|
||||
done
|
||||
}
|
||||
x-load-configs
|
||||
|
||||
# Import ssh keys in keychain
|
||||
ssh-add -A 2>/dev/null;
|
||||
|
||||
# Try to load antigen, if present
|
||||
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
|
||||
[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH"
|
||||
|
||||
# antigen is present
|
||||
have antigen && {
|
||||
antigen use oh-my-zsh
|
||||
|
||||
# config/functions
|
||||
x-default-antigen-bundles
|
||||
|
||||
antigen apply
|
||||
}
|
||||
|
||||
# starship is present
|
||||
have starship && eval "$(starship init zsh)"
|
||||
@@ -1,8 +0,0 @@
|
||||
# Fig pre block. Keep at the top of this file.
|
||||
[[ -f "$HOME/.fig/shell/bash_profile.pre.bash" ]] && builtin source "$HOME/.fig/shell/bash_profile.pre.bash"
|
||||
# shellcheck shell=bash
|
||||
|
||||
export PATH="$HOME/.local/bin:/usr/local/sbin:$PATH"
|
||||
|
||||
# Fig post block. Keep at the bottom of this file.
|
||||
[[ -f "$HOME/.fig/shell/bash_profile.post.bash" ]] && builtin source "$HOME/.fig/shell/bash_profile.post.bash"
|
||||
14
bashrc
14
bashrc
@@ -1,14 +0,0 @@
|
||||
# Fig pre block. Keep at the top of this file.
|
||||
[[ -f "$HOME/.fig/shell/bashrc.pre.bash" ]] && builtin source "$HOME/.fig/shell/bashrc.pre.bash"
|
||||
# shellcheck shell=bash
|
||||
|
||||
PHP_PATH=$(brew --prefix php)/bin
|
||||
|
||||
export PATH="$PHP_PATH:$HOME/.composer/vendor/bin/:/usr/local/opt/ruby/bin:/usr/local/sbin:$PATH"
|
||||
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
|
||||
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
|
||||
|
||||
# Fig post block. Keep at the bottom of this file.
|
||||
[[ -f "$HOME/.fig/shell/bashrc.post.bash" ]] && builtin source "$HOME/.fig/shell/bashrc.post.bash"
|
||||
89
config/alias
Normal file → Executable file
89
config/alias
Normal file → Executable file
@@ -1,45 +1,46 @@
|
||||
# shellcheck shell=bash
|
||||
# macOS specific
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck source="../scripts/shared.sh"
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
|
||||
# Get installed php versions from brew and setup aliases
|
||||
function x-set-php-aliases
|
||||
{
|
||||
local php_versions=()
|
||||
while IFS="" read -r line; do php_versions+=("$line"); done < <(brew list | grep '^php')
|
||||
have brew && {
|
||||
local php_versions=()
|
||||
while IFS="" read -r line; do php_versions+=("$line"); done < <(brew list | grep '^php')
|
||||
|
||||
php_error_reporting='-d error_reporting=22527'
|
||||
php_error_reporting='-d error_reporting=22527'
|
||||
|
||||
for version in "${php_versions[@]}"; do
|
||||
# drop the dot from version (8.0 -> 80)
|
||||
local php_abbr="${version//\./}"
|
||||
# replace "php@" with "p" so "php@80" becomes "p80"
|
||||
local php_alias="${php_abbr//php@/p}"
|
||||
for version in "${php_versions[@]}"; do
|
||||
# drop the dot from version (8.0 -> 80)
|
||||
local php_abbr="${version//\./}"
|
||||
# replace "php@" with "p" so "php@80" becomes "p80"
|
||||
local php_alias="${php_abbr//php@/p}"
|
||||
|
||||
# Skip php = php aliasing
|
||||
# if [[ "$php_abbr" == "$php_alias" ]]; then continue; fi;
|
||||
# Fetch the exec path once
|
||||
php_exec="$(brew --prefix "$version")/bin/php"
|
||||
|
||||
# Fetch the exec path once
|
||||
php_exec="$(brew --prefix "$version")/bin/php"
|
||||
|
||||
# Raw PHP without error_reporting flag.
|
||||
# shellcheck disable=SC2139
|
||||
alias ${php_alias}r="$php_exec"
|
||||
# PHP with error_reporting flag.
|
||||
# shellcheck disable=SC2139
|
||||
alias $php_alias="$php_exec $php_error_reporting"
|
||||
# Local PHP Server.
|
||||
# shellcheck disable=SC2139
|
||||
alias ${php_alias}s="$php_exec -S localhost:9000"
|
||||
# Use composer with specific PHP and error_reporting flag on.
|
||||
# shellcheck disable=SC2139
|
||||
alias ${php_alias}c="$php_exec $php_error_reporting $(which composer)"
|
||||
done
|
||||
# Raw PHP without error_reporting flag.
|
||||
# shellcheck disable=SC2139
|
||||
alias "${php_alias}"r="$php_exec"
|
||||
# PHP with error_reporting flag.
|
||||
# shellcheck disable=SC2139,SC2140
|
||||
alias "$php_alias"="$php_exec $php_error_reporting"
|
||||
# Local PHP Server.
|
||||
# shellcheck disable=SC2139,SC2140
|
||||
alias "${php_alias}s"="$php_exec -S localhost:9000"
|
||||
# Use composer with specific PHP and error_reporting flag on.
|
||||
# shellcheck disable=SC2139,SC2140
|
||||
alias "${php_alias}c"="$php_exec $php_error_reporting $(which composer)"
|
||||
done
|
||||
}
|
||||
}
|
||||
|
||||
if [[ $(uname) == 'Darwin' ]]; then
|
||||
|
||||
x-set-php-aliases
|
||||
|
||||
# Laravel Sail shortcut
|
||||
alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'
|
||||
|
||||
# Flush Directory Service cache
|
||||
@@ -53,26 +54,32 @@ if [[ $(uname) == 'Darwin' ]]; then
|
||||
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
|
||||
fi
|
||||
|
||||
alias watchx='watch -dpbc' # watch with: differences, precise, beep and color
|
||||
# watch with: differences, precise, beep and color
|
||||
alias watchx='watch -dpbc'
|
||||
# delete .DS_Store files
|
||||
alias zapds='find . -name ".DS_Store" -print -delete'
|
||||
alias t='tail -f' # tail with follow flag on
|
||||
alias dn='du -chd1' # directory usage, return only the total
|
||||
# tail with follow flag on
|
||||
alias t='tail -f'
|
||||
# directory usage, return only the total
|
||||
alias dn='du -chd1'
|
||||
# Mirror site with wget
|
||||
alias mirror_site='wget -m -k -K -E -e robots=off'
|
||||
# Mirror stdout to stderr, useful for seeing data going through a pipe
|
||||
alias peek='tee >(cat 1>&2)'
|
||||
|
||||
alias code_scanner='docker run \
|
||||
--env SOURCE_CODE="$PWD" \
|
||||
--volume "$PWD":/code \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||
registry.gitlab.com/gitlab-org/ci-cd/codequality:${CODEQUALITY_VERSION:-latest} \
|
||||
alias code_scanner='docker run
|
||||
--env SOURCE_CODE="$PWD"
|
||||
--volume "${PWD}":/code
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
||||
registry.gitlab.com/gitlab-org/ci-cd/codequality:"${CODEQUALITY_VERSION:-latest}"
|
||||
/code'
|
||||
|
||||
alias composerUp='composer global update'
|
||||
alias npmUp='npm -g up'
|
||||
alias zedit='$EDITOR ~/.dotfiles'
|
||||
|
||||
alias zedit='$EDITOR ~/.zshrc ~/.alias'
|
||||
alias zdots='$EDITOR ~/.dotfiles'
|
||||
have irssi \
|
||||
&& alias irssi="irssi --config='$IRSSI_CONFIG_FILE' --home='$IRSSI_CONFIG_HOME'"
|
||||
|
||||
if [[ -f "$HOME/.aliases.local" ]]; then
|
||||
# shellcheck disable=SC1091
|
||||
source "$HOME/.aliases.local"
|
||||
fi
|
||||
|
||||
|
||||
1
config/astronvim/lua/user
Submodule
1
config/astronvim/lua/user
Submodule
Submodule config/astronvim/lua/user added at 95cad51402
233
config/dircolors
Normal file
233
config/dircolors
Normal file
@@ -0,0 +1,233 @@
|
||||
# Configuration file for dircolors, a utility to help you set the
|
||||
# LS_COLORS environment variable used by GNU ls with the --color option.
|
||||
# Copyright (C) 1996-2023 Free Software Foundation, Inc.
|
||||
# Copying and distribution of this file, with or without modification,
|
||||
# are permitted provided the copyright notice and this notice are preserved.
|
||||
#
|
||||
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
|
||||
# slackware version of dircolors) are recognized but ignored.
|
||||
# Global config options can be specified before TERM or COLORTERM entries
|
||||
# ===================================================================
|
||||
# Terminal filters
|
||||
# ===================================================================
|
||||
# Below are TERM or COLORTERM entries, which can be glob patterns, which
|
||||
# restrict following config to systems with matching environment variables.
|
||||
COLORTERM ?*
|
||||
TERM Eterm
|
||||
TERM ansi
|
||||
TERM *color*
|
||||
TERM con[0-9]*x[0-9]*
|
||||
TERM cons25
|
||||
TERM console
|
||||
TERM cygwin
|
||||
TERM *direct*
|
||||
TERM dtterm
|
||||
TERM gnome
|
||||
TERM hurd
|
||||
TERM jfbterm
|
||||
TERM konsole
|
||||
TERM kterm
|
||||
TERM linux
|
||||
TERM linux-c
|
||||
TERM mlterm
|
||||
TERM putty
|
||||
TERM rxvt*
|
||||
TERM screen*
|
||||
TERM st
|
||||
TERM terminator
|
||||
TERM tmux*
|
||||
TERM vt100
|
||||
TERM xterm*
|
||||
# ===================================================================
|
||||
# Basic file attributes
|
||||
# ===================================================================
|
||||
# Below are the color init strings for the basic file types.
|
||||
# One can use codes for 256 or more colors supported by modern terminals.
|
||||
# The default color codes use the capabilities of an 8 color terminal
|
||||
# with some additional attributes as per the following codes:
|
||||
# Attribute codes:
|
||||
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
|
||||
# Text color codes:
|
||||
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
|
||||
# Background color codes:
|
||||
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
|
||||
#NORMAL 00 # no color code at all
|
||||
#FILE 00 # regular file: use no color at all
|
||||
RESET 0 # reset to "normal" color
|
||||
DIR 01;34 # directory
|
||||
LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
|
||||
# numerical value, the color is as for the file pointed to.)
|
||||
MULTIHARDLINK 00 # regular file with more than one link
|
||||
FIFO 40;33 # pipe
|
||||
SOCK 01;35 # socket
|
||||
DOOR 01;35 # door
|
||||
BLK 40;33;01 # block device driver
|
||||
CHR 40;33;01 # character device driver
|
||||
ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file ...
|
||||
MISSING 00 # ... and the files they point to
|
||||
SETUID 37;41 # file that is setuid (u+s)
|
||||
SETGID 30;43 # file that is setgid (g+s)
|
||||
CAPABILITY 00 # file with capability (very expensive to lookup)
|
||||
STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
|
||||
OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
|
||||
STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
|
||||
# This is for files with execute permission:
|
||||
EXEC 01;32
|
||||
# ===================================================================
|
||||
# File extension attributes
|
||||
# ===================================================================
|
||||
# List any file extensions like '.gz' or '.tar' that you would like ls
|
||||
# to color below. Put the suffix, a space, and the color init string.
|
||||
# (and any comments you want to add after a '#').
|
||||
# Suffixes are matched case insensitively, but if you define different
|
||||
# init strings for separate cases, those will be honored.
|
||||
#
|
||||
# If you use DOS-style suffixes, you may want to uncomment the following:
|
||||
#.cmd 01;32 # executables (bright green)
|
||||
#.exe 01;32
|
||||
#.com 01;32
|
||||
#.btm 01;32
|
||||
#.bat 01;32
|
||||
# Or if you want to color scripts even if they do not have the
|
||||
# executable bit actually set.
|
||||
#.sh 01;32
|
||||
#.csh 01;32
|
||||
# archives or compressed (bright red)
|
||||
.tar 01;31
|
||||
.tgz 01;31
|
||||
.arc 01;31
|
||||
.arj 01;31
|
||||
.taz 01;31
|
||||
.lha 01;31
|
||||
.lz4 01;31
|
||||
.lzh 01;31
|
||||
.lzma 01;31
|
||||
.tlz 01;31
|
||||
.txz 01;31
|
||||
.tzo 01;31
|
||||
.t7z 01;31
|
||||
.zip 01;31
|
||||
.z 01;31
|
||||
.dz 01;31
|
||||
.gz 01;31
|
||||
.lrz 01;31
|
||||
.lz 01;31
|
||||
.lzo 01;31
|
||||
.xz 01;31
|
||||
.zst 01;31
|
||||
.tzst 01;31
|
||||
.bz2 01;31
|
||||
.bz 01;31
|
||||
.tbz 01;31
|
||||
.tbz2 01;31
|
||||
.tz 01;31
|
||||
.deb 01;31
|
||||
.rpm 01;31
|
||||
.jar 01;31
|
||||
.war 01;31
|
||||
.ear 01;31
|
||||
.sar 01;31
|
||||
.rar 01;31
|
||||
.alz 01;31
|
||||
.ace 01;31
|
||||
.zoo 01;31
|
||||
.cpio 01;31
|
||||
.7z 01;31
|
||||
.rz 01;31
|
||||
.cab 01;31
|
||||
.wim 01;31
|
||||
.swm 01;31
|
||||
.dwm 01;31
|
||||
.esd 01;31
|
||||
# image formats
|
||||
.avif 01;35
|
||||
.jpg 01;35
|
||||
.jpeg 01;35
|
||||
.mjpg 01;35
|
||||
.mjpeg 01;35
|
||||
.gif 01;35
|
||||
.bmp 01;35
|
||||
.pbm 01;35
|
||||
.pgm 01;35
|
||||
.ppm 01;35
|
||||
.tga 01;35
|
||||
.xbm 01;35
|
||||
.xpm 01;35
|
||||
.tif 01;35
|
||||
.tiff 01;35
|
||||
.png 01;35
|
||||
.svg 01;35
|
||||
.svgz 01;35
|
||||
.mng 01;35
|
||||
.pcx 01;35
|
||||
.mov 01;35
|
||||
.mpg 01;35
|
||||
.mpeg 01;35
|
||||
.m2v 01;35
|
||||
.mkv 01;35
|
||||
.webm 01;35
|
||||
.webp 01;35
|
||||
.ogm 01;35
|
||||
.mp4 01;35
|
||||
.m4v 01;35
|
||||
.mp4v 01;35
|
||||
.vob 01;35
|
||||
.qt 01;35
|
||||
.nuv 01;35
|
||||
.wmv 01;35
|
||||
.asf 01;35
|
||||
.rm 01;35
|
||||
.rmvb 01;35
|
||||
.flc 01;35
|
||||
.avi 01;35
|
||||
.fli 01;35
|
||||
.flv 01;35
|
||||
.gl 01;35
|
||||
.dl 01;35
|
||||
.xcf 01;35
|
||||
.xwd 01;35
|
||||
.yuv 01;35
|
||||
.cgm 01;35
|
||||
.emf 01;35
|
||||
# https://wiki.xiph.org/MIME_Types_and_File_Extensions
|
||||
.ogv 01;35
|
||||
.ogx 01;35
|
||||
# audio formats
|
||||
.aac 00;36
|
||||
.au 00;36
|
||||
.flac 00;36
|
||||
.m4a 00;36
|
||||
.mid 00;36
|
||||
.midi 00;36
|
||||
.mka 00;36
|
||||
.mp3 00;36
|
||||
.mpc 00;36
|
||||
.ogg 00;36
|
||||
.ra 00;36
|
||||
.wav 00;36
|
||||
# https://wiki.xiph.org/MIME_Types_and_File_Extensions
|
||||
.oga 00;36
|
||||
.opus 00;36
|
||||
.spx 00;36
|
||||
.xspf 00;36
|
||||
# backup files
|
||||
*~ 00;90
|
||||
*# 00;90
|
||||
.bak 00;90
|
||||
.old 00;90
|
||||
.orig 00;90
|
||||
.part 00;90
|
||||
.rej 00;90
|
||||
.swp 00;90
|
||||
.tmp 00;90
|
||||
.dpkg-dist 00;90
|
||||
.dpkg-old 00;90
|
||||
.ucf-dist 00;90
|
||||
.ucf-new 00;90
|
||||
.ucf-old 00;90
|
||||
.rpmnew 00;90
|
||||
.rpmorig 00;90
|
||||
.rpmsave 00;90
|
||||
#
|
||||
# Subsequent TERM or COLORTERM entries, can be used to add / override
|
||||
# config specific to those matching environment variables.
|
||||
52
config/exports
Normal file → Executable file
52
config/exports
Normal file → Executable file
@@ -1,23 +1,43 @@
|
||||
# shellcheck shell=bash
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=zsh
|
||||
# vim: filetype=zsh
|
||||
|
||||
export HIST_STAMPS="yyyy-mm-dd"
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
path_append "$DOTFILES/local/bin"
|
||||
|
||||
# Larger bash history (allow 32³ entries; default is 500)
|
||||
export HISTSIZE=32768
|
||||
export HISTFILESIZE=$HISTSIZE
|
||||
export HISTCONTROL=ignoredups
|
||||
# Explicitly set XDG folders
|
||||
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
|
||||
# Make some commands not show up in history
|
||||
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"
|
||||
# custom variables
|
||||
export XDG_BIN_HOME="$HOME/.local/bin"
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
export XDG_RUNTIME_DIR="$HOME/.local/run"
|
||||
|
||||
# And include the parameter for ZSH
|
||||
export HISTORY_IGNORE="(ls|cd|cd -|pwd|exit|date|* --help)"
|
||||
# Homebrew configuration
|
||||
export HOMEBREW="/opt/homebrew"
|
||||
export HOMEBREW_BIN="$HOMEBREW/bin"
|
||||
export HOMEBREW_SBIN="$HOMEBREW/sbin"
|
||||
export HOMEBREW_PKG="$HOMEBREW/opt"
|
||||
export HOMEBREW_NO_ENV_HINTS=1
|
||||
|
||||
# Highlight section titles in manual pages
|
||||
export LESS_TERMCAP_md="$ORANGE"
|
||||
path_append "/usr/local/bin"
|
||||
path_append "$HOMEBREW_SBIN"
|
||||
path_append "$HOMEBREW_BIN"
|
||||
path_append "$XDG_BIN_HOME"
|
||||
|
||||
# Don’t clear the screen after quitting a manual page
|
||||
export MANPAGER="less -X"
|
||||
# brew, https://brew.sh
|
||||
have brew && {
|
||||
path_append "$(brew --prefix python)/bin"
|
||||
path_append "$(brew --prefix coreutils)/libexec/gnubin"
|
||||
path_append "$(brew --prefix ruby)/bin"
|
||||
path_append "$(gem environment gemdir)/bin"
|
||||
}
|
||||
|
||||
# Always enable colored `grep` output
|
||||
export GREP_OPTIONS="--color=auto"
|
||||
source "$DOTFILES/config/exports-shell"
|
||||
source "$DOTFILES/config/exports-apps"
|
||||
|
||||
have nvim && export EDITOR="nvim"
|
||||
|
||||
108
config/exports-apps
Executable file
108
config/exports-apps
Executable file
@@ -0,0 +1,108 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
# shellcheck enable=external-sources
|
||||
# vim: filetype=zsh
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
|
||||
# Antigen configuration
|
||||
# https://github.com/zsh-users/antigen/wiki/Configuration
|
||||
export ADOTDIR="$XDG_DATA_HOME/antigen"
|
||||
export ANTIGEN_SYSTEM_RECEIPT_F=".local/share/antigen/antigen_system_lastupdate"
|
||||
export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate"
|
||||
|
||||
# Ansible configuration
|
||||
# https://docs.ansible.com/ansible/latest/reference_appendices/config.html
|
||||
have ansible && {
|
||||
export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible"
|
||||
export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible.cfg"
|
||||
export ANSIBLE_GALAXY_CACHE_DIR="$XDG_CACHE_HOME/ansible/galaxy_cache"
|
||||
x-dc "$ANSIBLE_HOME"
|
||||
x-dc "$ANSIBLE_GALAXY_CACHE_DIR"
|
||||
}
|
||||
|
||||
# composer, https://getcomposer.org/
|
||||
have composer && {
|
||||
export COMPOSER_HOME="$XDG_STATE_HOME/composer"
|
||||
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
|
||||
export PATH="$COMPOSER_BIN:$PATH"
|
||||
}
|
||||
|
||||
# docker, https://docs.docker.com/engine/reference/commandline/cli/
|
||||
have docker && {
|
||||
export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
|
||||
x-dc "$DOCKER_CONFIG"
|
||||
}
|
||||
|
||||
# ffmpeg
|
||||
have ffmpeg && {
|
||||
export FFMPEG_DATADIR="$XDG_CONFIG_HOME/ffmpeg"
|
||||
x-dc "$FFMPEG_DATADIR"
|
||||
}
|
||||
|
||||
# gcloud
|
||||
have gcloud && {
|
||||
GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet)
|
||||
[[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc"
|
||||
[[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc"
|
||||
}
|
||||
|
||||
# gem, rubygems
|
||||
have gem && {
|
||||
export GEM_HOME="$XDG_STATE_HOME/gem"
|
||||
export GEM_PATH="$XDG_STATE_HOME/gem"
|
||||
export PATH="$GEM_HOME/bin:$PATH"
|
||||
path_append "$GEM_PATH/bin"
|
||||
}
|
||||
|
||||
# If we have go packages, include them to the PATH
|
||||
have go && {
|
||||
export GOPATH="$XDG_DATA_HOME/go"
|
||||
export GOBIN="$XDG_BIN_HOME"
|
||||
x-dc "$GOPATH"
|
||||
}
|
||||
|
||||
# irssi
|
||||
have irssi && {
|
||||
# These variables are used in ./alias with --config and --home
|
||||
export IRSSI_CONFIG_HOME="$XDG_CONFIG_HOME/irssi"
|
||||
export IRSSI_CONFIG_FILE="$IRSSI_CONFIG_HOME/config"
|
||||
x-dc "$IRSSI_CONFIG_HOME"
|
||||
}
|
||||
|
||||
# nvm, the node version manager
|
||||
export NVM_LAZY_LOAD=true
|
||||
export NVM_COMPLETION=true
|
||||
export NVM_AUTO_USE=true
|
||||
export NVM_DIR="$XDG_CONFIG_HOME/nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||
|
||||
# op (1Password cli) is present
|
||||
have op && {
|
||||
export OP_CACHE="$XDG_STATE_HOME/1password"
|
||||
x-dc "$OP_CACHE"
|
||||
eval "$(op completion zsh)"
|
||||
compdef _op op
|
||||
}
|
||||
|
||||
# pyenv, python environments
|
||||
have pyenv && {
|
||||
export PYENV_ROOT="$XDG_STATE_HOME/pyenv"
|
||||
x-dc "$PYENV_ROOT"
|
||||
path_append "$PYENV_ROOT/bin"
|
||||
|
||||
eval "$(pyenv init -)"
|
||||
}
|
||||
|
||||
# wakatime, https://github.com/wakatime/wakatime-cli
|
||||
export WAKATIME_HOME="$XDG_STATE_HOME/wakatime"
|
||||
x-dc "$WAKATIME_HOME"
|
||||
|
||||
# z, https://github.com/rupa/z
|
||||
export _Z_DATA="$XDG_STATE_HOME/z"
|
||||
[[ -f "$XDG_BIN_HOME/z/z.sh" ]] && source "$XDG_BIN_HOME/z/z.sh"
|
||||
|
||||
# Misc
|
||||
export ANDROID_HOME="$XDG_DATA_HOME/android"
|
||||
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
|
||||
export SCREENRC="$XDG_CONFIG_HOME/misc/screenrc"
|
||||
6
config/exports-secret.example
Normal file
6
config/exports-secret.example
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# This file is secret and wont be added to the git repo.
|
||||
|
||||
export GITLAB_API_TOKEN=""
|
||||
export GREN_GITHUB_TOKEN=""
|
||||
52
config/exports-shell
Executable file
52
config/exports-shell
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
# vim: filetype=zsh
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
|
||||
export LC_ALL=fi_FI.utf8
|
||||
|
||||
# Bash completion file location
|
||||
export BASH_COMPLETION_USER_FILE="${XDG_CONFIG_HOME}/bash-completion/bash_completion"
|
||||
|
||||
# History env variables
|
||||
export HIST_STAMPS="yyyy-mm-dd"
|
||||
# Larger bash history (allow 32³ entries; default is 500)
|
||||
export HISTSIZE=32768
|
||||
export HISTFILESIZE=$HISTSIZE
|
||||
# don't put duplicate lines or lines starting with space in the history.
|
||||
# See bash(1) for more options
|
||||
export HISTCONTROL=ignoreboth
|
||||
# Make some commands not show up in history
|
||||
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"
|
||||
# And include the parameter for ZSH
|
||||
export HISTORY_IGNORE="(ls|cd|cd -|pwd|exit|date|* --help)"
|
||||
|
||||
# Highlight section titles in manual pages
|
||||
export LESS_TERMCAP_md="$ORANGE"
|
||||
|
||||
# Don’t clear the screen after quitting a manual page
|
||||
export MANPAGER="less -X"
|
||||
|
||||
# Always enable colored `grep` output
|
||||
export GREP_OPTIONS="--color=auto"
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
hash shopt 2> /dev/null && shopt -s checkwinsize
|
||||
|
||||
# Load iterm2 shell integration
|
||||
# https://iterm2.com/documentation-shell-integration.html
|
||||
[[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] \
|
||||
&& source "$XDG_BIN_HOME/iterm2_shell_integration.zsh"
|
||||
|
||||
# Set dircolors based on the file, if it exists
|
||||
have dircolors && eval $(dircolors "$XDG_CONFIG_HOME/dircolors")
|
||||
|
||||
# If we are using zsh, color our dir lists and such
|
||||
if [ "$SHELL" = "$(which zsh)" ]; then
|
||||
x-dc "$XDG_CACHE_HOME/zsh"
|
||||
x-dc "$XDG_STATE_HOME/zsh"
|
||||
export HISTFILE="$XDG_STATE_HOME/zsh/history"
|
||||
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/zcompcache"
|
||||
zstyle ':completion:*' list-colors "$LS_COLORS"
|
||||
fi
|
||||
30
config/functions
Normal file → Executable file
30
config/functions
Normal file → Executable file
@@ -1,7 +1,9 @@
|
||||
# shellcheck shell=bash
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# shell functions
|
||||
#
|
||||
# shellcheck source="../scripts/shared.sh"
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
|
||||
# Weather in Tampere, or other city
|
||||
function weather
|
||||
@@ -65,3 +67,29 @@ function silent
|
||||
{
|
||||
"$@" >&/dev/null
|
||||
}
|
||||
|
||||
# Defines default antigen bundles
|
||||
function x-default-antigen-bundles
|
||||
{
|
||||
# these should be always available
|
||||
antigen bundle colored-man-pages
|
||||
antigen bundle command-not-found
|
||||
antigen bundle ssh-agent
|
||||
antigen bundle MichaelAquilina/zsh-you-should-use
|
||||
antigen bundle Sparragus/zsh-auto-nvm-use
|
||||
antigen bundle jreese/zsh-titles
|
||||
antigen bundle unixorn/autoupdate-antigen.zshplugin
|
||||
antigen bundle zsh-users/zsh-completions
|
||||
antigen bundle zsh-users/zsh-syntax-highlighting
|
||||
|
||||
# these should be available if there's need
|
||||
have git && antigen bundle git
|
||||
have brew && antigen bundle brew
|
||||
have docker && antigen bundle docker
|
||||
have docker-compose && antigen bundle sroze/docker-compose-zsh-plugin
|
||||
have jq && antigen bundle reegnz/jq-zsh-plugin
|
||||
have nvm && antigen bundle nvm
|
||||
have php && antigen bundle php
|
||||
have python && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
|
||||
have rvm && antigen bundle unixorn/rvm-plugin
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
git_protocol: ssh
|
||||
git_protocol: https
|
||||
|
||||
@@ -1,52 +1,59 @@
|
||||
[user]
|
||||
name = Ismo Vuorinen
|
||||
email = ismo@ivuorinen.net
|
||||
name = Ismo Vuorinen
|
||||
email = ismo@ivuorinen.net
|
||||
|
||||
[credential]
|
||||
helper = store --file ~/.cache/git/git-credentials
|
||||
helper = cache --timeout 30000
|
||||
|
||||
[core]
|
||||
excludesfile = ~/.config/git/gitignore
|
||||
excludesfile = ~/.config/git/gitignore
|
||||
|
||||
[alias]
|
||||
reset-origin = !git fetch origin && git reset --hard origin/master && git clean -f -d
|
||||
reset-upstream = !git fetch upstream && git reset --hard upstream/master && git clean -f -d
|
||||
nah = !git reset --hard && git clean -df
|
||||
undo-commit = reset HEAD~ --soft
|
||||
llog = log --pretty=fuller
|
||||
logs = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
|
||||
rl = reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)'
|
||||
tagdate = log --date-order --graph --tags --simplify-by-decoration --pretty=format:\"%ai %h %d\"
|
||||
branchbydate = for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'
|
||||
branchcolor = "!for ref in $(git for-each-ref --sort=-committerdate --format=\"%(refname)\" refs/heads/ refs/remotes ); do git log -n1 $ref --pretty=format:\"%Cgreen%cr%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset%n\" | cat ; done | awk '! a[$0]++'"
|
||||
reset-origin = !git fetch origin && git reset --hard origin/master && git clean -f -d
|
||||
reset-upstream = !git fetch upstream && git reset --hard upstream/master && git clean -f -d
|
||||
nah = !git reset --hard && git clean -df
|
||||
undo-commit = reset HEAD~ --soft
|
||||
llog = log --pretty=fuller
|
||||
logs = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
|
||||
rl = reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)'
|
||||
tagdate = log --date-order --graph --tags --simplify-by-decoration --pretty=format:\"%ai %h %d\"
|
||||
branchbydate = for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'
|
||||
branchcolor = "!for ref in $(git for-each-ref --sort=-committerdate --format=\"%(refname)\" refs/heads/ refs/remotes ); do git log -n1 $ref --pretty=format:\"%Cgreen%cr%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset%n\" | cat ; done | awk '! a[$0]++'"
|
||||
|
||||
[diff]
|
||||
tool = difftastic
|
||||
tool = difftastic
|
||||
|
||||
[difftool]
|
||||
prompt = false
|
||||
prompt = false
|
||||
|
||||
[difftool "difftastic"]
|
||||
cmd = difft "$LOCAL" "$REMOTE"
|
||||
cmd = difft "$LOCAL" "$REMOTE"
|
||||
|
||||
[filter "lfs"]
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
|
||||
[init]
|
||||
defaultBranch = master
|
||||
defaultBranch = main
|
||||
|
||||
[pull]
|
||||
rebase = false
|
||||
rebase = true
|
||||
|
||||
[color]
|
||||
ui = true
|
||||
diff = auto
|
||||
branch = auto
|
||||
status = auto
|
||||
ui = true
|
||||
diff = auto
|
||||
branch = auto
|
||||
status = auto
|
||||
|
||||
[color "status"]
|
||||
added = green bold
|
||||
changed = yellow
|
||||
deleted = red bold strike
|
||||
untracked = cyan
|
||||
branch = yellow black bold ul
|
||||
added = green bold
|
||||
changed = yellow
|
||||
deleted = red bold strike
|
||||
untracked = cyan
|
||||
branch = yellow black bold ul
|
||||
|
||||
[submodule]
|
||||
recurse = true
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*.cache
|
||||
*~
|
||||
|
||||
*-secret
|
||||
__secret
|
||||
__ignored
|
||||
__test_*.php
|
||||
|
||||
16
config/misc/screenrc
Normal file
16
config/misc/screenrc
Normal file
@@ -0,0 +1,16 @@
|
||||
# Disable the startup message
|
||||
startup_message off
|
||||
|
||||
# Set a large scrollback buffer
|
||||
defscrollback 32000
|
||||
|
||||
# Always start `screen` with UTF-8 enabled (`screen -U`)
|
||||
defutf8 on
|
||||
|
||||
# Scroll with mouse wheel (http://stackoverflow.com/a/1125947)
|
||||
termcapinfo xterm* ti@:te@
|
||||
|
||||
# Some settings for screen + vim
|
||||
term xterm-256color
|
||||
maptimeout 10
|
||||
|
||||
1
config/nano/nanorc
Normal file
1
config/nano/nanorc
Normal file
@@ -0,0 +1 @@
|
||||
set tabsize 2
|
||||
1
config/nvim
Submodule
1
config/nvim
Submodule
Submodule config/nvim added at cf624ae587
@@ -1,645 +0,0 @@
|
||||
-- Install packer
|
||||
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
|
||||
local is_bootstrap = false
|
||||
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
||||
is_bootstrap = true
|
||||
vim.fn.system {
|
||||
'git', 'clone', '--depth', '1',
|
||||
'https://github.com/wbthomason/packer.nvim',
|
||||
install_path
|
||||
}
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
end
|
||||
|
||||
require('packer').startup(function(use)
|
||||
-- Package manager
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
use { -- LSP Configuration & Plugins
|
||||
'neovim/nvim-lspconfig',
|
||||
requires = {
|
||||
-- Automatically install LSPs to stdpath for neovim
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
|
||||
-- Useful status updates for LSP
|
||||
'j-hui/fidget.nvim',
|
||||
},
|
||||
}
|
||||
|
||||
use { -- Autocompletion
|
||||
'hrsh7th/nvim-cmp',
|
||||
requires = {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'L3MON4D3/LuaSnip',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
},
|
||||
}
|
||||
|
||||
use { -- Highlight, edit, and navigate code
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = function()
|
||||
pcall(require('nvim-treesitter.install').update { with_sync = true })
|
||||
end,
|
||||
}
|
||||
|
||||
use { -- Additional text objects via treesitter
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
after = 'nvim-treesitter',
|
||||
}
|
||||
|
||||
-- Git related plugins
|
||||
use 'tpope/vim-fugitive'
|
||||
use 'tpope/vim-rhubarb'
|
||||
use 'lewis6991/gitsigns.nvim'
|
||||
|
||||
-- Theme based off the Material Pale Night
|
||||
use 'drewtempelmeyer/palenight.vim'
|
||||
-- Fancier statusline
|
||||
use 'nvim-lualine/lualine.nvim'
|
||||
-- Add indentation guides even on blank lines.
|
||||
use 'lukas-reineke/indent-blankline.nvim'
|
||||
-- "gc" to comment visual regions/lines
|
||||
use 'numToStr/Comment.nvim'
|
||||
-- Detect tabstop and shiftwidth automatically.
|
||||
use 'tpope/vim-sleuth'
|
||||
|
||||
-- Fuzzy Finder (files, lsp, etc)
|
||||
use { 'nvim-telescope/telescope.nvim',
|
||||
branch = '0.1.x',
|
||||
requires = { 'nvim-lua/plenary.nvim' }
|
||||
}
|
||||
|
||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
||||
-- Only load if `make` is available
|
||||
use { 'nvim-telescope/telescope-fzf-native.nvim',
|
||||
run = 'make', cond = vim.fn.executable 'make' == 1 }
|
||||
|
||||
-- Add custom plugins to packer from
|
||||
-- ~/.config/nvim/lua/custom/plugins.lua
|
||||
local has_plugins, plugins = pcall(require, 'custom.plugins')
|
||||
if has_plugins then
|
||||
plugins(use)
|
||||
end
|
||||
|
||||
if is_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
end)
|
||||
|
||||
-- When we are bootstrapping a configuration, it doesn't
|
||||
-- make sense to execute the rest of the init.lua.
|
||||
--
|
||||
-- You'll need to restart nvim, and then it will work.
|
||||
if is_bootstrap then
|
||||
print '=================================='
|
||||
print ' Plugins are being installed'
|
||||
print ' Wait until Packer completes,'
|
||||
print ' then restart nvim'
|
||||
print '=================================='
|
||||
return
|
||||
end
|
||||
|
||||
-- Automatically source and re-compile packer
|
||||
-- whenever you save this init.lua, or packages.lua
|
||||
local packer_group = vim.api.nvim_create_augroup('Packer', { clear = true })
|
||||
vim.api.nvim_create_autocmd('BufWritePost', {
|
||||
command = 'source <afile> | PackerCompile',
|
||||
group = packer_group,
|
||||
pattern = { vim.fn.expand '$MYVIMRC', '~/.dotfiles/config/nvim/**/*.lua' },
|
||||
})
|
||||
|
||||
-- [[ Setting options ]]
|
||||
-- See `:help vim.o`
|
||||
|
||||
-- Set highlight on search
|
||||
vim.o.hlsearch = false
|
||||
|
||||
-- Make line numbers default, enabled relative linenumbers
|
||||
vim.wo.number = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
-- Enable mouse mode
|
||||
vim.o.mouse = 'a'
|
||||
|
||||
-- Enable break indent
|
||||
vim.o.breakindent = true
|
||||
|
||||
-- Save undo history
|
||||
vim.o.undofile = true
|
||||
|
||||
-- Case insensitive searching UNLESS /C or capital in search
|
||||
vim.o.ignorecase = true
|
||||
vim.o.smartcase = true
|
||||
|
||||
-- Decrease update time
|
||||
vim.o.updatetime = 250
|
||||
vim.wo.signcolumn = 'yes'
|
||||
|
||||
-- Set colorscheme
|
||||
vim.o.termguicolors = true
|
||||
vim.cmd.colorscheme('palenight')
|
||||
|
||||
-- Set completeopt to have a better completion experience
|
||||
vim.o.completeopt = 'menuone,noselect'
|
||||
|
||||
-- Configure and disable providers.
|
||||
vim.g.python3_host_prog = '/opt/homebrew/bin/python3'
|
||||
vim.g.loaded_ruby_provider = 0
|
||||
|
||||
-- Setup winbar
|
||||
-- See :h statusline
|
||||
vim.o.winbar = '%=%m %f'
|
||||
|
||||
-- [[ Basic Keymaps ]]
|
||||
-- Set <space> as the leader key
|
||||
-- See `:help mapleader`
|
||||
-- NOTE: Must happen before plugins are required
|
||||
-- (otherwise wrong leader will be used)
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
-- Keymaps for better default experience
|
||||
-- See `:help vim.keymap.set()`
|
||||
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
||||
|
||||
-- Remap for dealing with word wrap
|
||||
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
|
||||
local highlight_group = vim.api.nvim_create_augroup(
|
||||
'YankHighlight', { clear = true }
|
||||
)
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
group = highlight_group,
|
||||
pattern = '*',
|
||||
})
|
||||
|
||||
-- Set lualine as statusline
|
||||
-- See `:help lualine.txt`
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'auto',
|
||||
component_separators = '|',
|
||||
section_separators = '',
|
||||
},
|
||||
}
|
||||
|
||||
-- Enable Comment.nvim
|
||||
require('Comment').setup()
|
||||
|
||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
||||
-- See `:help indent_blankline.txt`
|
||||
require('indent_blankline').setup {
|
||||
-- char = '┊',
|
||||
show_trailing_blankline_indent = true,
|
||||
space_char_blankline = " ",
|
||||
show_current_context = true,
|
||||
show_current_context_start = true,
|
||||
}
|
||||
|
||||
-- Gitsigns
|
||||
-- See `:help gitsigns.txt`
|
||||
require('gitsigns').setup {
|
||||
signs = {
|
||||
add = { text = '+' },
|
||||
change = { text = '~' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
},
|
||||
}
|
||||
|
||||
-- [[ Configure Telescope ]]
|
||||
-- See `:help telescope` and `:help telescope.setup()`
|
||||
require('telescope').setup {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
['<C-u>'] = false,
|
||||
['<C-d>'] = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Enable telescope fzf native, if installed
|
||||
pcall(require('telescope').load_extension, 'fzf')
|
||||
|
||||
-- See `:help telescope.builtin`
|
||||
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles,
|
||||
{ desc = '[?] Find recently opened files' })
|
||||
vim.keymap.set('n', '<leader><space>', require('telescope.builtin').buffers,
|
||||
{ desc = '[ ] Find existing buffers' })
|
||||
vim.keymap.set('n', '<leader>/', function()
|
||||
-- You can pass additional configuration to telescope to
|
||||
-- change theme, layout, etc.
|
||||
require('telescope.builtin').current_buffer_fuzzy_find(
|
||||
require('telescope.themes').get_dropdown {
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
})
|
||||
end, { desc = '[/] Fuzzily search in current buffer]' })
|
||||
|
||||
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files,
|
||||
{ desc = '[S]earch [F]iles' })
|
||||
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags,
|
||||
{ desc = '[S]earch [H]elp' })
|
||||
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string,
|
||||
{ desc = '[S]earch current [W]ord' })
|
||||
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep,
|
||||
{ desc = '[S]earch by [G]rep' })
|
||||
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics,
|
||||
{ desc = '[S]earch [D]iagnostics' })
|
||||
|
||||
-- Load custom treesitter grammar for org filetype
|
||||
require('orgmode').setup_ts_grammar()
|
||||
|
||||
-- [[ Configure Treesitter ]]
|
||||
-- See `:help nvim-treesitter`
|
||||
require('nvim-treesitter.configs').setup {
|
||||
-- Add languages to be installed here that you want
|
||||
-- installed for treesitter
|
||||
ensure_installed = {
|
||||
'bash',
|
||||
'c', 'comment', 'cpp',
|
||||
'diff', 'dockerfile',
|
||||
'gitattributes', 'gitignore', 'go',
|
||||
'html', 'http',
|
||||
'javascript', 'jq', 'jsdoc', 'json',
|
||||
'lua',
|
||||
'markdown',
|
||||
'org',
|
||||
'php', 'phpdoc', 'python',
|
||||
'regex', 'rust',
|
||||
'scss', 'sql',
|
||||
'typescript',
|
||||
'vim', 'vue',
|
||||
'yaml',
|
||||
'help',
|
||||
},
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
-- Required for spellcheck, some LaTex highlights and
|
||||
-- code block highlights that do not have ts grammar
|
||||
additional_vim_regex_highlighting = {'org'},
|
||||
},
|
||||
|
||||
indent = { enable = true, disable = { 'python' } },
|
||||
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = '<c-space>',
|
||||
node_incremental = '<c-space>',
|
||||
scope_incremental = '<c-s>',
|
||||
node_decremental = '<c-backspace>',
|
||||
},
|
||||
},
|
||||
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
['aa'] = '@parameter.outer',
|
||||
['ia'] = '@parameter.inner',
|
||||
['af'] = '@function.outer',
|
||||
['if'] = '@function.inner',
|
||||
['ac'] = '@class.outer',
|
||||
['ic'] = '@class.inner',
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
[']m'] = '@function.outer',
|
||||
[']]'] = '@class.outer',
|
||||
},
|
||||
goto_next_end = {
|
||||
[']M'] = '@function.outer',
|
||||
[']['] = '@class.outer',
|
||||
},
|
||||
goto_previous_start = {
|
||||
['[m'] = '@function.outer',
|
||||
['[['] = '@class.outer',
|
||||
},
|
||||
goto_previous_end = {
|
||||
['[M'] = '@function.outer',
|
||||
['[]'] = '@class.outer',
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
['<leader>a'] = '@parameter.inner',
|
||||
},
|
||||
swap_previous = {
|
||||
['<leader>A'] = '@parameter.inner',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
require('orgmode').setup({
|
||||
org_agenda_files = {
|
||||
'~/Library/Mobile Documents/iCloud~md~obsidian/Documents/_nvalt/**/*',
|
||||
'~/.dotfiles/local/org/**/*'
|
||||
},
|
||||
org_default_notes_file = '~/Library/Mobile Documents/iCloud~md~obsidian/Documents/_nvalt/refile.org',
|
||||
})
|
||||
|
||||
-- Diagnostic keymaps
|
||||
vim.keymap.set('n', 'dz', vim.diagnostic.goto_prev)
|
||||
vim.keymap.set('n', 'dx', vim.diagnostic.goto_next)
|
||||
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
|
||||
|
||||
-- LSP settings.
|
||||
-- This function gets run when an LSP connects to a particular buffer.
|
||||
local on_attach = function(_, bufnr)
|
||||
-- NOTE: Remember that lua is a real programming language,
|
||||
-- and as such it is possible to define small helper and
|
||||
-- utility functions so you don't have to repeat yourself
|
||||
-- many times.
|
||||
--
|
||||
-- In this case, we create a function that lets us more
|
||||
-- easily define mappings specific for LSP related items.
|
||||
-- It sets the mode, buffer and description for us each time.
|
||||
local nmap = function(keys, func, desc)
|
||||
if desc then
|
||||
desc = 'LSP: ' .. desc
|
||||
end
|
||||
|
||||
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
|
||||
end
|
||||
|
||||
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
||||
|
||||
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
|
||||
nmap('gr', require('telescope.builtin').lsp_references,
|
||||
'[G]oto [R]eferences')
|
||||
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
|
||||
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
|
||||
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols,
|
||||
'[D]ocument [S]ymbols')
|
||||
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols,
|
||||
'[W]orkspace [S]ymbols')
|
||||
|
||||
-- See `:help K` for why this keymap
|
||||
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
|
||||
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
||||
|
||||
-- Lesser used LSP functionality
|
||||
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder,
|
||||
'[W]orkspace [A]dd Folder')
|
||||
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder,
|
||||
'[W]orkspace [R]emove Folder')
|
||||
nmap('<leader>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, '[W]orkspace [L]ist Folders')
|
||||
|
||||
-- Create a command `:Format` local to the LSP buffer
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
||||
if vim.lsp.buf.format then
|
||||
vim.lsp.buf.format()
|
||||
elseif vim.lsp.buf.formatting then
|
||||
vim.lsp.buf.formatting()
|
||||
end
|
||||
end, { desc = 'Format current buffer with LSP' })
|
||||
end
|
||||
|
||||
-- Setup mason so it can manage external tooling
|
||||
require('mason').setup()
|
||||
|
||||
-- Enable the following language servers.
|
||||
-- Feel free to add/remove any LSPs that you want here.
|
||||
-- They will automatically be installed.
|
||||
-- https://github.com/williamboman/mason-lspconfig.nvim#available-lsp-servers
|
||||
local servers = {
|
||||
-- a
|
||||
'angularls',
|
||||
'ansiblels',
|
||||
-- b
|
||||
'bashls',
|
||||
-- c
|
||||
'clangd',
|
||||
'cssls',
|
||||
-- d
|
||||
'dockerls',
|
||||
-- e
|
||||
'eslint',
|
||||
'emmet_ls',
|
||||
-- f
|
||||
-- g
|
||||
'gopls',
|
||||
'graphql',
|
||||
-- h
|
||||
'html',
|
||||
-- i
|
||||
-- j
|
||||
'quick_lint_js', -- js
|
||||
'jsonls',
|
||||
-- k
|
||||
-- l
|
||||
'sumneko_lua', -- lua
|
||||
-- m
|
||||
'marksman', -- markdown
|
||||
-- n
|
||||
-- o
|
||||
'spectral', --openapi
|
||||
-- p
|
||||
'intelephense', 'phpactor', 'psalm',
|
||||
'pyright',
|
||||
-- q
|
||||
-- r
|
||||
'rust_analyzer',
|
||||
-- s
|
||||
'sqlls',
|
||||
'stylelint_lsp',
|
||||
-- t
|
||||
'tailwindcss',
|
||||
'terraformls',
|
||||
'tflint',
|
||||
'tsserver',
|
||||
-- u
|
||||
-- v / w
|
||||
'volar', -- vue
|
||||
'vuels', -- vue
|
||||
-- x / y / z
|
||||
'lemminx', -- xml
|
||||
'yamlls', -- yaml
|
||||
}
|
||||
|
||||
-- Ensure the servers above are installed
|
||||
require('mason-lspconfig').setup {
|
||||
ensure_installed = servers,
|
||||
}
|
||||
|
||||
require("mason-lspconfig").setup_handlers {
|
||||
-- The first entry (without a key) will be the default handler
|
||||
-- and will be called for each installed server that doesn't have
|
||||
-- a dedicated handler.
|
||||
function (server_name) -- default handler (optional)
|
||||
require("lspconfig")[server_name].setup {}
|
||||
end,
|
||||
}
|
||||
|
||||
-- nvim-cmp supports additional completion capabilities
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
require('lspconfig')[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
-- Turn on lsp status information
|
||||
require('fidget').setup()
|
||||
|
||||
-- Example custom configuration for lua
|
||||
--
|
||||
-- Make runtime files discoverable to the server
|
||||
local runtime_path = vim.split(package.path, ';')
|
||||
table.insert(runtime_path, 'lua/?.lua')
|
||||
table.insert(runtime_path, 'lua/?/init.lua')
|
||||
|
||||
require('lspconfig').sumneko_lua.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're
|
||||
-- using (most likely LuaJIT)
|
||||
version = 'LuaJIT',
|
||||
-- Setup your lua path
|
||||
path = runtime_path,
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
},
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file('', true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized
|
||||
-- but unique identifier
|
||||
telemetry = { enable = false },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- nvim-cmp setup
|
||||
local cmp = require 'cmp'
|
||||
local luasnip = require 'luasnip'
|
||||
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
},
|
||||
}
|
||||
|
||||
-- barbar keymaps
|
||||
local map = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- Move to previous/next
|
||||
map('n', '<C-,>', '<Cmd>BufferPrevious<CR>', opts)
|
||||
map('n', '<C-.>', '<Cmd>BufferNext<CR>', opts)
|
||||
-- Re-order to previous/next
|
||||
map('n', '<C-<>', '<Cmd>BufferMovePrevious<CR>', opts)
|
||||
map('n', '<C->>', '<Cmd>BufferMoveNext<CR>', opts)
|
||||
-- Goto buffer in position...
|
||||
map('n', '<A-1>', '<Cmd>BufferGoto 1<CR>', opts)
|
||||
map('n', '<A-2>', '<Cmd>BufferGoto 2<CR>', opts)
|
||||
map('n', '<A-3>', '<Cmd>BufferGoto 3<CR>', opts)
|
||||
map('n', '<A-4>', '<Cmd>BufferGoto 4<CR>', opts)
|
||||
map('n', '<A-5>', '<Cmd>BufferGoto 5<CR>', opts)
|
||||
map('n', '<A-6>', '<Cmd>BufferGoto 6<CR>', opts)
|
||||
map('n', '<A-7>', '<Cmd>BufferGoto 7<CR>', opts)
|
||||
map('n', '<A-8>', '<Cmd>BufferGoto 8<CR>', opts)
|
||||
map('n', '<A-9>', '<Cmd>BufferGoto 9<CR>', opts)
|
||||
map('n', '<A-0>', '<Cmd>BufferLast<CR>', opts)
|
||||
-- Pin/unpin buffer
|
||||
map('n', '<A-p>', '<Cmd>BufferPin<CR>', opts)
|
||||
-- Close buffer
|
||||
map('n', '<A-c>', '<Cmd>BufferClose<CR>', opts)
|
||||
-- Wipeout buffer
|
||||
-- :BufferWipeout
|
||||
-- Close commands
|
||||
-- :BufferCloseAllButCurrent
|
||||
-- :BufferCloseAllButPinned
|
||||
-- :BufferCloseAllButCurrentOrPinned
|
||||
-- :BufferCloseBuffersLeft
|
||||
-- :BufferCloseBuffersRight
|
||||
-- Magic buffer-picking mode
|
||||
map('n', '<C-p>', '<Cmd>BufferPick<CR>', opts)
|
||||
-- Sort automatically by...
|
||||
map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', opts)
|
||||
map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', opts)
|
||||
map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', opts)
|
||||
map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', opts)
|
||||
|
||||
-- Other:
|
||||
-- :BarbarEnable - enables barbar (enabled by default)
|
||||
-- :BarbarDisable - very bad command, should never be used
|
||||
|
||||
vim.api.nvim_create_autocmd("BufWritePost",
|
||||
{ pattern = "plugins.lua", command = "source <afile> | PackerSync" })
|
||||
vim.api.nvim_create_autocmd("BufRead",
|
||||
{ pattern = "*/node_modules/*", command = "lua vim.diagnostic.disable(0)" })
|
||||
vim.api.nvim_create_autocmd("BufNewFile",
|
||||
{ pattern = "*/node_modules/*", command = "lua vim.diagnostic.disable(0)" })
|
||||
-- Enable spell checking for certain file types
|
||||
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" },
|
||||
{ pattern = { "*.txt", "*.md", "*.tex" },
|
||||
command = "setlocal spell" })
|
||||
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
@@ -1,74 +0,0 @@
|
||||
return function(use)
|
||||
|
||||
-- 💥 Create key bindings that stick.
|
||||
-- WhichKey is a lua plugin that displays a popup with
|
||||
-- possible keybindings of the command you started typing.
|
||||
use({ "folke/which-key.nvim", config = function() require("which-key").setup({}) end })
|
||||
|
||||
-- 🍨 Soothing pastel theme for (Neo)vim
|
||||
-- https://github.com/catppuccin/nvim
|
||||
-- use { "catppuccin/nvim", as = "catppuccin" }
|
||||
-- vim.cmd.colorscheme('catppuccin-latte')
|
||||
|
||||
-- markdown preview plugin for (neo)vim
|
||||
-- https://github.com/iamcco/markdown-preview.nvim
|
||||
use({ "iamcco/markdown-preview.nvim",
|
||||
run = function() vim.fn["mkdp#util#install"]() end,
|
||||
})
|
||||
|
||||
-- The neovim tabline plugin.
|
||||
-- https://github.com/romgrk/barbar.nvim
|
||||
use 'nvim-tree/nvim-web-devicons'
|
||||
use { 'romgrk/barbar.nvim', wants = 'nvim-web-devicons' }
|
||||
|
||||
-- Pretty UI
|
||||
use 'stevearc/dressing.nvim' -- Neovim plugin to improve the default vim.ui interfaces
|
||||
use 'rcarriga/nvim-notify' -- A fancy, configurable, notification manager for NeoVim
|
||||
use 'vigoux/notifier.nvim' -- Non-intrusive notification system for neovim
|
||||
use { 'folke/todo-comments.nvim', -- ✅ Highlight, list and search todo comments in your projects
|
||||
requires = 'nvim-lua/plenary.nvim',
|
||||
config = function() require('todo-comments').setup {} end,
|
||||
}
|
||||
|
||||
-- The Refactoring library based off the Refactoring book by Martin Fowler
|
||||
-- https://github.com/ThePrimeagen/refactoring.nvim
|
||||
use {
|
||||
"ThePrimeagen/refactoring.nvim",
|
||||
requires = {
|
||||
{"nvim-lua/plenary.nvim"},
|
||||
{"nvim-treesitter/nvim-treesitter"}
|
||||
}
|
||||
}
|
||||
|
||||
-- An asynchronous linter plugin for Neovim complementary to the built-in Language Server Protocol support.
|
||||
-- https://github.com/mfussenegger/nvim-lint
|
||||
use 'mfussenegger/nvim-lint'
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
callback = function() require("lint").try_lint() end,
|
||||
})
|
||||
|
||||
-- nvim orgmode, to get me use nvim even more.
|
||||
use ({ "nvim-orgmode/orgmode",
|
||||
config = function() require("orgmode").setup({}) end,
|
||||
})
|
||||
|
||||
-- Remaps for the refactoring operations currently offered by the plugin
|
||||
local map = vim.api.nvim_set_keymap
|
||||
local refactoring_opts = { noremap = true, silent = true, expr = false }
|
||||
map("v", "<leader>re", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function')<CR>]], refactoring_opts)
|
||||
map("v", "<leader>rf", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function To File')<CR>]], refactoring_opts)
|
||||
map("v", "<leader>rv", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]], refactoring_opts)
|
||||
map("v", "<leader>ri", [[ <Esc><Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]], refactoring_opts)
|
||||
|
||||
-- Extract block doesn't need visual mode
|
||||
map("n", "<leader>rb", [[ <Cmd>lua require('refactoring').refactor('Extract Block')<CR>]], refactoring_opts)
|
||||
map("n", "<leader>rbf", [[ <Cmd>lua require('refactoring').refactor('Extract Block To File')<CR>]], refactoring_opts)
|
||||
|
||||
-- Inline variable can also pick up the identifier currently under the cursor without visual mode
|
||||
map("n", "<leader>ri", [[ <Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]],refactoring_opts)
|
||||
|
||||
-- prompt for a refactor to apply when the remap is triggered
|
||||
map("v", "<leader>rr", ":lua require('refactoring').select_refactor()<CR>", refactoring_opts)
|
||||
|
||||
end
|
||||
|
||||
@@ -1,294 +0,0 @@
|
||||
-- Automatically generated packer.nvim plugin loader code
|
||||
|
||||
if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
|
||||
vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"')
|
||||
return
|
||||
end
|
||||
|
||||
vim.api.nvim_command('packadd packer.nvim')
|
||||
|
||||
local no_errors, error_msg = pcall(function()
|
||||
|
||||
_G._packer = _G._packer or {}
|
||||
_G._packer.inside_compile = true
|
||||
|
||||
local time
|
||||
local profile_info
|
||||
local should_profile = false
|
||||
if should_profile then
|
||||
local hrtime = vim.loop.hrtime
|
||||
profile_info = {}
|
||||
time = function(chunk, start)
|
||||
if start then
|
||||
profile_info[chunk] = hrtime()
|
||||
else
|
||||
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
|
||||
end
|
||||
end
|
||||
else
|
||||
time = function(chunk, start) end
|
||||
end
|
||||
|
||||
local function save_profiles(threshold)
|
||||
local sorted_times = {}
|
||||
for chunk_name, time_taken in pairs(profile_info) do
|
||||
sorted_times[#sorted_times + 1] = {chunk_name, time_taken}
|
||||
end
|
||||
table.sort(sorted_times, function(a, b) return a[2] > b[2] end)
|
||||
local results = {}
|
||||
for i, elem in ipairs(sorted_times) do
|
||||
if not threshold or threshold and elem[2] > threshold then
|
||||
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
|
||||
end
|
||||
end
|
||||
if threshold then
|
||||
table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)')
|
||||
end
|
||||
|
||||
_G._packer.profile_output = results
|
||||
end
|
||||
|
||||
time([[Luarocks path setup]], true)
|
||||
local package_path_str = "/Users/ivuorinen/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/ivuorinen/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/ivuorinen/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/ivuorinen/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
|
||||
local install_cpath_pattern = "/Users/ivuorinen/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
|
||||
if not string.find(package.path, package_path_str, 1, true) then
|
||||
package.path = package.path .. ';' .. package_path_str
|
||||
end
|
||||
|
||||
if not string.find(package.cpath, install_cpath_pattern, 1, true) then
|
||||
package.cpath = package.cpath .. ';' .. install_cpath_pattern
|
||||
end
|
||||
|
||||
time([[Luarocks path setup]], false)
|
||||
time([[try_loadstring definition]], true)
|
||||
local function try_loadstring(s, component, name)
|
||||
local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
|
||||
if not success then
|
||||
vim.schedule(function()
|
||||
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
|
||||
end)
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
time([[try_loadstring definition]], false)
|
||||
time([[Defining packer_plugins]], true)
|
||||
_G.packer_plugins = {
|
||||
["Comment.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/Comment.nvim",
|
||||
url = "https://github.com/numToStr/Comment.nvim"
|
||||
},
|
||||
LuaSnip = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/LuaSnip",
|
||||
url = "https://github.com/L3MON4D3/LuaSnip"
|
||||
},
|
||||
["barbar.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/barbar.nvim",
|
||||
url = "https://github.com/romgrk/barbar.nvim",
|
||||
wants = { "nvim-web-devicons" }
|
||||
},
|
||||
catppuccin = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/catppuccin",
|
||||
url = "https://github.com/catppuccin/nvim"
|
||||
},
|
||||
["cmp-nvim-lsp"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
|
||||
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
|
||||
},
|
||||
cmp_luasnip = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/cmp_luasnip",
|
||||
url = "https://github.com/saadparwaiz1/cmp_luasnip"
|
||||
},
|
||||
["dressing.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/dressing.nvim",
|
||||
url = "https://github.com/stevearc/dressing.nvim"
|
||||
},
|
||||
["fidget.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/fidget.nvim",
|
||||
url = "https://github.com/j-hui/fidget.nvim"
|
||||
},
|
||||
["gitsigns.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/gitsigns.nvim",
|
||||
url = "https://github.com/lewis6991/gitsigns.nvim"
|
||||
},
|
||||
["indent-blankline.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim",
|
||||
url = "https://github.com/lukas-reineke/indent-blankline.nvim"
|
||||
},
|
||||
["lualine.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/lualine.nvim",
|
||||
url = "https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
["markdown-preview.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim",
|
||||
url = "https://github.com/iamcco/markdown-preview.nvim"
|
||||
},
|
||||
["mason-lspconfig.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim",
|
||||
url = "https://github.com/williamboman/mason-lspconfig.nvim"
|
||||
},
|
||||
["mason.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/mason.nvim",
|
||||
url = "https://github.com/williamboman/mason.nvim"
|
||||
},
|
||||
["notifier.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/notifier.nvim",
|
||||
url = "https://github.com/vigoux/notifier.nvim"
|
||||
},
|
||||
["nvim-cmp"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-cmp",
|
||||
url = "https://github.com/hrsh7th/nvim-cmp"
|
||||
},
|
||||
["nvim-lint"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-lint",
|
||||
url = "https://github.com/mfussenegger/nvim-lint"
|
||||
},
|
||||
["nvim-lspconfig"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
||||
url = "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
["nvim-notify"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-notify",
|
||||
url = "https://github.com/rcarriga/nvim-notify"
|
||||
},
|
||||
["nvim-treesitter"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
||||
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
["nvim-treesitter-textobjects"] = {
|
||||
load_after = {},
|
||||
loaded = true,
|
||||
needs_bufread = false,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/opt/nvim-treesitter-textobjects",
|
||||
url = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects"
|
||||
},
|
||||
["nvim-web-devicons"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
|
||||
url = "https://github.com/nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
orgmode = {
|
||||
config = { "\27LJ\2\n9\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\forgmode\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/orgmode",
|
||||
url = "https://github.com/nvim-orgmode/orgmode"
|
||||
},
|
||||
["packer.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/packer.nvim",
|
||||
url = "https://github.com/wbthomason/packer.nvim"
|
||||
},
|
||||
["palenight.vim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/palenight.vim",
|
||||
url = "https://github.com/drewtempelmeyer/palenight.vim"
|
||||
},
|
||||
["plenary.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/plenary.nvim",
|
||||
url = "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
["refactoring.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/refactoring.nvim",
|
||||
url = "https://github.com/ThePrimeagen/refactoring.nvim"
|
||||
},
|
||||
["telescope-fzf-native.nvim"] = {
|
||||
cond = { true },
|
||||
loaded = false,
|
||||
needs_bufread = false,
|
||||
only_cond = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/opt/telescope-fzf-native.nvim",
|
||||
url = "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
||||
},
|
||||
["telescope.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/telescope.nvim",
|
||||
url = "https://github.com/nvim-telescope/telescope.nvim"
|
||||
},
|
||||
["todo-comments.nvim"] = {
|
||||
config = { "\27LJ\2\n?\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\18todo-comments\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/todo-comments.nvim",
|
||||
url = "https://github.com/folke/todo-comments.nvim"
|
||||
},
|
||||
["vim-fugitive"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/vim-fugitive",
|
||||
url = "https://github.com/tpope/vim-fugitive"
|
||||
},
|
||||
["vim-rhubarb"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/vim-rhubarb",
|
||||
url = "https://github.com/tpope/vim-rhubarb"
|
||||
},
|
||||
["vim-sleuth"] = {
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/vim-sleuth",
|
||||
url = "https://github.com/tpope/vim-sleuth"
|
||||
},
|
||||
["which-key.nvim"] = {
|
||||
config = { "\27LJ\2\n;\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\14which-key\frequire\0" },
|
||||
loaded = true,
|
||||
path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/which-key.nvim",
|
||||
url = "https://github.com/folke/which-key.nvim"
|
||||
}
|
||||
}
|
||||
|
||||
time([[Defining packer_plugins]], false)
|
||||
-- Config for: orgmode
|
||||
time([[Config for orgmode]], true)
|
||||
try_loadstring("\27LJ\2\n9\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\forgmode\frequire\0", "config", "orgmode")
|
||||
time([[Config for orgmode]], false)
|
||||
-- Config for: todo-comments.nvim
|
||||
time([[Config for todo-comments.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\18todo-comments\frequire\0", "config", "todo-comments.nvim")
|
||||
time([[Config for todo-comments.nvim]], false)
|
||||
-- Config for: which-key.nvim
|
||||
time([[Config for which-key.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n;\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\14which-key\frequire\0", "config", "which-key.nvim")
|
||||
time([[Config for which-key.nvim]], false)
|
||||
-- Conditional loads
|
||||
time([[Conditional loading of telescope-fzf-native.nvim]], true)
|
||||
require("packer.load")({"telescope-fzf-native.nvim"}, {}, _G.packer_plugins)
|
||||
time([[Conditional loading of telescope-fzf-native.nvim]], false)
|
||||
-- Load plugins in order defined by `after`
|
||||
time([[Sequenced loading]], true)
|
||||
vim.cmd [[ packadd nvim-treesitter ]]
|
||||
vim.cmd [[ packadd nvim-treesitter-textobjects ]]
|
||||
time([[Sequenced loading]], false)
|
||||
|
||||
_G._packer.inside_compile = false
|
||||
if _G._packer.needs_bufread == true then
|
||||
vim.cmd("doautocmd BufRead")
|
||||
end
|
||||
_G._packer.needs_bufread = false
|
||||
|
||||
if should_profile then save_profiles() end
|
||||
|
||||
end)
|
||||
|
||||
if not no_errors then
|
||||
error_msg = error_msg:gsub('"', '\\"')
|
||||
vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None')
|
||||
end
|
||||
9
config/nvm/default-packages
Normal file
9
config/nvm/default-packages
Normal file
@@ -0,0 +1,9 @@
|
||||
blade-formatter
|
||||
corepack
|
||||
editorconfig-checker
|
||||
github-release-notes
|
||||
js-debug
|
||||
neovim
|
||||
prettier
|
||||
standardjs
|
||||
stylelint-lsp
|
||||
37
config/starship.toml
Normal file
37
config/starship.toml
Normal file
@@ -0,0 +1,37 @@
|
||||
# Get editor completions based on the config schema
|
||||
"$schema" = 'https://starship.rs/config-schema.json'
|
||||
|
||||
# Inserts a blank line between shell prompts
|
||||
add_newline = true
|
||||
|
||||
# Timeout for commands executed by starship (in milliseconds).
|
||||
command_timeout = 1000
|
||||
|
||||
# Replace the '❯' symbol in the prompt with '➜'
|
||||
[character] # The name of the module we are configuring is 'character'
|
||||
success_symbol = '[➜](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green'
|
||||
|
||||
[cmd_duration]
|
||||
disabled = true
|
||||
|
||||
[git_branch]
|
||||
symbol = '🌱 '
|
||||
truncation_length = 20
|
||||
truncation_symbol = '…'
|
||||
ignore_branches = ['master', 'main']
|
||||
|
||||
[git_status]
|
||||
up_to_date = '✓'
|
||||
staged = '[++\($count\)](green)'
|
||||
|
||||
[package]
|
||||
format = '[$symbol($version )]($style)'
|
||||
version_format = '${major}.${minor}'
|
||||
|
||||
[php]
|
||||
format = '[$symbol($version )]($style)'
|
||||
version_format = '${major}.${minor}'
|
||||
|
||||
[nodejs]
|
||||
format = '[$symbol($version )]($style)'
|
||||
version_format = '${major}.${minor}'
|
||||
@@ -177,4 +177,4 @@ wtf:
|
||||
left: 1
|
||||
height: 1
|
||||
width: 3
|
||||
refreshInterval: 3600
|
||||
refreshInterval: 3600
|
||||
|
||||
1
dotbot
Submodule
1
dotbot
Submodule
Submodule dotbot added at 328bcb3259
1
dotbot-brew
Submodule
1
dotbot-brew
Submodule
Submodule dotbot-brew added at 98e346360b
1
dotbot-include
Submodule
1
dotbot-include
Submodule
Submodule dotbot-include added at 88e6471cd6
@@ -1,66 +0,0 @@
|
||||
[user]
|
||||
name = Ismo Vuorinen
|
||||
email = ismo.vuorinen@vincit.fi
|
||||
signingkey = ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDLyOvkr1nRqMVv3UAizmk6C+q40H4khvw7qIXXXyOyFmzjwYx/Cuxoi4uZVjX+q4qFYJ+c312uu6YXiEtfyoCao3wub8r1cLBQ3eIvuyWp2K8Ixcd9JmFmLmoeiENpJxqyr0WPZLDkrCWUZCsQQh8zzGFnfciUdUdTiZ7s21AEhhmFRSdFlVfQSlGMFxU321psg1YilcP80bDwFd1FsL4TssSkwlbgP/twqnpZ4436TTo7kp0UnH/RZkfRdDWScKHaWgncBG0CZeQxGWnRp8fvZn/7gDnthcZhvnDALVBE7QFuZ90GxqVw3IGpHryV0mFO6EGQ9Ke9YX7pKVZPUXZjeCN4SVKsqFdVJ6AjaSJ9K7nL98rYK7qNzndT3cKqPNgPteyXWRulH68A51ecQqHrjTttZcdN9hKt9uBHpzuXsby2QObT+VB4MNjZapa+YYF/WgwJCml4lzn2xMFg1vYZD78pfoJ9e5f2cL1MMlUSDb0TNxmEXfDQ77H/pRpKDz0=
|
||||
|
||||
[core]
|
||||
excludesfile = ~/.config/git/gitignore
|
||||
|
||||
[alias]
|
||||
reset-origin = !git fetch origin && git reset --hard origin/master && git clean -f -d
|
||||
reset-upstream = !git fetch upstream && git reset --hard upstream/master && git clean -f -d
|
||||
nah = !git reset --hard && git clean -df
|
||||
undo-commit = reset HEAD~ --soft
|
||||
llog = log --pretty=fuller
|
||||
logs = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
|
||||
rl = reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)'
|
||||
tagdate = log --date-order --graph --tags --simplify-by-decoration --pretty=format:\"%ai %h %d\"
|
||||
branchbydate = for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'
|
||||
branchcolor = "!for ref in $(git for-each-ref --sort=-committerdate --format=\"%(refname)\" refs/heads/ refs/remotes ); do git log -n1 $ref --pretty=format:\"%Cgreen%cr%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset%n\" | cat ; done | awk '! a[$0]++'"
|
||||
|
||||
[diff]
|
||||
tool = difftastic
|
||||
|
||||
[difftool]
|
||||
prompt = false
|
||||
|
||||
[difftool "difftastic"]
|
||||
cmd = difft "$LOCAL" "$REMOTE"
|
||||
|
||||
[filter "lfs"]
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
|
||||
[init]
|
||||
defaultBranch = master
|
||||
|
||||
[pull]
|
||||
rebase = false
|
||||
|
||||
[color]
|
||||
ui = true
|
||||
diff = auto
|
||||
branch = auto
|
||||
status = auto
|
||||
|
||||
[color "status"]
|
||||
added = green bold
|
||||
changed = yellow
|
||||
deleted = red bold strike
|
||||
untracked = cyan
|
||||
branch = yellow black bold ul
|
||||
[gpg]
|
||||
format = ssh
|
||||
[gpg "ssh"]
|
||||
program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign
|
||||
allowedSignersFile = ~/.ssh/allowed_signers
|
||||
[commit]
|
||||
gpgsign = true
|
||||
[credential "https://github.com"]
|
||||
helper =
|
||||
helper = !/opt/homebrew/bin/gh auth git-credential
|
||||
[credential "https://gist.github.com"]
|
||||
helper =
|
||||
helper = !/opt/homebrew/bin/gh auth git-credential
|
||||
@@ -1,3 +1,3 @@
|
||||
# .dotfiles/host-air
|
||||
# .dotfiles/hosts/air
|
||||
|
||||
This is my home computer.
|
||||
0
hosts/air/config/.gitkeep
Normal file
0
hosts/air/config/.gitkeep
Normal file
15
hosts/air/install.conf.yaml
Normal file
15
hosts/air/install.conf.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
- include: 'hosts/defaults.yaml'
|
||||
- shell:
|
||||
- echo "Configuring air"
|
||||
- brewfile:
|
||||
- Brewfile
|
||||
- link:
|
||||
~/:
|
||||
force: true
|
||||
glob: true
|
||||
path: hosts/air/base/**
|
||||
prefix: "."
|
||||
~/.config/:
|
||||
glob: true
|
||||
force: true
|
||||
path: hosts/air/config/**
|
||||
9
hosts/defaults.yaml
Normal file
9
hosts/defaults.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
- defaults:
|
||||
create:
|
||||
mode: 0755
|
||||
link:
|
||||
create: true
|
||||
relink: true
|
||||
exclude: ["*.md", "*renovate*"]
|
||||
shell:
|
||||
stdout: true
|
||||
0
hosts/lakka/base/.gitkeep
Normal file
0
hosts/lakka/base/.gitkeep
Normal file
50
hosts/lakka/base/zshrc
Normal file
50
hosts/lakka/base/zshrc
Normal file
@@ -0,0 +1,50 @@
|
||||
# Lakka zsh configuration.
|
||||
#
|
||||
# shellcheck shell=bash
|
||||
export PATH="$HOME/bin:/usr/local/bin:/usr/bin:/usr/sbin:$PATH"
|
||||
|
||||
# Defaults
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
|
||||
# Run x-load-configs in your terminal to reload the files.
|
||||
function x-load-configs()
|
||||
{
|
||||
# Load the shell dotfiles, and then some:
|
||||
for file in $DOTFILES/config/{exports,alias,functions}; do
|
||||
[ -r "$file" ] && [ -f "$file" ] && source "$file"
|
||||
[ -r "$file-secret" ] && [ -f "$file-secret" ] && source "$file-secret"
|
||||
[ -r "$file-$HOSTNAME" ] && [ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME"
|
||||
[ -r "$file-$HOSTNAME-secret" ] && [ -f "$file-$HOSTNAME-secret" ] && source "$file-$HOSTNAME-secret"
|
||||
done
|
||||
}
|
||||
x-load-configs
|
||||
|
||||
export PATH="$XDG_BIN_HOME:$PATH"
|
||||
export LC_ALL=fi_FI.utf8
|
||||
|
||||
export RVM_PATH="$HOME/.rvm"
|
||||
export PATH="$RVM_PATH/bin:$PATH"
|
||||
[[ -s "$RVM_PATH/scripts/rvm" ]] && source "$RVM_PATH/scripts/rvm" # Load RVM into a shell session *as a function*
|
||||
|
||||
# Try to load antigen, if present
|
||||
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
|
||||
[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH"
|
||||
|
||||
# If antigen was loaded
|
||||
if command -v antigen &> /dev/null; then
|
||||
antigen use oh-my-zsh
|
||||
|
||||
# config/functions
|
||||
x-default-antigen-bundles
|
||||
|
||||
antigen theme oskarkrawczyk/honukai-iterm-zsh honukai
|
||||
|
||||
antigen apply
|
||||
fi
|
||||
|
||||
alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state'
|
||||
alias nano='nano -wS -$'
|
||||
alias gpg=gpg2
|
||||
|
||||
ACME_PATH="$HOME/.acme.sh"
|
||||
[[ -s "$ACME_PATH/acme.sh.env" ]] && . "$ACME_PATH/acme.sh.env"
|
||||
0
hosts/lakka/config/.gitkeep
Normal file
0
hosts/lakka/config/.gitkeep
Normal file
17
hosts/lakka/install.conf.yaml
Normal file
17
hosts/lakka/install.conf.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
- include: 'hosts/defaults.yaml'
|
||||
- shell:
|
||||
- echo "Configuring lakka"
|
||||
- link:
|
||||
~/:
|
||||
force: true
|
||||
glob: true
|
||||
path: hosts/lakka/base/**
|
||||
prefix: "."
|
||||
~/.config/:
|
||||
glob: true
|
||||
force: true
|
||||
path: hosts/lakka/config/**
|
||||
~/.irssi/:
|
||||
glob: true
|
||||
force: true
|
||||
path: hosts/lakka/irssi/**
|
||||
243
hosts/lakka/irssi/config
Normal file
243
hosts/lakka/irssi/config
Normal file
@@ -0,0 +1,243 @@
|
||||
# Reduce log fragmentation
|
||||
settings = {
|
||||
core = {
|
||||
write_buffer_size = "2MB";
|
||||
write_buffer_timeout = "5min";
|
||||
real_name = "Ismo Vuorinen";
|
||||
user_name = "viir";
|
||||
nick = "viir";
|
||||
};
|
||||
"fe-text" = { actlist_sort = "refnum"; };
|
||||
};
|
||||
|
||||
servers = (
|
||||
{
|
||||
address = "irc.tdc.fi";
|
||||
chatnet = "IRCnet";
|
||||
port = "6667";
|
||||
own_host = "kapsi.fi";
|
||||
family = "inet";
|
||||
autoconnect = "yes";
|
||||
},
|
||||
{
|
||||
address = "irc.fi.quakenet.org";
|
||||
chatnet = "QuakeNet";
|
||||
port = "6667";
|
||||
own_host = "kapsi.fi";
|
||||
family = "inet";
|
||||
},
|
||||
{ address = "irc.efnet.net"; chatnet = "EFNet"; port = "6667"; },
|
||||
{
|
||||
address = "irc.undernet.org";
|
||||
chatnet = "Undernet";
|
||||
port = "6667";
|
||||
},
|
||||
{ address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; },
|
||||
{
|
||||
address = "irc.quakenet.org";
|
||||
chatnet = "QuakeNet";
|
||||
port = "6667";
|
||||
},
|
||||
{ address = "silc.silcnet.org"; chatnet = "SILC"; port = "706"; },
|
||||
{ address = "irc.nerv.fi"; chatnet = "Nerv"; port = "706"; }
|
||||
);
|
||||
|
||||
chatnets = {
|
||||
IRCnet = {
|
||||
type = "IRC";
|
||||
max_kicks = "4";
|
||||
max_msgs = "5";
|
||||
max_whois = "4";
|
||||
max_query_chans = "5";
|
||||
};
|
||||
EFNet = {
|
||||
type = "IRC";
|
||||
max_kicks = "4";
|
||||
max_msgs = "3";
|
||||
max_whois = "1";
|
||||
};
|
||||
Undernet = {
|
||||
type = "IRC";
|
||||
max_kicks = "1";
|
||||
max_msgs = "3";
|
||||
max_whois = "30";
|
||||
};
|
||||
DALnet = {
|
||||
type = "IRC";
|
||||
max_kicks = "4";
|
||||
max_msgs = "3";
|
||||
max_whois = "30";
|
||||
};
|
||||
QuakeNet = {
|
||||
type = "IRC";
|
||||
max_kicks = "1";
|
||||
max_msgs = "3";
|
||||
max_whois = "30";
|
||||
};
|
||||
SILC = { type = "SILC"; };
|
||||
Nerv = { type = "IRC"; };
|
||||
};
|
||||
|
||||
channels = (
|
||||
{ name = "#kapsi.fi"; chatnet = "IRCNet"; autojoin = "No"; }
|
||||
);
|
||||
|
||||
aliases = {
|
||||
J = "join";
|
||||
WJOIN = "join -window";
|
||||
WQUERY = "query -window";
|
||||
LEAVE = "part";
|
||||
BYE = "quit";
|
||||
EXIT = "quit";
|
||||
SIGNOFF = "quit";
|
||||
DESCRIBE = "action";
|
||||
DATE = "time";
|
||||
HOST = "userhost";
|
||||
LAST = "lastlog";
|
||||
SAY = "msg *";
|
||||
WI = "whois";
|
||||
WII = "whois $0 $0";
|
||||
WW = "whowas";
|
||||
W = "who";
|
||||
N = "names";
|
||||
M = "msg";
|
||||
T = "topic";
|
||||
C = "clear";
|
||||
CL = "clear";
|
||||
K = "kick";
|
||||
KB = "kickban";
|
||||
KN = "knockout";
|
||||
BANS = "ban";
|
||||
B = "ban";
|
||||
MUB = "unban *";
|
||||
UB = "unban";
|
||||
IG = "ignore";
|
||||
UNIG = "unignore";
|
||||
SB = "scrollback";
|
||||
UMODE = "mode $N";
|
||||
WC = "window close";
|
||||
WN = "window new hide";
|
||||
SV = "say Irssi $J ($V) - http://irssi.org/";
|
||||
GOTO = "sb goto";
|
||||
CHAT = "dcc chat";
|
||||
RUN = "SCRIPT LOAD";
|
||||
CALC = "exec - if which bc &>/dev/null\\; then echo '$*' | bc | awk '{print \"$*=\"$$1}'\\; else echo bc was not found\\; fi";
|
||||
SBAR = "STATUSBAR";
|
||||
INVITELIST = "mode $C +I";
|
||||
Q = "QUERY";
|
||||
"MANUAL-WINDOWS" = "set use_status_window off;set autocreate_windows off;set autocreate_query_level none;set autoclose_windows off;set reuse_unused_windows on;save";
|
||||
EXEMPTLIST = "mode $C +e";
|
||||
ATAG = "WINDOW SERVER";
|
||||
};
|
||||
|
||||
statusbar = {
|
||||
# formats:
|
||||
# when using {templates}, the template is shown only if it's argument isn't
|
||||
# empty unless no argument is given. for example {sb} is printed always,
|
||||
# but {sb $T} is printed only if $T isn't empty.
|
||||
|
||||
items = {
|
||||
# start/end text in statusbars
|
||||
barstart = "{sbstart}";
|
||||
barend = "{sbend}";
|
||||
|
||||
topicbarstart = "{topicsbstart}";
|
||||
topicbarend = "{topicsbend}";
|
||||
|
||||
# treated "normally", you could change the time/user name to whatever
|
||||
time = "{sb $Z}";
|
||||
user = "{sb {sbnickmode $cumode}$N{sbmode $usermode}{sbaway $A}}";
|
||||
|
||||
# treated specially .. window is printed with non-empty windows,
|
||||
# window_empty is printed with empty windows
|
||||
window = "{sb $winref:$tag/$itemname{sbmode $M}}";
|
||||
window_empty = "{sb $winref{sbservertag $tag}}";
|
||||
prompt = "{prompt $[.15]itemname}";
|
||||
prompt_empty = "{prompt $winname}";
|
||||
topic = " $topic";
|
||||
topic_empty = " Irssi v$J - http://irssi.org/help/";
|
||||
|
||||
# all of these treated specially, they're only displayed when needed
|
||||
lag = "{sb Lag: $0-}";
|
||||
act = "{sb Act: $0-}";
|
||||
more = "-- more --";
|
||||
};
|
||||
|
||||
# there's two type of statusbars. root statusbars are either at the top
|
||||
# of the screen or at the bottom of the screen. window statusbars are at
|
||||
# the top/bottom of each split window in screen.
|
||||
default = {
|
||||
# the "default statusbar" to be displayed at the bottom of the window.
|
||||
# contains all the normal items.
|
||||
window = {
|
||||
disabled = "no";
|
||||
|
||||
# window, root
|
||||
type = "window";
|
||||
# top, bottom
|
||||
placement = "bottom";
|
||||
# number
|
||||
position = "1";
|
||||
# active, inactive, always
|
||||
visible = "active";
|
||||
|
||||
# list of items in statusbar in the display order
|
||||
items = {
|
||||
barstart = { priority = "100"; };
|
||||
time = { };
|
||||
user = { };
|
||||
window = { };
|
||||
window_empty = { };
|
||||
lag = { priority = "-1"; };
|
||||
act = { priority = "10"; };
|
||||
more = { priority = "-1"; alignment = "right"; };
|
||||
barend = { priority = "100"; alignment = "right"; };
|
||||
};
|
||||
};
|
||||
|
||||
# statusbar to use in inactive split windows
|
||||
window_inact = {
|
||||
type = "window";
|
||||
placement = "bottom";
|
||||
position = "1";
|
||||
visible = "inactive";
|
||||
items = {
|
||||
barstart = { priority = "100"; };
|
||||
window = { };
|
||||
window_empty = { };
|
||||
more = { priority = "-1"; alignment = "right"; };
|
||||
barend = { priority = "100"; alignment = "right"; };
|
||||
};
|
||||
};
|
||||
|
||||
# we treat input line as yet another statusbar :) It's possible to
|
||||
# add other items before or after the input line item.
|
||||
prompt = {
|
||||
type = "root";
|
||||
placement = "bottom";
|
||||
# we want to be at the bottom always
|
||||
position = "100";
|
||||
visible = "always";
|
||||
items = {
|
||||
prompt = { priority = "-1"; };
|
||||
prompt_empty = { priority = "-1"; };
|
||||
# treated specially, this is the real input line.
|
||||
input = { priority = "10"; };
|
||||
};
|
||||
};
|
||||
|
||||
# topicbar
|
||||
topic = {
|
||||
type = "root";
|
||||
placement = "top";
|
||||
position = "1";
|
||||
visible = "always";
|
||||
items = {
|
||||
topicbarstart = { priority = "100"; };
|
||||
topic = { };
|
||||
topic_empty = { };
|
||||
topicbarend = { priority = "100"; alignment = "right"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
294
hosts/lakka/irssi/default.theme
Normal file
294
hosts/lakka/irssi/default.theme
Normal file
@@ -0,0 +1,294 @@
|
||||
# When testing changes, the easiest way to reload the theme is with /RELOAD.
|
||||
# This reloads the configuration file too, so if you did any changes remember
|
||||
# to /SAVE it first. Remember also that /SAVE overwrites the theme file with
|
||||
# old data so keep backups :)
|
||||
|
||||
# TEMPLATES:
|
||||
|
||||
# The real text formats that irssi uses are the ones you can find with
|
||||
# /FORMAT command. Back in the old days all the colors and texts were mixed
|
||||
# up in those formats, and it was really hard to change the colors since you
|
||||
# might have had to change them in tens of different places. So, then came
|
||||
# this templating system.
|
||||
|
||||
# Now the /FORMATs don't have any colors in them, and they also have very
|
||||
# little other styling. Most of the stuff you need to change is in this
|
||||
# theme file. If you can't change something here, you can always go back
|
||||
# to change the /FORMATs directly, they're also saved in these .theme files.
|
||||
|
||||
# So .. the templates. They're those {blahblah} parts you see all over the
|
||||
# /FORMATs and here. Their usage is simply {name parameter1 parameter2}.
|
||||
# When irssi sees this kind of text, it goes to find "name" from abstracts
|
||||
# block below and sets "parameter1" into $0 and "parameter2" into $1 (you
|
||||
# can have more parameters of course). Templates can have subtemplates.
|
||||
# Here's a small example:
|
||||
# /FORMAT format hello {colorify {underline world}}
|
||||
# abstracts = { colorify = "%G$0-%n"; underline = "%U$0-%U"; }
|
||||
# When irssi expands the templates in "format", the final string would be:
|
||||
# hello %G%Uworld%U%n
|
||||
# ie. underlined bright green "world" text.
|
||||
# and why "$0-", why not "$0"? $0 would only mean the first parameter,
|
||||
# $0- means all the parameters. With {underline hello world} you'd really
|
||||
# want to underline both of the words, not just the hello (and world would
|
||||
# actually be removed entirely).
|
||||
|
||||
# COLORS:
|
||||
|
||||
# You can find definitions for the color format codes in docs/formats.txt.
|
||||
|
||||
# There's one difference here though. %n format. Normally it means the
|
||||
# default color of the terminal (white mostly), but here it means the
|
||||
# "reset color back to the one it was in higher template". For example
|
||||
# if there was /FORMAT test %g{foo}bar, and foo = "%Y$0%n", irssi would
|
||||
# print yellow "foo" (as set with %Y) but "bar" would be green, which was
|
||||
# set at the beginning before the {foo} template. If there wasn't the %g
|
||||
# at start, the normal behaviour of %n would occur. If you _really_ want
|
||||
# to use the terminal's default color, use %N.
|
||||
|
||||
#############################################################################
|
||||
|
||||
# default foreground color (%N) - -1 is the "default terminal color"
|
||||
default_color = "-1";
|
||||
|
||||
# print timestamp/servertag at the end of line, not at beginning
|
||||
info_eol = "false";
|
||||
|
||||
# these characters are automatically replaced with specified color
|
||||
# (dark grey by default)
|
||||
replaces = { "[]=" = "%K$*%n"; };
|
||||
|
||||
abstracts = {
|
||||
##
|
||||
## generic
|
||||
##
|
||||
|
||||
# text to insert at the beginning of each non-message line
|
||||
line_start = "%B-%n!%B-%n ";
|
||||
|
||||
# timestamp styling, nothing by default
|
||||
timestamp = "$*";
|
||||
|
||||
# any kind of text that needs hilighting, default is to bold
|
||||
hilight = "%_$*%_";
|
||||
|
||||
# any kind of error message, default is bright red
|
||||
error = "%R$*%n";
|
||||
|
||||
# channel name is printed
|
||||
channel = "%_$*%_";
|
||||
|
||||
# nick is printed
|
||||
nick = "%_$*%_";
|
||||
|
||||
# nick host is printed
|
||||
nickhost = "[$*]";
|
||||
|
||||
# server name is printed
|
||||
server = "%_$*%_";
|
||||
|
||||
# some kind of comment is printed
|
||||
comment = "[$*]";
|
||||
|
||||
# reason for something is printed (part, quit, kick, ..)
|
||||
reason = "{comment $*}";
|
||||
|
||||
# mode change is printed ([+o nick])
|
||||
mode = "{comment $*}";
|
||||
|
||||
##
|
||||
## channel specific messages
|
||||
##
|
||||
|
||||
# highlighted nick/host is printed (joins)
|
||||
channick_hilight = "%C$*%n";
|
||||
chanhost_hilight = "{nickhost %c$*%n}";
|
||||
|
||||
# nick/host is printed (parts, quits, etc.)
|
||||
channick = "%c$*%n";
|
||||
chanhost = "{nickhost $*}";
|
||||
|
||||
# highlighted channel name is printed
|
||||
channelhilight = "%c$*%n";
|
||||
|
||||
# ban/ban exception/invite list mask is printed
|
||||
ban = "%c$*%n";
|
||||
|
||||
##
|
||||
## messages
|
||||
##
|
||||
|
||||
# the basic styling of how to print message, $0 = nick mode, $1 = nick
|
||||
msgnick = "%K<%n$0$1-%K>%n %|";
|
||||
|
||||
# message from you is printed. "msgownnick" specifies the styling of the
|
||||
# nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the
|
||||
# whole line.
|
||||
|
||||
# Example1: You want the message text to be green:
|
||||
# ownmsgnick = "{msgnick $0 $1-}%g";
|
||||
# Example2.1: You want < and > chars to be yellow:
|
||||
# ownmsgnick = "%Y{msgnick $0 $1-%Y}%n";
|
||||
# (you'll also have to remove <> from replaces list above)
|
||||
# Example2.2: But you still want to keep <> grey for other messages:
|
||||
# pubmsgnick = "%K{msgnick $0 $1-%K}%n";
|
||||
# pubmsgmenick = "%K{msgnick $0 $1-%K}%n";
|
||||
# pubmsghinick = "%K{msgnick $1 $0$2-%n%K}%n";
|
||||
# ownprivmsgnick = "%K{msgnick $*%K}%n";
|
||||
# privmsgnick = "%K{msgnick %R$*%K}%n";
|
||||
|
||||
# $0 = nick mode, $1 = nick
|
||||
ownmsgnick = "{msgnick $0 $1-}";
|
||||
ownnick = "%_$*%n";
|
||||
|
||||
# public message in channel, $0 = nick mode, $1 = nick
|
||||
pubmsgnick = "{msgnick $0 $1-}";
|
||||
pubnick = "%N$*%n";
|
||||
|
||||
# public message in channel meant for me, $0 = nick mode, $1 = nick
|
||||
pubmsgmenick = "{msgnick $0 $1-}";
|
||||
menick = "%Y$*%n";
|
||||
|
||||
# public highlighted message in channel
|
||||
# $0 = highlight color, $1 = nick mode, $2 = nick
|
||||
pubmsghinick = "{msgnick $1 $0$2-%n}";
|
||||
|
||||
# channel name is printed with message
|
||||
msgchannel = "%K:%c$*%n";
|
||||
|
||||
# private message, $0 = nick, $1 = host
|
||||
privmsg = "[%R$0%K(%r$1-%K)%n] ";
|
||||
|
||||
# private message from you, $0 = "msg", $1 = target nick
|
||||
ownprivmsg = "[%r$0%K(%R$1-%K)%n] ";
|
||||
|
||||
# own private message in query
|
||||
ownprivmsgnick = "{msgnick $*}";
|
||||
ownprivnick = "%_$*%n";
|
||||
|
||||
# private message in query
|
||||
privmsgnick = "{msgnick %R$*%n}";
|
||||
|
||||
##
|
||||
## Actions (/ME stuff)
|
||||
##
|
||||
|
||||
# used internally by this theme
|
||||
action_core = "%_ * $*%n";
|
||||
|
||||
# generic one that's used by most actions
|
||||
action = "{action_core $*} ";
|
||||
|
||||
# own action, both private/public
|
||||
ownaction = "{action $*}";
|
||||
|
||||
# own action with target, both private/public
|
||||
ownaction_target = "{action_core $0}%K:%c$1%n ";
|
||||
|
||||
# private action sent by others
|
||||
pvtaction = "%_ (*) $*%n ";
|
||||
pvtaction_query = "{action $*}";
|
||||
|
||||
# public action sent by others
|
||||
pubaction = "{action $*}";
|
||||
|
||||
|
||||
##
|
||||
## other IRC events
|
||||
##
|
||||
|
||||
# whois
|
||||
whois = "%# $[8]0 : $1-";
|
||||
|
||||
# notices
|
||||
ownnotice = "[%r$0%K(%R$1-%K)]%n ";
|
||||
notice = "%K-%M$*%K-%n ";
|
||||
pubnotice_channel = "%K:%m$*";
|
||||
pvtnotice_host = "%K(%m$*%K)";
|
||||
servernotice = "%g!$*%n ";
|
||||
|
||||
# CTCPs
|
||||
ownctcp = "[%r$0%K(%R$1-%K)] ";
|
||||
ctcp = "%g$*%n";
|
||||
|
||||
# wallops
|
||||
wallop = "%_$*%n: ";
|
||||
wallop_nick = "%n$*";
|
||||
wallop_action = "%_ * $*%n ";
|
||||
|
||||
# netsplits
|
||||
netsplit = "%R$*%n";
|
||||
netjoin = "%C$*%n";
|
||||
|
||||
# /names list
|
||||
names_prefix = "";
|
||||
names_nick = "[%_$0%_$1-] ";
|
||||
names_nick_op = "{names_nick $*}";
|
||||
names_nick_halfop = "{names_nick $*}";
|
||||
names_nick_voice = "{names_nick $*}";
|
||||
names_users = "[%g$*%n]";
|
||||
names_channel = "%G$*%n";
|
||||
|
||||
# DCC
|
||||
dcc = "%g$*%n";
|
||||
dccfile = "%_$*%_";
|
||||
|
||||
# DCC chat, own msg/action
|
||||
dccownmsg = "[%r$0%K($1-%K)%n] ";
|
||||
dccownnick = "%R$*%n";
|
||||
dccownquerynick = "%_$*%n";
|
||||
dccownaction = "{action $*}";
|
||||
dccownaction_target = "{action_core $0}%K:%c$1%n ";
|
||||
|
||||
# DCC chat, others
|
||||
dccmsg = "[%G$1-%K(%g$0%K)%n] ";
|
||||
dccquerynick = "%G$*%n";
|
||||
dccaction = "%_ (*dcc*) $*%n %|";
|
||||
|
||||
##
|
||||
## statusbar
|
||||
##
|
||||
|
||||
# default background for all statusbars. You can also give
|
||||
# the default foreground color for statusbar items.
|
||||
sb_background = "%4%w";
|
||||
|
||||
# default backround for "default" statusbar group
|
||||
#sb_default_bg = "%4";
|
||||
# background for prompt / input line
|
||||
sb_prompt_bg = "%n";
|
||||
# background for info statusbar
|
||||
sb_info_bg = "%8";
|
||||
# background for topicbar (same default)
|
||||
#sb_topic_bg = "%4";
|
||||
|
||||
# text at the beginning of statusbars. sb-item already puts
|
||||
# space there,so we don't use anything by default.
|
||||
sbstart = "";
|
||||
# text at the end of statusbars. Use space so that it's never
|
||||
# used for anything.
|
||||
sbend = " ";
|
||||
|
||||
topicsbstart = "{sbstart $*}";
|
||||
topicsbend = "{sbend $*}";
|
||||
|
||||
prompt = "[$*] ";
|
||||
|
||||
sb = " %c[%n$*%c]%n";
|
||||
sbmode = "(%c+%n$*)";
|
||||
sbaway = " (%GzZzZ%n)";
|
||||
sbservertag = ":$0 (change with ^X)";
|
||||
sbnickmode = "$0";
|
||||
|
||||
# activity in statusbar
|
||||
|
||||
# ',' separator
|
||||
sb_act_sep = "%c$*";
|
||||
# normal text
|
||||
sb_act_text = "%c$*";
|
||||
# public message
|
||||
sb_act_msg = "%W$*";
|
||||
# hilight
|
||||
sb_act_hilight = "%M$*";
|
||||
# hilight with specified color, $0 = color, $1 = text
|
||||
sb_act_hilight_color = "$0$1-%n";
|
||||
};
|
||||
0
hosts/tunkki/base/.gitkeep
Normal file
0
hosts/tunkki/base/.gitkeep
Normal file
0
hosts/tunkki/config/.gitkeep
Normal file
0
hosts/tunkki/config/.gitkeep
Normal file
13
hosts/tunkki/install.conf.yaml
Normal file
13
hosts/tunkki/install.conf.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
- include: 'hosts/defaults.yaml'
|
||||
- shell:
|
||||
- echo "Configuring tunkki"
|
||||
- link:
|
||||
~/:
|
||||
force: true
|
||||
glob: true
|
||||
path: hosts/tunkki/base/**
|
||||
prefix: "."
|
||||
~/.config/:
|
||||
glob: true
|
||||
force: true
|
||||
path: hosts/tunkki/config/**
|
||||
0
hosts/v/.gitkeep
Normal file
0
hosts/v/.gitkeep
Normal file
@@ -1,3 +1,3 @@
|
||||
# .dotfiles/host-v
|
||||
# .dotfiles/hosts/v
|
||||
|
||||
This is my work computer.
|
||||
0
hosts/v/base/.gitkeep
Normal file
0
hosts/v/base/.gitkeep
Normal file
0
hosts/v/config/.gitkeep
Normal file
0
hosts/v/config/.gitkeep
Normal file
75
hosts/v/config/git/config
Normal file
75
hosts/v/config/git/config
Normal file
@@ -0,0 +1,75 @@
|
||||
[user]
|
||||
name = Ismo Vuorinen
|
||||
email = ismo.vuorinen@vincit.fi
|
||||
signingkey = ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDLyOvkr1nRqMVv3UAizmk6C+q40H4khvw7qIXXXyOyFmzjwYx/Cuxoi4uZVjX+q4qFYJ+c312uu6YXiEtfyoCao3wub8r1cLBQ3eIvuyWp2K8Ixcd9JmFmLmoeiENpJxqyr0WPZLDkrCWUZCsQQh8zzGFnfciUdUdTiZ7s21AEhhmFRSdFlVfQSlGMFxU321psg1YilcP80bDwFd1FsL4TssSkwlbgP/twqnpZ4436TTo7kp0UnH/RZkfRdDWScKHaWgncBG0CZeQxGWnRp8fvZn/7gDnthcZhvnDALVBE7QFuZ90GxqVw3IGpHryV0mFO6EGQ9Ke9YX7pKVZPUXZjeCN4SVKsqFdVJ6AjaSJ9K7nL98rYK7qNzndT3cKqPNgPteyXWRulH68A51ecQqHrjTttZcdN9hKt9uBHpzuXsby2QObT+VB4MNjZapa+YYF/WgwJCml4lzn2xMFg1vYZD78pfoJ9e5f2cL1MMlUSDb0TNxmEXfDQ77H/pRpKDz0=
|
||||
|
||||
[core]
|
||||
excludesfile = ~/.config/git/gitignore
|
||||
|
||||
[alias]
|
||||
reset-origin = !git fetch origin && git reset --hard origin/master && git clean -f -d
|
||||
reset-upstream = !git fetch upstream && git reset --hard upstream/master && git clean -f -d
|
||||
nah = !git reset --hard && git clean -df
|
||||
undo-commit = reset HEAD~ --soft
|
||||
llog = log --pretty=fuller
|
||||
logs = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
|
||||
rl = reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)'
|
||||
tagdate = log --date-order --graph --tags --simplify-by-decoration --pretty=format:\"%ai %h %d\"
|
||||
branchbydate = for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'
|
||||
branchcolor = "!for ref in $(git for-each-ref --sort=-committerdate --format=\"%(refname)\" refs/heads/ refs/remotes ); do git log -n1 $ref --pretty=format:\"%Cgreen%cr%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset%n\" | cat ; done | awk '! a[$0]++'"
|
||||
|
||||
[diff]
|
||||
tool = difftastic
|
||||
|
||||
[difftool]
|
||||
prompt = false
|
||||
|
||||
[difftool "difftastic"]
|
||||
cmd = difft "$LOCAL" "$REMOTE"
|
||||
|
||||
[filter "lfs"]
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
|
||||
[init]
|
||||
defaultBranch = main
|
||||
|
||||
[pull]
|
||||
rebase = true
|
||||
|
||||
[color]
|
||||
ui = true
|
||||
diff = auto
|
||||
branch = auto
|
||||
status = auto
|
||||
|
||||
[color "status"]
|
||||
added = green bold
|
||||
changed = yellow
|
||||
deleted = red bold strike
|
||||
untracked = cyan
|
||||
branch = yellow black bold ul
|
||||
|
||||
[gpg]
|
||||
format = ssh
|
||||
|
||||
[gpg "ssh"]
|
||||
program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign
|
||||
allowedSignersFile = ~/.ssh/allowed_signers
|
||||
|
||||
[commit]
|
||||
gpgsign = true
|
||||
|
||||
[credential "https://github.com"]
|
||||
helper =
|
||||
helper = !/opt/homebrew/bin/gh auth git-credential
|
||||
|
||||
[credential "https://gist.github.com"]
|
||||
helper =
|
||||
helper = !/opt/homebrew/bin/gh auth git-credential
|
||||
|
||||
[submodule]
|
||||
recurse = true
|
||||
|
||||
15
hosts/v/install.conf.yaml
Normal file
15
hosts/v/install.conf.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
- include: 'hosts/defaults.yaml'
|
||||
- shell:
|
||||
- echo "Configuring v"
|
||||
- brewfile:
|
||||
- Brewfile
|
||||
- link:
|
||||
~/:
|
||||
force: true
|
||||
glob: true
|
||||
path: hosts/v/base/**
|
||||
prefix: "."
|
||||
~/.config/:
|
||||
glob: true
|
||||
force: true
|
||||
path: hosts/v/config/**
|
||||
37
install
Executable file
37
install
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
CONFIG="install.conf.yaml"
|
||||
DOTBOT_DIR="dotbot"
|
||||
|
||||
DOTBOT_BIN="bin/dotbot"
|
||||
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
DOTBOT_BIN_PATH="${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}"
|
||||
DOTBOT_HOST="$(hostname -s)" || ''
|
||||
|
||||
cd "$BASEDIR"
|
||||
git submodule sync --quiet --recursive
|
||||
git submodule update --init --recursive
|
||||
|
||||
"${DOTBOT_BIN_PATH}" \
|
||||
-d "${BASEDIR}" \
|
||||
--plugin-dir=dotbot-brew \
|
||||
--plugin-dir=dotbot-gh-extension \
|
||||
--plugin-dir=dotbot-include \
|
||||
-c "${CONFIG}" \
|
||||
"${@}"
|
||||
|
||||
if [ "${DOTBOT_HOST}" != "" ]; then
|
||||
DOTBOT_HOST_CONFIG="${BASEDIR}/hosts/${DOTBOT_HOST}/${CONFIG}"
|
||||
echo "-> Trying if host config can be found: ${DOTBOT_HOST_CONFIG}"
|
||||
[ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] \
|
||||
&& echo "(!) Found $DOTBOT_HOST_CONFIG" \
|
||||
&& "$DOTBOT_BIN_PATH" \
|
||||
-d "$BASEDIR" \
|
||||
--plugin-dir=dotbot-brew \
|
||||
--plugin-dir=dotbot-gh-extension \
|
||||
--plugin-dir=dotbot-include \
|
||||
-c "$DOTBOT_HOST_CONFIG" \
|
||||
"${@}"
|
||||
fi
|
||||
33
install-without-plugins
Executable file
33
install-without-plugins
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
CONFIG="install.conf.yaml"
|
||||
DOTBOT_DIR="dotbot"
|
||||
|
||||
DOTBOT_BIN="bin/dotbot"
|
||||
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
DOTBOT_HOST="$(hostname -s)" || ''
|
||||
DOTBOT_BIN_PATH="${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}"
|
||||
|
||||
cd "$BASEDIR"
|
||||
git submodule sync --quiet --recursive
|
||||
git submodule update --init --recursive
|
||||
|
||||
"${DOTBOT_BIN_PATH}" \
|
||||
-d "${BASEDIR}" \
|
||||
--plugin-dir=dotbot-include \
|
||||
-c "${CONFIG}" \
|
||||
"${@}"
|
||||
|
||||
if [ "${DOTBOT_HOST}" != "" ]; then
|
||||
DOTBOT_HOST_CONFIG="${BASEDIR}/hosts/${DOTBOT_HOST}/${CONFIG}"
|
||||
echo "-> Trying if host config can be found: ${DOTBOT_HOST_CONFIG}"
|
||||
[ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] \
|
||||
&& echo "(!) Found $DOTBOT_HOST_CONFIG" \
|
||||
&& "$DOTBOT_BIN_PATH" \
|
||||
-d "$BASEDIR" \
|
||||
--plugin-dir=dotbot-include \
|
||||
-c "$DOTBOT_HOST_CONFIG" \
|
||||
"${@}"
|
||||
fi
|
||||
38
install.conf.yaml
Normal file
38
install.conf.yaml
Normal file
@@ -0,0 +1,38 @@
|
||||
- include: 'hosts/defaults.yaml'
|
||||
- clean:
|
||||
~/:
|
||||
~/.config:
|
||||
recursive: true
|
||||
~/.local:
|
||||
recursive: true
|
||||
- create:
|
||||
~/.cache:
|
||||
~/.cache/git:
|
||||
~/.config:
|
||||
~/.local:
|
||||
~/.local/run:
|
||||
~/.local/share:
|
||||
~/.local/state:
|
||||
~/.ssh:
|
||||
mode: 0700
|
||||
~/Code:
|
||||
- link:
|
||||
~/:
|
||||
force: true
|
||||
glob: true
|
||||
path: base/**
|
||||
prefix: "."
|
||||
~/.config/:
|
||||
glob: true
|
||||
path: config/**
|
||||
~/.local/bin/:
|
||||
glob: true
|
||||
path: local/bin/**
|
||||
~/.ssh/:
|
||||
force: true
|
||||
glob: true
|
||||
mode: 0600
|
||||
path: ssh/**
|
||||
- shell:
|
||||
- git submodule update --init --recursive --force
|
||||
- bash local/bin/dfm install all
|
||||
@@ -25,9 +25,9 @@ Some problematic code has been fixed per `shellcheck` suggestions.
|
||||
| `x-when-up` | skx/sysadmin-util |
|
||||
|
||||
- Sources:
|
||||
- [skx/sysadmin-utils](https://github.com/skx/sysadmin-util/)
|
||||
- Tools for Linux/Unix sysadmins.
|
||||
- [Licence](https://github.com/skx/sysadmin-util/blob/master/LICENSE)
|
||||
- onnimonni
|
||||
- https://gist.github.com/onnimonni/b49779ebc96216771a6be3de46449fa1
|
||||
- [mvdan/dotfiles](https://github.com/mvdan/dotfiles)
|
||||
- [skx/sysadmin-utils](https://github.com/skx/sysadmin-util/)
|
||||
- Tools for Linux/Unix sysadmins.
|
||||
- [Licence](https://github.com/skx/sysadmin-util/blob/master/LICENSE)
|
||||
- [onnimonni](https://github.com/onnimonni)
|
||||
- [validate_sha256sum](https://gist.github.com/onnimonni/b49779ebc96216771a6be3de46449fa1)
|
||||
- [mvdan/dotfiles](https://github.com/mvdan/dotfiles)
|
||||
|
||||
@@ -24,7 +24,7 @@ if [[ $ANTIGEN_CACHE != false ]]; then
|
||||
for config in $ANTIGEN_CHECK_FILES; do
|
||||
if [[ "$config" -nt "$config.zwc" ]]; then
|
||||
# Flag configuration file as newer
|
||||
{ zcompile "$config"; } &!
|
||||
{ zcompile "$config" } &!
|
||||
# Kill cache file in order to force full loading (see a few lines below)
|
||||
[[ -f "$ANTIGEN_CACHE" ]] && rm -f "$ANTIGEN_CACHE"
|
||||
fi
|
||||
@@ -151,7 +151,7 @@ antigen () {
|
||||
# String if record is found
|
||||
-antigen-find-record () {
|
||||
local bundle=$1
|
||||
|
||||
|
||||
if [[ $# -eq 0 ]]; then
|
||||
return 1
|
||||
fi
|
||||
@@ -255,7 +255,7 @@ antigen () {
|
||||
return 0
|
||||
}
|
||||
|
||||
# This function check ZSH_EVAL_CONTEXT to determine if running in interactive shell.
|
||||
# This function check ZSH_EVAL_CONTEXT to determine if running in interactive shell.
|
||||
#
|
||||
# Usage
|
||||
# -antigen-interactive-mode
|
||||
@@ -283,7 +283,7 @@ antigen () {
|
||||
# Branch name
|
||||
-antigen-parse-branch () {
|
||||
local url="$1" branch="$2" branches
|
||||
|
||||
|
||||
local match mbegin mend MATCH MBEGIN MEND
|
||||
|
||||
if [[ "$branch" =~ '\*' ]]; then
|
||||
@@ -466,7 +466,7 @@ antigen () {
|
||||
|
||||
# Compatibility with oh-my-zsh themes.
|
||||
-antigen-set-default _ANTIGEN_THEME_COMPAT true
|
||||
|
||||
|
||||
# Add default built-in extensions to load at start up
|
||||
-antigen-set-default _ANTIGEN_BUILTIN_EXTENSIONS 'lock parallel defer cache'
|
||||
|
||||
@@ -555,7 +555,7 @@ antigen () {
|
||||
if [[ $#list == 0 ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Using a for rather than `source $list` as we need to check for zsh-themes
|
||||
# In order to create antigen-compat file. This is only needed for interactive-mode
|
||||
# theme switching, for static loading (cache) there is no need.
|
||||
@@ -643,7 +643,7 @@ antigen () {
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
|
||||
# Check if url is just the plugin name. Super short syntax.
|
||||
if [[ "${args[url]}" != */* ]]; then
|
||||
case "$ANTIGEN_DEFAULT_REPO_URL" in
|
||||
@@ -728,13 +728,13 @@ antigen () {
|
||||
# if it's local then path is just the "url" argument, loc remains the same
|
||||
args[dir]=${args[url]}
|
||||
fi
|
||||
|
||||
|
||||
# Escape url and branch (may contain semver-like and pipe characters)
|
||||
args[url]="${(qq)args[url]}"
|
||||
if [[ -n "${args[branch]}" ]]; then
|
||||
args[branch]="${(qq)args[branch]}"
|
||||
fi
|
||||
|
||||
|
||||
# Escape bundle name (may contain semver-like characters)
|
||||
args[name]="${(qq)args[name]}"
|
||||
|
||||
@@ -821,7 +821,7 @@ antigen-bundle () {
|
||||
printf "Seems %s is already installed!\n" ${bundle[name]}
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Clone bundle if we haven't done do already.
|
||||
if [[ ! -d "${bundle[dir]}" ]]; then
|
||||
if ! -antigen-bundle-install ${(kv)bundle}; then
|
||||
@@ -835,7 +835,7 @@ antigen-bundle () {
|
||||
printf "Antigen: Failed to load %s.\n" ${bundle[btype]} >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Only add it to the record if it could be installed and loaded.
|
||||
_ANTIGEN_BUNDLE_RECORD+=("$record")
|
||||
}
|
||||
@@ -1326,7 +1326,7 @@ antigen-update () {
|
||||
local url=""
|
||||
local make_local_clone=""
|
||||
local start=$(date +'%s')
|
||||
|
||||
|
||||
if [[ $# -eq 0 ]]; then
|
||||
printf "Antigen: Missing argument.\n" >&2
|
||||
return 1
|
||||
@@ -1340,14 +1340,14 @@ antigen-update () {
|
||||
|
||||
url="$(echo "$record" | cut -d' ' -f1)"
|
||||
make_local_clone=$(echo "$record" | cut -d' ' -f4)
|
||||
|
||||
|
||||
local branch="master"
|
||||
if [[ $url == *\|* ]]; then
|
||||
branch="$(-antigen-parse-branch ${url%|*} ${url#*|})"
|
||||
fi
|
||||
|
||||
printf "Updating %s... " $(-antigen-bundle-short-name "$url" "$branch")
|
||||
|
||||
|
||||
if [[ $make_local_clone == "false" ]]; then
|
||||
printf "Bundle has no local clone. Will not be updated.\n" >&2
|
||||
return 1
|
||||
@@ -1358,7 +1358,7 @@ antigen-update () {
|
||||
printf "Error! Activate logging and try again.\n" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
local took=$(( $(date +'%s') - $start ))
|
||||
printf "Done. Took %ds.\n" $took
|
||||
}
|
||||
@@ -1410,7 +1410,7 @@ typeset -g _ANTIGEN_EXTENSIONS; _ANTIGEN_EXTENSIONS=()
|
||||
# -antigen-add-hook antigen-apply antigen-apply-hook ["replace"|"pre"|"post"] ["once"|"repeat"]
|
||||
antigen-add-hook () {
|
||||
local target="$1" hook="$2" type="$3" mode="${4:-repeat}"
|
||||
|
||||
|
||||
if (( ! $+functions[$target] )); then
|
||||
printf "Antigen: Function %s doesn't exist.\n" $target
|
||||
return 1
|
||||
@@ -1428,7 +1428,7 @@ antigen-add-hook () {
|
||||
fi
|
||||
|
||||
_ANTIGEN_HOOKS_META[$hook]="target $target type $type mode $mode called 0"
|
||||
|
||||
|
||||
# Do shadow for this function if there is none already
|
||||
local hook_function="${_ANTIGEN_HOOK_PREFIX}$target"
|
||||
if (( ! $+functions[$hook_function] )); then
|
||||
@@ -1441,7 +1441,7 @@ antigen-add-hook () {
|
||||
return \$?
|
||||
}"
|
||||
fi
|
||||
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -1454,7 +1454,7 @@ antigen-add-hook () {
|
||||
|
||||
typeset -a pre_hooks replace_hooks post_hooks;
|
||||
typeset -a hooks; hooks=(${(s|:|)_ANTIGEN_HOOKS[$target]})
|
||||
|
||||
|
||||
typeset -A meta;
|
||||
for hook in $hooks; do
|
||||
meta=(${(s: :)_ANTIGEN_HOOKS_META[$hook]})
|
||||
@@ -1500,7 +1500,7 @@ antigen-add-hook () {
|
||||
[[ $? == -1 ]] && WARN "$hook shortcircuited" && return $ret
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
if [[ $replace_hook == 0 ]]; then
|
||||
WARN "${_ANTIGEN_HOOK_PREFIX}$target $args"
|
||||
noglob ${_ANTIGEN_HOOK_PREFIX}$target $args
|
||||
@@ -1514,7 +1514,7 @@ antigen-add-hook () {
|
||||
noglob $hook $args
|
||||
[[ $? == -1 ]] && WARN "$hook shortcircuited" && return $ret
|
||||
done
|
||||
|
||||
|
||||
LOG "Return from hook ${target} with ${ret}"
|
||||
|
||||
return $ret
|
||||
@@ -1533,7 +1533,7 @@ antigen-remove-hook () {
|
||||
hooks[$hooks[(I)$hook]]=()
|
||||
fi
|
||||
_ANTIGEN_HOOKS[${target}]="${(j|:|)hooks}"
|
||||
|
||||
|
||||
if [[ $#hooks == 0 ]]; then
|
||||
# Destroy base hook
|
||||
eval "function $(functions -- ${_ANTIGEN_HOOK_PREFIX}$target | sed s/${_ANTIGEN_HOOK_PREFIX}//)"
|
||||
@@ -1554,7 +1554,7 @@ antigen-remove-hook () {
|
||||
eval "function $(functions -- ${_ANTIGEN_HOOK_PREFIX}$target | sed s/${_ANTIGEN_HOOK_PREFIX}//)"
|
||||
unfunction -- "${_ANTIGEN_HOOK_PREFIX}$target" 2> /dev/null
|
||||
done
|
||||
|
||||
|
||||
_ANTIGEN_HOOKS=()
|
||||
_ANTIGEN_HOOKS_META=()
|
||||
_ANTIGEN_EXTENSIONS=()
|
||||
@@ -1570,14 +1570,14 @@ antigen-ext () {
|
||||
eval $func
|
||||
local ret=$?
|
||||
WARN "$func return code was $ret"
|
||||
if (( $ret == 0 )); then
|
||||
if (( $ret == 0 )); then
|
||||
LOG "LOADED EXTENSION $ext" EXT
|
||||
-antigen-$ext-execute && _ANTIGEN_EXTENSIONS+=($ext)
|
||||
else
|
||||
WARN "IGNORING EXTENSION $func" EXT
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
else
|
||||
printf "Antigen: No extension defined or already loaded: %s\n" $func >&2
|
||||
return 1
|
||||
@@ -1617,7 +1617,7 @@ antigen-ext-init () {
|
||||
return -1 # Stop right there
|
||||
}
|
||||
antigen-add-hook antigen-bundle antigen-bundle-defer replace
|
||||
|
||||
|
||||
# Hooks antigen-apply in order to release hooked functions
|
||||
antigen-apply-defer () {
|
||||
WARN "Defer pre-apply" DEFER PRE-APPLY
|
||||
@@ -1639,14 +1639,14 @@ antigen-ext-init () {
|
||||
# Default lock path.
|
||||
-antigen-set-default ANTIGEN_LOCK $ADOTDIR/.lock
|
||||
typeset -g _ANTIGEN_LOCK_PROCESS=false
|
||||
|
||||
|
||||
# Use env variable to determine if we should load this extension
|
||||
-antigen-set-default ANTIGEN_MUTEX true
|
||||
# Set ANTIGEN_MUTEX to false to avoid loading this extension
|
||||
if [[ $ANTIGEN_MUTEX == true ]]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
|
||||
# Do not use mutex
|
||||
return 1;
|
||||
}
|
||||
@@ -1714,7 +1714,7 @@ antigen-ext-init () {
|
||||
else
|
||||
WARN "Bundle ${bundle[name]} already cloned locally." PARALLEL
|
||||
fi
|
||||
|
||||
|
||||
repositories+=(${bundle[url]})
|
||||
done
|
||||
|
||||
@@ -1734,7 +1734,7 @@ antigen-ext-init () {
|
||||
for bundle in ${_PARALLEL_BUNDLE[@]}; do
|
||||
antigen-bundle $bundle
|
||||
done
|
||||
|
||||
|
||||
|
||||
WARN "Parallel install done" PARALLEL
|
||||
}
|
||||
@@ -1751,7 +1751,7 @@ antigen-ext-init () {
|
||||
antigen-add-hook antigen-bundle antigen-bundle-parallel replace
|
||||
}
|
||||
antigen-add-hook antigen-apply antigen-apply-parallel pre once
|
||||
|
||||
|
||||
antigen-apply-parallel-execute () {
|
||||
WARN "Parallel replace-apply" PARALLEL REPLACE-APPLY
|
||||
antigen-remove-hook antigen-bundle-parallel
|
||||
@@ -1872,14 +1872,14 @@ EOC
|
||||
|
||||
# Cache auto config files to check for changes (.zshrc, .antigenrc etc)
|
||||
-antigen-set-default ANTIGEN_AUTO_CONFIG true
|
||||
|
||||
|
||||
# Default cache path.
|
||||
-antigen-set-default ANTIGEN_CACHE $ADOTDIR/init.zsh
|
||||
-antigen-set-default ANTIGEN_RSRC $ADOTDIR/.resources
|
||||
if [[ $ANTIGEN_CACHE == false ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -1911,21 +1911,21 @@ EOC
|
||||
antigen-remove-hook -antigen-load-source-cached
|
||||
antigen-remove-hook antigen-bundle-cached
|
||||
}
|
||||
|
||||
|
||||
antigen-add-hook antigen-apply antigen-apply-cached post once
|
||||
|
||||
|
||||
# Defer antigen-bundle.
|
||||
antigen-bundle-cached () {
|
||||
_ZCACHE_CAPTURE_BUNDLE+=("${(j: :)${@}}")
|
||||
}
|
||||
antigen-add-hook antigen-bundle antigen-bundle-cached pre
|
||||
|
||||
|
||||
# Defer loading.
|
||||
-antigen-load-env-cached () {
|
||||
local bundle
|
||||
typeset -A bundle; bundle=($@)
|
||||
local location=${bundle[dir]}/${bundle[loc]}
|
||||
|
||||
|
||||
# Load to path if there is no sourceable
|
||||
if [[ ${bundle[loc]} == "/" ]]; then
|
||||
_ZCACHE_BUNDLE_SOURCE+=("${location}")
|
||||
@@ -1935,13 +1935,13 @@ EOC
|
||||
_ZCACHE_BUNDLE_SOURCE+=("${location}")
|
||||
}
|
||||
antigen-add-hook -antigen-load-env -antigen-load-env-cached replace
|
||||
|
||||
|
||||
# Defer sourcing.
|
||||
-antigen-load-source-cached () {
|
||||
_ZCACHE_BUNDLE_SOURCE+=($@)
|
||||
}
|
||||
antigen-add-hook -antigen-load-source -antigen-load-source-cached replace
|
||||
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
304
local/bin/dfm
304
local/bin/dfm
@@ -9,130 +9,237 @@
|
||||
# Helper variables, override with ENVs like `VERBOSE=1 dfm help`
|
||||
: "${VERBOSE:=0}"
|
||||
: "${DOTFILES:=$HOME/.dotfiles}"
|
||||
: "${SHARED_SCRIPT:=$DOTFILES/scripts/shared.sh}"
|
||||
: "${INSTALL_SCRIPT:=$DOTFILES/scripts/install-dotfiles.sh}"
|
||||
: "${BREWFILE:=$DOTFILES/Brewfile}"
|
||||
: "${HOSTFILES:=$DOTFILES/hosts}"
|
||||
|
||||
SCRIPT=$(basename "$0")
|
||||
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
VERSION_NVM="v0.39.3"
|
||||
|
||||
# shellcheck source=./../../scripts/shared.sh
|
||||
source "$SHARED_SCRIPT"
|
||||
|
||||
function section_install
|
||||
{
|
||||
USAGE_PREFIX="$SCRIPT install"
|
||||
USAGE_PREFIX="$SCRIPT install <command>"
|
||||
|
||||
MENU=(
|
||||
"all:Installs everything in the correct order"
|
||||
"antigen:Updates the antigen.zsh file"
|
||||
"composer:Install composer"
|
||||
"dotenv:Install dotenv-linter"
|
||||
"gh:Install GitHub CLI Extensions"
|
||||
"go:Install Go Packages"
|
||||
"imagick:Install ImageMagick CLI"
|
||||
"starship:Install starship.rs"
|
||||
"macos:Setup nice macOS defaults"
|
||||
"nvm:Install Node Version Manager (nvm)"
|
||||
"npm:Install NPM Packages"
|
||||
"ntfy:Install ntfy"
|
||||
"z:Install z"
|
||||
)
|
||||
|
||||
case "$1" in
|
||||
all)
|
||||
$0 install antigen && msg_done "New antigen installed"
|
||||
$0 install macos && msg_done "macOS Defaults set"
|
||||
$0 install brew && msg_done "Brewfile defined apps has been installed"
|
||||
$0 install ext_gh && msg_done "Extensions for GitHub CLI have been installed"
|
||||
$0 install ext_go && msg_done "Go packages have been installed"
|
||||
$0 install macos
|
||||
$0 install antigen
|
||||
$0 install starship
|
||||
$0 brew install
|
||||
$0 install composer
|
||||
$0 install dotenv
|
||||
$0 install gh
|
||||
$0 install go
|
||||
$0 install imagick
|
||||
$0 install nvm
|
||||
$0 install npm
|
||||
$0 install ntfy
|
||||
$0 install z
|
||||
;;
|
||||
antigen)
|
||||
curl -L git.io/antigen > "$DOTFILES/local/bin/antigen.zsh" && msg_done "🎉 Done!"
|
||||
curl -L git.io/antigen > "$DOTFILES/local/bin/antigen.zsh" \
|
||||
&& msg_yay "New antigen installed!"
|
||||
;;
|
||||
brew)
|
||||
brew bundle install --file="$BREWFILE" && msg_done "🎉 Done!"
|
||||
composer)
|
||||
bash "$DOTFILES/scripts/install-composer.sh" \
|
||||
&& msg_yay "composer installed!"
|
||||
;;
|
||||
dotenv)
|
||||
curl -sSfL \
|
||||
https://raw.githubusercontent.com/dotenv-linter/dotenv-linter/master/install.sh \
|
||||
| sh -s -- -b "$XDG_BIN_HOME" \
|
||||
&& msg_yay "dotenv-linter installed!"
|
||||
;;
|
||||
gh)
|
||||
bash "$DOTFILES/scripts/install-gh-extensions.sh" \
|
||||
&& msg_yay "github cli extensions installed!"
|
||||
;;
|
||||
go)
|
||||
bash "$DOTFILES/scripts/install-go-packages.sh" \
|
||||
&& msg_yay "go packages installed!"
|
||||
;;
|
||||
imagick)
|
||||
curl -L https://imagemagick.org/archive/binaries/magick > "$XDG_BIN_HOME/magick" \
|
||||
&& msg_yay "imagick installed!"
|
||||
;;
|
||||
starship)
|
||||
curl -sS https://starship.rs/install.sh | sh -s -- --bin-dir ~/.local/bin \
|
||||
&& msg_yay "starship installed!"
|
||||
;;
|
||||
macos)
|
||||
bash "$DOTFILES/scripts/set-macos-defaults.sh" && msg_done "🎉 Done!"
|
||||
bash "$DOTFILES/scripts/set-macos-defaults.sh" \
|
||||
&& msg_yay "Brewfile defined apps has been installed!"
|
||||
;;
|
||||
ext_go)
|
||||
bash "$DOTFILES/scripts/install-go-packages.sh" && msg_done "🎉 Done!"
|
||||
nvm)
|
||||
curl -o- "https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION_NVM/install.sh" | bash \
|
||||
&& nvm install --lts --latest-npm --default
|
||||
git checkout "$DOTFILES/base/zshrc"
|
||||
msg_yay "nvm installed!"
|
||||
;;
|
||||
ext_gh)
|
||||
bash "$DOTFILES/scripts/install-gh-extensions.sh" && msg_done "🎉 Done!"
|
||||
npm)
|
||||
bash "$DOTFILES/scripts/install-npm-packages.sh" \
|
||||
&& msg_yay "NPM Packages have been installed!"
|
||||
;;
|
||||
settler)
|
||||
bash "$DOTFILES/scripts/settler.sh" && msg_done "🎉 Done!"
|
||||
ntfy)
|
||||
bash "$DOTFILES/scripts/install-ntfy.sh" \
|
||||
&& msg_yay "ntfy installed!"
|
||||
;;
|
||||
z)
|
||||
bash "$DOTFILES/scripts/install-z.sh" \
|
||||
&& msg_yay "z has been installed!"
|
||||
;;
|
||||
*)
|
||||
menu_section "$USAGE_PREFIX" "all | antigen | brew | macos | ext_go | ext_gh | settler"
|
||||
menu_item "all" "Installs antigen, macos, brew, ext_gh and ext_go"
|
||||
menu_item "antigen" "Updates the antigen.zsh file"
|
||||
menu_item "brew" "Install Brewfile contents"
|
||||
menu_item "ext_gh" "Install GitHub CLI Extensions"
|
||||
menu_item "ext_go" "Install Go Packages"
|
||||
menu_item "macos" "Setup nice macOS defaults"
|
||||
menu_item "settler" "Runs the WIP settler.sh"
|
||||
menu_usage "$USAGE_PREFIX" "${MENU[@]}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function section_brew
|
||||
{
|
||||
USAGE_PREFIX="$SCRIPT brew"
|
||||
USAGE_PREFIX="$SCRIPT brew <command>"
|
||||
|
||||
if ! command -v brew &> /dev/null; then
|
||||
echo "brew could not be found, please install it first"
|
||||
exit
|
||||
fi
|
||||
MENU=(
|
||||
"install:Installs items defined in Brewfile"
|
||||
"update:Updates and upgrades brew packages"
|
||||
"updatebundle:Updates Brewfile with descriptions"
|
||||
"autoupdate:Setups brew auto-update and runs it immediately"
|
||||
)
|
||||
|
||||
case "$1" in
|
||||
install)
|
||||
brew bundle install --file="$BREWFILE" && msg_done "🎉 Done!"
|
||||
;;
|
||||
update)
|
||||
brew update && brew outdated && brew upgrade && brew cleanup
|
||||
msg_done "🎉 Done!"
|
||||
;;
|
||||
updatebundle)
|
||||
# Updates .dotfiles/Brewfile with descriptions
|
||||
brew bundle dump \
|
||||
--force \
|
||||
--file="$BREWFILE" \
|
||||
--describe && msg_done "🎉 Done!"
|
||||
;;
|
||||
autoupdate)
|
||||
brew autoupdate start 43200 --upgrade --cleanup --immediate
|
||||
;;
|
||||
*)
|
||||
menu_section "$USAGE_PREFIX" "install | update | updatebundle | autoupdate"
|
||||
menu_item "install" "Installs items defined in Brewfile"
|
||||
menu_item "update" "Updates and upgrades brew packages"
|
||||
menu_item "updatebundle" "Updates Brewfile with descriptions"
|
||||
menu_item "autoupdate" "Setups brew auto-update and runs it immediately"
|
||||
;;
|
||||
esac
|
||||
have brew && {
|
||||
case "$1" in
|
||||
install)
|
||||
brew bundle install --file="$BREWFILE" && msg_yay "Done!"
|
||||
;;
|
||||
update)
|
||||
brew update && brew outdated && brew upgrade && brew cleanup
|
||||
msg_yay "Done!"
|
||||
;;
|
||||
updatebundle)
|
||||
# Updates .dotfiles/Brewfile with descriptions
|
||||
brew bundle dump \
|
||||
--force \
|
||||
--file="$BREWFILE" \
|
||||
--describe && msg_yay "Done!"
|
||||
;;
|
||||
autoupdate)
|
||||
brew autoupdate delete
|
||||
brew autoupdate start 43200 --upgrade --cleanup --immediate
|
||||
;;
|
||||
*)
|
||||
menu_usage "$USAGE_PREFIX" "${MENU[@]}"
|
||||
;;
|
||||
esac
|
||||
} || menu_section "$USAGE_PREFIX" "brew not available on this system"
|
||||
}
|
||||
|
||||
function section_dotfiles
|
||||
{
|
||||
USAGE_PREFIX="$SCRIPT dotfiles"
|
||||
USAGE_PREFIX="$SCRIPT dotfiles <command>"
|
||||
|
||||
MENU=(
|
||||
"fmt:Run all formatters"
|
||||
"yamlfmt:Run yamlfmt to all dotfiles, which are in our control"
|
||||
"shfmt:Run shfmt to all dotfiles"
|
||||
"reset_all:Reset everything, runs all configured reset actions"
|
||||
"reset_nvim:Resets nvim. Deletes caches, removes nvim folders and relinks nvim folders"
|
||||
)
|
||||
|
||||
case "$1" in
|
||||
link)
|
||||
rcup -B "$HOSTNAME" -f -v && msg_done "🎉 Done!"
|
||||
;;
|
||||
update)
|
||||
# Updates .dotfiles/scripts/install.sh and formats it
|
||||
rcup -B 0 -g \
|
||||
| tee "$INSTALL_SCRIPT" 1> /dev/null \
|
||||
&& sed -i '' "s|$HOME|\$HOME|g" "$INSTALL_SCRIPT" \
|
||||
&& sed -i '' "s|install.sh|$(basename $INSTALL_SCRIPT)|g" "$INSTALL_SCRIPT"
|
||||
fmt)
|
||||
msg_ok "Running all formatters"
|
||||
$0 dotfiles yamlfmt
|
||||
$0 dotfiles shfmt
|
||||
msg_done "🎉 Done!"
|
||||
msg_done "...done!"
|
||||
;;
|
||||
reset_all)
|
||||
msg_ok "Running all reset commands"
|
||||
$0 dotfiles reset_nvim
|
||||
;;
|
||||
reset_nvim)
|
||||
rm -rf \
|
||||
~/.local/share/nvim \
|
||||
~/.local/state/nvim \
|
||||
~/.cache/nvim \
|
||||
~/.config/astronvim \
|
||||
~/.config/nvim
|
||||
msg_ok "Deleted old nvim files"
|
||||
ln -s $DOTFILES/config/astronvim ~/.config/astronvim
|
||||
ln -s $DOTFILES/config/nvim ~/.config/nvim
|
||||
msg_ok "Linked nvim and astronvim"
|
||||
have npm && $0 install npm
|
||||
msg_ok "Installed packages"
|
||||
msg_done "nvim reset!"
|
||||
;;
|
||||
yamlfmt)
|
||||
# format yaml files
|
||||
have yamlfmt && yamlfmt -conf "$DOTFILES/.yamlfmt" || msg_err "yamlfmt not found"
|
||||
;;
|
||||
shfmt)
|
||||
# Format shell scripts according to following rules.
|
||||
shfmt \
|
||||
--find \
|
||||
--list \
|
||||
--write \
|
||||
--diff \
|
||||
--simplify \
|
||||
--indent 2 \
|
||||
--binary-next-line \
|
||||
--case-indent \
|
||||
--space-redirects \
|
||||
--func-next-line \
|
||||
"$DOTFILES"
|
||||
find "$DOTFILES" \
|
||||
-type f -perm +111 \
|
||||
-not -path '*/.git/*' \
|
||||
-not -path '*dotbot*' \
|
||||
-not -name '*.pl' \
|
||||
-not -name '*.py' \
|
||||
-not -name '*.php' \
|
||||
-not -name '*.zsh' \
|
||||
-exec shfmt \
|
||||
--language-dialect bash \
|
||||
--func-next-line --list --write \
|
||||
--indent 2 --case-indent --space-redirects \
|
||||
--binary-next-line {} \;
|
||||
msg_yay "dotfiles have been shfmt formatted!"
|
||||
;;
|
||||
*)
|
||||
menu_section "$USAGE_PREFIX" "link | update | shfmt"
|
||||
menu_item "link" "Use rcrc to update dotfile links"
|
||||
menu_item "update" "Updates dotfile links, installs host specific overrides automatically"
|
||||
menu_item "shfmt" "Run shfmt to all dotfiles"
|
||||
menu_usage "$USAGE_PREFIX" "${MENU[@]}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function section_check
|
||||
{
|
||||
USAGE_PREFIX="$SCRIPT check <command>"
|
||||
X_HOSTNAME=$(hostname)
|
||||
X_ARCH=$(uname)
|
||||
|
||||
MENU=(
|
||||
"arch <arch>:Empty <arch> returns current. Exit code 0=match to current, 1=no match."
|
||||
"host <host>:Empty <host> returns current. Exit code 0=match to current, 1=no match."
|
||||
)
|
||||
|
||||
case "$1" in
|
||||
a | arch)
|
||||
[[ "$2" = "" ]] && echo "$X_ARCH" && exit 0
|
||||
[[ $X_ARCH = "$2" ]] && exit 0 || exit 1
|
||||
;;
|
||||
h | host | hostname)
|
||||
[[ "$2" = "" ]] && echo "$X_HOSTNAME" && exit 0
|
||||
[[ $X_HOSTNAME = "$2" ]] && exit 0 || exit 1
|
||||
;;
|
||||
*)
|
||||
menu_usage "$USAGE_PREFIX" "${MENU[@]}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@@ -140,24 +247,31 @@ function section_dotfiles
|
||||
# Secret menu for visual tests
|
||||
function section_tests
|
||||
{
|
||||
USAGE_PREFIX="$SCRIPT tests"
|
||||
USAGE_PREFIX="$SCRIPT tests <command>"
|
||||
|
||||
MENU=(
|
||||
"msg:List all log functions from shared.sh"
|
||||
)
|
||||
|
||||
case "$1" in
|
||||
msg)
|
||||
msg "msg"
|
||||
msg_done "msg_done"
|
||||
msg_prompt "msg_prompt"
|
||||
msg_prompt_done "msg_prompt_done"
|
||||
msg_done_suffix "msg_done_suffix"
|
||||
msg_err "msg_err"
|
||||
msg_nested "msg_nested"
|
||||
msg_nested_done "msg_nested_done"
|
||||
msg_run "msg_run" "second_param"
|
||||
msg_ok "msg_ok"
|
||||
msg_prompt "msg_prompt"
|
||||
msg_prompt_done "msg_prompt_done"
|
||||
msg_run "msg_run" "second_param"
|
||||
msg_run_done "msg_run_done" "second_param"
|
||||
msg_warn "msg_warn"
|
||||
msg_err "msg_err"
|
||||
msg_yay "msg_yay"
|
||||
msg_yay_done "msg_yay_done"
|
||||
;;
|
||||
*)
|
||||
menu_section "$USAGE_PREFIX" "msg"
|
||||
menu_item "msg" "List all log functions from shared.sh"
|
||||
menu_usage "$USAGE_PREFIX" "${MENU[@]}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@@ -165,13 +279,15 @@ function section_tests
|
||||
function usage
|
||||
{
|
||||
echo ""
|
||||
menu_section "Usage: $SCRIPT" "install | brew | dotfiles"
|
||||
echo $" All commands have their own subcommands."
|
||||
msg_prompt "Usage: $SCRIPT <section> <command>"
|
||||
echo $" Empty <command> prints <section> help."
|
||||
echo ""
|
||||
section_install
|
||||
echo ""
|
||||
section_brew
|
||||
echo ""
|
||||
section_check
|
||||
echo ""
|
||||
section_dotfiles
|
||||
}
|
||||
|
||||
@@ -179,8 +295,8 @@ function usage
|
||||
case "$1" in
|
||||
install) section_install "$2" ;;
|
||||
brew) section_brew "$2" ;;
|
||||
check) section_check "$2" ;;
|
||||
dotfiles) section_dotfiles "$2" ;;
|
||||
tests) section_tests "$2" ;;
|
||||
*) usage && exit 1 ;;
|
||||
*) usage && exit 0 ;;
|
||||
esac
|
||||
|
||||
|
||||
82
local/bin/git-dirty
Executable file
82
local/bin/git-dirty
Executable file
@@ -0,0 +1,82 @@
|
||||
#!/usr/bin/env bash
|
||||
# Get git repository status for all subdirectories
|
||||
# recursively in specified dir.
|
||||
#
|
||||
# Check the default dir:
|
||||
# `git-dirty.sh`
|
||||
# Check specific dir:
|
||||
# `git-dirty.sh ~/Projects`
|
||||
# Override default dir with env:
|
||||
# `GIT_DIRTY_DIR=$HOME/Projects git-dirty.sh`
|
||||
#
|
||||
# If you want to skip directory from checks, just add `.ignore` file next
|
||||
# to the `.git` folder. ProTip: Add `.ignore` to your global `.gitignore`.
|
||||
#
|
||||
# The script automatically skips folders:
|
||||
# node_modules, vendor
|
||||
#
|
||||
# SET Defaults:
|
||||
# Default dir to check, can be overridden in env (.bashrc, .zshrc, ...)
|
||||
: "${GIT_DIRTY_DIR:=$HOME/Code}"
|
||||
|
||||
# If user has provided folder as a first argument, use it.
|
||||
if [ "$1" != "" ]; then
|
||||
GIT_DIRTY_DIR="$1"
|
||||
fi
|
||||
|
||||
# UTF-8 ftw
|
||||
GITDIRTY="❌ "
|
||||
GITCLEAN="✅ "
|
||||
|
||||
catch()
|
||||
{
|
||||
echo "Error $1 occurred on $2"
|
||||
}
|
||||
|
||||
gitdirty()
|
||||
{
|
||||
local d="$1"
|
||||
trap 'catch $? $LINENO' ERR
|
||||
|
||||
if [[ -d "$d" ]]; then
|
||||
if [[ -e "$d/.ignore" ]]; then
|
||||
echo -e ""
|
||||
else
|
||||
# Check that $d is not '--', 'vendor', or 'node_modules'
|
||||
if [[ "${d:0:2}" == "--" ]] || [[ "$d" == "vendor" ]] || [[ "$d" == "node_modules" ]]; then
|
||||
echo ""
|
||||
else
|
||||
cd "$d" > /dev/null
|
||||
|
||||
# If we have `.git` folder, check it.
|
||||
if [[ -d ".git" ]]; then
|
||||
ISDIRTY=$(git diff --shortstat 2> /dev/null | tail -n1)
|
||||
ICON="$GITCLEAN"
|
||||
|
||||
[[ $ISDIRTY != "" ]] && ICON="$GITDIRTY"
|
||||
|
||||
printf " %s %s\n" "$ICON" "$(pwd)"
|
||||
else
|
||||
# If it wasn't git repository, check subdirectories.
|
||||
gitdirtyrepos -- *
|
||||
fi
|
||||
fi
|
||||
cd .. > /dev/null
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
gitdirtyrepos()
|
||||
{
|
||||
for x in "$@"; do
|
||||
gitdirty "$x"
|
||||
done
|
||||
}
|
||||
|
||||
set -e
|
||||
trap 'case $? in
|
||||
139) echo "segfault occurred";;
|
||||
11) echo "ssegfault occurred";;
|
||||
esac' EXIT
|
||||
|
||||
gitdirtyrepos "$GIT_DIRTY_DIR"
|
||||
188
local/bin/iterm2_shell_integration.zsh
Executable file
188
local/bin/iterm2_shell_integration.zsh
Executable file
@@ -0,0 +1,188 @@
|
||||
# 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 2
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
if [[ -o interactive ]]; then
|
||||
if [ "${ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX-}""$TERM" != "tmux-256color" -a "${ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX-}""$TERM" != "screen" -a "${ITERM_SHELL_INTEGRATION_INSTALLED-}" = "" -a "$TERM" != linux -a "$TERM" != dumb ]; then
|
||||
ITERM_SHELL_INTEGRATION_INSTALLED=Yes
|
||||
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
||||
# Indicates start of command output. Runs just before command executes.
|
||||
iterm2_before_cmd_executes()
|
||||
{
|
||||
if [ "$TERM_PROGRAM" = "iTerm.app" ]; then
|
||||
printf "\033]133;C;\r\007"
|
||||
else
|
||||
printf "\033]133;C;\007"
|
||||
fi
|
||||
}
|
||||
|
||||
iterm2_set_user_var()
|
||||
{
|
||||
printf "\033]1337;SetUserVar=%s=%s\007" "$1" $(printf "%s" "$2" | base64 | tr -d '\n')
|
||||
}
|
||||
|
||||
# Users can write their own version of this method. It should call
|
||||
# iterm2_set_user_var but not produce any other output.
|
||||
# e.g., iterm2_set_user_var currentDirectory $PWD
|
||||
# Accessible in iTerm2 (in a badge now, elsewhere in the future) as
|
||||
# \(user.currentDirectory).
|
||||
whence -v iterm2_print_user_vars > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
iterm2_print_user_vars()
|
||||
{
|
||||
true
|
||||
}
|
||||
fi
|
||||
|
||||
iterm2_print_state_data()
|
||||
{
|
||||
local _iterm2_hostname="${iterm2_hostname-}"
|
||||
if [ -z "${iterm2_hostname:-}" ]; then
|
||||
_iterm2_hostname=$(hostname -f 2> /dev/null)
|
||||
fi
|
||||
printf "\033]1337;RemoteHost=%s@%s\007" "$USER" "${_iterm2_hostname-}"
|
||||
printf "\033]1337;CurrentDir=%s\007" "$PWD"
|
||||
iterm2_print_user_vars
|
||||
}
|
||||
|
||||
# Report return code of command; runs after command finishes but before prompt
|
||||
iterm2_after_cmd_executes()
|
||||
{
|
||||
printf "\033]133;D;%s\007" "$STATUS"
|
||||
iterm2_print_state_data
|
||||
}
|
||||
|
||||
# Mark start of prompt
|
||||
iterm2_prompt_mark()
|
||||
{
|
||||
printf "\033]133;A\007"
|
||||
}
|
||||
|
||||
# Mark end of prompt
|
||||
iterm2_prompt_end()
|
||||
{
|
||||
printf "\033]133;B\007"
|
||||
}
|
||||
|
||||
# There are three possible paths in life.
|
||||
#
|
||||
# 1) A command is entered at the prompt and you press return.
|
||||
# The following steps happen:
|
||||
# * iterm2_preexec is invoked
|
||||
# * PS1 is set to ITERM2_PRECMD_PS1
|
||||
# * ITERM2_SHOULD_DECORATE_PROMPT is set to 1
|
||||
# * The command executes (possibly reading or modifying PS1)
|
||||
# * iterm2_precmd is invoked
|
||||
# * ITERM2_PRECMD_PS1 is set to PS1 (as modified by command execution)
|
||||
# * PS1 gets our escape sequences added to it
|
||||
# * zsh displays your prompt
|
||||
# * You start entering a command
|
||||
#
|
||||
# 2) You press ^C while entering a command at the prompt.
|
||||
# The following steps happen:
|
||||
# * (iterm2_preexec is NOT invoked)
|
||||
# * iterm2_precmd is invoked
|
||||
# * iterm2_before_cmd_executes is called since we detected that iterm2_preexec was not run
|
||||
# * (ITERM2_PRECMD_PS1 and PS1 are not messed with, since PS1 already has our escape
|
||||
# sequences and ITERM2_PRECMD_PS1 already has PS1's original value)
|
||||
# * zsh displays your prompt
|
||||
# * You start entering a command
|
||||
#
|
||||
# 3) A new shell is born.
|
||||
# * PS1 has some initial value, either zsh's default or a value set before this script is sourced.
|
||||
# * iterm2_precmd is invoked
|
||||
# * ITERM2_SHOULD_DECORATE_PROMPT is initialized to 1
|
||||
# * ITERM2_PRECMD_PS1 is set to the initial value of PS1
|
||||
# * PS1 gets our escape sequences added to it
|
||||
# * Your prompt is shown and you may begin entering a command.
|
||||
#
|
||||
# Invariants:
|
||||
# * ITERM2_SHOULD_DECORATE_PROMPT is 1 during and just after command execution, and "" while the prompt is
|
||||
# shown and until you enter a command and press return.
|
||||
# * PS1 does not have our escape sequences during command execution
|
||||
# * After the command executes but before a new one begins, PS1 has escape sequences and
|
||||
# ITERM2_PRECMD_PS1 has PS1's original value.
|
||||
iterm2_decorate_prompt()
|
||||
{
|
||||
# This should be a raw PS1 without iTerm2's stuff. It could be changed during command
|
||||
# execution.
|
||||
ITERM2_PRECMD_PS1="$PS1"
|
||||
ITERM2_SHOULD_DECORATE_PROMPT=""
|
||||
|
||||
# Add our escape sequences just before the prompt is shown.
|
||||
# Use ITERM2_SQUELCH_MARK for people who can't mdoify PS1 directly, like powerlevel9k users.
|
||||
# This is gross but I had a heck of a time writing a correct if statetment for zsh 5.0.2.
|
||||
local PREFIX=""
|
||||
if [[ $PS1 == *"$(iterm2_prompt_mark)"* ]]; then
|
||||
PREFIX=""
|
||||
elif [[ "${ITERM2_SQUELCH_MARK-}" != "" ]]; then
|
||||
PREFIX=""
|
||||
else
|
||||
PREFIX="%{$(iterm2_prompt_mark)%}"
|
||||
fi
|
||||
PS1="$PREFIX$PS1%{$(iterm2_prompt_end)%}"
|
||||
ITERM2_DECORATED_PS1="$PS1"
|
||||
}
|
||||
|
||||
iterm2_precmd()
|
||||
{
|
||||
local STATUS="$?"
|
||||
if [ -z "${ITERM2_SHOULD_DECORATE_PROMPT-}" ]; then
|
||||
# You pressed ^C while entering a command (iterm2_preexec did not run)
|
||||
iterm2_before_cmd_executes
|
||||
if [ "$PS1" != "${ITERM2_DECORATED_PS1-}" ]; then
|
||||
# PS1 changed, perhaps in another precmd. See issue 9938.
|
||||
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
||||
fi
|
||||
fi
|
||||
|
||||
iterm2_after_cmd_executes "$STATUS"
|
||||
|
||||
if [ -n "$ITERM2_SHOULD_DECORATE_PROMPT" ]; then
|
||||
iterm2_decorate_prompt
|
||||
fi
|
||||
}
|
||||
|
||||
# This is not run if you press ^C while entering a command.
|
||||
iterm2_preexec()
|
||||
{
|
||||
# Set PS1 back to its raw value prior to executing the command.
|
||||
PS1="$ITERM2_PRECMD_PS1"
|
||||
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
||||
iterm2_before_cmd_executes
|
||||
}
|
||||
|
||||
# If hostname -f is slow on your system set iterm2_hostname prior to
|
||||
# sourcing this script. We know it is fast on macOS so we don't cache
|
||||
# it. That lets us handle the hostname changing like when you attach
|
||||
# to a VPN.
|
||||
if [ -z "${iterm2_hostname-}" ]; then
|
||||
if [ "$(uname)" != "Darwin" ]; then
|
||||
iterm2_hostname=$(hostname -f 2> /dev/null)
|
||||
# Some flavors of BSD (i.e. NetBSD and OpenBSD) don't have the -f option.
|
||||
if [ $? -ne 0 ]; then
|
||||
iterm2_hostname=$(hostname)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ -z ${precmd_functions-} ]] && precmd_functions=()
|
||||
precmd_functions=($precmd_functions iterm2_precmd)
|
||||
|
||||
[[ -z ${preexec_functions-} ]] && preexec_functions=()
|
||||
preexec_functions=($preexec_functions iterm2_preexec)
|
||||
|
||||
iterm2_print_state_data
|
||||
printf "\033]1337;ShellIntegrationVersion=14;shell=zsh\007"
|
||||
fi
|
||||
fi
|
||||
25
local/bin/x-backup-folder.sh
Executable file
25
local/bin/x-backup-folder.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIRECTORY=$1
|
||||
FILENAME=$2
|
||||
|
||||
if [ -z "${DIRECTORY}" ]; then
|
||||
echo "DIRECTORY (first argument) is missing"
|
||||
echo "Usage: $0 folder_to_backup"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -z "${FILENAME}" ]; then
|
||||
FILENAME=$DIRECTORY
|
||||
fi
|
||||
|
||||
FILENAME=${FILENAME} \
|
||||
| tr '/' _ \
|
||||
| iconv -t ascii//TRANSLIT \
|
||||
| sed -r s/[^a-zA-Z0-9]+/_/g \
|
||||
| sed -r s/^_+\|-+$//g
|
||||
|
||||
TIMESTAMP=$(date "+%Y%m%d_%H%M%S")
|
||||
FILENAME_TIMESTAMP="${FILENAME}_${TIMESTAMP}"
|
||||
|
||||
tar cvzf "${FILENAME_TIMESTAMP}.tar.gz" "${DIRECTORY}/"
|
||||
@@ -35,9 +35,9 @@ TIMESTAMP=$(date "+%Y%m%d_%H%M%S")
|
||||
FILENAME_TIMESTAMP="${DATABASE}_${FILENAME}_${TIMESTAMP}.sql"
|
||||
|
||||
mysqldump \
|
||||
${DATABASE} \
|
||||
"${DATABASE}" \
|
||||
"$(
|
||||
echo "show tables like '${PREFIX}%';" \
|
||||
| mysql ${DATABASE} \
|
||||
| mysql "${DATABASE}" \
|
||||
| sed '/Tables_in/d'
|
||||
)" > "${FILENAME_TIMESTAMP}"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
if ! command -v git &> /dev/null; then
|
||||
echo "git could not be found, please install it first"
|
||||
exit
|
||||
exit 1
|
||||
fi
|
||||
|
||||
missing_attributes=$(git ls-files | git check-attr -a --stdin | grep "text: auto")
|
||||
|
||||
57
local/bin/x-compare-versions.py
Executable file
57
local/bin/x-compare-versions.py
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Version Comparison tool for the CLI.
|
||||
|
||||
Adapted from script found in anishathalye's dotfiles.
|
||||
https://github.com/anishathalye/dotfiles/blob/master/bin/vercmp
|
||||
"""
|
||||
|
||||
import operator
|
||||
import sys
|
||||
|
||||
from packaging import version
|
||||
|
||||
str_to_operator = {
|
||||
"==": operator.eq,
|
||||
"!=": operator.ne,
|
||||
"<": operator.lt,
|
||||
"<=": operator.le,
|
||||
">": operator.gt,
|
||||
">=": operator.ge,
|
||||
}
|
||||
|
||||
|
||||
def vercmp(expr):
|
||||
"""Version Comparison function."""
|
||||
words = expr.split()
|
||||
comparisons = [words[i: i + 3] for i in range(0, len(words) - 2, 2)]
|
||||
for left, op_str, right in comparisons:
|
||||
compare_op = str_to_operator[op_str]
|
||||
if not compare_op(version.parse(left), version.parse(right)):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def main():
|
||||
"""Triggers version comparison if line is provided."""
|
||||
for line in sys.stdin:
|
||||
if not vercmp(line):
|
||||
sys.exit(1)
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
def test():
|
||||
"""Basic functionality tests."""
|
||||
assert not vercmp("1.9 >= 2.4")
|
||||
assert vercmp("2.4 >= 2.4")
|
||||
assert vercmp("2.5 >= 2.4")
|
||||
assert vercmp("3 >= 2.999")
|
||||
assert vercmp("2.9 < 2.9a")
|
||||
assert vercmp("2.9a >= 2.8")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) == 2 and sys.argv[1] == "test":
|
||||
test()
|
||||
else:
|
||||
main()
|
||||
13
local/bin/x-dc
Executable file
13
local/bin/x-dc
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
# Verify folder exists, and if it does not, create it.
|
||||
|
||||
dir="$1"
|
||||
|
||||
[ $# -eq 0 ] && {
|
||||
echo "Usage: $0 full/path/to/dir/to/create"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ ! -d "$dir" ]; then
|
||||
mkdir -p "$dir" && exit 0
|
||||
fi
|
||||
@@ -206,3 +206,4 @@ sub parsedOptions
|
||||
return (%vars);
|
||||
|
||||
}
|
||||
|
||||
166
local/bin/x-git-largest-files.py
Executable file
166
local/bin/x-git-largest-files.py
Executable file
@@ -0,0 +1,166 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Python script to find the largest files in a git repository.
|
||||
# The general method is based on the script in this blog post:
|
||||
# http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
|
||||
#
|
||||
# The above script worked for me, but was very slow on my 11GB repository. This version has a bunch
|
||||
# of changes to speed things up to a more reasonable time. It takes less than a minute on repos with 250K objects.
|
||||
#
|
||||
# The MIT License (MIT)
|
||||
# Copyright (c) 2015 Nick Kocharhook
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
# associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all copies or
|
||||
# substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
||||
# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
||||
# OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
from subprocess import check_output, CalledProcessError, Popen, PIPE
|
||||
import argparse
|
||||
import signal
|
||||
import sys
|
||||
|
||||
sortByOnDiskSize = False
|
||||
|
||||
def main():
|
||||
global sortByOnDiskSize
|
||||
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
|
||||
args = parseArguments()
|
||||
sortByOnDiskSize = args.sortByOnDiskSize
|
||||
sizeLimit = 1024*args.filesExceeding
|
||||
|
||||
if args.filesExceeding > 0:
|
||||
print "Finding objects larger than {}kB…".format(args.filesExceeding)
|
||||
else:
|
||||
print "Finding the {} largest objects…".format(args.matchCount)
|
||||
|
||||
blobs = getTopBlobs(args.matchCount, sizeLimit)
|
||||
|
||||
populateBlobPaths(blobs)
|
||||
printOutBlobs(blobs)
|
||||
|
||||
def getTopBlobs(count, sizeLimit):
|
||||
sortColumn = 4
|
||||
|
||||
if sortByOnDiskSize:
|
||||
sortColumn = 3
|
||||
|
||||
verifyPack = "git verify-pack -v `git rev-parse --git-dir`/objects/pack/pack-*.idx | grep blob | sort -k{}nr".format(sortColumn)
|
||||
output = check_output(verifyPack, shell=True).split("\n")[:-1]
|
||||
|
||||
blobs = dict()
|
||||
compareBlob = Blob("a b {} {} c".format(sizeLimit, sizeLimit)) # use __lt__ to do the appropriate comparison
|
||||
|
||||
for objLine in output:
|
||||
blob = Blob(objLine)
|
||||
|
||||
if sizeLimit > 0:
|
||||
if compareBlob < blob:
|
||||
blobs[blob.sha1] = blob
|
||||
else:
|
||||
break
|
||||
else:
|
||||
blobs[blob.sha1] = blob
|
||||
|
||||
if len(blobs) == count:
|
||||
break
|
||||
|
||||
return blobs
|
||||
|
||||
|
||||
def populateBlobPaths(blobs):
|
||||
if len(blobs):
|
||||
print "Finding object paths…"
|
||||
|
||||
# Only include revs which have a path. Other revs aren't blobs.
|
||||
revList = "git rev-list --all --objects | awk '$2 {print}'"
|
||||
allObjectLines = check_output(revList, shell=True).split("\n")[:-1]
|
||||
|
||||
outstandingKeys = blobs.keys()
|
||||
|
||||
for line in allObjectLines:
|
||||
cols = line.split()
|
||||
sha1, path = cols[0], " ".join(cols[1:])
|
||||
|
||||
if (sha1 in outstandingKeys):
|
||||
outstandingKeys.remove(sha1)
|
||||
blobs[sha1].path = path
|
||||
|
||||
# short-circuit the search if we're done
|
||||
if not len(outstandingKeys):
|
||||
break
|
||||
|
||||
|
||||
def printOutBlobs(blobs):
|
||||
if len(blobs):
|
||||
csvLines = ["size,pack,hash,path"]
|
||||
|
||||
for blob in sorted(blobs.values(), reverse=True):
|
||||
csvLines.append(blob.csvLine())
|
||||
|
||||
p = Popen(["column", "-t", "-s", "','"], stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
||||
stdout, stderr = p.communicate("\n".join(csvLines)+"\n")
|
||||
|
||||
print "\nAll sizes in kB. The pack column is the compressed size of the object inside the pack file.\n"
|
||||
print stdout.rstrip('\n')
|
||||
else:
|
||||
print "No files found which match those criteria."
|
||||
|
||||
|
||||
def parseArguments():
|
||||
parser = argparse.ArgumentParser(description='List the largest files in a git repository')
|
||||
parser.add_argument('-c', '--match-count', dest='matchCount', type=int, default=10,
|
||||
help='The number of files to return. Default is 10. Ignored if --files-exceeding is used.')
|
||||
parser.add_argument('--files-exceeding', dest='filesExceeding', type=int, default=0,
|
||||
help='The cutoff amount, in KB. Files with a pack size (or pyhsical size, with -p) larger than this will be printed.')
|
||||
parser.add_argument('-p', '--physical-sort', dest='sortByOnDiskSize', action='store_true', default=False,
|
||||
help='Sort by the on-disk size of the files. Default is to sort by the pack size.')
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def signal_handler(signal, frame):
|
||||
print('Caught Ctrl-C. Exiting.')
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
class Blob(object):
|
||||
sha1 = ''
|
||||
size = 0
|
||||
packedSize = 0
|
||||
path = ''
|
||||
|
||||
def __init__(self, line):
|
||||
cols = line.split()
|
||||
self.sha1, self.size, self.packedSize = cols[0], int(cols[2]), int(cols[3])
|
||||
|
||||
def __repr__(self):
|
||||
return '{} - {} - {} - {}'.format(self.sha1, self.size, self.packedSize, self.path)
|
||||
|
||||
def __lt__(self, other):
|
||||
if (sortByOnDiskSize):
|
||||
return self.size < other.size
|
||||
else:
|
||||
return self.packedSize < other.packedSize
|
||||
|
||||
def csvLine(self):
|
||||
return "{},{},{},{}".format(self.size/1024, self.packedSize/1024, self.sha1, self.path)
|
||||
|
||||
|
||||
# Default function is main()
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
53
local/bin/x-hr
Executable file
53
local/bin/x-hr
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env bash
|
||||
# Simple script to output a solid line in the terminal
|
||||
# Useful for marking the end of a task in your bash log
|
||||
# Inspired by @LuRsT's script of the same name
|
||||
# Can be called directly, or source'd in *rc file
|
||||
#
|
||||
# Licensed under MIT, (C) Alicia Sykes 2022
|
||||
# See: https://github.com/Lissy93/dotfiles
|
||||
#
|
||||
# Modified by Ismo Vuorinen <https://github.com/ivuorinen> 2023
|
||||
|
||||
# Determine width of terminal
|
||||
hr_col_count="$(tput cols)"
|
||||
if [ -z "${hr_col_count+set}" ] || [ "$hr_col_count" -lt 1 ]; then
|
||||
hr_col_count="${COLUMNS:-80}"
|
||||
fi
|
||||
|
||||
# Colors
|
||||
CLR_RED="\033[1;31m"
|
||||
hr_color="${hr_color:=$CLR_RED}"
|
||||
hr_reset="\033[0m"
|
||||
|
||||
# Prints the HR line
|
||||
hr_draw_char() {
|
||||
local CHAR="$1"
|
||||
local LINE=''
|
||||
LINE=$(printf "%*s" "$((hr_col_count - 2))")
|
||||
LINE="${LINE// /${CHAR}}"
|
||||
echo -e "◀${hr_color}${LINE:0:${hr_col_count}}${hr_reset}▶"
|
||||
}
|
||||
|
||||
# Passes param and calls hr()
|
||||
hr() {
|
||||
for WORD in "${@:--}"; do
|
||||
hr_draw_char "$WORD"
|
||||
done
|
||||
}
|
||||
|
||||
# Determine if file is being run directly or sourced
|
||||
(
|
||||
[[ -n $ZSH_EVAL_CONTEXT && $ZSH_EVAL_CONTEXT =~ :file$ ]] \
|
||||
|| [[ -n $KSH_VERSION && $(cd "$(dirname -- "$0")" \
|
||||
&& printf '%s' "${PWD%/}/")$(basename -- "$0") != "${.sh.file}" ]] \
|
||||
|| [[ -n $BASH_VERSION ]] && (return 0 2>/dev/null)
|
||||
) && sourced=1 || sourced=0
|
||||
|
||||
# Either instantiate immediately, or set alias for later
|
||||
if [ "$sourced" -eq 0 ]; then
|
||||
[ "$0" == "${BASH_SOURCE[0]}" ] && hr "$@"
|
||||
else
|
||||
export alias hr='hr'
|
||||
fi
|
||||
|
||||
4
local/bin/x-ip
Executable file
4
local/bin/x-ip
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# Source: https://github.com/thirtythreeforty/dotfiles/blob/master/bin/extip
|
||||
|
||||
curl icanhazip.com "${@}"
|
||||
@@ -226,3 +226,4 @@ sub parsedOptions
|
||||
return (%vars);
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# List open (listened) ports, without the crud that
|
||||
# usually comes with `lsof -i`
|
||||
#
|
||||
# Modified by: Ismo Vuorinen <https://github.com/ivuorinen> 2020
|
||||
# Originally from: https://www.commandlinefu.com/commands/view/8951
|
||||
# Original author: https://www.commandlinefu.com/commands/by/wickedcpj
|
||||
#
|
||||
|
||||
85
local/bin/x-quota-usage.php
Executable file
85
local/bin/x-quota-usage.php
Executable file
@@ -0,0 +1,85 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$debug = false;
|
||||
|
||||
$quota = '';
|
||||
$output = [];
|
||||
$fsCharLenght = 0;
|
||||
|
||||
if ($debug) {
|
||||
$quota = "Disk quotas for user viir (uid 2913):
|
||||
Filesystem blocks quota limit grace files quota limit grace
|
||||
10.0.0.89:/www/webroots/2 8277615 52428800 52428800 0 0 0
|
||||
10.0.0.179:/users1/users/2 1999431 52428800 52428800 0 0 0
|
||||
10.0.0.90:/siilo/2 24835106 524288000 524288000 0 0 0";
|
||||
} else {
|
||||
// $quota = system("quota -w");
|
||||
$quota = shell_exec("quota -w");
|
||||
}
|
||||
|
||||
function pad($i, $n = 3, $p = ' ') {
|
||||
return str_pad($i, $n, $p, STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
if (empty($quota)) {
|
||||
var_dump($quota);
|
||||
die("quota was empty\n");
|
||||
}
|
||||
|
||||
$quota = explode("\n", $quota);
|
||||
$quota = array_map('trim', $quota);
|
||||
|
||||
foreach ($quota as $lineNum => $line) {
|
||||
if ($lineNum < 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$values = array_filter(explode(" ", $line));
|
||||
|
||||
if (count($values) != 4) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$result = array_combine(['fs', 'used', 'quota', 'limit'], $values);
|
||||
|
||||
$result['used_percentage'] = round($result['used'] / $result['quota'] * 100, 3);
|
||||
$result['used_gb'] = round($result['used'] / 1024 / 1024, 2);
|
||||
$result['quota_gb'] = round($result['quota'] / 1024 / 1024, 2);
|
||||
|
||||
$char = strlen($result['fs']);
|
||||
if ($char > $fsCharLenght) {
|
||||
$fsCharLenght = $char;
|
||||
}
|
||||
|
||||
$output[] = $result;
|
||||
}
|
||||
|
||||
if (!empty($output)) {
|
||||
|
||||
$header = sprintf("%s | %s | %s | %s",
|
||||
str_pad("Mount", $fsCharLenght),
|
||||
'Usage%',
|
||||
'Used/Total',
|
||||
'Bar'
|
||||
);
|
||||
$headerWidth = strlen($header);
|
||||
|
||||
echo "\n" . $header . "\n";
|
||||
echo str_repeat('-', $headerWidth + 24) . "\n";
|
||||
|
||||
foreach ($output as $i) {
|
||||
$barUsed = round($i['used_percentage']) / 4;
|
||||
echo sprintf(
|
||||
"%s | %s | %s | [%s]",
|
||||
str_pad($i['fs'], $fsCharLenght),
|
||||
str_pad(round($i['used_percentage'], 1) . '%', 6, ' ', STR_PAD_LEFT),
|
||||
str_pad($i['used_gb'] . '/' . $i['quota_gb'], 10, ' ', STR_PAD_LEFT),
|
||||
str_pad(str_repeat('#', $barUsed), 25, '_')
|
||||
) . "\n";
|
||||
}
|
||||
|
||||
echo "\n\n";
|
||||
}
|
||||
|
||||
@@ -4,130 +4,103 @@
|
||||
# -----
|
||||
# Check the expiry date of the SSL certificate on the given host.
|
||||
#
|
||||
#
|
||||
# License
|
||||
# -------
|
||||
#
|
||||
# Copyright (c) 2013-2015 by Steve Kemp. All rights reserved.
|
||||
#
|
||||
# This script is free software; you can redistribute it and/or modify it under
|
||||
# the same terms as Perl itself.
|
||||
#
|
||||
# The LICENSE file contains the full text of the license.
|
||||
#
|
||||
#
|
||||
|
||||
#
|
||||
# Simple function to show usage information, and exit.
|
||||
#
|
||||
usage() {
|
||||
echo "Usage: $0 [-d] [-p 443] domain1.org domain2.com .. domainN"
|
||||
exit 0
|
||||
# Simple function to show usage information, and exit.
|
||||
usage()
|
||||
{
|
||||
echo "Usage: $0 [-d] [-p 443] domain1.org domain2.com .. domainN"
|
||||
exit 0
|
||||
}
|
||||
|
||||
#
|
||||
# Default settings for flags set by the command-line arguments
|
||||
#
|
||||
# Default settings for flags set by the command-line arguments
|
||||
days=0
|
||||
port=443
|
||||
|
||||
#
|
||||
# Parse the argument(s) - i.e. look for "-d" / "-p 443".
|
||||
#
|
||||
# Parse the argument(s) - i.e. look for "-d" / "-p 443".
|
||||
while getopts "h?dp:" opt; do
|
||||
case $opt in
|
||||
h)
|
||||
usage
|
||||
;;
|
||||
\?)
|
||||
usage
|
||||
;;
|
||||
d)
|
||||
days=1
|
||||
;;
|
||||
p)
|
||||
port=$OPTARG
|
||||
;;
|
||||
case $opt in
|
||||
h)
|
||||
usage
|
||||
;;
|
||||
\?)
|
||||
usage
|
||||
;;
|
||||
d)
|
||||
days=1
|
||||
;;
|
||||
p)
|
||||
port=$OPTARG
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
#
|
||||
# Ensure we have some arguments
|
||||
#
|
||||
# Ensure we have some arguments
|
||||
if [ "$#" = "0" ]; then
|
||||
usage
|
||||
usage
|
||||
fi
|
||||
|
||||
#
|
||||
# For each domain-name on the command-line.
|
||||
#
|
||||
for name in "$@"; do
|
||||
|
||||
#
|
||||
# Make a temporary file
|
||||
#
|
||||
# Test if we have BSD or GNU version of mktemp
|
||||
if ( strings "$(which mktemp)" | grep -q GNU); then
|
||||
# We have the GNU version
|
||||
tmp=$(mktemp)
|
||||
# Make a temporary file
|
||||
# Test if we have BSD or GNU version of mktemp
|
||||
if (strings "$(which mktemp)" | grep -q GNU); then
|
||||
# We have the GNU version
|
||||
tmp=$(mktemp)
|
||||
else
|
||||
# We have the BSD version
|
||||
tmp=$(mktemp -t tmp)
|
||||
# We have the BSD version
|
||||
tmp=$(mktemp -t tmp)
|
||||
fi
|
||||
|
||||
#
|
||||
# Download the certificate
|
||||
#
|
||||
if ( ! echo "" | openssl s_client -connect $name:$port > $tmp 2> /dev/null); then
|
||||
echo "Failed to get cert from https://$name:$port/"
|
||||
exit 3
|
||||
# Download the certificate
|
||||
if (! echo "" | openssl s_client -connect "$name:$port" > "$tmp" 2> /dev/null); then
|
||||
echo "Failed to get cert from https://$name:$port/"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
#
|
||||
# Get the expiry date
|
||||
#
|
||||
date=$(openssl x509 -in "$tmp" -noout -enddate | awk -F= '{print $2}')
|
||||
# Get the expiry date
|
||||
date=$(openssl x509 -in "$tmp" -noout -enddate | awk -F= '{print $2}')
|
||||
|
||||
#
|
||||
# Remove the temporary file
|
||||
#
|
||||
rm -f "$tmp"
|
||||
# Remove the temporary file
|
||||
rm -f "$tmp"
|
||||
|
||||
#
|
||||
# Convert the expiry date + todays date to seconds-past epoch
|
||||
#
|
||||
# Check if we have the BSD or the GNU version of date
|
||||
if (strings "$(which date)" | grep -q GNU); then
|
||||
# We have GNU this is easy
|
||||
then=$(date --date "$date" +%s)
|
||||
# Convert the expiry date + todays date to seconds-past epoch
|
||||
# Check if we have the BSD or the GNU version of date
|
||||
if (strings "$(which date)" | grep -q GNU); then
|
||||
# We have GNU this is easy
|
||||
then=$(date --date "$date" +%s)
|
||||
else
|
||||
# We have BSD now it is getting complicated
|
||||
year=$(echo "$date" | awk '{print $4}')
|
||||
month=$(echo "$date" | awk '{print $1}')
|
||||
day=$(echo "$date" | awk '{print $2}')
|
||||
hour=$(echo "$date" | awk '{print $3}' | awk -F: '{print $1}')
|
||||
minute=$(echo "$date" | awk '{print $3}' | awk -F: '{print $2}')
|
||||
second=$(echo "$date" | awk '{print $3}' | awk -F: '{print $3}')
|
||||
then=$(date -v${year}y -v${month} -v${day}d -v${hour}H -v${minute}M -v${second}S -u +%s)
|
||||
# We have BSD now it is getting complicated
|
||||
year=$(echo "$date" | awk '{print $4}')
|
||||
month=$(echo "$date" | awk '{print $1}')
|
||||
day=$(echo "$date" | awk '{print $2}')
|
||||
hour=$(echo "$date" | awk '{print $3}' | awk -F: '{print $1}')
|
||||
minute=$(echo "$date" | awk '{print $3}' | awk -F: '{print $2}')
|
||||
second=$(echo "$date" | awk '{print $3}' | awk -F: '{print $3}')
|
||||
then=$(date -v${year}y -v${month} -v${day}d -v${hour}H -v${minute}M -v${second}S -u +%s)
|
||||
fi
|
||||
|
||||
now=$(date +%s)
|
||||
now=$(date +%s)
|
||||
|
||||
#
|
||||
# Day diff
|
||||
#
|
||||
diff=$(("$then" - "$now"))
|
||||
diff=$($diff / 86400)
|
||||
# Day diff
|
||||
diff=$(("$then" - "$now"))
|
||||
diff=$($diff / 86400)
|
||||
|
||||
#
|
||||
# All done
|
||||
#
|
||||
if [ "$days" = "1" ]; then
|
||||
echo "${name}: ${diff}"
|
||||
# All done
|
||||
if [ "$days" = "1" ]; then
|
||||
echo "${name}: ${diff}"
|
||||
else
|
||||
echo "$name"
|
||||
echo " Expires: ${date}"
|
||||
echo " Days: ${diff}"
|
||||
echo "$name"
|
||||
echo " Expires: ${date}"
|
||||
echo " Days: ${diff}"
|
||||
fi
|
||||
done
|
||||
|
||||
39
local/bin/x-thumbgen
Executable file
39
local/bin/x-thumbgen
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
# Generate thumbnails using magick
|
||||
# https://imagemagick.org/script/download.php
|
||||
#
|
||||
# Defaults to current directory creating thumbs with 1000x1000
|
||||
# images with 200px white borders around the original image.
|
||||
#
|
||||
# Defaults can be overridden with ENV variables like this:
|
||||
# $ THMB_BACKGROUND=black x-thumbgen ~/images/
|
||||
#
|
||||
# Created by: Ismo Vuorinen <https://github.com/ivuorinen> 2015
|
||||
|
||||
: "${THMB_SOURCE:=$1}"
|
||||
: "${THMB_BACKGROUND:=white}"
|
||||
: "${THMB_RESIZE:=800x800}"
|
||||
: "${THMB_EXTENT:=1000x1000}"
|
||||
|
||||
[ $# -eq 0 ] && {
|
||||
echo "Usage: $0 /full/path/to/image/folder"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ "$THMB_SOURCE" == "" ] || [ ! -d "$THMB_SOURCE" ]; then
|
||||
THMB_SOURCE=$(pwd)
|
||||
fi
|
||||
|
||||
if command -v magick &> /dev/null; then
|
||||
|
||||
magick \
|
||||
"$THMB_SOURCE/*" \
|
||||
-resize "$THMB_RESIZE" \
|
||||
-background "$THMB_BACKGROUND" \
|
||||
-gravity center \
|
||||
-extent "$THMB_EXTENT" \
|
||||
-set filename:fname '%t_thumb.%e' +adjoin '%[filename:fname]'
|
||||
|
||||
else
|
||||
echo "magick not found in PATH, https://imagemagick.org/script/download.php"
|
||||
fi
|
||||
@@ -3,13 +3,10 @@
|
||||
# About
|
||||
# -----
|
||||
# Repeat the command until it fails - always run at least once.
|
||||
#
|
||||
|
||||
"$@"
|
||||
|
||||
#
|
||||
# If the status code was zero then repeat.
|
||||
#
|
||||
# If the status code was zero then repeat.
|
||||
while [ $? -eq 0 ]; do
|
||||
"$@"
|
||||
"$@"
|
||||
done
|
||||
|
||||
@@ -14,17 +14,11 @@
|
||||
# the same terms as Perl itself.
|
||||
#
|
||||
# The LICENSE file contains the full text of the license.
|
||||
#
|
||||
#
|
||||
|
||||
#
|
||||
# Run the first time.
|
||||
#
|
||||
# Run the first time.
|
||||
"$@"
|
||||
|
||||
#
|
||||
# If the status code was not zero then repeat.
|
||||
#
|
||||
# If the status code was not zero then repeat.
|
||||
while [ $? -ne 0 ]; do
|
||||
"$@"
|
||||
"$@"
|
||||
done
|
||||
|
||||
93
local/bin/x-welcome-banner
Executable file
93
local/bin/x-welcome-banner
Executable file
@@ -0,0 +1,93 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
######################################################################
|
||||
# 🌞 Welcome Banner #
|
||||
######################################################################
|
||||
# Prints personal greeting, system info and data about today #
|
||||
# Intended for use as a MOTD, for when using multiple systems #
|
||||
# For docs and more info, see: https://github.com/lissy93/dotfiles #
|
||||
# #
|
||||
# Licensed under MIT (C) Alicia Sykes 2022 <https://aliciasykes.com> #
|
||||
######################################################################
|
||||
|
||||
# Formatting variables
|
||||
COLOR_P='\033[1;36m'
|
||||
COLOR_S='\033[0;36m'
|
||||
RESET='\033[0m'
|
||||
|
||||
# Print time-based personalized message, using figlet & lolcat if availible
|
||||
function welcome_greeting () {
|
||||
h=$(date +%H)
|
||||
if [ "$h" -lt 04 ] || [[ $h -gt 22 ]];
|
||||
then greeting="Good Night"
|
||||
elif [ "$h" -lt 12 ];
|
||||
then greeting="Good morning"
|
||||
elif [ "$h" -lt 18 ];
|
||||
then greeting="Good afternoon"
|
||||
elif [ "$h" -lt 22 ];
|
||||
then greeting="Good evening"
|
||||
else
|
||||
greeting="Hello"
|
||||
fi
|
||||
WELCOME_MSG="$greeting $USER!"
|
||||
if hash lolcat 2>/dev/null && hash figlet 2>/dev/null; then
|
||||
echo "${WELCOME_MSG}" | figlet | lolcat
|
||||
else
|
||||
echo -e "$COLOR_P${WELCOME_MSG}${RESET}\n"
|
||||
fi
|
||||
}
|
||||
|
||||
# Print system information with neofetch, if it's installed
|
||||
function welcome_sysinfo () {
|
||||
if hash neofetch 2>/dev/null; then
|
||||
neofetch --shell_version off \
|
||||
--disable kernel distro shell resolution de wm wm_theme theme icons terminal \
|
||||
--backend off \
|
||||
--colors 4 8 4 4 8 6 \
|
||||
--color_blocks off \
|
||||
--memory_display info
|
||||
fi
|
||||
}
|
||||
|
||||
# Print todays info: Date, IP, weather, etc
|
||||
function welcome_today () {
|
||||
timeout=1
|
||||
echo -e "\033[1;34mToday\n------"
|
||||
|
||||
# Print date time
|
||||
echo -e "$COLOR_S$(date '+🗓️ Date: %A, %B %d, %Y at %H:%M')"
|
||||
|
||||
# Print local weather
|
||||
curl -s -m $timeout "https://wttr.in?format=%cWeather:+%C+%t,+%p+%w"
|
||||
echo -e "${RESET}"
|
||||
|
||||
# Print IP address
|
||||
if hash ip 2>/dev/null; then
|
||||
ip_address=$(ip route get 8.8.8.8 | awk -F"src " 'NR==1{split($2,a," ");print a[1]}')
|
||||
ip_interface=$(ip route get 8.8.8.8 | awk -F"dev " 'NR==1{split($2,a," ");print a[1]}')
|
||||
echo -e "${COLOR_S}🌐 IP: $(curl -s -m $timeout 'https://ipinfo.io/ip') (${ip_address} on ${ip_interface})"
|
||||
echo -e "${RESET}\n"
|
||||
fi
|
||||
}
|
||||
|
||||
# Putting it all together
|
||||
function welcome() {
|
||||
welcome_greeting
|
||||
welcome_sysinfo
|
||||
welcome_today
|
||||
}
|
||||
|
||||
# Determine if file is being run directly or sourced
|
||||
([[ -n $ZSH_EVAL_CONTEXT && $ZSH_EVAL_CONTEXT =~ :file$ ]] \
|
||||
|| [[ -n $KSH_VERSION && $(cd "$(dirname -- "$0")" \
|
||||
&& printf '%s' "${PWD%/}/")$(basename -- "$0") != "${.sh.file}" ]] \
|
||||
|| [[ -n $BASH_VERSION ]] && (return 0 2>/dev/null)
|
||||
) && sourced=1 || sourced=0
|
||||
|
||||
# If script being called directly run immediately
|
||||
if [ "$sourced" -eq 0 ]; then
|
||||
welcome "$@"
|
||||
fi
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
# Ensure we received the correct number of arguments.
|
||||
#
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "Usage: $0 HOST COMMAND..."
|
||||
exit 1
|
||||
echo "Usage: $0 HOST COMMAND..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
HOST=$1
|
||||
@@ -24,7 +24,7 @@ echo "Waiting for $HOST to get down..."
|
||||
|
||||
true
|
||||
while [ $? -ne 1 ]; do
|
||||
ping -c 1 -W 1 $HOST > /dev/null
|
||||
ping -c 1 -W 1 "$HOST" > /dev/null
|
||||
done
|
||||
|
||||
shift
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
# Ensure we received the correct number of arguments.
|
||||
#
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "Usage: $0 HOST COMMAND..."
|
||||
exit 1
|
||||
echo "Usage: $0 HOST COMMAND..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $1 = "ssh" ]; then
|
||||
if [ "$1" = "ssh" ]; then
|
||||
HOST=$2
|
||||
else
|
||||
HOST=$1
|
||||
@@ -30,15 +30,15 @@ fi
|
||||
|
||||
echo "Waiting for $HOST to come online..."
|
||||
|
||||
ping -c 1 -W 1 $HOST > /dev/null
|
||||
ping -c 1 -W 1 "$HOST" > /dev/null
|
||||
while [ $? -ne 0 ]; do
|
||||
sleep 1
|
||||
ping -c 1 -W 1 $HOST > /dev/null
|
||||
sleep 1
|
||||
ping -c 1 -W 1 "$HOST" > /dev/null
|
||||
done
|
||||
|
||||
# By the time we reach here the ping-command has completed successfully
|
||||
# so we can launch the command we were given - along with any arguments.
|
||||
if [ $1 != "ssh" ]; then
|
||||
if [ "$1" != "ssh" ]; then
|
||||
shift
|
||||
fi
|
||||
|
||||
|
||||
2
rcrc
2
rcrc
@@ -1,2 +0,0 @@
|
||||
EXCLUDES="*.md *.sh *.lock.json Brewfile scripts"
|
||||
HOSTNAME=$(hostname -s)
|
||||
6
renovate.json
Normal file
6
renovate.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"local>ivuorinen/.github:renovate-config"
|
||||
]
|
||||
}
|
||||
23
scripts/install-composer.sh
Executable file
23
scripts/install-composer.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
# Install PHP Package Manager Composer
|
||||
#
|
||||
# shellcheck source="shared.sh"
|
||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
have php && {
|
||||
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
|
||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
|
||||
|
||||
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
|
||||
echo >&2 'ERROR: Invalid installer checksum'
|
||||
rm composer-setup.php
|
||||
exit 1
|
||||
fi
|
||||
|
||||
php composer-setup.php --quiet
|
||||
RESULT=$?
|
||||
rm composer-setup.php
|
||||
mv composer.phar ~/.local/bin/composer
|
||||
exit $RESULT
|
||||
} || msg_err "PHP Not Available, cannot install composer"
|
||||
@@ -1,102 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# sh install-dotfiles.sh
|
||||
#
|
||||
# Environment variables: VERBOSE, CP, LN, MKDIR, RM, DIRNAME.
|
||||
#
|
||||
# env VERBOSE=1 sh install-dotfiles.sh
|
||||
#
|
||||
# DO NOT EDIT THIS FILE
|
||||
#
|
||||
# This file is generated by rcm(7) as:
|
||||
#
|
||||
# rcup -B 0 -g
|
||||
#
|
||||
# To update it, re-run the above command.
|
||||
#
|
||||
: ${VERBOSE:=0}
|
||||
: ${CP:=/bin/cp}
|
||||
: ${LN:=/bin/ln}
|
||||
: ${MKDIR:=/bin/mkdir}
|
||||
: ${RM:=/bin/rm}
|
||||
: ${DIRNAME:=/usr/bin/dirname}
|
||||
verbose()
|
||||
{
|
||||
if [ "$VERBOSE" -gt 0 ]; then
|
||||
echo "$@"
|
||||
fi
|
||||
}
|
||||
handle_file_cp()
|
||||
{
|
||||
if [ -e "$2" ]; then
|
||||
printf "%s " "overwrite $2? [yN]"
|
||||
read overwrite
|
||||
case "$overwrite" in
|
||||
y)
|
||||
$RM -rf "$2"
|
||||
;;
|
||||
*)
|
||||
echo "skipping $2"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
verbose "'$1' -> '$2'"
|
||||
$MKDIR -p "$($DIRNAME "$2")"
|
||||
$CP -R "$1" "$2"
|
||||
}
|
||||
handle_file_ln()
|
||||
{
|
||||
if [ -e "$2" ]; then
|
||||
printf "%s " "overwrite $2? [yN]"
|
||||
read overwrite
|
||||
case "$overwrite" in
|
||||
y)
|
||||
$RM -rf "$2"
|
||||
;;
|
||||
*)
|
||||
echo "skipping $2"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
verbose "'$1' -> '$2'"
|
||||
$MKDIR -p "$($DIRNAME "$2")"
|
||||
$LN -sf "$1" "$2"
|
||||
}
|
||||
handle_file_ln "$HOME/.dotfiles/bash_profile" "$HOME/.bash_profile"
|
||||
handle_file_ln "$HOME/.dotfiles/bashrc" "$HOME/.bashrc"
|
||||
handle_file_ln "$HOME/.dotfiles/config/alias" "$HOME/.config/alias"
|
||||
handle_file_ln "$HOME/.dotfiles/config/exports" "$HOME/.config/exports"
|
||||
handle_file_ln "$HOME/.dotfiles/config/flipperdevices.com/qFlipper.ini" "$HOME/.config/flipperdevices.com/qFlipper.ini"
|
||||
handle_file_ln "$HOME/.dotfiles/config/functions" "$HOME/.config/functions"
|
||||
handle_file_ln "$HOME/.dotfiles/config/gh/config.yml" "$HOME/.config/gh/config.yml"
|
||||
handle_file_ln "$HOME/.dotfiles/config/git/config" "$HOME/.config/git/config"
|
||||
handle_file_ln "$HOME/.dotfiles/config/git/gitignore" "$HOME/.config/git/gitignore"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/after/plugin/defaults.lua" "$HOME/.config/nvim/after/plugin/defaults.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/init.lua" "$HOME/.config/nvim/init.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/custom/plugins.lua" "$HOME/.config/nvim/lua/custom/plugins.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/plugin/packer_compiled.lua" "$HOME/.config/nvim/plugin/packer_compiled.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/tmux/tmux.conf" "$HOME/.config/tmux/tmux.conf"
|
||||
handle_file_ln "$HOME/.dotfiles/config/wtf/config.yml" "$HOME/.config/wtf/config.yml"
|
||||
handle_file_ln "$HOME/.dotfiles/git_profiles" "$HOME/.git_profiles"
|
||||
handle_file_ln "$HOME/.dotfiles/huskyrc" "$HOME/.huskyrc"
|
||||
handle_file_ln "$HOME/.dotfiles/local/bin/antigen.zsh" "$HOME/.local/bin/antigen.zsh"
|
||||
handle_file_ln "$HOME/.dotfiles/local/bin/dfm" "$HOME/.local/bin/dfm"
|
||||
handle_file_ln "$HOME/.dotfiles/local/bin/x-check-git-attributes" "$HOME/.local/bin/x-check-git-attributes"
|
||||
handle_file_ln "$HOME/.dotfiles/local/bin/x-dupes" "$HOME/.local/bin/x-dupes"
|
||||
handle_file_ln "$HOME/.dotfiles/local/bin/x-foreach" "$HOME/.local/bin/x-foreach"
|
||||
handle_file_ln "$HOME/.dotfiles/local/bin/x-multi-ping" "$HOME/.local/bin/x-multi-ping"
|
||||
handle_file_ln "$HOME/.dotfiles/local/bin/x-open-ports" "$HOME/.local/bin/x-open-ports"
|
||||
handle_file_ln "$HOME/.dotfiles/local/bin/x-ssl-expiry-date" "$HOME/.local/bin/x-ssl-expiry-date"
|
||||
handle_file_ln "$HOME/.dotfiles/local/bin/x-until-error" "$HOME/.local/bin/x-until-error"
|
||||
handle_file_ln "$HOME/.dotfiles/local/bin/x-until-success" "$HOME/.local/bin/x-until-success"
|
||||
handle_file_ln "$HOME/.dotfiles/local/bin/x-when-down" "$HOME/.local/bin/x-when-down"
|
||||
handle_file_ln "$HOME/.dotfiles/local/bin/x-when-up" "$HOME/.local/bin/x-when-up"
|
||||
handle_file_ln "$HOME/.dotfiles/rcrc" "$HOME/.rcrc"
|
||||
handle_file_ln "$HOME/.dotfiles/ssh/allowed_signers" "$HOME/.ssh/allowed_signers"
|
||||
handle_file_ln "$HOME/.dotfiles/ssh/config" "$HOME/.ssh/config"
|
||||
handle_file_ln "$HOME/.dotfiles/vuerc" "$HOME/.vuerc"
|
||||
handle_file_ln "$HOME/.dotfiles/zshrc" "$HOME/.zshrc"
|
||||
@@ -1,53 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
# Install GitHub CLI extensions
|
||||
|
||||
#
|
||||
# shellcheck source="shared.sh"
|
||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
if ! command -v gh &> /dev/null; then
|
||||
msg_run "gh (GitHub Client) could not be found, please install it first"
|
||||
exit 1
|
||||
fi
|
||||
have gh && {
|
||||
extensions=(
|
||||
# GitHub CLI extension for generating a report on repository dependencies.
|
||||
andyfeller/gh-dependency-report
|
||||
# GitHub CLI extension to generate montage from GitHub user avatars
|
||||
andyfeller/gh-montage
|
||||
# An opinionated GitHub Cli extension for creating
|
||||
# changelogs that adhere to the keep a changelog specification.
|
||||
chelnak/gh-changelog
|
||||
# Safely deletes local branches with no upstream and no un-pushed commits
|
||||
davidraviv/gh-clean-branches
|
||||
# A beautiful CLI dashboard for GitHub 🚀
|
||||
dlvhdr/gh-dash
|
||||
# A github-cli extension script to clone all repositories
|
||||
# in an organization, optionally filtering by topic.
|
||||
matt-bartel/gh-clone-org
|
||||
# being an extension to view the overall health of
|
||||
# an organization's use of actions
|
||||
rsese/gh-actions-status
|
||||
)
|
||||
|
||||
extensions=(
|
||||
# GitHub CLI extension for reviewing Dependabot PRs.
|
||||
einride/gh-dependabot
|
||||
# A GitHub CLI extension that provides summary pull request metrics.
|
||||
hectcastro/gh-metrics
|
||||
# being an extension to view the overall health of an organization's use of actions
|
||||
rsese/gh-actions-status
|
||||
# GitHub CLI extension for label management
|
||||
heaths/gh-label
|
||||
# An opinionated GitHub Cli extension for creating
|
||||
# changelogs that adhere to the keep a changelog specification.
|
||||
chelnak/gh-changelog
|
||||
# Safely deletes local branches with no upstream and no un-pushed commits
|
||||
davidraviv/gh-clean-branches
|
||||
# A beautiful CLI dashboard for GitHub 🚀
|
||||
dlvhdr/gh-dash
|
||||
# A github-cli extension script to clone all repositories
|
||||
# in an organization, optionally filtering by topic.
|
||||
matt-bartel/gh-clone-org
|
||||
# GitHub CLI extension to generate montage from GitHub user avatars
|
||||
andyfeller/gh-montage
|
||||
# Organisation specific extension for gh cli to retrieve different statistics
|
||||
VildMedPap/gh-orgstats
|
||||
# GitHub CLI extension for generating a report on repository dependencies.
|
||||
andyfeller/gh-dependency-report
|
||||
# gh cli extension to generate account/organization/enterprise reports
|
||||
stoe/gh-report
|
||||
)
|
||||
msg "Starting to install GitHub CLI extensions..."
|
||||
|
||||
msg "Starting to install GitHub CLI extensions..."
|
||||
for ext in "${extensions[@]}"; do
|
||||
# Trim spaces
|
||||
ext=${ext// /}
|
||||
# Skip comments
|
||||
if [[ ${ext:0:1} == "#" ]]; then continue; fi
|
||||
|
||||
for ext in "${extensions[@]}"; do
|
||||
# Trim spaces
|
||||
ext=${ext// /}
|
||||
# Skip comments
|
||||
if [[ ${ext:0:1} == "#" ]]; then continue; fi
|
||||
msg_run "Installing $ext"
|
||||
gh extensions install "$ext"
|
||||
echo ""
|
||||
done
|
||||
|
||||
msg_run "Installing $ext"
|
||||
gh extensions install "$ext"
|
||||
echo ""
|
||||
done
|
||||
|
||||
msg_ok "Done"
|
||||
msg_ok "Done"
|
||||
} || msg_err "gh (GitHub Client) could not be found, please install it first"
|
||||
|
||||
44
scripts/install-go-packages.sh
Normal file → Executable file
44
scripts/install-go-packages.sh
Normal file → Executable file
@@ -1,27 +1,29 @@
|
||||
#!/usr/bin/env zsh
|
||||
#!/usr/bin/env bash
|
||||
# Install Go packages
|
||||
|
||||
#
|
||||
# shellcheck source=shared.sh
|
||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
if ! command -v go &> /dev/null; then
|
||||
msg "go hasn't been installed yet."
|
||||
exit 0
|
||||
fi
|
||||
have go && {
|
||||
packages=(
|
||||
# sysadmin/scripting utilities, distributed as a single binary
|
||||
github.com/skx/sysbox@latest
|
||||
github.com/dotzero/git-profile@latest
|
||||
github.com/google/yamlfmt/cmd/yamlfmt@latest
|
||||
github.com/ericchiang/pup@latest
|
||||
github.com/suntong/html2md@latest
|
||||
)
|
||||
|
||||
packages=(
|
||||
# sysadmin/scripting utilities, distributed as a single binary
|
||||
github.com/skx/sysbox@latest
|
||||
)
|
||||
for pkg in "${packages[@]}"; do
|
||||
# Trim spaces
|
||||
pkg=${pkg// /}
|
||||
# Skip comments
|
||||
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
|
||||
|
||||
for pkg in "${packages[@]}"; do
|
||||
# Trim spaces
|
||||
pkg=${pkg// /}
|
||||
# Skip comments
|
||||
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
|
||||
msg_run "Installing go package:" "$pkg"
|
||||
go install "$pkg"
|
||||
echo ""
|
||||
done
|
||||
|
||||
msg_run "Installing go package:" "$pkg"
|
||||
go install "$pkg"
|
||||
echo ""
|
||||
done
|
||||
|
||||
msg_ok "Done"
|
||||
msg_ok "Done"
|
||||
} || msg "go hasn't been installed yet."
|
||||
|
||||
44
scripts/install-npm-packages.sh
Executable file
44
scripts/install-npm-packages.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
# Install npm packages globally.
|
||||
#
|
||||
# shellcheck source=shared.sh
|
||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
have npm && {
|
||||
packages=(
|
||||
# This is a tool to check if your files consider your .editorconfig rules.
|
||||
"editorconfig-checker"
|
||||
# Node module to create a release or a changelog from
|
||||
# a tag and uses issues or commits to creating the release notes.
|
||||
"github-release-notes"
|
||||
"neovim"
|
||||
"prettier"
|
||||
"@bchatard/alfred-jetbrains"
|
||||
"@johnnymorganz/stylua-bin"
|
||||
"stylelint-lsp"
|
||||
"blade-formatter"
|
||||
"@loopback/cli"
|
||||
"corepack"
|
||||
"standardjs"
|
||||
)
|
||||
|
||||
for pkg in "${packages[@]}"; do
|
||||
# Trim spaces
|
||||
pkg=${pkg// /}
|
||||
# Skip comments
|
||||
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
|
||||
|
||||
if [[ $(npm ls -g -p "$pkg") != "" ]]; then
|
||||
msg_run_done "$pkg" "already installed"
|
||||
else
|
||||
msg_run "Installing npm package:" "$pkg"
|
||||
npm install -g --no-fund --no-progress --no-timing "$pkg"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
done
|
||||
|
||||
msg_run "Upgrading all global packages"
|
||||
npm -g --no-progress --no-timing --no-fund outdated
|
||||
npm -g --no-timing --no-fund upgrade
|
||||
} || msg_err "npm could not be found."
|
||||
37
scripts/install-ntfy.sh
Executable file
37
scripts/install-ntfy.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Install ntfy
|
||||
#
|
||||
# shellcheck source=shared.sh
|
||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
set -e
|
||||
|
||||
have ntfy && {
|
||||
msg "ntfy already installed"
|
||||
} || {
|
||||
case $(dfm check arch) in
|
||||
Linux)
|
||||
NTFY_ARCH="linux_$(arch)"
|
||||
;;
|
||||
Darwin)
|
||||
NTFY_ARCH="macOS_all"
|
||||
;;
|
||||
esac
|
||||
|
||||
NTFY_VERSION=2.2.0
|
||||
NTFY_URL="https://github.com/binwiederhier/ntfy"
|
||||
NTFY_DEST="ntfy_${NTFY_VERSION}_${NTFY_ARCH}"
|
||||
|
||||
curl -L "$NTFY_URL/releases/download/v${NTFY_VERSION}/${NTFY_DEST}.tar.gz" \
|
||||
> "${NTFY_DEST}.tar.gz"
|
||||
tar zxvf "${NTFY_DEST}.tar.gz"
|
||||
cp -a "${NTFY_DEST}/ntfy" ~/.local/bin/ntfy
|
||||
mkdir -p ~/.config/ntfy
|
||||
|
||||
# copy config only if it does not exist
|
||||
if [ ! -f "$HOME/.config/ntfy/client.yml" ]; then
|
||||
cp "${NTFY_DEST}/client/client.yml" ~/.config/ntfy/client.yml
|
||||
fi
|
||||
|
||||
rm -rf "${NTFY_DEST}" "${NTFY_DEST}.tar.gz"
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user