Compare commits

...

22 Commits

Author SHA1 Message Date
6f854ddbfd chore(lint): linting, tweaks, cleanup 2023-09-25 12:17:14 +03:00
748e5bb561 feat(dotbot): plugins: pipx, snap and crontab 2023-09-25 11:51:23 +03:00
67867b57cd feat(bin): x-git-largest-files.py python 3 version 2023-09-25 10:24:21 +03:00
91734ffa15 chore(config): tweaks to gh and tmux configs 2023-09-25 09:10:13 +03:00
5364bef678 fix(dotbot): git host overrides, nvm default pkgs 2023-09-25 08:28:11 +03:00
50b4f5c60f chore(config): alacritty font style 2023-09-25 00:56:46 +03:00
7cd508a727 chore(brew): update Brewfile 2023-09-25 00:56:24 +03:00
bf2c665433 chore(dotbot): update linking to use whole folders 2023-09-25 00:52:48 +03:00
f5b1bf0915 feat(dfm): install nerdfonts 2023-09-24 23:46:09 +03:00
e0c6d7e4f4 chore(nvim): update plugins 2023-09-24 22:45:36 +03:00
1937e72f17 chore(config): starship username tweak 2023-09-24 22:45:11 +03:00
228ba78341 feat(nvim): nvim-ufo, indent-blankline, gitsigns 2023-09-21 13:14:49 +03:00
c8c34dcc81 chore(nvim): tweak settings, update plugins 2023-09-21 13:14:15 +03:00
3d65fdee43 chore(config): tweak starship config 2023-09-21 13:11:31 +03:00
1897f49906 chore(nvim): transparency, edgy, configs, updates 2023-09-20 11:13:48 +03:00
d86785ad47 chore(repo): new screenshot, updated readme 2023-09-20 11:12:56 +03:00
1c3c04a6f3 fix(scripts): git-profile completion file name 2023-09-20 09:53:37 +03:00
debb79ee09 fix(cheat): save common to tldr root, fix names 2023-09-20 09:52:57 +03:00
c1dda8a230 feat(shell): eza, a modern replacement for ‘ls’ 2023-09-20 09:49:21 +03:00
5c74383dda chore(shell): add aliases and cleanup zsh plugins 2023-09-20 09:48:28 +03:00
da1473547a chore(nvim): plugin updates 2023-09-20 08:29:12 +03:00
43df368ec1 chore(nvim): configuration and plugin updates 2023-09-20 08:27:14 +03:00
47 changed files with 712 additions and 229 deletions

24
.github/README.md vendored
View File

@@ -23,20 +23,14 @@ fork or download the repo as a zip and go from there with your own configs.
## The looks
## tmux with powerlevel10k, the default view
![screenshot of tmux with powerlevel10k](./screenshots/tmux-powerlevel10k-130x20.png)
## tmux + nvim (astronvim) editing this repository
![screenshot of tmux showing nvim](./screenshots/tmux-astronvim-130x40.png)
![screenshot of tmux with nvim editing this repo](./screenshots/tmux-nvim.png)
## Interesting files and locations
### Interesting folders
| Path | Description |
|---------------------|----------------------------------------------|
| ------------------- | -------------------------------------------- |
| `.github` | GitHub Repository configuration files. |
| `hosts/{hostname}/` | Configs that should apply to that host only. |
| `local/bin` | Helper scripts that I've collected or wrote. |
@@ -45,7 +39,7 @@ fork or download the repo as a zip and go from there with your own configs.
### dotfile folders
| Repo | Destination | Description |
|-----------|-------------|---------------------------------------------|
| --------- | ----------- | ------------------------------------------- |
| `base/` | `.*` | `$HOME` level files. |
| `config/` | `.config/` | Configurations for applications. |
| `local/` | `.local/` | XDG Base folder: `bin`, `share` and `state` |
@@ -62,7 +56,7 @@ The folder structure follows [XDG Base Directory Specification][xdg] where possi
### XDG Variables
| Env | Default | Short description |
|--------------------|----------------------|------------------------------------------------|
| ------------------ | -------------------- | ---------------------------------------------- |
| `$XDG_BIN_HOME` | `$HOME/.local/bin` | Local binaries |
| `$XDG_CONFIG_HOME` | `$HOME/.config` | User-specific configs |
| `$XDG_DATA_HOME` | `$HOME/.local/share` | User-specific data files |
@@ -79,7 +73,7 @@ environment variable, at an appropriate place.
#### XDG_DATA_HOME (`$HOME/.local/share`)
`$XDG_DATA_HOME` defines the base directory relative to which
user-specific *data files* should be stored.
user-specific _data files_ should be stored.
If `$XDG_DATA_HOME` is either not set or empty,
a default equal to `$HOME/.local/share` should be used.
@@ -87,7 +81,7 @@ a default equal to `$HOME/.local/share` should be used.
#### XDG_CONFIG_HOME (`$HOME/.config`)
`$XDG_CONFIG_HOME` defines the base directory relative to which
user-specific *configuration files* should be stored.
user-specific _configuration files_ should be stored.
If `$XDG_CONFIG_HOME` is either not set or empty,
a default equal to `$HOME/.config` should be used.
@@ -95,13 +89,13 @@ a default equal to `$HOME/.config` should be used.
#### XDG_STATE_HOME (`$HOME/.local/state`)
`$XDG_STATE_HOME` defines the base directory relative to which
user-specific *state files* should be stored.
user-specific _state files_ should be stored.
If `$XDG_STATE_HOME` is either not set or empty,
a default equal to `$HOME/.local/state` should be used.
The `$XDG_STATE_HOME` contains *state data* that should
*persist between (application) restarts*, but that is not important or
The `$XDG_STATE_HOME` contains _state data_ that should
_persist between (application) restarts_, but that is not important or
portable enough to the user that it should be stored in `$XDG_DATA_HOME`.
- It may contain:

BIN
.github/screenshots/tmux-nvim.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

1
.gitignore vendored
View File

