Compare commits

...

50 Commits

Author SHA1 Message Date
622c8f991a chore(alias): wget 2023-11-07 07:20:44 +02:00
88894a33a5 feat(dfm): install latest lts node with nvm-latest 2023-11-07 07:20:02 +02:00
acbfd34e7d chore: paths and tweaks 2023-11-06 14:57:01 +02:00
bac03a0b7b chore(config): path additions 2023-11-06 10:40:45 +02:00
a96bf921a2 chore(scripts): backup scripts tweaks and license 2023-11-02 23:44:27 +02:00
b5df60851f chore(deps): updated yarn packages 2023-11-01 14:46:44 +02:00
2e682c58fa chore(deps): updated brewfile 2023-11-01 14:46:30 +02:00
cb28e274ca feat(config): amethyst 2023-11-01 14:46:14 +02:00
4572c42eea feat: x-path-* as scripts, run other changes 2023-11-01 14:45:03 +02:00
cec1edb269 feat: git-fsck-dirs, validate git repo objects 2023-10-31 13:08:04 +02:00
bfe7e93b60 chore(lint): run prettier to all files 2023-10-30 14:44:46 +02:00
1b80c8b7ed feat: from individual npm configs to meta pkg 2023-10-30 14:26:52 +02:00
c7c3493259 feat: git-update-dirs, update subdir repos 2023-10-30 14:24:08 +02:00
0e797d36ae chore(nvim): added leap & dot from lazyvim extras 2023-10-30 14:22:35 +02:00
renovate[bot]
0beb386f4a chore(deps): update dependency @ivuorinen/prettier-config to ^0.2.0 (#15) 2023-10-29 09:42:36 +02:00
renovate[bot]
cc0e668cd9 chore(deps): update dependency @ivuorinen/markdownlint-config to ^0.2.0 (#14) 2023-10-29 09:40:28 +02:00
renovate[bot]
d6f7aecf6c chore(deps): update dependency @ivuorinen/commitlint-config to ^0.2.0 (#12) 2023-10-29 09:36:42 +02:00
renovate[bot]
5253b69e37 chore(deps): update dependency @ivuorinen/eslint-config to ^0.3.0 (#13) 2023-10-29 09:32:37 +02:00
12080f59e1 feat(repo): delete and ignore nvim lazy-lock.json
this file causes too much noise to the repo, and should be per-machine
managed. starting nvim already generates this, and the state is always
going to change.
2023-10-25 09:42:24 +03:00
614827a877 chore(deps): update nvim dependencies 2023-10-24 08:16:02 +03:00
09343033ec chore(deps): update nvim packages 2023-10-19 16:14:58 +03:00
c24f51adb9 chore(deps): update brew packages 2023-10-19 16:14:58 +03:00
1a74cf78c1 chore(dfm): added messages to each install command 2023-10-19 13:28:59 +03:00
e31948dcc5 feat(shell): oh-my-bash for bash 2023-10-19 13:27:41 +03:00
25acc678d8 feat(actions): self-hosted github actions runner 2023-10-17 09:32:21 +03:00
8c3796b433 chore(deps): update nvim packages 2023-10-17 09:16:22 +03:00
048c9ac64f chore(tmux): remove continuum autostart 2023-10-17 08:11:26 +03:00
4ef3369c0e fix(config): tmux plugin load order 2023-10-16 15:26:21 +03:00
b9c343dc27 chore(deps): update npm packages 2023-10-16 15:25:25 +03:00
cfb41b8a03 chore(nvim): updates, markdown support 2023-10-16 10:41:53 +03:00
e42edc2dcf chore(scripts): update cheat install scripts 2023-10-16 10:40:56 +03:00
5a95484c58 feat(nvim): update lazyvim to use new system 2023-10-13 11:29:56 +03:00
988cb9cd18 chore(shell): drop autoupdate-antigen plugin 2023-10-13 11:13:12 +03:00
Ismo Vuorinen
681396383a Create SECURITY.md 2023-10-13 09:28:32 +03:00
Ismo Vuorinen
f1aaf65e93 Create CODE_OF_CONDUCT.md 2023-10-13 09:17:41 +03:00
83bdfbf6a2 chore(nvim): nvim updates, copilot and glance.nvim 2023-10-09 16:55:01 +03:00
08c2be6f97 chore(shell): shell env and path tweaks 2023-10-09 16:53:36 +03:00
renovate[bot]
acf0bbe659 chore(deps): update python docker tag to v3.12 (#11)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-09 10:34:52 +03:00
e4bae620fa chore(config): update irssi config 2023-10-03 15:50:17 +03:00
b81c8f05b5 fix(nvim): removed tabnine, updated deps 2023-10-03 15:49:39 +03:00
56427a08a8 chore(deps): update nvim 2023-10-03 13:04:02 +03:00
f2e7864583 fix(tmux): use 24h time in statusbar 2023-10-03 13:03:50 +03:00
9f96d553f0 feat(tmux): tmux config tweaks 2023-10-03 11:14:06 +03:00
1dee09759a chore(deps): update nvim and yarn 2023-10-02 19:13:37 +03:00
e2f6db9208 feat(tmux): tmux suspend and mode indicator 2023-10-02 13:04:53 +03:00
14270093c2 chore(config): remove irssi default theme 2023-10-02 11:58:45 +03:00
5015a8cd5a chore(nvim): update plugins, tweaks ui 2023-10-02 11:58:19 +03:00
266c18e195 chore(dotbot): cleanup dotbot plugins 2023-10-02 11:33:35 +03:00
9c432ed2a0 feat(tmux): update cfg, remove tpm, change theme 2023-10-02 11:32:41 +03:00
e6f3aae287 fix(shell): rework shell config for more stability 2023-10-02 08:39:07 +03:00
65 changed files with 4137 additions and 1404 deletions

1
.browserslistrc Normal file
View File

@@ -0,0 +1 @@
extends @ivuorinen/browserslist-config

128
.github/CODE_OF_CONDUCT.md vendored Normal file
View File

@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
ismo@ivuorinen.net.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

12
.github/SECURITY.md vendored Normal file
View File

@@ -0,0 +1,12 @@
# Security Policy
## Supported Versions
Usually only the latest daily tag is supported at all,
because that's the current I'm using.
## Reporting a Vulnerability
Please send me email directly to the email in my profile.
I'd appreciate link to the release the vulnerability was
found in, and what is the vulnerable code/dependency.

View File

@@ -3,7 +3,7 @@ on:
workflow_dispatch: # Trigger manually
jobs:
debug-changelog:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Create changelog text

View File

@@ -3,7 +3,7 @@ on: [push]
jobs:
linters:
name: Linters
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: GitHub Actions

View File

@@ -7,7 +7,7 @@ permissions:
contents: write
jobs:
new-daily-release:
runs-on: ubuntu-latest
runs-on: self-hosted
outputs:
created: ${{ steps.daily-version.outputs.created }}
version: ${{ steps.daily-version.outputs.version }}

View File

@@ -8,7 +8,7 @@ permissions:
pull-requests: write
jobs:
update-submodules:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4

6
.gitignore vendored
View File

@@ -1,4 +1,5 @@
Brewfile.lock.json
config/nvim/lazy-lock.json
*.log
*-secret
*cache
@@ -15,4 +16,9 @@ ssh/local.d/*
.env
local/share/fonts/*
node_modules
.nfs*
*.socket
iTermServer-*
lock
config/iterm2/AppSupport

25
.gitmodules vendored
View File

@@ -19,37 +19,36 @@
url = https://github.com/cheat/cheatsheets.git
ignore = dirty
[submodule "tmux/tpm"]
path = config/tmux/plugins/tpm
url = https://github.com/tmux-plugins/tpm.git
ignore = dirty
[submodule "tmux/catppuccin"]
path = config/tmux/plugins/tmux
url = https://github.com/catppuccin/tmux.git
[submodule "tmux/tmux-continuum"]
path = config/tmux/plugins/tmux-continuum
url = https://github.com/tmux-plugins/tmux-continuum
[submodule "tmux/tmux-menus"]
path = config/tmux/plugins/tmux-menus
url = https://github.com/jaclu/tmux-menus.git
ignore = dirty
[submodule "tmux/tmux-resurrect"]
path = config/tmux/plugins/tmux-resurrect
url = https://github.com/tmux-plugins/tmux-resurrect
ignore = dirty
[submodule "tmux/tmux-sensible"]
path = config/tmux/plugins/tmux-sensible
url = https://github.com/tmux-plugins/tmux-sensible.git
ignore = dirty
[submodule "tmux/tmux-sessionist"]
path = config/tmux/plugins/tmux-sessionist
url = https://github.com/tmux-plugins/tmux-sessionist.git
ignore = dirty
[submodule "tmux/tmux-yank"]
path = config/tmux/plugins/tmux-yank
url = https://github.com/tmux-plugins/tmux-yank.git
ignore = dirty
[submodule "tmux/tmux-window-name"]
path = config/tmux/plugins/tmux-window-name
url = https://github.com/ofirgall/tmux-window-name.git
[submodule "dotbot-snap"]
path = tools/dotbot-snap
url = https://github.com/DrDynamic/dotbot-snap.git
ignore = dirty
[submodule "dotbot-pip"]
path = tools/dotbot-pip
url = https://github.com/sobolevn/dotbot-pip.git
[submodule "tmux/tmux-suspend"]
path = config/tmux/plugins/tmux-suspend
url = https://github.com/MunifTanjim/tmux-suspend.git
[submodule "tmux/tmux-mode-indicator"]
path = config/tmux/plugins/tmux-mode-indicator
url = https://github.com/MunifTanjim/tmux-mode-indicator.git

View File

@@ -1 +1 @@
3.11
3.12

3
.releaserc.json Normal file
View File

@@ -0,0 +1,3 @@
{
"extends": ["@ivuorinen/semantic-release-config"]
}

View File

@@ -7,10 +7,6 @@ git submodule add --name dotbot-brew \
-f https://github.com/wren/dotbot-brew.git tools/dotbot-brew
git submodule add --name dotbot-include \
-f https://gitlab.com/gnfzdz/dotbot-include.git tools/dotbot-include
git submodule add --name dotbot-crontab \
-f https://github.com/codekansas/dotbot-crontab.git tools/dotbot-crontab
git submodule add --name dotbot-snap \
-f https://github.com/DrDynamic/dotbot-snap.git tools/dotbot-snap
git submodule add --name dotbot-pip \
-f https://github.com/sobolevn/dotbot-pip.git tools/dotbot-pip
@@ -19,21 +15,31 @@ git submodule add --name cheat-community \
-f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community
# tmux plugin manager and plugins
git submodule add --name tmux/tpm \
-f https://github.com/tmux-plugins/tpm.git config/tmux/plugins/tpm
git submodule add --name tmux/catppuccin \
-f https://github.com/catppuccin/tmux.git config/tmux/plugins/tmux
git submodule add --name tmux/tmux-continuum \
-f https://github.com/tmux-plugins/tmux-continuum config/tmux/plugins/tmux-continuum
git submodule add --name tmux/tmux-menus \
-f https://github.com/jaclu/tmux-menus.git config/tmux/plugins/tmux-menus
git submodule add --name tmux/tmux-mode-indicator \
-f https://github.com/MunifTanjim/tmux-mode-indicator.git config/tmux/plugins/tmux-mode-indicator
git submodule add --name tmux/tmux-resurrect \
-f https://github.com/tmux-plugins/tmux-resurrect config/tmux/plugins/tmux-resurrect
git submodule add --name tmux/tmux-sensible \
-f https://github.com/tmux-plugins/tmux-sensible.git config/tmux/plugins/tmux-sensible
git submodule add --name tmux/tmux-sessionist \
-f https://github.com/tmux-plugins/tmux-sessionist.git config/tmux/plugins/tmux-sessionist
git submodule add --name tmux/tmux-suspend \
-f https://github.com/MunifTanjim/tmux-suspend.git config/tmux/plugins/tmux-suspend
git submodule add --name tmux/tmux-window-name \
-f https://github.com/ofirgall/tmux-window-name.git config/tmux/plugins/tmux-window-name
git submodule add --name tmux/tmux-yank \
-f https://github.com/tmux-plugins/tmux-yank.git config/tmux/plugins/tmux-yank
# Takes submodules and sets them to ignore all changes
for MODULE in $(git config --file .gitmodules --get-regexp path | awk '{ print $2 }'); do
git config "submodule.${MODULE}.ignore" all
done
# remove old submodules
[ -d "config/tmux/plugins/tpm" ] && rm -rf config/tmux/plugins/tpm
[ -d "config/tmux/plugins/tmux" ] && rm -rf config/tmux/plugins/tmux
[ -d "config/tmux/plugins/tmux-menus" ] && rm -rf config/tmux/plugins/tmux-menus
[ -d "tools/dotbot-crontab" ] && rm -rf tools/dotbot-crontab
[ -d "tools/dotbot-snap" ] && rm -rf tools/dotbot-snap

103
base/bashrc Executable file → Normal file
View File

@@ -3,11 +3,106 @@
# Defaults
export DOTFILES="$HOME/.dotfiles"
# shellcheck source=scripts/shared.sh
source "$DOTFILES/scripts/shared.sh"
path_prepend "$DOTFILES/local/bin"
$DOTFILES/local/bin/x-load-configs
# 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"
# custom variables
export XDG_BIN_HOME="$HOME/.local/bin"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_RUNTIME_DIR="$HOME/.local/run"
# Paths
export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$HOME/.local/go/bin:$XDG_DATA_HOME/cargo/bin:$PATH"
# shellcheck source=scripts/shared.sh
# source "$DOTFILES/scripts/shared.sh"
source "$DOTFILES/config/exports"
source "$DOTFILES/config/alias"
# shellcheck source=../config/fzf/fzf.bash
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] &&
source "${DOTFILES}/config/fzf/fzf.bash"
# Import ssh keys in keychain
ssh-add -A 2>/dev/null
# Enable the subsequent settings only in interactive sessions
case $- in
*i*) ;;
*) return ;;
esac
# Path to your oh-my-bash installation.
export OSH="$HOME/.local/share/oh-my-bash"
[ -d "$OSH" ] && {
export OSH_THEME="powerline-multiline"
# PowerLine theme config
export POWERLINE_LEFT_PROMPT="cwd scm"
export POWERLINE_RIGHT_PROMPT="python_venv ruby in_vim battery user_info"
# Display red dots whilst waiting for completion.
export COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
export DISABLE_UNTRACKED_FILES_DIRTY="true"
# To disable the uses of "sudo" by oh-my-bash, please set "false" to
# this variable. The default behavior for the empty value is "true".
export OMB_USE_SUDO=true
# To enable/disable display of Python virtualenv and condaenv
export OMB_PROMPT_SHOW_PYTHON_VENV=true # enable
# OMB_PROMPT_SHOW_PYTHON_VENV=false # disable
# Which completions would you like to load? (completions can be found in ~/.oh-my-bash/completions/*)
# Custom completions may be added to ~/.oh-my-bash/custom/completions/
# Example format: completions=(ssh git bundler gem pip pip3)
# Add wisely, as too many completions slow down shell startup.
export completions=(
git
composer
ssh
)
# Which aliases would you like to load? (aliases can be found in ~/.oh-my-bash/aliases/*)
# Custom aliases may be added to ~/.oh-my-bash/custom/aliases/
# Example format: aliases=(vagrant composer git-avh)
# Add wisely, as too many aliases slow down shell startup.
export aliases=(
general
)
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-bash/plugins/*)
# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
export plugins=(
git
bashmarks
)
# Which plugins would you like to conditionally load? (plugins can be found in ~/.oh-my-bash/plugins/*)
# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/
# Example format:
# if [ "$DISPLAY" ] || [ "$SSH" ]; then
# plugins+=(tmux-autoattach)
# fi
source "$OSH/oh-my-bash.sh"
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
}

19
base/zshenv Normal file
View File

@@ -0,0 +1,19 @@
# shellcheck shell=bash
# vim: filetype=zsh
export PATH="$HOME/.local/bin:$HOME/.dotfiles/local/bin:$HOME/.local/go/bin:$PATH"
export DOTFILES="$HOME/.dotfiles"
# 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"
# custom variables
export XDG_BIN_HOME="$HOME/.local/bin"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_RUNTIME_DIR="$HOME/.local/run"
source "$DOTFILES/config/exports"

View File

@@ -1,15 +1,40 @@
# this is my zsh config. there are many like it, but this one is mine.
# shellcheck shell=bash
# Defaults
export DOTFILES="$HOME/.dotfiles"
# shellcheck source=scripts/shared.sh
# 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"
# custom variables
export XDG_BIN_HOME="$HOME/.local/bin"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_RUNTIME_DIR="$HOME/.local/run"
export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$HOME/.local/go/bin:$XDG_DATA_HOME/cargo/bin:$PATH"
source "$DOTFILES/config/exports"
source "$DOTFILES/config/alias"
source "$DOTFILES/config/functions"
source "$DOTFILES/scripts/shared.sh"
path_prepend "$DOTFILES/local/bin"
export COMPLETION_WAITING_DOTS=true
$DOTFILES/local/bin/x-load-configs
path_append "/opt/homebrew/bin"
if type brew &> /dev/null; then
eval "$(brew shellenv)"
FPATH="$HOMEBREW_PREFIX/share/zsh/site-functions:${FPATH}"
fi
path_append "/usr/local/bin"
path_prepend "$XDG_DATA_HOME/cargo/bin"
path_prepend "$XDG_BIN_HOME"
path_prepend "$HOME/.local/go/bin"
path_prepend "$XDG_DATA_HOME/bob/nvim-bin"
export ZSH_CUSTOM_COMPLETION_PATH="$XDG_CONFIG_HOME/zsh/completion"
x-dc "$ZSH_CUSTOM_COMPLETION_PATH"
@@ -17,10 +42,6 @@ x-dc "$ZSH_CUSTOM_COMPLETION_PATH"
# Add completion scripts to zsh path
FPATH="$ZSH_CUSTOM_COMPLETION_PATH:$FPATH"
if type brew &> /dev/null; then
FPATH="$HOMEBREW_PREFIX/share/zsh/site-functions:${FPATH}"
fi
# Try to load antigen, if present
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
# shellcheck source=../../.local/bin/antigen.zsh
@@ -29,7 +50,7 @@ ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
# antigen is present
antigen use oh-my-zsh
export ZSH_TMUX_AUTOSTART=false
export ZSH_TMUX_AUTOSTART=true
export ZSH_TMUX_CONFIG="$DOTFILES/config/tmux/tmux.conf"
export ZSH_TMUX_UNICODE=true
export ZSH_TMUX_AUTOQUIT=false
@@ -48,7 +69,6 @@ antigen bundle colored-man-pages
antigen bundle command-not-found
antigen bundle ssh-agent
antigen bundle jreese/zsh-titles
antigen bundle unixorn/autoupdate-antigen.zshplugin
antigen bundle zsh-users/zsh-completions
# these should be available if there's need

View File

@@ -75,144 +75,39 @@ font:
# Should display the render timer
debug.render_timer: false
# https://github.com/catppuccin/alacritty
# TokyoNight Alacritty Colors (storm)
colors:
# Default colors
primary:
background: '#1E1E2E' # base
foreground: '#CDD6F4' # text
# Bright and dim foreground colors
dim_foreground: '#CDD6F4' # text
bright_foreground: '#CDD6F4' # text
# Cursor colors
cursor:
text: '#1E1E2E' # base
cursor: '#F5E0DC' # rosewater
vi_mode_cursor:
text: '#1E1E2E' # base
cursor: '#B4BEFE' # lavender
# Search colors
search:
matches:
foreground: '#1E1E2E' # base
background: '#A6ADC8' # subtext0
focused_match:
foreground: '#1E1E2E' # base
background: '#A6E3A1' # green
footer_bar:
foreground: '#1E1E2E' # base
background: '#A6ADC8' # subtext0
# Keyboard regex hints
hints:
start:
foreground: '#1E1E2E' # base
background: '#F9E2AF' # yellow
end:
foreground: '#1E1E2E' # base
background: '#A6ADC8' # subtext0
# Selection colors
selection:
text: '#1E1E2E' # base
background: '#F5E0DC' # rosewater
background: '0x24283b'
foreground: '0xc0caf5'
# Normal colors
normal:
black: '#45475A' # surface1
red: '#F38BA8' # red
green: '#A6E3A1' # green
yellow: '#F9E2AF' # yellow
blue: '#89B4FA' # blue
magenta: '#F5C2E7' # pink
cyan: '#94E2D5' # teal
white: '#BAC2DE' # subtext1
black: '0x1d202f'
red: '0xf7768e'
green: '0x9ece6a'
yellow: '0xe0af68'
blue: '0x7aa2f7'
magenta: '0xbb9af7'
cyan: '0x7dcfff'
white: '0xa9b1d6'
# Bright colors
bright:
black: '#585B70' # surface2
red: '#F38BA8' # red
green: '#A6E3A1' # green
yellow: '#F9E2AF' # yellow
blue: '#89B4FA' # blue
magenta: '#F5C2E7' # pink
cyan: '#94E2D5' # teal
white: '#A6ADC8' # subtext0
# Dim colors
dim:
black: '#45475A' # surface1
red: '#F38BA8' # red
green: '#A6E3A1' # green
yellow: '#F9E2AF' # yellow
blue: '#89B4FA' # blue
magenta: '#F5C2E7' # pink
cyan: '#94E2D5' # teal
white: '#BAC2DE' # subtext1
black: '0x414868'
red: '0xf7768e'
green: '0x9ece6a'
yellow: '0xe0af68'
blue: '0x7aa2f7'
magenta: '0xbb9af7'
cyan: '0x7dcfff'
white: '0xc0caf5'
indexed_colors:
- { index: 16, color: '#FAB387' }
- { index: 17, color: '#F5E0DC' }
- { index: 16, color: '0xff9e64' }
- { index: 17, color: '0xdb4b4b' }
# Visual Bell
#
# Any time the BEL code is received, Alacritty "rings" the visual bell. Once
# rung, the terminal background will be set to white and transition back to the
# default background color. You can control the rate of this transition by
# setting the `duration` property (represented in milliseconds). You can also
# configure the transition function by setting the `animation` property.
#
# Possible values for `animation`
# `Ease`
# `EaseOut`
# `EaseOutSine`
# `EaseOutQuad`
# `EaseOutCubic`
# `EaseOutQuart`
# `EaseOutQuint`
# `EaseOutExpo`
# `EaseOutCirc`
# `Linear`
#
# To completely disable the visual bell, set its duration to 0.
#
# visual_bell:
# animation: EaseOutExpo
# duration: 0
# Key bindings
#
# Each binding is defined as an object with some properties. Most of the
# properties are optional. All of the alphabetical keys should have a letter for
# the `key` value such as `V`. Function keys are probably what you would expect
# as well (F1, F2, ..). The number keys above the main keyboard are encoded as
# `Key1`, `Key2`, etc. Keys on the number pad are encoded `Number1`, `Number2`,
# etc. These all match the glutin::VirtualKeyCode variants.
#
# Possible values for `mods`
# `Command`, `Super` refer to the super/command/windows key
# `Control` for the control key
# `Shift` for the Shift key
# `Alt` and `Option` refer to alt/option
#
# mods may be combined with a `|`. For example, requiring control and shift
# looks like:
#
# mods: Control|Shift
#
# The parser is currently quite sensitive to whitespace and capitalization -
# capitalization must match exactly, and piped items must not have whitespace
# around them.
#
# Either an `action`, `chars`, or `command` field must be present.
# `action` must be one of `Paste`, `PasteSelection`, `Copy`, or `Quit`.
# `chars` writes the specified string every time that binding is activated.
# These should generally be escape sequences, but they can be configured to
# send arbitrary strings of bytes.
# `command` must be a map containing a `program` string, and `args` array of
# strings. For example:
# - { ... , command: { program: "alacritty", args: ["-e", "vttest"] } }
key_bindings:
- { key: V, mods: Command, action: Paste }
- { key: C, mods: Command, action: Copy }

View File

@@ -1,14 +1,14 @@
#!/usr/bin/env bash
# shellcheck source="../scripts/shared.sh"
# shellcheck disable=1091,2139
source "$DOTFILES/scripts/shared.sh"
DOTFILES="$HOME/.dotfiles"
# Get installed php versions from brew and setup aliases
function x-set-php-aliases
{
have brew && {
x-have brew && {
local php_versions=()
while IFS="" read -r line; do php_versions+=("$line"); done < <(brew_installed | grep '^php')
while IFS="" read -r line; do php_versions+=("$line"); done < <(bkt -- brew list | grep '^php')
php_error_reporting='-d error_reporting=22527'
@@ -61,8 +61,8 @@ alias please="sudo "
# Color the grep output
alias grep='grep --color'
! have eza && alias ls='ls --color=auto'
have eza && {
! x-have eza && alias ls='ls --color=auto'
x-have eza && {
alias ls='eza -h -s=type --git --icons --group-directories-first'
}
@@ -106,9 +106,6 @@ alias updatedb="sudo /usr/libexec/locate.updatedb"
# Always return full history
alias history="history 1"
alias pip="pip3 "
alias python="python3 "
# tmux: automatically attach or create session with name 'main'
alias tmux='tmux new-session -A -s main'
# tmux: attach or create new session
@@ -147,5 +144,71 @@ if [[ -f "$HOME/.aliases.local" ]]; then
source "$HOME/.aliases.local"
fi
alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts"
alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts"
alias svn="svn --config-dir $XDG_CONFIG_HOME/subversion"
# Alacritty preexec hook to update dynamic title
preexec()
{
print -Pn "\e]0;$1%~\a"
}
# Update dotfiles
dfu()
{
(
cd "$DOTFILES" && git pull --ff-only && ./install -q
)
}
# Weather in Tampere, or other city
weather()
{
# https://github.com/chubin/wttr.in#usage
local city="${1:-Tampere}"
curl "http://wttr.in/${city// /+}?2nFQM&lang=fi"
}
# Docker
ssh-docker()
{
docker exec -it "$@" bash
}
# All the dig info
digga()
{
dig +nocmd "$1" any +multiline +noall +answer
}
# Rector project to php version 8.2 by default.
rector()
{
local php="${1:-82}"
docker run -v "$(pwd)":/project rector/rector:latest process \
"/project/$1" \
--set "php${php}" \
--autoload-file /project/vendor/autoload.php
}
# Commit everything
commit()
{
commitMessage="$*"
if [ "$commitMessage" = "" ]; then
commitMessage="Automated commit"
fi
git add .
eval "git commit -a -m '${commitMessage}'"
}
scheduler()
{
while :; do
php artisan schedule:run
echo "Sleeping 60 seconds..."
sleep 60
done
}

View File

@@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Setting aliases for tunkki
alias nvim="/snap/nvim/current/usr/bin/nvim"

View File

@@ -0,0 +1,320 @@
# Default settings for amethyst
# Repo: `https://github.com/ianyh/Amethyst`
#
# Note due to issue 1419 (https://github.com/ianyh/Amethyst/issues/1419) some
# config values may conflict and not work if they are the same as the default
# values for amathyst. You can see these values on github at
# https://github.com/ianyh/Amethyst/blob/development/Amethyst/default.amethyst
# If you're experiencing conflicts and the settings are the same as the default,
# comment out the commands in this file.
#
# Move this file to: `~/.amethyst.yml`
# In order to register changes restart Amethyst.
# If you experience issues pulling in the changes you can also quit Amethyst and run: `defaults delete com.amethyst.Amethyst.plist`
# This removes the current preferences and causes Amethyst to restart with default preferences and pull configs from this file.
# layouts - Ordered list of layouts to use by layout key (default tall, wide, fullscreen, and column).
layouts:
- bsp
- tall
# - fullscreen
# - tall-right
# - wide
# - two-pane
# - middle-wide
- 3column-left
# - 3column-middle
# - 3column-right
# - 4column-left
# - 4column-right
# - column
# - row
# - floating
- widescreen-tall
# - widescreen-tall-right
# - bsp
# First mod (default option + shift).
mod1:
- option
- shift
# - control
# - command
# Second mod (default option + shift + control).
mod2:
- option
- shift
- control
# - command
# Commands:
# special key values
# space
# enter
# up
# right
# down
# left
# special characters require quotes
# '.'
# ','
# Move to the next layout in the list.
cycle-layout:
mod: mod1
key: space
# Move to the previous layout in the list.
cycle-layout-backward:
mod: mod2
key: space
# Shrink the main pane by a percentage of the screen dimension as defined by window-resize-step. Note that not all layouts respond to this command.
shrink-main:
mod: mod1
key: h
# Expand the main pane by a percentage of the screen dimension as defined by window-resize-step. Note that not all layouts respond to this command.
expand-main:
mod: mod1
key: l
# Increase the number of windows in the main pane. Note that not all layouts respond to this command.
increase-main:
mod: mod1
key: ','
# Decrease the number of windows in the main pane. Note that not all layouts respond to this command.
decrease-main:
mod: mod1
key: '.'
# General purpose command for custom layouts. Functionality is layout-dependent.
# command1:
# mod: <NONE>
# key: <NONE>
# General purpose command for custom layouts. Functionality is layout-dependent.
# command2:
# mod: <NONE>
# key: <NONE>
# General purpose command for custom layouts. Functionality is layout-dependent.
# command3:
# mod: <NONE>
# key: <NONE>
# General purpose command for custom layouts. Functionality is layout-dependent.
# command4:
# mod: <NONE>
# key: <NONE>
# Focus the next window in the list going counter-clockwise.
focus-ccw:
mod: mod1
key: j
# Focus the next window in the list going clockwise.
focus-cw:
mod: mod1
key: k
# Focus the main window in the list.
focus-main:
mod: mod1
key: m
# Focus the next screen in the list going counter-clockwise.
focus-screen-ccw:
mod: mod1
key: p
# Focus the next screen in the list going clockwise.
focus-screen-cw:
mod: mod1
key: n
# Move the currently focused window onto the next screen in the list going counter-clockwise.
swap-screen-ccw:
mod: mod2
key: h
# Move the currently focused window onto the next screen in the list going clockwise.
swap-screen-cw:
mod: mod2
key: l
# Swap the position of the currently focused window with the next window in the list going counter-clockwise.
swap-ccw:
mod: mod2
key: j
# Swap the position of the currently focused window with the next window in the list going clockwise.
swap-cw:
mod: mod2
key: k
# Swap the position of the currently focused window with the main window in the list.
swap-main:
mod: mod1
key: enter
# Move focus to the n-th screen in the list; e.g., focus-screen-3 will move mouse focus to the 3rd screen. Note that the main window in the given screen will be focused.
#focus-screen-n:
# focus-screen-<screen-number>:
# mod: mod1
# key: y
# Move the currently focused window to the n-th screen; e.g., throw-screen-3 will move the window to the 3rd screen.
# throw-screen-n:
# throw-screen-<screen-number>:
# mod: mod1
# key: u
# Move the currently focused window to the n-th space; e.g., throw-space-3 will move the window to the 3rd space.
# throw-space-<screen-number>:
# mod: mod1
# key: i
# Select tall layout
#select-tall-layout:
# mod: mod1
# key: a
# Select wide layout
#select-wide-layout:
# mod: mod1
# key: s
# Select fullscreen layout
select-fullscreen-layout:
mod: mod1
key: d
# Select column layout
select-column-layout:
mod: mod1
key: f
# Move the currently focused window to the space to the left.
throw-space-left:
mod: mod2
key: left
# Move currently the focused window to the space to the right.
throw-space-right:
mod: mod2
key: right
# Toggle the floating state of the currently focused window; i.e., if it was floating make it tiled and if it was tiled make it floating.
toggle-float:
mod: mod1
key: t
# Display the layout HUD with the current layout on each screen.
display-current-layout:
mod: mod1
key: i
# Turn on or off tiling entirely.
toggle-tiling:
mod: mod1
key: t
# Rerun the current layout's algorithm.
reevaluate-windows:
mod: mod1
key: z
# Turn on or off focus-follows-mouse.
toggle-focus-follows-mouse:
mod: mod2
key: x
# Automatically quit and reopen Amethyst.
relaunch-amethyst:
mod: mod2
key: z
# disable screen padding on builtin display
disable-padding-on-builtin-display: false
# Boolean flag for whether or not to add margins betwen windows (default false).
window-margins: false
# Boolean flag for whether or not to set window margins if there is only one window on the screen, assuming window margins are enabled (default false).
smart-window-margins: true
# # Add 10px margin between windows
# window-margins: true
# window-margin-size: 5
# The size of the margins between windows (in px, default 0).
window-margin-size: 0
# The max number of windows that may be visible on a screen at one time before
# additional windows are minimized. A value of 0 disables the feature.
window-max-count: 0
# The smallest height that a window can be sized to regardless of its layout frame (in px, default 0).
window-minimum-height: 0
# The smallest width that a window can be sized to regardless of its layout frame (in px, default 0)
window-minimum-width: 0
# List of bundle identifiers for applications to either be automatically floating or automatically tiled based on floating-is-blacklist (default []).
floating: []
# Boolean flag determining behavior of the floating list.
# true if the applications should be floating and all others tiled. false if the applications should be tiled and all others floating (default true).
floating-is-blacklist: false
# true if screen frames should exclude the status bar. false if the screen frames should include the status bar (default false).
ignore-menu-bar: false
# true if windows smaller than a 500px square should be floating by default (default true)
float-small-windows: true
# true if the mouse should move position to the center of a window when it becomes focused (default false). Note that this is largely incompatible with focus-follows-mouse.
mouse-follows-focus: false
# true if the windows underneath the mouse should become focused as the mouse moves (default false). Note that this is largely incompatible with mouse-follows-focus
focus-follows-mouse: false
# true if dragging and dropping windows on to each other should swap their positions (default false).
mouse-swaps-windows: true
# true if changing the frame of a window with the mouse should update the layout to accommodate the change (default false). Note that not all layouts will be able to respond to the change.
mouse-resizes-windows: true
# true to display the name of the layout when a new layout is selected (default true).
enables-layout-hud: true
# true to display the name of the layout when moving to a new space (default true).
enables-layout-hud-on-space-change: true
# true to get updates to beta versions of the software (default false).
use-canary-build: false
# true to insert new windows into the first position and false to insert new windows into the last position (default false).
new-windows-to-main: false
# true to automatically move to a space when throwing a window to it (default true).
follow-space-thrown-windows: true
# The integer percentage of the screen dimension to increment and decrement main pane ratios by (default 5).
window-resize-step: 5
# Padding to apply between windows and the left edge of the screen (in px, default 0).
screen-padding-left: 0
# Padding to apply between windows and the right edge of the screen (in px, default 0).
screen-padding-right: 0
# Padding to apply between windows and the top edge of the screen (in px, default 0).
screen-padding-top: 0
# Padding to apply between windows and the bottom edge of the screen (in px, default 0).
screen-padding-bottom: 0
# true to maintain layout state across application executions (default true).
restore-layouts-on-launch: true
# true to display some optional debug information in the layout HUD (default false).
debug-layout-info: true

View File

@@ -0,0 +1,35 @@
/**
* Almost Maximize
* Almost maximizes the window to the screen, leaving a small margin.
*
* @author Ville Viklund <https://github.com/ville6000>
*
* @param {Object} windows - All windows in the current space.
* @param {Object} screenFrame - The frame of the current screen.
* @param {Object} state - The state of the current space.
* @param {Object} extendedFrames - The frames of the windows in the current space.
* @return {Object} - The frames for the windows in the current space.
*/
function layout() {
return {
name: 'Almost Maximize',
getFrameAssignments: (windows, screenFrame, state, extendedFrames) => {
const width = screenFrame.width * 0.95
const height = screenFrame.height * 0.95
const x = (screenFrame.width - width) / 2
const y = (screenFrame.height - height) / 2
const windowFrames = {}
windows.forEach(window => {
windowFrames[window.id] = {
Y: screenFrame.y + y,
x: screenFrame.x + x,
width,
height,
}
})
return windowFrames
},
}
}

View File

@@ -2,28 +2,61 @@
# shellcheck shell=bash
# vim: filetype=zsh
export DOTFILES="$HOME/.dotfiles"
source "$DOTFILES/scripts/shared.sh"
path_prepend "$DOTFILES/local/bin"
# if cargo directory exists, add it to path
if [[ -d "$HOME/.local/share/cargo/bin" ]]; then
export PATH="$HOME/.local/share/cargo/bin:$PATH"
fi
# 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"
# Cache commands using bkt if installed
if command -v bkt >&/dev/null; then
bkt()
{
command bkt --cache-dir="$XDG_CACHE_HOME/bkt" "$@"
}
else
# If bkt isn't installed skip its arguments and just execute directly.
# Optionally write a msg to stderr suggesting users install bkt.
bkt()
{
while [[ "$1" == --* ]]; do shift; done
"$@"
}
fi
# custom variables
export XDG_BIN_HOME="$HOME/.local/bin"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_RUNTIME_DIR="$HOME/.local/run"
# shorthand for checking if the system has the bin in path,
# this version does not use caching
# usage: have_command php && php -v
function have_command
{
command -v "$1" >&/dev/null
}
path_append "/opt/homebrew/bin"
have brew && eval "$(brew shellenv)"
# shorthand for checking if the system has the bin in path,
# this version uses caching
# usage: have php && php -v
function have
{
bkt -- which "$1" >&/dev/null
}
path_append "/usr/local/bin"
path_prepend "$XDG_BIN_HOME"
function brew_installed
{
bkt -- brew list
}
# shorthand for checking if brew package is installed
# usage: have_brew php && php -v
function have_brew
{
! have brew && return 125
if bkt -- brew list "$1" &> /dev/null; then
return 0
else
return 1
fi
}
source "$DOTFILES/config/exports-shell"
source "$DOTFILES/config/exports-apps"
have nvim && export EDITOR="nvim"

View File

@@ -4,9 +4,6 @@
# shellcheck disable=1091,2139
# vim: filetype=bash
: "${DOTFILES:=$HOME/.dotfiles}"
source "$DOTFILES/scripts/shared.sh"
# Antigen configuration
# https://github.com/zsh-users/antigen/wiki/Configuration
export ADOTDIR="$XDG_DATA_HOME/antigen"
@@ -24,17 +21,15 @@ x-dc "$ANSIBLE_GALAXY_CACHE_DIR"
export ANDROID_HOME="$XDG_DATA_HOME/android"
# bob manages nvim versions
have bob && {
path_prepend "$XDG_DATA_HOME/bob/nvim-bin"
have nvim && export EDITOR="nvim"
}
x-path-prepend "$XDG_DATA_HOME/bob/nvim-bin"
x-have nvim && export EDITOR="nvim"
export HOMEBREW_NO_ENV_HINTS=true
# composer, https://getcomposer.org/
export COMPOSER_HOME="$XDG_STATE_HOME/composer"
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
path_append "$COMPOSER_BIN"
x-path-append "$COMPOSER_BIN"
# docker, https://docs.docker.com/engine/reference/commandline/cli/
export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
@@ -44,7 +39,7 @@ export DOCKER_SCAN_SUGGEST=false
# ffmpeg
export FFMPEG_DATADIR="$XDG_CONFIG_HOME/ffmpeg"
have ffmpeg && x-dc "$FFMPEG_DATADIR"
x-have ffmpeg && x-dc "$FFMPEG_DATADIR"
# GnuPG
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
@@ -58,14 +53,14 @@ export NBRC_PATH="$XDG_CONFIG_HOME/nbrc"
export NB_DIR="$XDG_STATE_HOME/nb"
# NPM: Add npm packages to path
have node && {
x-have node && {
NVM_NODE_BIN_DIR="$(dirname "$(which node)")"
path_append "$NVM_NODE_BIN_DIR"
x-path-append "$NVM_NODE_BIN_DIR"
}
# op (1Password cli) is present
export OP_CACHE="$XDG_STATE_HOME/1password"
have op && {
x-have op && {
[ "$DOTFILES_CURRENT_SHELL" = "zsh" ] && {
eval "$(op completion zsh)"
compdef _op op
@@ -77,8 +72,8 @@ have op && {
# pyenv, python environments
export WORKON_HOME="$XDG_DATA_HOME/virtualenvs"
export PYENV_ROOT="$XDG_STATE_HOME/pyenv"
have pyenv && {
path_append "$PYENV_ROOT/shims"
x-have pyenv && {
x-path-append "$PYENV_ROOT/shims"
eval "$(pyenv init -)"
}
@@ -92,8 +87,8 @@ export BUNDLE_USER_CACHE="$XDG_CACHE_HOME"/bundle
export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME"/bundle
export RBENV_ROOT="$XDG_STATE_HOME/rbenv"
x-dc "$RBENV_ROOT"
have gem && path_append "${GEM_HOME}/bin"
have rbenv && {
x-have gem && x-path-append "${GEM_HOME}/bin"
x-have rbenv && {
[ "$DOTFILES_CURRENT_SHELL" = "zsh" ] && eval "$(rbenv init - zsh)"
[ "$DOTFILES_CURRENT_SHELL" = "bash" ] && eval "$(rbenv init - bash)"
}
@@ -101,7 +96,7 @@ have rbenv && {
# Rust / cargo
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
export CARGO_HOME="$XDG_DATA_HOME/cargo"
path_append "$CARGO_HOME/bin"
x-path-append "$CARGO_HOME/bin"
# screen
export SCREENRC="$XDG_CONFIG_HOME/misc/screenrc"

View File

@@ -3,7 +3,7 @@
## LUA
have luarocks && $(luarocks path --bin)
path_append "$HOME/.local/go/bin"
path_prepend "$HOME/.local/go/bin"
alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state'
alias nano='nano -wS -$'

View File

@@ -4,7 +4,17 @@
# vim: filetype=bash
export DOTFILES="$HOME/.dotfiles"
source "$DOTFILES/scripts/shared.sh"
# 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"
# custom variables
export XDG_BIN_HOME="$HOME/.local/bin"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_RUNTIME_DIR="$HOME/.local/run"
export LC_ALL=fi_FI.UTF-8
@@ -44,36 +54,3 @@ export GREP_OPTIONS="--color=auto"
# update the values of LINES and COLUMNS.
hash shopt 2> /dev/null && shopt -s checkwinsize
# 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 [ "$DOTFILES_CURRENT_SHELL" = "-zsh" ]; then
[[ $ZSH_VERSION != "" ]] && {
autoload -U colors zsh/terminfo compinit
colors
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
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"
# fzf
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh ] \
&& source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh
# 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"
}
fi
# If we are using bash
if [ "$DOTFILES_CURRENT_SHELL" = "bash" ]; then
# shellcheck source=../config/fzf/fzf.bash
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] &&
source "${DOTFILES}/config/fzf/fzf.bash"
fi

View File

@@ -1,73 +1,3 @@
#!/usr/bin/env bash
#
# shell functions
#
# shellcheck source="../scripts/shared.sh"
export DOTFILES="$HOME/.dotfiles"
source "$DOTFILES/scripts/shared.sh"
# Alacritty preexec hook to update dynamic title
preexec()
{
print -Pn "\e]0;$1%~\a"
}
# Update dotfiles
dfu()
{
(
cd "$DOTFILES" && git pull --ff-only && ./install -q
)
}
# Weather in Tampere, or other city
weather()
{
# https://github.com/chubin/wttr.in#usage
local city="${1:-Tampere}"
curl "http://wttr.in/${city// /+}?2nFQM&lang=fi"
}
# Docker
ssh-docker()
{
docker exec -it "$@" bash
}
# All the dig info
digga()
{
dig +nocmd "$1" any +multiline +noall +answer
}
# Rector project to php version 8.2 by default.
rector()
{
local php="${1:-82}"
docker run -v "$(pwd)":/project rector/rector:latest process \
"/project/$1" \
--set "php${php}" \
--autoload-file /project/vendor/autoload.php
}
# Commit everything
commit()
{
commitMessage="$*"
if [ "$commitMessage" = "" ]; then
commitMessage="Automated commit"
fi
git add .
eval "git commit -a -m '${commitMessage}'"
}
scheduler()
{
while :; do
php artisan schedule:run
echo "Sleeping 60 seconds..."
sleep 60
done
}

View File

@@ -18,10 +18,12 @@ tap "xwmx/taps"
brew "act"
# Mozilla CA certificate store
brew "ca-certificates"
# Interpreted, interactive, object-oriented programming language
brew "python@3.11"
# YAML Parser
brew "libyaml"
# Cryptography and SSL/TLS Toolkit
brew "openssl@3"
# Interpreted, interactive, object-oriented programming language
brew "python@3.11"
# Automate deployment, configuration, and upgrading
brew "ansible"
# Checks ansible playbooks for practices and behaviour
@@ -103,13 +105,11 @@ 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"
brew "editorconfig-checker", link: false
# Useful examples at the command-line
brew "eg-examples"
# OpenType text shaping engine
brew "harfbuzz"
# Development kit for the Java programming language
brew "openjdk"
# Spellchecker wrapping library
brew "enchant"
# Run arbitrary commands when files change
brew "entr"
# Perl lib for reading and writing EXIF metadata
@@ -158,6 +158,8 @@ brew "gpgme"
brew "gpg-tui"
# Image manipulation
brew "netpbm"
# OpenType text shaping engine
brew "harfbuzz"
# Framework for layout and rendering of i18n text
brew "pango"
# Library to render SVG files using Cairo
@@ -180,6 +182,8 @@ brew "hugo"
brew "libheif"
# Tools and libraries to manipulate images in many formats
brew "imagemagick"
# Modular IRC client
brew "irssi"
# Lightweight and flexible command-line JSON processor
brew "jq"
# Network authentication protocol
@@ -194,12 +198,18 @@ brew "libvoikko"
brew "lolcat"
# Package manager for the Lua programming language
brew "luarocks"
# LZMA-based compression program similar to gzip or bzip2
brew "lzip"
# Swiss Army Knife for macOS
brew "m-cli"
# Mac App Store command-line interface
brew "mas"
# Mongrel of mail user agents (part elm, pine, mush, mh, etc.)
brew "mutt"
# NCurses Disk Usage
brew "ncdu"
# Ambitious Vim-fork focused on extensibility and agility
brew "neovim"
# HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server
brew "nginx"
# Port scanning utility for large networks
@@ -210,6 +220,8 @@ brew "nvm"
brew "openjdk@11"
# Generate clients, server & docs from an OpenAPI spec (v2, v3)
brew "openapi-generator"
# Development kit for the Java programming language
brew "openjdk"
# Swiss-army knife of markup format conversion
brew "pandoc"
# Highly capable, feature-rich programming language
@@ -318,6 +330,8 @@ brew "teamookla/speedtest/speedtest"
cask "1password-cli"
# GPU-accelerated terminal emulator
cask "alacritty"
# Automatic tiling window manager similar to xmonad
cask "amethyst"
# Turn audio CDs and files into audiobooks
cask "audiobook-builder"
# Text editor
@@ -390,6 +404,8 @@ cask "rsyncosx"
cask "rsyncui"
# MySQL/MariaDB database management
cask "sequel-ace"
# Plugin for AWS CLI to start and end sessions that connect to managed instances
cask "session-manager-plugin"
# Collection of apps available by subscription
cask "setapp"
# Team communication and collaboration software
@@ -419,6 +435,8 @@ mas "Pages", id: 409201541
mas "Pixelmator Pro", id: 1289583905
mas "Tailscale", id: 1475387142
mas "Xcode", id: 497799835
vscode "4ops.terraform"
vscode "adamiBs.terraform-live-graph"
vscode "akamud.vscode-theme-onelight"
vscode "amiralizadeh9480.laravel-extra-intellisense"
vscode "andrewleedham.vscode-css-modules"
@@ -440,11 +458,14 @@ vscode "formulahendry.auto-rename-tag"
vscode "formulahendry.code-runner"
vscode "foxundermoon.shell-format"
vscode "gencer.html-slim-scss-css-class-completion"
vscode "GitHub.copilot"
vscode "GitHub.copilot-chat"
vscode "github.vscode-github-actions"
vscode "GitHub.vscode-pull-request-github"
vscode "GraphQL.vscode-graphql"
vscode "GraphQL.vscode-graphql-execution"
vscode "GraphQL.vscode-graphql-syntax"
vscode "hashicorp.terraform"
vscode "heybourn.headwind"
vscode "JohnnyMorganz.stylua"
vscode "jumpinjackie.vscode-map-preview"
@@ -456,6 +477,7 @@ vscode "mikestead.dotenv"
vscode "MisterJ.vue-volar-extention-pack"
vscode "MrChetan.phpstorm-parameter-hints-in-vscode"
vscode "mrorz.language-gettext"
vscode "ms-azuretools.vscode-azureterraform"
vscode "ms-azuretools.vscode-docker"
vscode "ms-python.python"
vscode "ms-python.vscode-pylance"
@@ -465,6 +487,7 @@ vscode "ms-toolsai.vscode-jupyter-cell-tags"
vscode "ms-toolsai.vscode-jupyter-slideshow"
vscode "ms-vscode-remote.remote-containers"
vscode "ms-vscode-remote.remote-wsl"
vscode "ms-vscode.azure-account"
vscode "ms-vscode.cpptools"
vscode "msjsdiag.vscode-react-native"
vscode "mtxr.sqltools"

View File

@@ -1,4 +1,13 @@
# vim:noext ft=conf;
servers = (
{
address = "irc.cc.tut.fi";
chatnet = "IRCNet";
port = "6667";
own_host = "kapsi.fi";
family = "inet";
autoconnect = "no";
},
{ address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; },
{
address = "ssl.efnet.org";
@@ -315,4 +324,5 @@ settings = {
nick = "ivuorinen";
};
"fe-common/core" = { theme = "lyynx"; };
"fe-text" = { actlist_sort = "refnum"; };
};

View File

@@ -1,5 +1,3 @@
{
"diagnostics.globals": [
"vim"
]
}
"diagnostics.globals": ["vim"]
}

View File

@@ -1,69 +0,0 @@
{
"LazyVim": { "branch": "main", "commit": "6f9adbd4fba4132bd4f12404bd2b90c4a28ff136" },
"LuaSnip": { "branch": "master", "commit": "480b032f6708573334f4437d3f83307d143f1a72" },
"SchemaStore.nvim": { "branch": "main", "commit": "9a4e2f8da367ab671a6d7bf8b5b82e125c71a645" },
"alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" },
"animation.nvim": { "branch": "main", "commit": "fb77091ab72ec9971aee0562e7081182527aaa6a" },
"bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" },
"bufferline.nvim": { "branch": "main", "commit": "6ecd37e0fa8b156099daedd2191130e083fb1490" },
"catppuccin": { "branch": "main", "commit": "3d9a5ed556e289bce6c1fb0af89ec838360641b2" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"comment-box.nvim": { "branch": "main", "commit": "dd1a48f8d06102e9b87ae1e0069bc365c006979b" },
"dressing.nvim": { "branch": "master", "commit": "73a7d54b5289000108c7f52402a36cf380fced67" },
"edgy.nvim": { "branch": "main", "commit": "4ccc1c67ae2b1a0c55f18c83d03b714e2bb1bae4" },
"flash.nvim": { "branch": "main", "commit": "0256d8ecab33a9aa69fdaaf885db22e1103e2a3a" },
"friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" },
"gitsigns.nvim": { "branch": "main", "commit": "bdeba1cec3faddd89146690c10b9a87949c0ee66" },
"indent-blankline.nvim": { "branch": "master", "commit": "2ec42d26c933e7a129fe056dfc11a207afff252d" },
"lazy.nvim": { "branch": "main", "commit": "753c391b44daadafb0e821d4a4dfd72c4fac6f43" },
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "81e30dd629de24cbb26d08073ee938ab40006695" },
"mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" },
"middleclass": { "branch": "master", "commit": "9fab4d5bca67262614960960ca35c4740eb2be2c" },
"mini.ai": { "branch": "main", "commit": "7ae226f331885e6f30e9a8229e113debc59308ae" },
"mini.animate": { "branch": "main", "commit": "989ac014933ab5cd14ab83f2fce4b9a08ca6d81e" },
"mini.bufremove": { "branch": "main", "commit": "7821606e35c1ac931b56d8e3155f45ffe76ee7e5" },
"mini.comment": { "branch": "main", "commit": "877acea5b2a32ff55f808fc0ebe9aa898648318c" },
"mini.indentscope": { "branch": "main", "commit": "f60e9b51a6214c73a170ffc5445ce91560981031" },
"mini.pairs": { "branch": "main", "commit": "dfa9f6e2576bb8853be277d96b735af59d9be7c2" },
"mini.surround": { "branch": "main", "commit": "9d1956b576d7051da3a483b251dfc778121c60db" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "71f1841ba6c652908678cece623f52c1fea8a6cd" },
"neoconf.nvim": { "branch": "main", "commit": "86ed5b91927b65352e3d8f315f8256a180805377" },
"neodev.nvim": { "branch": "main", "commit": "58b1c0740e8ad79ce71e2649a449bb90536435cf" },
"neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" },
"noice.nvim": { "branch": "main", "commit": "396f9146529130904e07c45e90ecdbfa607534f3" },
"none-ls.nvim": { "branch": "main", "commit": "68645e56d10b5120a3fdc7467601f1ea497635e6" },
"nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" },
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
"nvim-lspconfig": { "branch": "master", "commit": "61b40df9c17943e43e7e698873caab0e7dbcdadc" },
"nvim-navic": { "branch": "master", "commit": "0ffa7ffe6588f3417e680439872f5049e38a24db" },
"nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" },
"nvim-regexplainer": { "branch": "main", "commit": "4250c8f3c1307876384e70eeedde5149249e154f" },
"nvim-spectre": { "branch": "master", "commit": "97cfd1b0f5a6ab35979ce1bee6c17f54745fd1e5" },
"nvim-treesitter": { "branch": "master", "commit": "16ea2969ea0a5ba902fceece9b2db10c7c9ba2d6" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "95e9ba9de4289d221666b66fd930d157c7ca08c6" },
"nvim-ufo": { "branch": "main", "commit": "6f2ccdf2da390d62f8f9e15fc5ddbcbd312e1e66" },
"nvim-web-devicons": { "branch": "master", "commit": "45d0237c427baba8cd05e0ab26d30e2ee58c2c82" },
"persistence.nvim": { "branch": "main", "commit": "4b8051c01f696d8849a5cb8afa9767be8db16e40" },
"plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" },
"promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" },
"stickybuf.nvim": { "branch": "master", "commit": "e3db41f2c1bb2df3ee6ff964ee74fe991f6f9566" },
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
"tabnine": { "branch": "master", "commit": "2c06b4865415701dc638549032824664e114ee23" },
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" },
"telescope.nvim": { "branch": "master", "commit": "ffe90fac32122f401429b14d383137bd92a685d0" },
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
"tokyonight.nvim": { "branch": "main", "commit": "e89caa3ad6d8da9d0dd981ec74a82c55adc61ffd" },
"trouble.nvim": { "branch": "main", "commit": "3f85d8ed30e97ceeddbbcf80224245d347053711" },
"venv-selector.nvim": { "branch": "main", "commit": "14d6e866070f759e9014a8053954f835294f56f9" },
"vim-illuminate": { "branch": "master", "commit": "1b5d70332a51a1de05f281069851865a2bb1e6d7" },
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
"vim-wakatime": { "branch": "master", "commit": "0d2efa2daff34b27b0d227d4c3b136811c93db93" },
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },
"windows.nvim": { "branch": "main", "commit": "c7492552b23d0ab30325e90b56066ec51242adc8" }
}

28
config/nvim/lazyvim.json Normal file
View File

@@ -0,0 +1,28 @@
{
"extras": [
"lazyvim.plugins.extras.coding.copilot",
"lazyvim.plugins.extras.editor.aerial",
"lazyvim.plugins.extras.editor.leap",
"lazyvim.plugins.extras.editor.symbols-outline",
"lazyvim.plugins.extras.formatting.black",
"lazyvim.plugins.extras.formatting.prettier",
"lazyvim.plugins.extras.lang.docker",
"lazyvim.plugins.extras.lang.go",
"lazyvim.plugins.extras.lang.json",
"lazyvim.plugins.extras.lang.markdown",
"lazyvim.plugins.extras.lang.python",
"lazyvim.plugins.extras.lang.tailwind",
"lazyvim.plugins.extras.lang.terraform",
"lazyvim.plugins.extras.lang.typescript",
"lazyvim.plugins.extras.lang.yaml",
"lazyvim.plugins.extras.linting.eslint",
"lazyvim.plugins.extras.ui.edgy",
"lazyvim.plugins.extras.ui.mini-animate",
"lazyvim.plugins.extras.util.dot",
"lazyvim.plugins.extras.vscode"
],
"news": {
"NEWS.md": "2123"
},
"version": 2
}

View File

@@ -13,20 +13,18 @@ require("lazy").setup({
"LazyVim/LazyVim",
import = "lazyvim.plugins",
},
-- import any extras modules here
{ import = "lazyvim.plugins.extras.formatting.prettier" },
{ import = "lazyvim.plugins.extras.lang.docker" },
{ import = "lazyvim.plugins.extras.lang.go" },
{ import = "lazyvim.plugins.extras.lang.json" },
{ import = "lazyvim.plugins.extras.lang.python" },
{ import = "lazyvim.plugins.extras.lang.tailwind" },
{ import = "lazyvim.plugins.extras.lang.terraform" },
{ import = "lazyvim.plugins.extras.lang.typescript" },
{ import = "lazyvim.plugins.extras.lang.yaml" },
{ import = "lazyvim.plugins.extras.linting.eslint" },
{ import = "lazyvim.plugins.extras.ui.edgy" },
{ import = "lazyvim.plugins.extras.ui.mini-animate" },
-- import/override with your plugins
{
"folke/tokyonight.nvim",
opts = {
style = "night",
transparent = true,
sidebars = { "qf", "vista_kind", "terminal", "packer" },
styles = {
sidebars = "transparent",
floats = "transparent",
},
},
},
{ import = "plugins" },
},
defaults = {

View File

@@ -7,6 +7,7 @@ local opt = vim.opt
opt.number = true
opt.relativenumber = true
opt.modeline = true
vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et

View File

@@ -72,6 +72,26 @@ return {
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"actionlint",
"ansible-language-server",
"ansible-lint",
"bash-language-server",
"blade-formatter",
"cfn-lint",
"codeql",
"codespell",
"commitlint",
"diagnostic-languageserver",
"docker-compose-language-service",
"dockerfile-language-server",
"editorconfig-checker",
"fixjson",
"html-lsp",
"jq",
"nginx-language-server",
"php-cs-fixer",
"semgrep",
"sonarlint-language-server",
"stylua",
"shellcheck",
"shfmt",
@@ -79,20 +99,6 @@ return {
},
},
},
-- Tabnine Client for Neovim
-- https://github.com/codota/tabnine-nvim
{
"codota/tabnine-nvim",
name = "tabnine",
-- enabled = false,
build = vim.loop.os_uname().sysname == "Windows_NT" and "pwsh.exe -file .\\dl_binaries.ps1" or "./dl_binaries.sh",
cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" },
event = "User",
opts = {
accept_keymap = "<C-e>",
dismiss_keymap = "<C-Esc>",
},
},
-- Vim plugin for automatic time tracking and metrics generated from your programming activity.
-- https://github.com/wakatime/vim-wakatime
{ "wakatime/vim-wakatime", lazy = false, enabled = true },

View File

@@ -103,7 +103,7 @@ return {
dependencies = {
"jose-elias-alvarez/typescript.nvim",
init = function()
require("lazyvim.util").on_attach(function(_, buffer)
require("lazyvim.util.lsp").on_attach(function(_, buffer)
-- stylua: ignore
vim.keymap.set("n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })

View File

@@ -7,7 +7,7 @@ return {
},
setup = {
eslint = function()
require("lazyvim.util").on_attach(function(client)
require("lazyvim.util.lsp").on_attach(function(client)
if client.name == "eslint" then
client.server_capabilities.documentFormattingProvider = true
elseif client.name == "tsserver" then

View File

@@ -1,8 +1,8 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, {
"bash",
"html",
"javascript",
@@ -17,7 +17,7 @@ return {
"typescript",
"vim",
"yaml",
},
},
})
end,
},
}

View File

@@ -1,15 +1,5 @@
-- luacheck: globals vim
return {
{
"folke/tokyonight.nvim",
opts = {
transparent = true,
styles = {
sidebars = "transparent",
floats = "transparent",
},
},
},
-- Not UFO in the sky, but an ultra fold in Neovim.
-- https://github.com/kevinhwang91/nvim-ufo/
{
@@ -19,6 +9,20 @@ return {
dependencies = {
"kevinhwang91/promise-async",
{ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" },
{
"luukvbaal/statuscol.nvim",
config = function()
local builtin = require("statuscol.builtin")
require("statuscol").setup({
relculright = true,
segments = {
{ text = { builtin.foldfunc }, click = "v:lua.ScFa" },
{ text = { "%s" }, click = "v:lua.ScSa" },
{ text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
},
})
end,
},
},
init = function()
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
@@ -75,12 +79,6 @@ return {
end,
},
},
{
"simrat39/symbols-outline.nvim",
cmd = "SymbolsOutline",
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
config = true,
},
-- Indent guides for Neovim
-- https://github.com/lukas-reineke/indent-blankline.nvim
{ "lukas-reineke/indent-blankline.nvim" },
@@ -93,6 +91,9 @@ return {
-- Neovim plugin for locking a buffer to a window
-- https://github.com/stevearc/stickybuf.nvim
{ "stevearc/stickybuf.nvim", opts = {} },
-- A pretty window for previewing, navigating and editing your LSP locations
-- https://github.com/DNLHC/glance.nvim
{ "dnlhc/glance.nvim" },
-- Automatically expand width of the current window.
-- Maximizes and restore it. And all this with nice animations!
-- https://github.com/anuvyklack/windows.nvim

View File

@@ -85,62 +85,45 @@ set-option -g renumber-windows on
# set vi-mode
set-window-option -g mode-keys vi
# ╭──────────────────────────────────────────────────────────╮
# │ Plugins │
# ╰──────────────────────────────────────────────────────────╯
# Set plugins install dir
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.dotfiles/config/tmux/plugins'
## Install plugins, starting with plugin manager
set -g @tpm_plugins ' \
catppuccin/tmux \
tmux-plugins/tmux-continuum \
jaclu/tmux-menus \
ofirgall/tmux-window-name \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-sessionist \
tmux-plugins/tmux-yank \
tmux-plugins/tpm \
'
# Set theme to tokyonight
source-file ~/.dotfiles/config/tmux/tokyonight_storm.tmux
# ╭──────────────────────────────────────────────────────────╮
# │ Plugins related configurations │
# ╰──────────────────────────────────────────────────────────╯
## https://github.com/jaclu/tmux-menus
set -g @menus_trigger 'm'
# Plugin that lets you suspend local tmux session,
# so that you can work with nested remote tmux session painlessly.
# https://github.com/MunifTanjim/tmux-suspend
set -g @suspend_key 'F12'
## A plugin to name your tmux windows smartly.
## https://github.com/ofirgall/tmux-window-name
### Maximum name length of a window
set -g @tmux_window_name_max_name_len "20"
set -g @tmux_window_name_max_name_len "30"
### Replace $HOME with ~ in window names
set -g @tmux_window_name_use_tilde "True"
## https://github.com/catppuccin/tmux
set -g @catppuccin_flavour "mocha" # latte/frappe/macchiato/mocha
set -g @catppuccin_window_tabs_enabled on # or off to disable window_tabs
set -g @catppuccin_window_status_enable "yes"
## set -g @catppuccin_window_right_separator "█"
set -g @catppuccin_window_number_position "left"
set -g @catppuccin_window_middle_separator ": "
set -g @catppuccin_window_default_fill "none"
set -g @catppuccin_window_current_fill "all"
set -g @catppuccin_status_modules "application session date_time"
set -g @catppuccin_status_left_separator "█"
set -g @catppuccin_status_right_separator "█"
set -g @catppuccin_date_time_text "%Y-%m-%d %H:%M"
## https://github.com/tmux-plugins/tmux-continuum
set -g @continuum-restore 'on'
set -g @continuum-boot 'on'
## https://github.com/tmux-plugins/tmux-resurrect
set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-dir '$HOME/.local/state/tmux/tmux-resurrect'
# Finally run the tmux plugin manager
run '~/.dotfiles/config/tmux/plugins/tpm/tpm'
# Modified from tokyonight_storm to include tmux_mode_indicator
set -g status-right "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#1f2335] #{prefix_highlight} #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %H:%M #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#1d202f,bg=#7aa2f7,bold] #h #{tmux_mode_indicator}"
# ╭──────────────────────────────────────────────────────────╮
# │ Plugins │
# ╰──────────────────────────────────────────────────────────╯
run-shell ~/.dotfiles/config/tmux/plugins/tmux-sensible/sensible.tmux
run-shell ~/.dotfiles/config/tmux/plugins/tmux-window-name/tmux_window_name.tmux
run-shell ~/.dotfiles/config/tmux/plugins/tmux-resurrect/resurrect.tmux
run-shell ~/.dotfiles/config/tmux/plugins/tmux-continuum/continuum.tmux
run-shell ~/.dotfiles/config/tmux/plugins/tmux-sessionist/sessionist.tmux
run-shell ~/.dotfiles/config/tmux/plugins/tmux-mode-indicator/mode_indicator.tmux
run-shell ~/.dotfiles/config/tmux/plugins/tmux-suspend/suspend.tmux
run-shell ~/.dotfiles/config/tmux/plugins/tmux-yank/yank.tmux

View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
# TokyoNight colors for Tmux
set -g mode-style "fg=#7aa2f7,bg=#3b4261"
set -g message-style "fg=#7aa2f7,bg=#3b4261"
set -g message-command-style "fg=#7aa2f7,bg=#3b4261"
set -g pane-border-style "fg=#3b4261"
set -g pane-active-border-style "fg=#7aa2f7"
set -g status "on"
set -g status-justify "left"
set -g status-style "fg=#7aa2f7,bg=#1f2335"
set -g status-left-length "100"
set -g status-right-length "100"
set -g status-left-style NONE
set -g status-right-style NONE
set -g status-left "#[fg=#1d202f,bg=#7aa2f7,bold] #S #[fg=#7aa2f7,bg=#1f2335,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#1f2335] #{prefix_highlight} #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %I:%M %p #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#1d202f,bg=#7aa2f7,bold] #h "
if-shell '[ "$(tmux show-option -gqv "clock-mode-style")" == "24" ]' {
set -g status-right "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#1f2335] #{prefix_highlight} #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %H:%M #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#1d202f,bg=#7aa2f7,bold] #h "
}
setw -g window-status-activity-style "underscore,fg=#a9b1d6,bg=#1f2335"
setw -g window-status-separator ""
setw -g window-status-style "NONE,fg=#a9b1d6,bg=#1f2335"
setw -g window-status-format "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[default] #I  #W #F #[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=#1f2335,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261,bold] #I  #W #F #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]"
# tmux-plugins/tmux-prefix-highlight support
set -g @prefix_highlight_output_prefix "#[fg=#e0af68]#[bg=#1f2335]#[fg=#1f2335]#[bg=#e0af68]"
set -g @prefix_highlight_output_suffix ""

View File

@@ -1,294 +0,0 @@
# 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";
};

10
install
View File

@@ -18,8 +18,6 @@ git submodule update --init --recursive "${DOTBOT_DIR}"
-d "${BASEDIR}" \
--plugin-dir=tools/dotbot-brew \
--plugin-dir=tools/dotbot-include \
--plugin-dir=tools/dotbot-crontab \
--plugin-dir=tools/dotbot-snap \
--plugin-dir=tools/dotbot-pip \
-c "${CONFIG}" \
"${@}"
@@ -27,14 +25,12 @@ git submodule update --init --recursive "${DOTBOT_DIR}"
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" \
[ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] &&
echo "(!) Found $DOTBOT_HOST_CONFIG" &&
"$DOTBOT_BIN_PATH" \
-d "$BASEDIR" \
--plugin-dir=tools/dotbot-brew \
--plugin-dir=tools/dotbot-include \
--plugin-dir=tools/dotbot-crontab \
--plugin-dir=tools/dotbot-snap \
--plugin-dir=tools/dotbot-pip \
-c "$DOTBOT_HOST_CONFIG" \
"${@}"

View File

@@ -9,7 +9,6 @@
# Helper variables, override with ENVs like `VERBOSE=1 dfm help`
: "${VERBOSE:=0}"
: "${DOTFILES:=$HOME/.dotfiles}"
: "${SHARED_SCRIPT:=$DOTFILES/scripts/shared.sh}"
: "${BREWFILE:=$DOTFILES/config/homebrew/Brewfile}"
: "${HOSTFILES:=$DOTFILES/hosts}"
@@ -17,9 +16,9 @@ SCRIPT=$(basename "$0")
VERSION_NVM="v0.39.5"
export DOTFILES_SHARED_LOADED=""
export DOTFILES="$HOME/.dotfiles"
# shellcheck source=./../../scripts/shared.sh
source "$SHARED_SCRIPT"
source "$HOME/.dotfiles/scripts/shared.sh"
# Loads configs for better installation experience
x-load-configs
@@ -43,8 +42,10 @@ function section_install
"macos:Setup nice macOS defaults"
"neofetch:Install neofetch"
"nvm:Install Node Version Manager (nvm)"
"nvm-latest:Install latest lts node using nvm"
"npm:Install NPM Packages"
"ntfy:Install ntfy"
"ohmybash:Install oh-my-bash"
"pip:Install pip/python packages"
"z:Install z"
)
@@ -57,6 +58,7 @@ function section_install
$0 install fonts
$0 install antigen
$0 brew install
$0 install ohmybash
$0 install pip
$0 install cargo
$0 install composer
@@ -76,80 +78,113 @@ function section_install
msgr yay "All done!"
;;
antigen)
msg "Installing antigen..."
curl -sSfL git.io/antigen -o "$DOTFILES/local/bin/antigen.zsh" \
&& msg_yay "New antigen installed!"
;;
cargo)
msg "Installing cargo packages..."
bash "$DOTFILES/scripts/install-cargo-packages.sh" \
&& msg_yay "cargo packages installed!"
;;
cheat-databases)
msg "Installing cheat databases..."
for database in "$DOTFILES"/scripts/install-cheat-*; do
bash "$database" \
&& msg_yay "Cheat: $database run"
done
;;
composer)
msg "Installing composer..."
bash "$DOTFILES/scripts/install-composer.sh" \
&& msg_yay "composer installed!"
;;
dotenv)
msg "Installing dotenv-linter..."
curl -sSfL \
https://raw.githubusercontent.com/dotenv-linter/dotenv-linter/master/install.sh \
| sh -s -- -b "$XDG_BIN_HOME" \
&& msg_yay "dotenv-linter installed!"
;;
fonts)
msg "Installing fonts..."
bash "$DOTFILES/scripts/install-fonts.sh" \
&& msg_yay "Installed fonts!"
;;
fzf)
msg "Installing fzf..."
bash "$DOTFILES/scripts/install-fzf.sh" \
&& msg_yay "fzf installed!"
;;
gh)
msg "Installing GitHub CLI Extensions..."
bash "$DOTFILES/scripts/install-gh-extensions.sh" \
&& msg_yay "github cli extensions installed!"
;;
go)
msg "Installing Go Packages..."
bash "$DOTFILES/scripts/install-go-packages.sh" \
&& msg_yay "go packages installed!"
;;
imagick)
msg "Installing ImageMagick CLI..."
curl -L https://imagemagick.org/archive/binaries/magick > "$XDG_BIN_HOME/magick" \
&& chmod +x "$XDG_BIN_HOME/magick" \
&& msg_yay "imagick installed!"
;;
starship)
msg "Installing starship.rs..."
curl -sS https://starship.rs/install.sh | sh -s -- \
--bin-dir ~/.local/bin \
--yes \
&& msg_yay "starship installed!"
;;
macos)
msg "Setting up macOS defaults..."
bash "$DOTFILES/scripts/set-macos-defaults.sh" \
&& msg_yay "Brewfile defined apps has been installed!"
;;
neofetch)
msg "Installing neofetch..."
bash "$DOTFILES/scripts/install-neofetch.sh" \
&& msg_yay "neofetch installed!"
;;
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 "Installing nvm..."
curl -o- "https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION_NVM/install.sh" | bash
$0 install nvm-latest
msg_yay "nvm installed!"
;;
nvm-latest)
msg "Installing latest lts node..."
if [ -n "$NVM_DIR" ]; then
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
fi
nvm install --lts --latest-npm --default
git checkout "$DOTFILES/base/*"
msg_yay "latest lts node installed!"
;;
npm)
msg "NPM Packages install started..."
bash "$DOTFILES/scripts/install-npm-packages.sh" \
&& msg_yay "NPM Packages have been installed!"
;;
ntfy)
msg "ntfy install started..."
bash "$DOTFILES/scripts/install-ntfy.sh" \
&& msg_yay "ntfy installed!"
;;
pip) bash "$DOTFILES/scripts/install-pip-packages.sh" ;;
ohmybash)
msg "oh-my-bash install started..."
bash "$DOTFILES/scripts/install-ohmybash.sh" \
&& msg_yay "oh-my-bash installed!"
;;
pip)
msg "pip install started..."
bash "$DOTFILES/scripts/install-pip-packages.sh"
;;
z)
msg "Installing z..."
bash "$DOTFILES/scripts/install-z.sh" \
&& msg_yay "z has been installed!"
;;

