mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-07 23:50:43 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ba66c7734 | ||
|
|
86824d8c45 | ||
| 38d853aa8a | |||
|
|
34a0d7d8c4 | ||
|
|
65bf470c5b | ||
|
|
965c47efef | ||
| 410f5ac2b5 | |||
|
|
b6a18688c4 | ||
| 9f1ba5034f |
11
Brewfile
11
Brewfile
@@ -120,6 +120,8 @@ brew "mas"
|
|||||||
brew "midnight-commander"
|
brew "midnight-commander"
|
||||||
# Ambitious Vim-fork focused on extensibility and agility
|
# Ambitious Vim-fork focused on extensibility and agility
|
||||||
brew "neovim"
|
brew "neovim"
|
||||||
|
# No Nonsense Neovim Client in Rust
|
||||||
|
brew "neovide"
|
||||||
# Port scanning utility for large networks
|
# Port scanning utility for large networks
|
||||||
brew "nmap"
|
brew "nmap"
|
||||||
# Manage multiple Node.js versions
|
# Manage multiple Node.js versions
|
||||||
@@ -128,6 +130,8 @@ brew "nvm"
|
|||||||
brew "openjdk"
|
brew "openjdk"
|
||||||
# Generate clients, server & docs from an OpenAPI spec (v2, v3)
|
# Generate clients, server & docs from an OpenAPI spec (v2, v3)
|
||||||
brew "openapi-generator"
|
brew "openapi-generator"
|
||||||
|
# Swiss-army knife of markup format conversion
|
||||||
|
brew "pandoc"
|
||||||
# Highly capable, feature-rich programming language
|
# Highly capable, feature-rich programming language
|
||||||
brew "perl"
|
brew "perl"
|
||||||
# Interpreted, interactive, object-oriented programming language
|
# Interpreted, interactive, object-oriented programming language
|
||||||
@@ -232,8 +236,6 @@ cask "insomnia"
|
|||||||
cask "jetbrains-toolbox"
|
cask "jetbrains-toolbox"
|
||||||
# Kubernetes IDE
|
# Kubernetes IDE
|
||||||
cask "lens"
|
cask "lens"
|
||||||
# Neovim Client
|
|
||||||
cask "neovide"
|
|
||||||
# Reverse proxy, secure introspectable tunnels to localhost
|
# Reverse proxy, secure introspectable tunnels to localhost
|
||||||
cask "ngrok"
|
cask "ngrok"
|
||||||
# Collaboration platform for API development
|
# Collaboration platform for API development
|
||||||
@@ -266,8 +268,12 @@ cask "syntax-highlight"
|
|||||||
cask "visual-studio-code"
|
cask "visual-studio-code"
|
||||||
# Multimedia player
|
# Multimedia player
|
||||||
cask "vlc"
|
cask "vlc"
|
||||||
|
# Spell-checking service for Finnish
|
||||||
|
cask "voikkospellservice"
|
||||||
# Rust-based terminal
|
# Rust-based terminal
|
||||||
cask "warp"
|
cask "warp"
|
||||||
|
# View output from scripts in the menu bar
|
||||||
|
cask "xbar"
|
||||||
mas "1Password for Safari", id: 1569813296
|
mas "1Password for Safari", id: 1569813296
|
||||||
mas "Flow", id: 1423210932
|
mas "Flow", id: 1423210932
|
||||||
mas "GarageBand", id: 682658836
|
mas "GarageBand", id: 682658836
|
||||||
@@ -275,4 +281,5 @@ mas "iMovie", id: 408981434
|
|||||||
mas "Keynote", id: 409183694
|
mas "Keynote", id: 409183694
|
||||||
mas "Numbers", id: 409203825
|
mas "Numbers", id: 409203825
|
||||||
mas "Pages", id: 409201541
|
mas "Pages", id: 409201541
|
||||||
|
mas "pullBar", id: 1601913905
|
||||||
mas "Tailscale", id: 1475387142
|
mas "Tailscale", id: 1475387142
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
*.cache
|
*.cache
|
||||||
*~
|
*~
|
||||||
|
|
||||||
|
*-secret
|
||||||
__secret
|
__secret
|
||||||
__ignored
|
__ignored
|
||||||
__test_*.php
|
__test_*.php
|
||||||
|
|||||||
@@ -392,6 +392,9 @@ ks('n', '<leader>sw', tl.grep_string, { desc = '[S]earch current [W]ord' })
|
|||||||
ks('n', '<leader>sg', tl.live_grep, { desc = '[S]earch by [G]rep' })
|
ks('n', '<leader>sg', tl.live_grep, { desc = '[S]earch by [G]rep' })
|
||||||
ks('n', '<leader>sd', tl.diagnostics, { desc = '[S]earch [D]iagnostics' })
|
ks('n', '<leader>sd', tl.diagnostics, { desc = '[S]earch [D]iagnostics' })
|
||||||
|
|
||||||
|
-- Add harpoon to telescope
|
||||||
|
require("telescope").load_extension('harpoon')
|
||||||
|
|
||||||
-- [[ Configure Treesitter ]]
|
-- [[ Configure Treesitter ]]
|
||||||
-- See `:help nvim-treesitter`
|
-- See `:help nvim-treesitter`
|
||||||
require('nvim-treesitter.configs').setup {
|
require('nvim-treesitter.configs').setup {
|
||||||
|
|||||||
@@ -59,6 +59,13 @@ return function(use)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- harpoon, by ThePrimeagen
|
||||||
|
-- https://github.com/ThePrimeagen/harpoon
|
||||||
|
use {
|
||||||
|
"ThePrimeagen/harpoon",
|
||||||
|
requires = { { "nvim-lua/plenary.nvim" } }
|
||||||
|
}
|
||||||
|
|
||||||
-- An asynchronous linter plugin for Neovim complementary to
|
-- An asynchronous linter plugin for Neovim complementary to
|
||||||
-- the built-in Language Server Protocol support.
|
-- the built-in Language Server Protocol support.
|
||||||
-- https://github.com/mfussenegger/nvim-lint
|
-- https://github.com/mfussenegger/nvim-lint
|
||||||
@@ -197,4 +204,7 @@ return function(use)
|
|||||||
requires = { "jose-elias-alvarez/null-ls.nvim" }
|
requires = { "jose-elias-alvarez/null-ls.nvim" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- WakaTime Support
|
||||||
|
use { "wakatime/vim-wakatime" }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ function section_brew
|
|||||||
--describe && msg_done "🎉 Done!"
|
--describe && msg_done "🎉 Done!"
|
||||||
;;
|
;;
|
||||||
autoupdate)
|
autoupdate)
|
||||||
|
brew autoupdate delete
|
||||||
brew autoupdate start 43200 --upgrade --cleanup --immediate
|
brew autoupdate start 43200 --upgrade --cleanup --immediate
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -115,18 +116,7 @@ function section_dotfiles
|
|||||||
;;
|
;;
|
||||||
shfmt)
|
shfmt)
|
||||||
# Format shell scripts according to following rules.
|
# Format shell scripts according to following rules.
|
||||||
shfmt \
|
shfmt -fn -l -w -i 2 -ci -sr -bn "$DOTFILES"
|
||||||
--find \
|
|
||||||
--list \
|
|
||||||
--write \
|
|
||||||
--diff \
|
|
||||||
--simplify \
|
|
||||||
--indent 2 \
|
|
||||||
--binary-next-line \
|
|
||||||
--case-indent \
|
|
||||||
--space-redirects \
|
|
||||||
--func-next-line \
|
|
||||||
"$DOTFILES"
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
menu_section "$USAGE_PREFIX" "link | update | shfmt"
|
menu_section "$USAGE_PREFIX" "link | update | shfmt"
|
||||||
@@ -183,4 +173,3 @@ case "$1" in
|
|||||||
tests) section_tests "$2" ;;
|
tests) section_tests "$2" ;;
|
||||||
*) usage && exit 1 ;;
|
*) usage && exit 1 ;;
|
||||||
esac
|
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"
|
||||||
@@ -20,7 +20,8 @@
|
|||||||
#
|
#
|
||||||
# Simple function to show usage information, and exit.
|
# Simple function to show usage information, and exit.
|
||||||
#
|
#
|
||||||
usage() {
|
usage()
|
||||||
|
{
|
||||||
echo "Usage: $0 [-d] [-p 443] domain1.org domain2.com .. domainN"
|
echo "Usage: $0 [-d] [-p 443] domain1.org domain2.com .. domainN"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|||||||
2
rcrc
2
rcrc
@@ -1,2 +1,2 @@
|
|||||||
EXCLUDES="*.md *.sh *.lock.json Brewfile scripts"
|
EXCLUDES="*.md *.sh *.lock.json Brewfile scripts *-secret"
|
||||||
HOSTNAME=$(hostname -s)
|
HOSTNAME=$(hostname -s)
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ 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/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/config" "$HOME/.config/git/config"
|
||||||
handle_file_ln "$HOME/.dotfiles/config/git/gitignore" "$HOME/.config/git/gitignore"
|
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/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/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/nvim/plugin/packer_compiled.lua" "$HOME/.config/nvim/plugin/packer_compiled.lua"
|
||||||
@@ -85,6 +84,7 @@ handle_file_ln "$HOME/.dotfiles/git_profiles" "$HOME/.git_profiles"
|
|||||||
handle_file_ln "$HOME/.dotfiles/huskyrc" "$HOME/.huskyrc"
|
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/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/dfm" "$HOME/.local/bin/dfm"
|
||||||
|
handle_file_ln "$HOME/.dotfiles/local/bin/git-dirty" "$HOME/.local/bin/git-dirty"
|
||||||
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-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-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-foreach" "$HOME/.local/bin/x-foreach"
|
||||||
|
|||||||
@@ -12,77 +12,95 @@ CLR_BLUE='\033[1;34m'
|
|||||||
CLR_RESET="\033[0m"
|
CLR_RESET="\033[0m"
|
||||||
|
|
||||||
# -- Helpers -- #
|
# -- Helpers -- #
|
||||||
function __log_marker() {
|
function __log_marker()
|
||||||
|
{
|
||||||
echo -e "${CLR_BLUE}➜${CLR_RESET}"
|
echo -e "${CLR_BLUE}➜${CLR_RESET}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function __log_marker_ok() {
|
function __log_marker_ok()
|
||||||
|
{
|
||||||
echo -e "${CLR_GREEN}✔${CLR_RESET}"
|
echo -e "${CLR_GREEN}✔${CLR_RESET}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function __log_marker_ok_blue() {
|
function __log_marker_ok_blue()
|
||||||
|
{
|
||||||
echo -e "${CLR_BLUE}✔${CLR_RESET}"
|
echo -e "${CLR_BLUE}✔${CLR_RESET}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function __log_marker_warn() {
|
function __log_marker_warn()
|
||||||
|
{
|
||||||
echo -e "${CLR_YELLOW}⁕${CLR_RESET}"
|
echo -e "${CLR_YELLOW}⁕${CLR_RESET}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function __log_marker_err() {
|
function __log_marker_err()
|
||||||
|
{
|
||||||
echo -e "${CLR_RED}⛌${CLR_RESET}"
|
echo -e "${CLR_RED}⛌${CLR_RESET}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function __log_indent() {
|
function __log_indent()
|
||||||
|
{
|
||||||
echo " "
|
echo " "
|
||||||
}
|
}
|
||||||
|
|
||||||
# -- Log -- #
|
# -- Log -- #
|
||||||
function msg() {
|
function msg()
|
||||||
|
{
|
||||||
echo -e "$(__log_marker) $1"
|
echo -e "$(__log_marker) $1"
|
||||||
}
|
}
|
||||||
|
|
||||||
function msg_done() {
|
function msg_done()
|
||||||
|
{
|
||||||
echo -e "$(__log_marker) $1 ...$(__log_marker_ok)"
|
echo -e "$(__log_marker) $1 ...$(__log_marker_ok)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function msg_prompt() {
|
function msg_prompt()
|
||||||
|
{
|
||||||
echo -e "$(__log_marker) $1"
|
echo -e "$(__log_marker) $1"
|
||||||
}
|
}
|
||||||
|
|
||||||
function msg_prompt_done() {
|
function msg_prompt_done()
|
||||||
|
{
|
||||||
echo -e "$(__log_marker) $1 ...$(__log_marker_ok)"
|
echo -e "$(__log_marker) $1 ...$(__log_marker_ok)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function msg_nested() {
|
function msg_nested()
|
||||||
|
{
|
||||||
echo -e "$(__log_indent)$(__log_marker) $1"
|
echo -e "$(__log_indent)$(__log_marker) $1"
|
||||||
}
|
}
|
||||||
|
|
||||||
function msg_nested_done() {
|
function msg_nested_done()
|
||||||
|
{
|
||||||
echo -e "$(__log_indent)$(__log_marker) $1 ...$(__log_marker_ok)"
|
echo -e "$(__log_indent)$(__log_marker) $1 ...$(__log_marker_ok)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function msg_run() {
|
function msg_run()
|
||||||
|
{
|
||||||
echo -e "${CLR_GREEN}➜ $1${CLR_RESET} $2"
|
echo -e "${CLR_GREEN}➜ $1${CLR_RESET} $2"
|
||||||
}
|
}
|
||||||
|
|
||||||
function msg_ok() {
|
function msg_ok()
|
||||||
|
{
|
||||||
echo -e "$(__log_marker_ok) $1"
|
echo -e "$(__log_marker_ok) $1"
|
||||||
}
|
}
|
||||||
|
|
||||||
function msg_warn() {
|
function msg_warn()
|
||||||
|
{
|
||||||
echo -e "$(__log_marker_warn) $1"
|
echo -e "$(__log_marker_warn) $1"
|
||||||
}
|
}
|
||||||
|
|
||||||
function msg_err() {
|
function msg_err()
|
||||||
|
{
|
||||||
echo -e "$(__log_marker_err) $1"
|
echo -e "$(__log_marker_err) $1"
|
||||||
}
|
}
|
||||||
|
|
||||||
# -- Menu builder -- #
|
# -- Menu builder -- #
|
||||||
function menu_section() {
|
function menu_section()
|
||||||
|
{
|
||||||
LINE=$(printf '%-18s [ %-15s ]\n' "$1" "$2")
|
LINE=$(printf '%-18s [ %-15s ]\n' "$1" "$2")
|
||||||
echo -e " $(__log_marker) $LINE"
|
echo -e " $(__log_marker) $LINE"
|
||||||
}
|
}
|
||||||
function menu_item() {
|
function menu_item()
|
||||||
|
{
|
||||||
LINE=$(printf '%-15s %-30s\n' "$1" "$2")
|
LINE=$(printf '%-15s %-30s\n' "$1" "$2")
|
||||||
echo -e "$(__log_indent)$(__log_marker) $LINE"
|
echo -e "$(__log_indent)$(__log_marker) $LINE"
|
||||||
}
|
}
|
||||||
|
|||||||
2
zshrc
2
zshrc
@@ -48,7 +48,9 @@ function x-load-configs()
|
|||||||
# Load the shell dotfiles, and then some:
|
# Load the shell dotfiles, and then some:
|
||||||
for file in ~/.dotfiles/config/{exports,alias,functions}; do
|
for file in ~/.dotfiles/config/{exports,alias,functions}; do
|
||||||
[ -r "$file" ] && [ -f "$file" ] && source "$file"
|
[ -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" ] && [ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME"
|
||||||
|
[ -r "$file-$HOSTNAME-secret" ] && [ -f "$file-$HOSTNAME-secret" ] && source "$file-$HOSTNAME-secret"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
x-load-configs
|
x-load-configs
|
||||||
|
|||||||
Reference in New Issue
Block a user