@@ -13,4 +13,5 @@ ssh/local.d/*
!ssh/local.d/.gitkeep
!.gitkeep
.env
local/share/fonts/NerdFonts

9
.gitmodules vendored
View File

@@ -47,3 +47,12 @@
[submodule "tmux/tmux-window-name"]
path = config/tmux/plugins/tmux-window-name
url = https://github.com/ofirgall/tmux-window-name.git
[submodule "dotbot-crontab"]
path = tools/dotbot-crontab
url = https://github.com/codekansas/dotbot-crontab.git
[submodule "dotbot-snap"]
path = tools/dotbot-snap
url = https://github.com/DrDynamic/dotbot-snap.git
[submodule "dotbot-pip"]
path = tools/dotbot-pip
url = https://github.com/sobolevn/dotbot-pip.git

View File

@@ -19,4 +19,3 @@ include:
exclude:
- ./tools/**
- ./config/nvim/**

View File

@@ -1,9 +1,22 @@
#!/usr/bin/env bash
git submodule add --name dotbot -f https://github.com/anishathalye/dotbot.git tools/dotbot
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 cheat-community -f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community
# dotbot and plugins
git submodule add --name dotbot \
-f https://github.com/anishathalye/dotbot.git tools/dotbot
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
# other repos
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 \

24
base/bashrc Normal file → Executable file
View File

@@ -7,19 +7,27 @@ export DOTFILES="$HOME/.dotfiles"
# Run x-load-configs in your terminal to reload the files.
function x-load-configs()
{
# Load the shell dotfiles, and then some:
for file in $DOTFILES/config/{exports,alias,functions}; do
HOST="$(hostname -s)"
# Load the shell dotfiles, and then some:
for file in $DOTFILES/config/{exports,alias,functions}; do
[ -r "$file" ] && source "$file"
[ -r "$file-secret" ] && source "$file-secret"
[ -r "$file-$HOST" ] && source "$file-$HOST"
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
done
# global (exports|alias|functions) file for all hosts
# shellcheck source=../config/exports
[ -r "$file" ] && source "$file"
# global secret file, git ignored
# shellcheck source=../config/exports-secret
[ -r "$file-secret" ] && source "$file-secret"
# host specific (exports|alias|functions) file
# shellcheck source=../config/exports
[ -r "$file-$HOST" ] && source "$file-$HOST"
# host specific (exports|alias|functions) file, git ignored
# shellcheck source=../config/exports
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
done
}
x-load-configs
# Import ssh keys in keychain
ssh-add -A 2>/dev/null;
ssh-add -A 2> /dev/null
# shellcheck source=../config/fzf/fzf.bash
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] \

4
base/zshrc Normal file → Executable file
View File

@@ -42,8 +42,7 @@ x-dc "$ZSH_CUSTOM_COMPLETION_PATH"
FPATH="$ZSH_CUSTOM_COMPLETION_PATH:$FPATH"
autoload -Uz compinit
if type brew &>/dev/null
then
if type brew &> /dev/null; then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
fi
@@ -70,4 +69,3 @@ have antigen && {
# Start starship
eval "$(starship init zsh)"

View File

@@ -1,3 +1,4 @@
---
# Configuration for Alacritty, the GPU enhanced terminal emulator
# Any items in the `env` entry below will be added as
@@ -40,7 +41,7 @@ font:
normal:
family: JetBrainsMono Nerd Font
# Style can be specified to pick a specific face.
# style: Regular
style: ExtraLight
# The bold font face
bold:
@@ -298,7 +299,6 @@ mouse:
selection:
semantic_escape_chars: ',│`|:"'' ()[]{}<>'
# Shell
#
# You can set shell.program to the path of your favorite shell, e.g. /bin/fish.

View File

@@ -55,6 +55,60 @@ if [[ $(uname) == 'Darwin' ]]; then
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
fi
# Be nice
alias please="sudo "
! have eza && alias ls='ls --color=auto'
have eza && {
alias ls='eza -h -s=type --git --icons --group-directories-first'
}
# Easier navigation: .., ..., ....
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
# Colors for ls
alias ll="ls -l"
alias l="ls"
# Prevent common typos
alias cd..="cd .."
alias sl="ls"
# List only directories
alias lsd="ls -lF | grep '^d'"
# Recursively delete `.pyc` files
alias rmpyc="find . -type f -name '*.pyc' -ls -delete"
# Recursively delete `.DS_Store` files
alias rmds="find . -type f -name '*.DS_Store' -ls -delete"
# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias localip="ipconfig getifaddr en1"
alias ips="ifconfig -a | grep -o 'inet6\? \(\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)\|[a-fA-F0-9:]\+\)' | sed -e 's/inet6* //'"
# Show/hide hidden files in Finder
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true; killall Finder"
alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false; killall Finder"
# Pipe public key to clipboard.
alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | echo '=> Public key copied to pasteboard.'"
# Flush Directory Service cache
alias flush="dscacheutil -flushcache"
# Update locatedb
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

View File

@@ -119,6 +119,7 @@ have gem && path_append "$(gem environment gemdir)/bin"
have rbenv && eval "$(rbenv init - zsh)"
# Rust / cargo
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
export CARGO_HOME="$XDG_DATA_HOME/cargo"
path_append "$CARGO_HOME/bin"

View File

@@ -67,15 +67,11 @@ x-default-antigen-bundles()
export ZSH_TMUX_AUTOQUIT=false
export ZSH_TMUX_DEFAULT_SESSION_NAME=main
# Add keychain to ssh-agent args when on macOS
have brew && zstyle :omz:plugins:ssh-agent ssh-add-args --apple-load-keychain
# these should be always available
antigen bundle tmux
antigen bundle colored-man-pages
antigen bundle command-not-found
antigen bundle ssh-agent
# antigen bundle MichaelAquilina/zsh-you-should-use
antigen bundle jreese/zsh-titles
antigen bundle unixorn/autoupdate-antigen.zshplugin
antigen bundle zsh-users/zsh-completions

View File

@@ -0,0 +1,19 @@
check_for_updates: true
excluded_labels:
- maintenance
- dependencies
file_name: CHANGELOG.md
logger: spinner
no_color: false
sections:
added:
- feature
- enhancement
changed:
- backwards-incompatible
fixed:
- bug
- bugfix
- documentation
show_unreleased: true
skip_entries_without_label: false

54
config/gh-dash/config.yml Normal file
View File

@@ -0,0 +1,54 @@
prSections:
- title: My Pull Requests
filters: is:open author:@me
- title: Needs My Review
filters: is:open review-requested:@me
- title: Involved
filters: is:open involves:@me -author:@me
issuesSections:
- title: My Issues
filters: is:open author:@me
- title: Assigned
filters: is:open assignee:@me
- title: Involved
filters: is:open involves:@me -author:@me
defaults:
preview:
open: true
width: 50
prsLimit: 20
issuesLimit: 20
view: prs
layout:
prs:
updatedAt:
width: 7
repo:
width: 15
author:
width: 15
assignees:
width: 20
hidden: true
base:
width: 15
hidden: true
lines:
width: 16
issues:
updatedAt:
width: 7
repo:
width: 15
creator:
width: 10
assignees:
width: 20
hidden: true
refetchIntervalMinutes: 30
keybindings:
issues: []
prs: []
repoPaths: {}
pager:
diff: ""

3
config/gh/hosts.yml Normal file
View File

@@ -0,0 +1,3 @@
github.com:
user: ivuorinen
git_protocol: https

View File

@@ -5,3 +5,6 @@
name = Ismo Vuorinen
email = ismo@ivuorinen.net
[include]
path = ~/.config/git/overrides/config

2
config/git/overrides/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
!.gitkeep
config

View File

@@ -18,8 +18,6 @@ tap "xwmx/taps"
brew "act"
# Mozilla CA certificate store
brew "ca-certificates"
# Cryptography and SSL/TLS Toolkit
brew "openssl@3"
# Interpreted, interactive, object-oriented programming language
brew "python@3.11"
# YAML Parser
@@ -104,12 +102,20 @@ brew "dnsmasq"
brew "dog"
# Lightning-fast linter for .env files written in Rust
brew "dotenv-linter"
# Tool to verify that your files are in harmony with your .editorconfig
brew "editorconfig-checker"
# Useful examples at the command-line
brew "eg-examples"
# OpenType text shaping engine
brew "harfbuzz"
# Development kit for the Java programming language
brew "openjdk"
# Run arbitrary commands when files change
brew "entr"
# Perl lib for reading and writing EXIF metadata
brew "exiftool"
# Simple, fast and user-friendly alternative to find
brew "fd"
# Banner-like program prints strings as ASCII art
brew "figlet"
# Libraries to talk to Microsoft SQL Server and Sybase databases
@@ -152,8 +158,6 @@ 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
@@ -208,8 +212,6 @@ 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
@@ -416,6 +418,7 @@ mas "Keynote", id: 409183694
mas "LastPass", id: 926036361
mas "Numbers", id: 409203825
mas "Pages", id: 409201541
mas "Pixelmator Pro", id: 1289583905
mas "Tailscale", id: 1475387142
mas "Xcode", id: 497799835
vscode "akamud.vscode-theme-onelight"
@@ -485,6 +488,7 @@ vscode "Vue.volar"
vscode "Vue.vscode-typescript-vue-plugin"
vscode "WakaTime.vscode-wakatime"
vscode "wix.vscode-import-cost"
vscode "XadillaX.viml"
vscode "xdebug.php-debug"
vscode "xdebug.php-pack"
vscode "yinfei.luahelper"

View File

@@ -1,63 +1,67 @@
{
"LazyVim": { "branch": "main", "commit": "a72a84972d85e5bbc6b9d60a0983b37efef21b8a" },
"LuaSnip": { "branch": "master", "commit": "3657c3f3cb2214a681fc7e95b6ffb509d076ebfb" },
"SchemaStore.nvim": { "branch": "main", "commit": "7b115d9dca286192ffa5b2a254ff61a34006ac3e" },
"LuaSnip": { "branch": "master", "commit": "1fd22fa96c11573248f9fdd09f25e724c7bb3dd4" },
"SchemaStore.nvim": { "branch": "main", "commit": "d2a3d1da007549c921f7b0e22521d1c20d09c8a7" },
"alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" },
"animation.nvim": { "branch": "main", "commit": "fb77091ab72ec9971aee0562e7081182527aaa6a" },
"bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" },
"bufferline.nvim": { "branch": "main", "commit": "9961d87bb3ec008213c46ba14b3f384a5f520eb5" },
"catppuccin": { "branch": "main", "commit": "85e93601e0f0b48aa2c6bbfae4d0e9d7a1898280" },
"bufferline.nvim": { "branch": "main", "commit": "6ecd37e0fa8b156099daedd2191130e083fb1490" },
"catppuccin": { "branch": "main", "commit": "3d9a5ed556e289bce6c1fb0af89ec838360641b2" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"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": "c1e1d5fa44fe08811b6ef4aadac2b50e602f9504" },
"flash.nvim": { "branch": "main", "commit": "8a8e74922a383c253b7f92e042b749150140c8d1" },
"edgy.nvim": { "branch": "main", "commit": "4ccc1c67ae2b1a0c55f18c83d03b714e2bb1bae4" },
"flash.nvim": { "branch": "main", "commit": "cc8c7e03987134997d74ee87e55a5717279f2d05" },
"friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" },
"gitsigns.nvim": { "branch": "main", "commit": "bce4576a9047085a528c479a7fe1e2f6b787b6c1" },
"gitsigns.nvim": { "branch": "main", "commit": "bdeba1cec3faddd89146690c10b9a87949c0ee66" },
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
"indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" },
"lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" },
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "f014db32437aa61c86fc0ef1067cd2bc6a37205c" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "2451adb9bdb0fd32140bf3aa8dbc17ff60050db3" },
"mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" },
"middleclass": { "branch": "master", "commit": "9fab4d5bca67262614960960ca35c4740eb2be2c" },
"mini.ai": { "branch": "main", "commit": "7ae226f331885e6f30e9a8229e113debc59308ae" },
"mini.animate": { "branch": "main", "commit": "230140aa0b06af87c9d345573aab1aaf50d8b539" },
"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": "2d89ca96e08eb6e9c8e50e1bb4738bc5125c9f12" },
"neoconf.nvim": { "branch": "main", "commit": "b7cde4ba41eabf9bec9464c990bcf84a0fef4526" },
"neodev.nvim": { "branch": "main", "commit": "471324e6c746284dbbdc1d357799d1911bb7e120" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "71f1841ba6c652908678cece623f52c1fea8a6cd" },
"neoconf.nvim": { "branch": "main", "commit": "360805250fe45391d30b96b6640d03e2c35597ee" },
"neodev.nvim": { "branch": "main", "commit": "ddf29935af5a510307850919d6772ea6a4e2c008" },
"neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" },
"noice.nvim": { "branch": "main", "commit": "74c2902146b080035beb19944baf6f014a954720" },
"nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" },
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
"nvim-lspconfig": { "branch": "master", "commit": "f3195835c0447ee2c80152b893ab51ca162b04a9" },
"nvim-lspconfig": { "branch": "master", "commit": "ede4114e1fd41acb121c70a27e1b026ac68c42d6" },
"nvim-navic": { "branch": "master", "commit": "0ffa7ffe6588f3417e680439872f5049e38a24db" },
"nvim-notify": { "branch": "master", "commit": "94859430020f5cf32a1b97ddd9e596fed9db7981" },
"nvim-regexplainer": { "branch": "main", "commit": "4250c8f3c1307876384e70eeedde5149249e154f" },
"nvim-spectre": { "branch": "master", "commit": "97cfd1b0f5a6ab35979ce1bee6c17f54745fd1e5" },
"nvim-treesitter": { "branch": "master", "commit": "b4f6dd72980607a9821d24502b0ca7ee826376af" },
"nvim-treesitter": { "branch": "master", "commit": "0960322686bfa38afd4f1e0b9660473cf77e24b6" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "95e9ba9de4289d221666b66fd930d157c7ca08c6" },
"nvim-web-devicons": { "branch": "master", "commit": "973ab742f143a796a779af4d786ec409116a0d87" },
"nvim-ufo": { "branch": "main", "commit": "6f2ccdf2da390d62f8f9e15fc5ddbcbd312e1e66" },
"nvim-web-devicons": { "branch": "master", "commit": "480a756df82a0c231622c9bf2173bb6634713716" },
"persistence.nvim": { "branch": "main", "commit": "4b8051c01f696d8849a5cb8afa9767be8db16e40" },
"plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" },
"promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" },
"stickybuf.nvim": { "branch": "master", "commit": "e3db41f2c1bb2df3ee6ff964ee74fe991f6f9566" },
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" },
"telescope.nvim": { "branch": "master", "commit": "b543aaa2c9cf8123ed2fe7dbb6c211a9cd415124" },
"telescope.nvim": { "branch": "master", "commit": "ed9574dd6dde143d009b2528ea6d79bd34bbe6c8" },
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
"tokyonight.nvim": { "branch": "main", "commit": "9a01eada39558dc3243278e6805d90e8dff45dc0" },
"transparent.nvim": { "branch": "main", "commit": "3af6232c8d39d51062702e875ff6407c1eeb0391" },
"trouble.nvim": { "branch": "main", "commit": "3f85d8ed30e97ceeddbbcf80224245d347053711" },
"typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" },
"venv-selector.nvim": { "branch": "main", "commit": "14d6e866070f759e9014a8053954f835294f56f9" },
"vim-illuminate": { "branch": "master", "commit": "8c910b2f84ae6acd9b4b17330bb94dd783c0c11a" },
"vim-illuminate": { "branch": "master", "commit": "6acf7d4a18255a3ddc43770866c8e148fe85af7b" },
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
"vim-wakatime": { "branch": "master", "commit": "0d2efa2daff34b27b0d227d4c3b136811c93db93" },
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },

View File

@@ -1,3 +1,19 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here
local keymap = vim.keymap.set
-- ╭──────────────────────────────────────────────────────────╮
-- │ Comment box │
-- ╰──────────────────────────────────────────────────────────╯
local cb = require("comment-box")
-- left aligned fixed size box with left aligned text
keymap({ "n", "v" }, "<Leader>bcb", cb.lbox, { desc = "Comment: Left aligned" })
-- centered adapted box with centered text
keymap({ "n", "v" }, "<Leader>bcc", cb.ccbox, { desc = "Comment: Centered" })
-- centered line
keymap("n", "<Leader>bcl", cb.cline, { desc = "Comment: Centered line" })
keymap("i", "<M-l>", cb.cline, { desc = "Comment: Centered line" })

View File

@@ -27,6 +27,7 @@ require("lazy").setup({
{ 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
{ import = "plugins" },
@@ -40,7 +41,7 @@ require("lazy").setup({
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "catppuccin", "tokyonight", "habamax" } },
install = { colorscheme = { "catppuccin" } },
checker = { enabled = true }, -- automatically check for plugin updates
performance = {
rtp = {

View File

@@ -6,6 +6,8 @@ local opt = vim.opt
opt.number = true
opt.relativenumber = true
opt.modeline = true
opt.spelllang = { "en", "fi" }
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et

View File

@@ -80,7 +80,7 @@ return {
cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" },
event = "User",
opts = {
accept_keymap = "<C-CR>",
accept_keymap = "<C-e>",
dismiss_keymap = "<C-Esc>",
},
},

View File

@@ -105,7 +105,7 @@ return {
init = function()
require("lazyvim.util").on_attach(function(_, buffer)
-- stylua: ignore
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
vim.keymap.set("n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
end)
end,

View File

@@ -0,0 +1,47 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, {
"php",
})
end,
},
{
"williamboman/mason.nvim",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, {
"phpactor",
})
end,
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
phpactor = {},
},
},
},
{
"mfussenegger/nvim-dap",
optional = true,
dependencies = {
"williamboman/mason.nvim",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
table.insert(opts.ensure_installed, "php-debug-adapter")
end
end,
},
opts = function()
local dap = require("dap")
local path = require("mason-registry").get_package("php-debug-adapter"):get_install_path()
dap.adapters.php = {
type = "executable",
command = "node",
args = { path .. "/extension/out/phpDebug.js" },
}
end,
},
}

View File

@@ -1,7 +1,10 @@
return {
"neovim/nvim-lspconfig",
opts = {
servers = { eslint = {} },
servers = {
eslint = {},
tflint = {},
},
setup = {
eslint = function()
require("lazyvim.util").on_attach(function(client)

View File

@@ -0,0 +1,24 @@
return {
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"actionlint",
"ansible-lint",
"bash-language-server",
"commitlint",
"flake8",
"intelephense",
"jsonlint",
"luacheck",
"phpcs",
"phpmd",
"shellcheck",
"shfmt",
"stylelint",
"stylua",
"yamllint",
},
},
},
}

View File

@@ -14,6 +14,101 @@ return {
flavour = "mocha",
},
},
-- Remove all background colors to make nvim transparent
-- https://github.com/xiyaowong/transparent.nvim
{
"xiyaowong/transparent.nvim",
lazy = false,
enabled = true,
config = function()
vim.g.transparent_groups = vim.list_extend(
vim.g.transparent_groups or {},
vim.tbl_map(function(v)
return v.hl_group
end, vim.tbl_values(require("bufferline.config").highlights))
)
end,
},
-- A fancy, configurable, notification manager for NeoVim
-- https://github.com/rcarriga/nvim-notify
{
"rcarriga/nvim-notify",
opts = {
-- Set background color to black so transparent doesn't mess stuff up
background_colour = "#000000",
},
},
-- Not UFO in the sky, but an ultra fold in Neovim.
-- https://github.com/kevinhwang91/nvim-ufo/
{
"kevinhwang91/nvim-ufo",
lazy = false,
enabled = true,
dependencies = {
"kevinhwang91/promise-async",
{ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" },
},
init = function()
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
vim.o.foldcolumn = "1" -- '0' is not bad
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
vim.o.foldlevelstart = 99
vim.o.foldenable = true
end,
opts = {
open_fold_hl_timeout = 150,
close_fold_kinds = { "imports", "comment" },
preview = {
win_config = {
border = { "", "", "", "", "", "", "", "" },
winhighlight = "Normal:Folded",
winblend = 0,
},
mappings = {
scrollU = "<C-u>",
scrollD = "<C-d>",
jumpTop = "[",
jumpBot = "]",
},
},
provider_selector = function(bufnr, filetype, buftype)
return { "treesitter", "indent" }
end,
fold_virt_text_handler = function(virtText, lnum, endLnum, width, truncate)
local newVirtText = {}
local suffix = (" 󰁂 %d "):format(endLnum - lnum)
local sufWidth = vim.fn.strdisplaywidth(suffix)
local targetWidth = width - sufWidth
local curWidth = 0
for _, chunk in ipairs(virtText) do
local chunkText = chunk[1]
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
if targetWidth > curWidth + chunkWidth then
table.insert(newVirtText, chunk)
else
chunkText = truncate(chunkText, targetWidth - curWidth)
local hlGroup = chunk[2]
table.insert(newVirtText, { chunkText, hlGroup })
chunkWidth = vim.fn.strdisplaywidth(chunkText)
-- str width returned from truncate() may less than 2nd argument, need padding
if curWidth + chunkWidth < targetWidth then
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
end
break
end
curWidth = curWidth + chunkWidth
end
table.insert(newVirtText, { suffix, "MoreMsg" })
return newVirtText
end,
},
},
-- Indent guides for Neovim
-- https://github.com/lukas-reineke/indent-blankline.nvim
{ "lukas-reineke/indent-blankline.nvim" },
-- Git integration for buffers
-- https://github.com/lewis6991/gitsigns.nvim
{ "lewis6991/gitsigns.nvim" },
-- Getting you where you want with the fewest keystrokes.
-- https://github.com/ThePrimeagen/harpoon
{ "ThePrimeagen/harpoon" },
@@ -33,7 +128,7 @@ return {
"anuvyklack/animation.nvim",
},
config = function()
vim.o.winwidth = 10
vim.o.winwidth = 15
vim.o.winminwidth = 10
vim.o.equalalways = false
require("windows").setup()

View File

@@ -23,7 +23,7 @@ $line_break\
$character"""
# Timeout for commands executed by starship (in milliseconds).
# command_timeout = 1000
command_timeout = 1500
[character]
success_symbol = "[→](bold green)"
@@ -43,16 +43,18 @@ style = "blue"
[docker_context]
symbol = " "
format = '[$symbol$context]($style) '
[fill]
symbol = '·'
style = 'bold black'
[gcloud]
format = ' [($symbol)$account(@$domain)(\($region\))]($style) '
format = '[($symbol)$account(@$domain)(\($region\))]($style) '
[git_branch]
symbol = " "
format = '[$symbol$branch(:$remote_branch)]($style) '
truncation_length = 20
truncation_symbol = '…'
ignore_branches = ['master', 'main']
@@ -72,12 +74,16 @@ disabled = false
[golang]
symbol = " "
format = '[$symbol($version )]($style) '
[hostname]
ssh_symbol = " "
ssh_only = false
format = '[$ssh_symbol](bold blue)[$hostname](bold red) '
[lua]
format = '[$symbol($version )]($style)'
[nodejs]
symbol = " "
format = '[$symbol($version )]($style)'
@@ -141,5 +147,7 @@ version_format = '${major}.${minor}'
[python]
symbol = " "
format = "[$virtualenv]($style) "
style = "bright-black"
[username]
format = "[$user]($style) "

View File

@@ -137,6 +137,7 @@ 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'

View File

@@ -1,8 +1,6 @@
- include: "tools/dotbot-defaults.yaml"
- shell:
- echo "Configuring v"
- brewfile:
- Brewfile
- link:
~/:
force: true

View File

@@ -18,6 +18,9 @@ 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}" \
"${@}"
@@ -30,6 +33,9 @@ if [ "${DOTBOT_HOST}" != "" ]; then
-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" \
"${@}"
fi

View File

@@ -5,36 +5,66 @@
recursive: true
~/.local:
recursive: true
~/.ssh:
recursive: true
- create:
~/.cache:
~/.cache/git:
~/.config:
~/.config/cheat/cheatsheets/personal:
~/.config/cheat/cheatsheets/pure-bash-bible:
~/.config/cheat/cheatsheets/tldr:
~/.local:
~/.local/bin:
~/.local/run:
~/.local/share:
~/.local/state:
~/.ssh:
mode: 0700
~/.ssh/local.d:
mode: 0700
~/Code:
- link:
~/:
force: true
glob: true
path: base/**
path: base/*
prefix: "."
~/.config/:
glob: true
path: config/**
~/.local/:
relink: true
path: config/*
exclude: [config/nvm]
~/.config/nvm/default-packages:
create: true
relink: true
path: config/nvm/default-packages
~/.local/bin:
glob: true
path: local/**
path: local/bin/*
~/.local/man:
glob: true
path: local/man/**
~/.local/share:
glob: true
path: local/share/*
~/.ssh/:
glob: true
mode: 0600
path: ssh/**
path: ssh/*
- shell:
- git submodule update --init --recursive --force
- bash local/bin/dfm install all
- pipx:
file: tools/requirements-pipx.txt
stdout: false
stderr: true
- crontab:
- time: 0 5 * * *
command: brew update && brew upgrade
platform: darwin # Optional
- time: 0 5 * * *
command: apt update && apt upgrade
platform: linux # Optional
- time: 0 5 * * *
command: task sync
- snap:
- nvim:
classic: true

View File

@@ -32,6 +32,7 @@ function section_install
"cheat-databases:Install cheat external cheatsheet databases"
"composer:Install composer"
"dotenv:Install dotenv-linter"
"fonts:Install programming fonts"
"gh:Install GitHub CLI Extensions"
"go:Install Go Packages"
"imagick:Install ImageMagick CLI"
@@ -48,6 +49,7 @@ function section_install
case "$1" in
all)
$0 install macos
$0 install fonts
$0 install antigen
$0 brew install
$0 install pip
@@ -89,6 +91,10 @@ function section_install
| sh -s -- -b "$XDG_BIN_HOME" \
&& msg_yay "dotenv-linter installed!"
;;
fonts)
bash "$DOTFILES/scripts/install-fonts.sh" \
&& msg_yay "Installed fonts!"
;;
fzf)
bash "$DOTFILES/scripts/install-fzf.sh" \
&& msg_yay "fzf installed!"
@@ -244,10 +250,8 @@ function section_dotfiles
~/.local/share/nvim \
~/.local/state/nvim \
~/.cache/nvim \
~/.config/astronvim \
~/.config/nvim
msg_ok "Deleted old nvim files"
ln -s "$DOTFILES/config/astronvim" ~/.config/astronvim
msg_ok "Deleted old nvim files (share, state and cache + config)"
ln -s "$DOTFILES/config/nvim" ~/.config/nvim
msg_ok "Linked nvim and astronvim"
have npm && $0 install npm

View File

@@ -1,136 +1,195 @@
#!/usr/bin/python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python script to find the largest files in a git repository.
# The general method is based on the script in this blog post:
# http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
#
# The above script worked for me, but was very slow on my 11GB repository. This version has a bunch
# of changes to speed things up to a more reasonable time. It takes less than a minute on repos with 250K objects.
# The above script worked for me, but was very slow on my 11GB repository.
# This version has a bunch of changes to speed things up to a more
# reasonable time. It takes less than a minute on repos with 250K objects.
#
# The MIT License (MIT)
# Copyright (c) 2015 Nick Kocharhook
# Copyright (c) 2023 Ismo Vuorinen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
# substantial portions of the Software.
# The above copyright notice and this permission notice shall be included in all copies
# or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
# OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# vim:tw=120:ts=4:ft=python:norl:
from subprocess import check_output, CalledProcessError, Popen, PIPE
from subprocess import check_output, Popen, PIPE
import argparse
import signal
import sys
sortByOnDiskSize = False
class Blob(object):
sha1 = ''
size = 0
packedSize = 0
path = ''
def __init__(self, line):
cols = line.split()
self.sha1, self.size, self.packedSize = cols[0], int(cols[2]), int(cols[3])
def __repr__(self):
return '{} - {} - {} - {}'.format(
self.sha1, self.size, self.packedSize, self.path)
def __lt__(self, other):
if (sortByOnDiskSize):
return self.size < other.size
else:
return self.packedSize < other.packedSize
def csv_line(self):
return "{},{},{},{}".format(
self.size/1024, self.packedSize/1024, self.sha1, self.path)
def main():
global sortByOnDiskSize
global sortByOnDiskSize
signal.signal(signal.SIGINT, signal_handler)
args = parseArguments()
sortByOnDiskSize = args.sortByOnDiskSize
sizeLimit = 1024*args.filesExceeding
signal.signal(signal.SIGINT, signal_handler)
if args.filesExceeding > 0:
print "Finding objects larger than {}kB…".format(args.filesExceeding)
else:
print "Finding the {} largest objects…".format(args.matchCount)
args = parse_arguments()
sortByOnDiskSize = args.sortByOnDiskSize
sizeLimit = 1024*args.filesExceeding
blobs = getTopBlobs(args.matchCount, sizeLimit)
if args.filesExceeding > 0:
print("Finding objects larger than {}kB…".format(args.filesExceeding))
else:
print("Finding the {} largest objects…".format(args.matchCount))
populateBlobPaths(blobs)
printOutBlobs(blobs)
blobs = get_top_blobs(args.matchCount, sizeLimit)
def getTopBlobs(count, sizeLimit):
sortColumn = 4
if sortByOnDiskSize:
sortColumn = 3
verifyPack = "git verify-pack -v `git rev-parse --git-dir`/objects/pack/pack-*.idx | grep blob | sort -k{}nr".format(sortColumn)
output = check_output(verifyPack, shell=True).split("\n")[:-1]
blobs = dict()
compareBlob = Blob("a b {} {} c".format(sizeLimit, sizeLimit)) # use __lt__ to do the appropriate comparison
for objLine in output:
blob = Blob(objLine)
if sizeLimit > 0:
if compareBlob < blob:
blobs[blob.sha1] = blob
else:
break
else:
blobs[blob.sha1] = blob
if len(blobs) == count:
break
return blobs
populate_blob_paths(blobs)
print_out_blobs(blobs)
def populateBlobPaths(blobs):
if len(blobs):
print "Finding object paths…"
def get_top_blobs(count, sizeLimit):
"""Get top blobs from git repository
# Only include revs which have a path. Other revs aren't blobs.
revList = "git rev-list --all --objects | awk '$2 {print}'"
allObjectLines = check_output(revList, shell=True).split("\n")[:-1]
Args:
count (int): How many items to return
sizeLimit (int): What is the size limit
outstandingKeys = blobs.keys()
Returns:
dict: Dictionary of Blobs
"""
sortColumn = 4
for line in allObjectLines:
cols = line.split()
sha1, path = cols[0], " ".join(cols[1:])
if sortByOnDiskSize:
sortColumn = 3
if (sha1 in outstandingKeys):
outstandingKeys.remove(sha1)
blobs[sha1].path = path
verifyPack = "git verify-pack -v `git rev-parse --git-dir`/objects/pack/pack-*.idx | grep blob | sort -k{}nr".format(sortColumn) # noqa: E501
output = check_output(verifyPack, shell=True).decode('utf-8').strip().split("\n")[:-1] # noqa: E501
# short-circuit the search if we're done
if not len(outstandingKeys):
break
blobs = dict()
# use __lt__ to do the appropriate comparison
compareBlob = Blob("a b {} {} c".format(sizeLimit, sizeLimit))
for objLine in output:
blob = Blob(objLine)
if sizeLimit > 0:
if compareBlob < blob:
blobs[blob.sha1] = blob
else:
break
else:
blobs[blob.sha1] = blob
if len(blobs) == count:
break
return blobs
def printOutBlobs(blobs):
if len(blobs):
csvLines = ["size,pack,hash,path"]
def populate_blob_paths(blobs):
"""Populate blob paths that only have a path
for blob in sorted(blobs.values(), reverse=True):
csvLines.append(blob.csvLine())
Args:
blobs (Blob, dict): Dictionary of Blobs
"""
if len(blobs):
print("Finding object paths…")
p = Popen(["column", "-t", "-s", "','"], stdin=PIPE, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate("\n".join(csvLines)+"\n")
# Only include revs which have a path. Other revs aren't blobs.
revList = "git rev-list --all --objects | awk '$2 {print}'"
all_object_lines = check_output(revList, shell=True).decode('utf-8').strip().split("\n")[:-1] # noqa: E501
outstanding_keys = list(blobs.keys())
print "\nAll sizes in kB. The pack column is the compressed size of the object inside the pack file.\n"
print stdout.rstrip('\n')
else:
print "No files found which match those criteria."
for line in all_object_lines:
cols = line.split()
sha1, path = cols[0], " ".join(cols[1:])
if (sha1 in outstanding_keys):
outstanding_keys.remove(sha1)
blobs[sha1].path = path
# short-circuit the search if we're done
if not len(outstanding_keys):
break
def parseArguments():
parser = argparse.ArgumentParser(description='List the largest files in a git repository')
parser.add_argument('-c', '--match-count', dest='matchCount', type=int, default=10,
help='The number of files to return. Default is 10. Ignored if --files-exceeding is used.')
parser.add_argument('--files-exceeding', dest='filesExceeding', type=int, default=0,
help='The cutoff amount, in KB. Files with a pack size (or pyhsical size, with -p) larger than this will be printed.')
parser.add_argument('-p', '--physical-sort', dest='sortByOnDiskSize', action='store_true', default=False,
help='Sort by the on-disk size of the files. Default is to sort by the pack size.')
def print_out_blobs(blobs):
if len(blobs):
csvLines = ["size,pack,hash,path"]
return parser.parse_args()
for blob in sorted(blobs.values(), reverse=True):
csvLines.append(blob.csv_line())
command = ["column", "-t", "-s", ","]
p = Popen(command, stdin=PIPE, stdout=PIPE, stderr=PIPE)
# Encode the input as bytes
input_data = ("\n".join(csvLines) + "\n").encode()
stdout, _ = p.communicate(input_data)
print("\nAll sizes in kB. The pack column is the compressed size of the object inside the pack file.\n") # noqa: E501
print(stdout.decode("utf-8").rstrip('\n'))
else:
print("No files found which match those criteria.")
def parse_arguments():
parser = argparse.ArgumentParser(
description='List the largest files in a git repository'
)
parser.add_argument(
'-c', '--match-count', dest='matchCount', type=int, default=10,
help='Files to return. Default is 10. Ignored if --files-exceeding is used.'
)
parser.add_argument(
'--files-exceeding', dest='filesExceeding', type=int, default=0,
help='The cutoff amount, in KB. Files with a pack size (or physical size, with -p) larger than this will be printed.' # noqa: E501
)
parser.add_argument(
'-p', '--physical-sort', dest='sortByOnDiskSize',
action='store_true', default=False,
help='Sort by the on-disk size. Default is to sort by the pack size.'
)
return parser.parse_args()
def signal_handler(signal, frame):
@@ -138,29 +197,6 @@ def signal_handler(signal, frame):
sys.exit(0)
class Blob(object):
sha1 = ''
size = 0
packedSize = 0
path = ''
def __init__(self, line):
cols = line.split()
self.sha1, self.size, self.packedSize = cols[0], int(cols[2]), int(cols[3])
def __repr__(self):
return '{} - {} - {} - {}'.format(self.sha1, self.size, self.packedSize, self.path)
def __lt__(self, other):
if (sortByOnDiskSize):
return self.size < other.size
else:
return self.packedSize < other.packedSize
def csvLine(self):
return "{},{},{},{}".format(self.size/1024, self.packedSize/1024, self.sha1, self.path)
# Default function is main()
if __name__ == '__main__':
main()
main()

View File

@@ -16,21 +16,22 @@ COLOR_S='\033[0;36m'
RESET='\033[0m'
# Print time-based personalized message, using figlet & lolcat if availible
function welcome_greeting () {
function welcome_greeting()
{
h=$(date +%H)
if [ "$h" -lt 04 ] || [ "$h" -gt 22 ];
then greeting="Good Night"
elif [ "$h" -lt 12 ];
then greeting="Good morning"
elif [ "$h" -lt 18 ];
then greeting="Good afternoon"
elif [ "$h" -lt 22 ];
then greeting="Good evening"
if [ "$h" -lt 04 ] || [ "$h" -gt 22 ]; then
greeting="Good Night"
elif [ "$h" -lt 12 ]; then
greeting="Good morning"
elif [ "$h" -lt 18 ]; then
greeting="Good afternoon"
elif [ "$h" -lt 22 ]; then
greeting="Good evening"
else
greeting="Hello"
fi
WELCOME_MSG="$greeting $USER!"
if hash lolcat 2>/dev/null && hash figlet 2>/dev/null; then
if hash lolcat 2> /dev/null && hash figlet 2> /dev/null; then
echo "${WELCOME_MSG}" | figlet | lolcat
else
echo -e "$COLOR_P${WELCOME_MSG}${RESET}\n"
@@ -38,8 +39,9 @@ function welcome_greeting () {
}
# Print system information with neofetch, if it's installed
function welcome_sysinfo () {
if hash neofetch 2>/dev/null; then
function welcome_sysinfo()
{
if hash neofetch 2> /dev/null; then
neofetch --shell_version off \
--disable kernel distro shell resolution cpu gpu de wm wm_theme theme icons terminal \
--backend off \
@@ -50,7 +52,8 @@ function welcome_sysinfo () {
}
# Print todays info: Date, IP, weather, etc
function welcome_today () {
function welcome_today()
{
timeout=1
echo -e "\033[1;34mToday\n------"
@@ -62,7 +65,7 @@ function welcome_today () {
echo -e "${RESET}"
# Print IP address
if hash ip 2>/dev/null; then
if hash ip 2> /dev/null; then
ip_address=$(ip route get 8.8.8.8 | awk -F"src " 'NR==1{split($2,a," ");print a[1]}')
ip_interface=$(ip route get 8.8.8.8 | awk -F"dev " 'NR==1{split($2,a," ");print a[1]}')
echo -e "${COLOR_S}🌐 IP: $(curl -s -m $timeout 'https://ipinfo.io/ip') (${ip_address} on ${ip_interface})"
@@ -71,23 +74,11 @@ function welcome_today () {
}
# Putting it all together
function welcome() {
function welcome()
{
welcome_greeting
welcome_sysinfo
welcome_today
}
# Determine if file is being run directly or sourced
([[ -n $ZSH_EVAL_CONTEXT && $ZSH_EVAL_CONTEXT =~ :file$ ]] \
|| [[ -n $KSH_VERSION && $(cd "$(dirname -- "$0")" \
&& printf '%s' "${PWD%/}/")$(basename -- "$0") != "${.sh.file}" ]] \
|| [[ -n $BASH_VERSION ]] && (return 0 2>/dev/null)
) && sourced=1 || sourced=0
# If script being called directly run immediately
if [ "$sourced" -eq 0 ]; then
welcome "$@"
fi
# EOF
welcome "$@"

View File

@@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
! have cargo && {
msg "cargo could not be found. installing cargo with rustup.rs"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path
}
packages=(
@@ -14,8 +14,13 @@ packages=(
"bkt"
# a structural diff that understands syntax
"difftastic"
# a modern replacement for ls.
"eza"
# A simple, fast and user-friendly alternative to 'find'
"fd-find"
"cargo-update"
"pijul"
"ripgrep"
)
for pkg in "${packages[@]}"; do
@@ -24,7 +29,8 @@ for pkg in "${packages[@]}"; do
# Skip comments
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
cargo install $pkg
msg_run "Installing cargo package $pkg"
cargo install "$pkg"
echo ""
done

View File

@@ -38,6 +38,9 @@ for d in "$TLDR_TEMP_DIR"/pages/*; do
# echo "-> $DIRNAME ($d)"
SECTION_DIR="${TLDR_CHEAT_DEST}/$DIRNAME"
[ "$DIRNAME" = "common" ] && SECTION_DIR="${TLDR_CHEAT_DEST}"
TLDR_TAGS="tags: [$DIRNAME]"
if [ ! -d "$SECTION_DIR" ]; then
@@ -48,7 +51,7 @@ for d in "$TLDR_TEMP_DIR"/pages/*; do
BASENAME=$(basename "$FILE" .md)
FILENAME="${BASENAME%%.*}"
# echo "-> $FILE = $FILENAME"
TLDR_FILE="$SECTION_DIR/${FILENAME}"
TLDR_FILE="$SECTION_DIR/${BASENAME}"
# echo "-> dest: $TLDR_FILE"
# Update the original file for making the replacable value comparable

44
scripts/install-fonts.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Install NerdFonts
#
# shellcheck source="shared.sh"
source "$HOME/.dotfiles/scripts/shared.sh"
GIT_REPO="https://github.com/ryanoasis/nerd-fonts.git"
TMP_PATH="$XDG_CACHE_HOME/nerd-fonts"
msg "-- NerdFonts --"
fonts=(
Hack
IntelOneMono
JetBrainsMono
OpenDyslexic
SpaceMono
)
if [ ! -d "$TMP_PATH" ]; then
git clone --filter=blob:none --sparse "$GIT_REPO" "$TMP_PATH"
fi
cd "$TMP_PATH" || {
msg_err "No such folder $TMP_PATH"
exit 1
}
for ext in "${fonts[@]}"; do
# Trim spaces
ext=${ext// /}
# Skip comments
if [[ ${ext:0:1} == "#" ]]; then continue; fi
msg_run "Adding $ext to sparse-checkout"
git sparse-checkout add "patched-fonts/$ext"
echo ""
done
msg "Starting to install NerdFonts..."
./install.sh -s ${fonts[*]}
msg_ok "Done"

View File

@@ -41,7 +41,7 @@ done
msg "Installing completions for selected packages"
have git-profile && {
git-profile completion zsh > "$ZSH_CUSTOM_COMPLETION_PATH/git-profile" \
git-profile completion zsh > "$ZSH_CUSTOM_COMPLETION_PATH/_git-profile" \
&& msg_yay "Installed completions for git-profile"
}

View File

@@ -9,6 +9,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
}
packages=(
"pipx"
"libtmux"
)
@@ -18,7 +19,7 @@ for pkg in "${packages[@]}"; do
# Skip comments
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
python3 -m pip install --user $pkg
python3 -m pip install --user "$pkg"
echo ""
done

1
tools/dotbot-crontab Submodule

Submodule tools/dotbot-crontab added at ea900a7cf6

1
tools/dotbot-pip Submodule

Submodule tools/dotbot-pip added at 42e6a8f3be

1
tools/dotbot-snap Submodule

Submodule tools/dotbot-snap added at 5722c4e5af

View File

@@ -0,0 +1,2 @@
openapi-python-client
libtmux