23
local/bin/git-fsck-dirs Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# FSCK subfolders git projects.
#
# Actions taken: git fsck --no-dangling --full
#
# Copyright 2023 Ismo Vuorinen. All Rights Reserved.
# License: MIT <https://opensource.org/license/mit/>
STARTING_PATH=${1:-$(pwd)}
DIRS=$(find "$STARTING_PATH" -mindepth 1 -maxdepth 1 -type d)
for DIR in $DIRS; do
echo "-> Processing dir: $DIR"
cd "$DIR" || exit 1
if [ -d "$DIR/.git" ]; then
git fsck --no-dangling --full --no-progress
echo ""
fi
done
echo ""
echo "Done."

14
local/bin/git-update-dirs Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
#
# Updates subfolders git projects.
#
# Actions taken: pull with rebase, autostashes own changes
# and prunes branches no longer in the remote.
#
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
# License: MIT <https://opensource.org/license/mit/>
for f in */; do (cd "$f" && echo "-> $f" && git pull --rebase --autostash --prune); done
echo "Done."
echo ""

View File

@@ -1,4 +1,12 @@
#!/usr/bin/env bash
#
# Backup a folder with a timestamp
# Usage: x-backup-folder folder_to_backup [filename]
# If filename is not provided, folder_to_backup will be used
# Example: x-backup-folder ~/Documents/MyFolder
#
# Copyright (c) 2022 Ismo Vuorinen. All Rights Reserved.
# Licensed under the MIT license.
DIRECTORY=$1
FILENAME=$2

View File

@@ -2,7 +2,7 @@
#
# Backup local MySQL Database tables with certain prefix.
# Ismo Vuorinen <https://github.com/ivuorinen> 2018
#
# License: MIT
SCRIPT=$(basename "$0")
PREFIX=$1

16
local/bin/x-dc Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Create directory if it doesn't exist already
#
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
# Licensed under MIT License. http://www.opensource.org/licenses/mit-license.
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

View File

@@ -3,7 +3,7 @@
which "$1" >&/dev/null
if [ $? -eq 0 ]; then
echo 0
exit 0
else
echo 1
exit 1
fi

View File

@@ -2,13 +2,13 @@
# Load our configuration files
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
: "${DOTFILES:=$HOME/.dotfiles}"
source "$DOTFILES/scripts/shared.sh"
DOTFILES="$HOME/.dotfiles"
source "$HOME/.dotfiles/scripts/shared.sh"
CONFIG_PATH="$DOTFILES/config"
# Load the shell dotfiles, and then some:
function load()
function x-load-config-fn()
{
for FILE in $CONFIG_PATH/{exports,alias,functions}; do
FILENAME="$FILE"
@@ -28,4 +28,4 @@ function load()
done
}
load
x-load-config-fn

8
local/bin/x-path-append Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
#
# Add a directory to the beginning of the PATH if it's not already there.
# Usage: x-path-append <dir>
x-path-remove "$1"
export PATH="${PATH:+"$PATH:"}$1"

7
local/bin/x-path-prepend Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#
# Add a directory to the front of the PATH if it exists and is not already there
# Usage: x-path-prepend <dir>
export PATH="$1${PATH:+":$PATH"}"

7
local/bin/x-path-remove Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#
# Remove a directory from the PATH
# Usage: x-path-remove <dir>
export PATH=$(echo -n "$PATH" | awk -v RS=: -v ORS=: "\$0 != \"$1\"" | sed 's/:$//')

View File

@@ -22,15 +22,12 @@
"ivuorinen"
],
"author": "Ismo Vuorinen",
"license": "ISC",
"license": "MIT",
"bugs": {
"url": "https://github.com/ivuorinen/dotfiles/issues"
},
"homepage": "https://github.com/ivuorinen/dotfiles#readme",
"devDependencies": {
"@ivuorinen/commitlint-config": "^0.1.10",
"@ivuorinen/eslint-config": "^0.2.13",
"@ivuorinen/markdownlint-config": "^0.1.6",
"@ivuorinen/prettier-config": "^0.1.1"
"@ivuorinen/base-configs": "^1.1.0"
}
}

View File

@@ -22,7 +22,7 @@ packages=(
"bkt"
# a structural diff that understands syntax
"difftastic"
# a modern replacement for ls.
# a modern replacement for ls.
"eza"
# A simple, fast and user-friendly alternative to 'find'
"fd-find"

View File

@@ -1,7 +1,6 @@
#!/usr/bin/env bash
# shellcheck disable=SC2231,SC2034,SC2181,SC2068
# shellcheck source=shared.sh
DOTFILES_SHARED_LOADED=""
source "$HOME/.dotfiles/scripts/shared.sh"
PBB_REQUIRED_TOOLS=(git cheat)
@@ -15,13 +14,19 @@ PBB_SYNTAX="syntax: bash"
PBB_TAGS="tags: [bash]"
PBB_TEMP_PREFIX=$(basename "$0")
PBB_TEMP_DIR="/tmp/pbb-$(rnd)"
PBB_TEMP_DIR="$XDG_CACHE_HOME/cheat/pbb"
# If there's no .git, clone the folder
if [ ! -d "$PBB_TEMP_DIR/.git" ]; then
msg_run "Starting to clone $PBB_GIT"
git clone --depth 1 --single-branch -q "$PBB_GIT" "$PBB_TEMP_DIR" \
&& msg_yay "Cloned $PBB_GIT"
else
# Update the repo
msg_run "Starting to update $PBB_GIT"
git -C "$PBB_TEMP_DIR" reset --hard origin/master
git -C "$PBB_TEMP_DIR" pull -q \
&& msg_yay "Updated $PBB_GIT"
fi
PBB_CHAPTERS=$(ls -1v "$PBB_TEMP_DIR"/manuscript/chapter*)
@@ -51,8 +56,3 @@ for f in ${PBB_CHAPTERS[@]}; do
echo -e "---\n$T---\n$(cat "$CHEAT_FILE")" > "$CHEAT_FILE"
fi
done
# Cleanup
if [ -d "$PBB_TEMP_DIR" ]; then
rm -rf "$PBB_TEMP_DIR"
fi

View File

@@ -1,7 +1,6 @@
#!/usr/bin/env bash
# shellcheck disable=SC2231,SC2034,SC2181,SC2068
# shellcheck source=shared.sh
DOTFILES_SHARED_LOADED=""
source "$HOME/.dotfiles/scripts/shared.sh"
TLDR_REQUIRED_TOOLS=(git cheat)
@@ -14,13 +13,19 @@ TLDR_SOURCE="source: $TLDR_GIT"
TLDR_SYNTAX="syntax: markdown"
TLDR_TEMP_PREFIX=$(basename "$0")
TLDR_TEMP_DIR="/tmp/cheat-tldr-$(rnd)"
TLDR_TEMP_DIR="$XDG_CACHE_HOME/cheat/tldr"
# If there's no .git, clone the folder
if [ ! -d "$TLDR_TEMP_DIR/.git" ]; then
msg_run "Starting to clone $TLDR_GIT"
git clone --depth 1 --single-branch -q "$TLDR_GIT" "$TLDR_TEMP_DIR" \
&& msg_done "Cloned $TLDR_GIT"
else
# Update the repo
msg_run "Starting to update $TLDR_GIT"
git -C "$TLDR_TEMP_DIR" reset --hard origin/main
git -C "$TLDR_TEMP_DIR" pull -q \
&& msg_done "Updated $TLDR_GIT"
fi
# Fetch the destination directory from cheat defined directories.
@@ -68,8 +73,3 @@ for d in "$TLDR_TEMP_DIR"/pages/*; do
done
done
# Cleanup
if [ -d "$TLDR_TEMP_DIR" ]; then
rm -rf "$TLDR_TEMP_DIR"
fi

16
scripts/install-ohmybash.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
#
# Install oh-my-bash
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
export OSH="$HOME/.local/share/oh-my-bash"
if [ ! -d "$OSH" ]; then
[ -f "$HOME/.bashrc" ] && mv "$HOME/.bashrc" "$HOME/.bashrc.temp"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)" --unattended
[ -f "$HOME/.bashrc.temp" ] && mv "$HOME/.bashrc.temp" "$HOME/.bashrc"
else
msg_done "oh-my-bash ($OSH) already installed"
fi

View File

@@ -5,11 +5,110 @@
# Helper env variables. Use like this: VERBOSE=1 ./script.sh
: "${VERBOSE:=0}"
: "${DOTFILES:=$HOME/.dotfiles}"
# Modified from https://stackoverflow.com/a/28776166
(
[[ -n $ZSH_VERSION && $ZSH_EVAL_CONTEXT =~ :file$ ]] \
|| [[ -n $BASH_VERSION ]] && (return 0 2> /dev/null)
) && sourced=1 || sourced=0
export DOTFILES="$HOME/.dotfiles"
DOTFILES_CURRENT_SHELL=$(ps -p $$ -oargs=)
export DOTFILES_CURRENT_SHELL
# 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"
# custom variables
export XDG_BIN_HOME="$HOME/.local/bin"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_RUNTIME_DIR="$HOME/.local/run"
# Remove directory from the PATH variable
# usage: path_remove ~/.local/bin
function path_remove
{
x-path-remove "$1"
}
# Append directory to the PATH
# usage: path_append ~/.local/bin
function path_append
{
x-path-remove "$1"
x-path-prepend "$1"
}
# Prepend directory to the PATH
# usage: path_prepend ~/.local/bin
function path_prepend
{
x-path-remove "$1"
x-path-prepend "$1"
}
# Create directory if it doesn't exist already
x-dc()
{
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
}
# Create a new directory and enter it
mkd()
{
mkdir -p "$@" && cd "$@" || exit
}
# Run command silently
# Usage: silent uptime
silent()
{
"$@" >&/dev/null
}
# Check if a file contains non-ascii characters
nonascii()
{
LC_ALL=C grep -n '[^[:print:][:space:]]' "${@}"
}
CONFIG_PATH="$DOTFILES/config"
# Load the shell dotfiles, and then some:
function x-load-config-fn()
{
for FILE in $CONFIG_PATH/{exports,alias,functions}; do
FILENAME="$FILE"
HOST="$(hostname -s)"
# global (exports|alias|functions) FILENAME for all hosts
# shellcheck source=../config/exports
[ -r "$FILENAME" ] && source "$FILENAME"
# global secret FILENAME, git ignored
# shellcheck source=../config/exports-secret
[ -r "$FILENAME-secret" ] && source "$FILENAME-secret"
# host specific (exports|alias|functions) FILENAME
# shellcheck source=../config/exports
[ -r "$FILENAME-$HOST" ] && source "$FILENAME-$HOST"
# host specific (exports|alias|functions) FILENAME, git ignored
# shellcheck source=../config/exports
[ -r "$FILENAME-$HOST-secret" ] && source "$FILENAME-$HOST-secret"
done
}
x-load-config-fn
source "$DOTFILES/local/bin/msgr"
# -- Menu builder -- #
@@ -67,79 +166,6 @@ function menu_usage()
done
}
# Cache commands using bkt if installed
if command -v bkt >&/dev/null; then
bkt()
{
command bkt --cache-dir="$XDG_CACHE_HOME/bkt" "$@"
}
else
# If bkt isn't installed skip its arguments and just execute directly.
# Optionally write a msg to stderr suggesting users install bkt.
bkt()
{
while [[ "$1" == --* ]]; do shift; done
"$@"
}
fi
# shorthand for checking if the system has the bin in path,
# this version does not use caching
# usage: have_command php && php -v
function have_command
{
command -v "$1" >&/dev/null
}
# shorthand for checking if the system has the bin in path,
# this version uses caching
# usage: have php && php -v
function have
{
bkt -- which "$1" >&/dev/null
}
function brew_installed
{
bkt -- brew list
}
# shorthand for checking if brew package is installed
# usage: have_brew php && php -v
function have_brew
{
! have brew && return 125
if bkt -- brew list "$1" &> /dev/null; then
return 0
else
return 1
fi
}
# Remove directory from the PATH variable
# usage: path_remove ~/.local/bin
function path_remove
{
PATH=$(echo -n "$PATH" | awk -v RS=: -v ORS=: "\$0 != \"$1\"" | sed 's/:$//')
}
# Append directory to the PATH
# usage: path_append ~/.local/bin
function path_append
{
path_remove "$1"
PATH="${PATH:+"$PATH:"}$1"
}
# Prepend directory to the PATH
# usage: path_prepend ~/.local/bin
function path_prepend
{
path_remove "$1"
PATH="$1${PATH:+":$PATH"}"
}
# Creates a random string
rnd()
{
@@ -194,37 +220,3 @@ function replacable()
return 1
}
# Create directory if it doesn't exist already
x-dc()
{
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
}
# Create a new directory and enter it
mkd()
{
mkdir -p "$@" && cd "$@" || exit
}
# Run command silently
# Usage: silent uptime
silent()
{
"$@" >&/dev/null
}
# Check if a file contains non-ascii characters
nonascii()
{
LC_ALL=C grep -n '[^[:print:][:space:]]' "${@}"
}

3292
yarn.lock

File diff suppressed because it is too large Load Diff