mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-07 14:50:14 +00:00
Compare commits
76 Commits
begin-nix
...
begin-nixo
Author | SHA1 | Date | |
---|---|---|---|
634e8cabac | |||
f493b263e0 | |||
e819c2a7b6 | |||
6a0a27714b | |||
b09a38201c | |||
26ee43fe84 | |||
38ea7742a1 | |||
d1269e8455 | |||
f314eb82b7 | |||
d913ad88d5 | |||
39d21d23f4 | |||
955c6b0aca | |||
f485a20e06 | |||
9914eae230 | |||
4ea1235c9c | |||
f025413ad1 | |||
154fe2917b | |||
29cf53f5f6 | |||
a3ff05b40c | |||
3a04b58574 | |||
21333baefd | |||
9e3244d8ea | |||
f40dc276e2 | |||
93a74e5d22 | |||
5ce2e5cbce | |||
3b223a88ca | |||
bd2433c869 | |||
216d325d5c | |||
59c65bfa53 | |||
beeebb178e | |||
dd07f97122 | |||
4d8de6b3bc | |||
b486085580 | |||
afefa06229 | |||
bc31e9d7df | |||
13a4cac980 | |||
b9747c4e6f | |||
06a455fcf4 | |||
7a9e9b75c0 | |||
007ed17e71 | |||
6453e6788e | |||
37647acbeb | |||
1f1769be70 | |||
b4dc2f0d18 | |||
4a8f41a151 | |||
e58763a168 | |||
16e4165d14 | |||
f51f0c0e3d | |||
096aa594a8 | |||
3a244110eb | |||
5f794c626b | |||
1c95039847 | |||
c69fa02713 | |||
81815ed551 | |||
8012fa7051 | |||
609bfb8132 | |||
c71ffe0ea2 | |||
aadeffecde | |||
cbb64f61fc | |||
170a2a24de | |||
f92b7cf891 | |||
a1962afef0 | |||
b9e248be32 | |||
e4b6c3c9ba | |||
249cbe5889 | |||
1f9fdac268 | |||
2705e636b9 | |||
43cbd18caf | |||
ba75ec2366 | |||
bb00648208 | |||
cf1e39a3b8 | |||
06a2c5eb3d | |||
03889db9f8 | |||
3a27c37f3e | |||
0989a15b5d | |||
bf180db95e |
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,4 +1,6 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
|
newsboat.configlink/history.search
|
||||||
|
newsboat.configlink/urls
|
||||||
nvim.configlink/dirs/*
|
nvim.configlink/dirs/*
|
||||||
nvim.configlink/.netrwhist
|
nvim.configlink/.netrwhist
|
||||||
nvim.configlink/plugin/**
|
nvim.configlink/plugin/**
|
||||||
@ -9,3 +11,4 @@ fish.configlink/functions/vim.fish
|
|||||||
fish_variables
|
fish_variables
|
||||||
homebrew/*.lock.json
|
homebrew/*.lock.json
|
||||||
*.bak
|
*.bak
|
||||||
|
*.db
|
||||||
|
@ -99,7 +99,8 @@ font:
|
|||||||
# - (Windows) Consolas
|
# - (Windows) Consolas
|
||||||
#family: Fira Code
|
#family: Fira Code
|
||||||
#family: Noto Sans Mono
|
#family: Noto Sans Mono
|
||||||
family: Fira Mono for Powerline
|
# family: Fira Mono for Powerline
|
||||||
|
family: FiraMono Nerd Font
|
||||||
|
|
||||||
# The `style` can be specified to pick a specific face.
|
# The `style` can be specified to pick a specific face.
|
||||||
#style: Regular
|
#style: Regular
|
||||||
@ -138,7 +139,7 @@ font:
|
|||||||
#style: Bold Italic
|
#style: Bold Italic
|
||||||
|
|
||||||
# Point size
|
# Point size
|
||||||
size: 18.0
|
size: 17.0
|
||||||
|
|
||||||
# Offset is the extra space around each character. `offset.y` can be thought of
|
# Offset is the extra space around each character. `offset.y` can be thought of
|
||||||
# as modifying the line spacing, and `offset.x` as modifying the letter spacing.
|
# as modifying the line spacing, and `offset.x` as modifying the letter spacing.
|
||||||
|
15
bin/bookmark
Executable file
15
bin/bookmark
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
URL=$1
|
||||||
|
TITLE=$2
|
||||||
|
DESCRIPTION=$3
|
||||||
|
FEED=$4
|
||||||
|
|
||||||
|
printf "\n\n## [%s](%s)\n%s\nFrom %s: added on [%s](%s.md).\n\n---\n" \
|
||||||
|
"$TITLE" \
|
||||||
|
"$URL" \
|
||||||
|
"$DESCRIPTION" \
|
||||||
|
"$FEED" \
|
||||||
|
"$TODAY_NOTE" \
|
||||||
|
"$TODAY_NOTE" \
|
||||||
|
>>"$NOTES_PATH/bookmarks.md"
|
@ -5,4 +5,4 @@ jmespath==0.9.4
|
|||||||
python-dateutil==2.8.0
|
python-dateutil==2.8.0
|
||||||
s3transfer==0.2.1
|
s3transfer==0.2.1
|
||||||
six==1.12.0
|
six==1.12.0
|
||||||
urllib3==1.25.8
|
urllib3==1.26.5
|
||||||
|
37
bin/gh-repos
Executable file
37
bin/gh-repos
Executable file
@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
t2) organization="take-two" ;;
|
||||||
|
d2c) organization="take-two-t2gp" ;;
|
||||||
|
t2gp) organization="take-two-t2gp" ;;
|
||||||
|
pd) organization="private-division" ;;
|
||||||
|
dots) organization="playdots" ;;
|
||||||
|
*) organization="nmasur" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
selected=$(gh repo list "$organization" \
|
||||||
|
--limit 50 \
|
||||||
|
--no-archived \
|
||||||
|
--json=name,description,isPrivate,updatedAt,primaryLanguage \
|
||||||
|
| jq -r '.[] | .name + "," + if .description == "" then "-" else .description |= gsub(","; " ") | .description end + "," + .updatedAt + "," + .primaryLanguage.name' \
|
||||||
|
| (echo "REPO,DESCRIPTION,UPDATED,LANGUAGE"; cat -) \
|
||||||
|
| column -s , -t \
|
||||||
|
| fzf \
|
||||||
|
--header-lines=1 \
|
||||||
|
--layout=reverse \
|
||||||
|
--bind "ctrl-o:execute:gh repo view -w ${organization}/{1}" \
|
||||||
|
--bind "shift-up:preview-half-page-up" \
|
||||||
|
--bind "shift-down:preview-half-page-down" \
|
||||||
|
--preview "GH_FORCE_TTY=49% gh repo view ${organization}/{1} | glow -" \
|
||||||
|
--preview-window up
|
||||||
|
)
|
||||||
|
[ -n "${selected}" ] && {
|
||||||
|
directory="$HOME/dev/work"
|
||||||
|
if [ $organization = "nmasur" ]; then directory="$HOME/dev/personal"; fi
|
||||||
|
repo=$(echo "${selected}" | awk '{print $1}')
|
||||||
|
repo_full="${organization}/${repo}"
|
||||||
|
if [ ! -d "${directory}/${repo}" ]; then
|
||||||
|
gh repo clone "$repo_full" "${directory}/${repo}"
|
||||||
|
fi
|
||||||
|
echo "${directory}/${repo}"
|
||||||
|
}
|
@ -1,12 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Copied from David Pedersen: https://github.com/davidpdrsn/dotfiles/blob/master/bin/git-pp
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
git_branch_name() {
|
|
||||||
val=$( git branch 2>/dev/null | grep '^\*' | colrm 1 2 )
|
|
||||||
echo "$val"
|
|
||||||
}
|
|
||||||
|
|
||||||
git push --set-upstream origin "$(git_branch_name)"
|
|
5
bin/url-decode
Executable file
5
bin/url-decode
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
|
||||||
|
|
||||||
|
urldecode "$@"
|
@ -1,7 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
CACHE_FILE="$HOME/.tmux/.weather_cache"
|
CACHE_FILE="$HOME/.cache/weather_cache"
|
||||||
CACHE_TIME="$(stat -f %m "$CACHE_FILE")"
|
|
||||||
|
if [ "$1" = "clear" ]; then
|
||||||
|
rm -f "$CACHE_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
CACHE_TIME="$(stat -f %m "$CACHE_FILE" 2>/dev/null)"
|
||||||
NOW_TIME=$(date +%s)
|
NOW_TIME=$(date +%s)
|
||||||
TIME_PASSED=$((NOW_TIME-CACHE_TIME))
|
TIME_PASSED=$((NOW_TIME-CACHE_TIME))
|
||||||
if [ "$TIME_PASSED" -gt "1200" ]
|
if [ "$TIME_PASSED" -gt "1200" ]
|
||||||
|
1
digrc.symlink
Normal file
1
digrc.symlink
Normal file
@ -0,0 +1 @@
|
|||||||
|
+noall +answer
|
@ -1,138 +0,0 @@
|
|||||||
# Setup Nix
|
|
||||||
|
|
||||||
# We need to distinguish between single-user and multi-user installs.
|
|
||||||
# This is difficult because there's no official way to do this.
|
|
||||||
# We could look for the presence of /nix/var/nix/daemon-socket/socket but this will fail if the
|
|
||||||
# daemon hasn't started yet. /nix/var/nix/daemon-socket will exist if the daemon has ever run, but
|
|
||||||
# I don't think there's any protection against accidentally running `nix-daemon` as a user.
|
|
||||||
# We also can't just look for /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh because
|
|
||||||
# older single-user installs used the default profile instead of a per-user profile.
|
|
||||||
# We can still check for it first, because all multi-user installs should have it, and so if it's
|
|
||||||
# not present that's a pretty big indicator that this is a single-user install. If it does exist,
|
|
||||||
# we still need to verify the install type. To that end we'll look for a root owner and sticky bit
|
|
||||||
# on /nix/store. Multi-user installs set both, single-user installs don't. It's certainly possible
|
|
||||||
# someone could do a single-user install as root and then manually set the sticky bit but that
|
|
||||||
# would be extremely unusual.
|
|
||||||
|
|
||||||
set -l nix_profile_path /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
|
||||||
set -l single_user_profile_path ~/.nix-profile/etc/profile.d/nix.sh
|
|
||||||
if test -e $nix_profile_path
|
|
||||||
# The path exists. Double-check that this is a multi-user install.
|
|
||||||
# We can't just check for ~/.nix-profile/… because this may be a single-user install running as
|
|
||||||
# the wrong user.
|
|
||||||
|
|
||||||
# stat is not portable. Splitting the output of ls -nd is reliable on most platforms.
|
|
||||||
set -l owner (string split -n ' ' (ls -nd /nix/store 2>/dev/null))[3]
|
|
||||||
if not test -k /nix/store -a $owner -eq 0
|
|
||||||
# /nix/store is either not owned by root or not sticky. Assume single-user.
|
|
||||||
set nix_profile_path $single_user_profile_path
|
|
||||||
end
|
|
||||||
else
|
|
||||||
# The path doesn't exist. Assume single-user
|
|
||||||
set nix_profile_path $single_user_profile_path
|
|
||||||
end
|
|
||||||
|
|
||||||
if test -e $nix_profile_path
|
|
||||||
# Source the nix setup script
|
|
||||||
# We're going to run the regular Nix profile under bash and then print out a few variables
|
|
||||||
for line in (env -u BASH_ENV bash -c '. "$0"; for name in PATH "${!NIX_@}"; do printf "%s=%s\0" "$name" "${!name}"; done' $nix_profile_path | string split0)
|
|
||||||
set -xg (string split -m 1 = $line)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Insert Nix's fish share directories into fish's special variables.
|
|
||||||
# nixpkgs-installed fish tries to set these up already if NIX_PROFILES is defined, which won't
|
|
||||||
# be the case when sourcing $__fish_data_dir/share/config.fish normally, but might be for a
|
|
||||||
# recursive invocation. To guard against that, we'll only insert paths that don't already exit.
|
|
||||||
# Furthermore, for the vendor_conf.d sourcing, we'll use the pre-existing presence of a path in
|
|
||||||
# $fish_function_path to determine whether we want to source the relevant vendor_conf.d folder.
|
|
||||||
|
|
||||||
# To start, let's locally define NIX_PROFILES if it doesn't already exist.
|
|
||||||
set -al NIX_PROFILES
|
|
||||||
if test (count $NIX_PROFILES) -eq 0
|
|
||||||
set -a NIX_PROFILES $HOME/.nix-profile
|
|
||||||
end
|
|
||||||
# Replicate the logic from nixpkgs version of $__fish_data_dir/__fish_build_paths.fish.
|
|
||||||
set -l __nix_profile_paths (string split ' ' -- $NIX_PROFILES)[-1..1]
|
|
||||||
set -l __extra_completionsdir \
|
|
||||||
$__nix_profile_paths/etc/fish/completions \
|
|
||||||
$__nix_profile_paths/share/fish/vendor_completions.d
|
|
||||||
set -l __extra_functionsdir \
|
|
||||||
$__nix_profile_paths/etc/fish/functions \
|
|
||||||
$__nix_profile_paths/share/fish/vendor_functions.d
|
|
||||||
set -l __extra_confdir \
|
|
||||||
$__nix_profile_paths/etc/fish/conf.d \
|
|
||||||
$__nix_profile_paths/share/fish/vendor_conf.d \
|
|
||||||
|
|
||||||
### Configure fish_function_path ###
|
|
||||||
# Remove any of our extra paths that may already exist.
|
|
||||||
# Record the equivalent __extra_confdir path for any function path that exists.
|
|
||||||
set -l existing_conf_paths
|
|
||||||
for path in $__extra_functionsdir
|
|
||||||
if set -l idx (contains --index -- $path $fish_function_path)
|
|
||||||
set -e fish_function_path[$idx]
|
|
||||||
set -a existing_conf_paths $__extra_confdir[(contains --index -- $path $__extra_functionsdir)]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
# Insert the paths before $__fish_data_dir.
|
|
||||||
if set -l idx (contains --index -- $__fish_data_dir/functions $fish_function_path)
|
|
||||||
# Fish has no way to simply insert into the middle of an array.
|
|
||||||
set -l new_path $fish_function_path[1..$idx]
|
|
||||||
set -e new_path[$idx]
|
|
||||||
set -a new_path $__extra_functionsdir
|
|
||||||
set fish_function_path $new_path $fish_function_path[$idx..-1]
|
|
||||||
else
|
|
||||||
set -a fish_function_path $__extra_functionsdir
|
|
||||||
end
|
|
||||||
|
|
||||||
### Configure fish_complete_path ###
|
|
||||||
# Remove any of our extra paths that may already exist.
|
|
||||||
for path in $__extra_completionsdir
|
|
||||||
if set -l idx (contains --index -- $path $fish_complete_path)
|
|
||||||
set -e fish_complete_path[$idx]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
# Insert the paths before $__fish_data_dir.
|
|
||||||
if set -l idx (contains --index -- $__fish_data_dir/completions $fish_complete_path)
|
|
||||||
set -l new_path $fish_complete_path[1..$idx]
|
|
||||||
set -e new_path[$idx]
|
|
||||||
set -a new_path $__extra_completionsdir
|
|
||||||
set fish_complete_path $new_path $fish_complete_path[$idx..-1]
|
|
||||||
else
|
|
||||||
set -a fish_complete_path $__extra_completionsdir
|
|
||||||
end
|
|
||||||
|
|
||||||
### Source conf directories ###
|
|
||||||
# The built-in directories were already sourced during shell initialization.
|
|
||||||
# Any __extra_confdir that came from $__fish_data_dir/__fish_build_paths.fish was also sourced.
|
|
||||||
# As explained above, we're using the presence of pre-existing paths in $fish_function_path as a
|
|
||||||
# signal that the corresponding conf dir has also already been sourced.
|
|
||||||
# In order to simulate this, we'll run through the same algorithm as found in
|
|
||||||
# $__fish_data_dir/config.fish except we'll avoid sourcing the file if it comes from an
|
|
||||||
# already-sourced location.
|
|
||||||
# Caveats:
|
|
||||||
# * Files will be sourced in a different order than we'd ideally do (because we're coming in
|
|
||||||
# after the fact to source them).
|
|
||||||
# * If there are existing extra conf paths, files in them may have been sourced that should have
|
|
||||||
# been suppressed by paths we're inserting in front.
|
|
||||||
# * Similarly any files in $__fish_data_dir/vendor_conf.d that should have been suppressed won't
|
|
||||||
# have been.
|
|
||||||
set -l sourcelist
|
|
||||||
for file in $__fish_config_dir/conf.d/*.fish $__fish_sysconf_dir/conf.d/*.fish
|
|
||||||
# We know these paths were sourced already. Just record them.
|
|
||||||
set -l basename (string replace -r '^.*/' '' -- $file)
|
|
||||||
contains -- $basename $sourcelist
|
|
||||||
or set -a sourcelist $basename
|
|
||||||
end
|
|
||||||
for root in $__extra_confdir
|
|
||||||
for file in $root/*.fish
|
|
||||||
set -l basename (string replace -r '^.*/' '' -- $file)
|
|
||||||
contains -- $basename $sourcelist
|
|
||||||
and continue
|
|
||||||
set -a sourcelist $basename
|
|
||||||
contains -- $root $existing_conf_paths
|
|
||||||
and continue # this is a pre-existing path, it will have been sourced already
|
|
||||||
[ -f $file -a -r $file ]
|
|
||||||
and source $file
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -38,4 +38,7 @@ if status --is-interactive
|
|||||||
|
|
||||||
# Use `starship` prompt
|
# Use `starship` prompt
|
||||||
starship init fish | source
|
starship init fish | source
|
||||||
|
|
||||||
|
# Hook into direnv
|
||||||
|
direnv hook fish | source
|
||||||
end
|
end
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
function abbrs --description 'All abbreviations'
|
function abbrs --description 'All abbreviations'
|
||||||
|
|
||||||
# Directory aliases
|
# Directory aliases
|
||||||
abbr -a l 'ls'
|
abbr -a l ls
|
||||||
abbr -a lh 'ls -lh'
|
abbr -a lh 'ls -lh'
|
||||||
abbr -a ll 'ls -alhF'
|
abbr -a ll 'ls -alhF'
|
||||||
abbr -a lf 'ls -lh | fzf'
|
abbr -a lf 'ls -lh | fzf'
|
||||||
abbr -a c 'cd'
|
abbr -a c cd
|
||||||
abbr -a -- - 'cd -'
|
abbr -a -- - 'cd -'
|
||||||
abbr -a proj 'cd $PROJ'
|
abbr -a proj 'cd $PROJ'
|
||||||
abbr -a mkd 'mkdir -pv'
|
abbr -a mkd 'mkdir -pv'
|
||||||
@ -18,7 +18,7 @@ function abbrs --description 'All abbreviations'
|
|||||||
abbr -a tnn 'tmux new-session -s noah'
|
abbr -a tnn 'tmux new-session -s noah'
|
||||||
|
|
||||||
# Git
|
# Git
|
||||||
abbr -a g 'git'
|
abbr -a g git
|
||||||
abbr -a gs 'git status'
|
abbr -a gs 'git status'
|
||||||
abbr -a gd 'git diff'
|
abbr -a gd 'git diff'
|
||||||
abbr -a gds 'git diff --staged'
|
abbr -a gds 'git diff --staged'
|
||||||
@ -27,10 +27,10 @@ function abbrs --description 'All abbreviations'
|
|||||||
abbr -a gaa 'git add -A'
|
abbr -a gaa 'git add -A'
|
||||||
abbr -a gac 'git commit -am'
|
abbr -a gac 'git commit -am'
|
||||||
abbr -a gc 'git commit -m'
|
abbr -a gc 'git commit -m'
|
||||||
abbr -a gca 'git commit --amend'
|
abbr -a gca 'git commit --amend --no-edit'
|
||||||
abbr -a gu 'git pull'
|
abbr -a gu 'git pull'
|
||||||
abbr -a gp 'git push'
|
abbr -a gp 'git push'
|
||||||
abbr -a gpp 'git_set_upstream'
|
abbr -a gpp git-push-upstream
|
||||||
abbr -a gl 'git log --graph --decorate --oneline -20'
|
abbr -a gl 'git log --graph --decorate --oneline -20'
|
||||||
abbr -a gll 'git log --graph --decorate --oneline'
|
abbr -a gll 'git log --graph --decorate --oneline'
|
||||||
abbr -a gco 'git checkout'
|
abbr -a gco 'git checkout'
|
||||||
@ -47,40 +47,46 @@ function abbrs --description 'All abbreviations'
|
|||||||
|
|
||||||
# GitHub
|
# GitHub
|
||||||
abbr -a ghr 'gh repo view -w'
|
abbr -a ghr 'gh repo view -w'
|
||||||
abbr -a gha 'gh run list | head -1 | awk \'{ print $NF }\' | xargs gh run view'
|
abbr -a gha 'gh run list | head -1 | awk \'{ print $(NF-2) }\' | xargs gh run view'
|
||||||
abbr -a grw 'gh run watch'
|
abbr -a grw 'noti gh run watch'
|
||||||
abbr -a grf 'gh run view --log-failed'
|
abbr -a grf 'gh run view --log-failed'
|
||||||
abbr -a grl 'gh run view --log'
|
abbr -a grl 'gh run view --log'
|
||||||
|
abbr -a ghpr 'gh pr create && sleep 3 && noti gh run watch'
|
||||||
|
abbr -a ghm 'gh pr merge -s -d && git pull'
|
||||||
|
|
||||||
# Vim
|
# Vim
|
||||||
if command -v nvim > /dev/null
|
if command -v nvim >/dev/null
|
||||||
alias --save vim='nvim'
|
alias --save vim='nvim'
|
||||||
abbr -a vimrc 'vim $HOME/.config/nvim/init.lua'
|
abbr -a vimrc 'vim $HOME/.config/nvim/init.lua'
|
||||||
else
|
else
|
||||||
alias --save vim='vim'
|
alias --save vim='vim'
|
||||||
abbr -a vimrc 'vim $HOME/.vimrc'
|
abbr -a vimrc 'vim $HOME/.vimrc'
|
||||||
end
|
end
|
||||||
abbr -a v 'vim'
|
abbr -a v vim
|
||||||
abbr -a vl 'vim -c "normal! `0"'
|
abbr -a vl 'vim -c "normal! `0"'
|
||||||
abbr -a vll 'vim -c "Hist"'
|
abbr -a vll 'vim -c "Telescope oldfiles"'
|
||||||
|
abbr -a vh 'vim -c "Telescope oldfiles"'
|
||||||
|
|
||||||
# Notes
|
# Notes
|
||||||
abbr -a qn 'quicknote'
|
abbr -a qn quicknote
|
||||||
abbr -a sn 'syncnotes'
|
abbr -a sn syncnotes
|
||||||
|
abbr -a to today
|
||||||
abbr -a work 'vim $NOTES_PATH/work.md'
|
abbr -a work 'vim $NOTES_PATH/work.md'
|
||||||
|
|
||||||
|
# RSS
|
||||||
|
abbr -a nb newsboat
|
||||||
|
|
||||||
# Improved CLI Tools
|
# Improved CLI Tools
|
||||||
abbr -a cat 'bat' # Swap cat with bat
|
abbr -a cat bat # Swap cat with bat
|
||||||
abbr -a h 'http -Fh --all' # Curl site for headers
|
abbr -a h 'http -Fh --all' # Curl site for headers
|
||||||
|
abbr -a j just
|
||||||
|
|
||||||
# Fun CLI Tools
|
# Fun CLI Tools
|
||||||
abbr goo 'googler'
|
|
||||||
abbr gooj 'googler -j'
|
|
||||||
abbr weather 'curl wttr.in/$WEATHER_CITY'
|
abbr weather 'curl wttr.in/$WEATHER_CITY'
|
||||||
abbr moon 'curl wttr.in/Moon'
|
abbr moon 'curl wttr.in/Moon'
|
||||||
|
|
||||||
# Dotfile and config shortcuts
|
# Dotfile and config shortcuts
|
||||||
abbr -a s 'sudo'
|
abbr -a s sudo
|
||||||
abbr -a boot '$DOTS/scripts/bootstrap'
|
abbr -a boot '$DOTS/scripts/bootstrap'
|
||||||
abbr -a sshc 'vim ~/.ssh/config'
|
abbr -a sshc 'vim ~/.ssh/config'
|
||||||
abbr -a hosts 'sudo nvim /etc/hosts'
|
abbr -a hosts 'sudo nvim /etc/hosts'
|
||||||
@ -89,11 +95,12 @@ function abbrs --description 'All abbreviations'
|
|||||||
|
|
||||||
# Cheat Sheets
|
# Cheat Sheets
|
||||||
abbr -a ssl 'openssl req -new -newkey rsa:2048 -nodes' \
|
abbr -a ssl 'openssl req -new -newkey rsa:2048 -nodes' \
|
||||||
'-keyout server.key -out server.csr'
|
'-keyout server.key -out server.csr'
|
||||||
abbr -a fingerprint 'ssh-keyscan myhost.com | ssh-keygen -lf -'
|
abbr -a fingerprint 'ssh-keyscan myhost.com | ssh-keygen -lf -'
|
||||||
abbr -a publickey 'ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub'
|
abbr -a publickey 'ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub'
|
||||||
abbr -a forloop 'for i in (seq 1 100)'
|
abbr -a forloop 'for i in (seq 1 100)'
|
||||||
abbr -a gatekeeper 'sudo spctl --master-disable'
|
abbr -a gatekeeper 'sudo spctl --master-disable'
|
||||||
|
abbr -a flushdns 'sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder'
|
||||||
|
|
||||||
# Docker
|
# Docker
|
||||||
abbr -a dc '$DOTS/bin/docker_cleanup'
|
abbr -a dc '$DOTS/bin/docker_cleanup'
|
||||||
@ -105,37 +112,37 @@ function abbrs --description 'All abbreviations'
|
|||||||
abbr -a alp 'docker run --rm -it -v $PWD:/project alpine sh'
|
abbr -a alp 'docker run --rm -it -v $PWD:/project alpine sh'
|
||||||
|
|
||||||
# Terraform
|
# Terraform
|
||||||
abbr -a te 'terraform'
|
abbr -a te terraform
|
||||||
abbr -a tap 'terraform apply'
|
abbr -a tap 'terraform apply'
|
||||||
|
|
||||||
# Kubernetes
|
# Kubernetes
|
||||||
abbr -a k 'kubectl'
|
abbr -a k kubectl
|
||||||
abbr -a pods 'kubectl get pods -A'
|
abbr -a pods 'kubectl get pods -A'
|
||||||
abbr -a nodes 'kubectl get nodes'
|
abbr -a nodes 'kubectl get nodes'
|
||||||
abbr -a deploys 'kubectl get deployments -A'
|
abbr -a deploys 'kubectl get deployments -A'
|
||||||
abbr -a dash 'kube-dashboard'
|
abbr -a dash kube-dashboard
|
||||||
abbr -a ks 'k9s'
|
abbr -a ks k9s
|
||||||
|
|
||||||
# Cloud
|
# Cloud
|
||||||
abbr -a awsc 'vim ~/.aws/credentials'
|
abbr -a awsc 'vim ~/.aws/credentials'
|
||||||
|
|
||||||
# Python
|
# Python
|
||||||
abbr -a py 'python'
|
abbr -a py python
|
||||||
abbr -a po 'poetry'
|
abbr -a po poetry
|
||||||
abbr -a pr 'poetry run python'
|
abbr -a pr 'poetry run python'
|
||||||
abbr -a pl 'poetry run pylint *'
|
abbr -a pl 'poetry run pylint *'
|
||||||
abbr -a black 'poetry run black --target-version py38 .'
|
abbr -a black 'poetry run black --target-version py38 .'
|
||||||
abbr -a bl 'poetry run black --target-version py38 .'
|
abbr -a bl 'poetry run black --target-version py38 .'
|
||||||
|
|
||||||
# Rust
|
# Rust
|
||||||
abbr -a ca 'cargo'
|
abbr -a ca cargo
|
||||||
|
|
||||||
# macOS
|
# macOS
|
||||||
abbr -a casks 'vim $DOTS/homebrew/Caskfile'
|
abbr -a casks 'vim $DOTS/homebrew/Caskfile'
|
||||||
abbr -a t 'trash'
|
abbr -a t trash
|
||||||
|
|
||||||
# Linux
|
# Linux
|
||||||
if [ (uname) = "Linux" ]
|
if [ (uname) = Linux ]
|
||||||
linux
|
linux
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -8,4 +8,5 @@ function fcd --description 'Jump to directory' -a 'directory'
|
|||||||
end
|
end
|
||||||
set jump (fd -t d . $directory | fzf)
|
set jump (fd -t d . $directory | fzf)
|
||||||
and cd $jump $argv;
|
and cd $jump $argv;
|
||||||
|
and commandline -f execute;
|
||||||
end
|
end
|
||||||
|
@ -2,8 +2,16 @@
|
|||||||
|
|
||||||
function fish_user_key_bindings
|
function fish_user_key_bindings
|
||||||
bind -M insert \co 'edit'
|
bind -M insert \co 'edit'
|
||||||
|
bind -M default \co 'edit'
|
||||||
|
bind -M insert \ca 'cd ~; and edit; and commandline -a "; cd -"; commandline -f execute'
|
||||||
|
bind -M default \ca 'cd ~; and edit; and commandline -a "; cd -"; commandline -f execute'
|
||||||
bind -M insert \ce 'recent'
|
bind -M insert \ce 'recent'
|
||||||
|
bind -M default \ce 'recent'
|
||||||
bind -M insert \cg 'commandline-git-commits'
|
bind -M insert \cg 'commandline-git-commits'
|
||||||
|
bind -M insert \cf 'fcd'
|
||||||
|
bind -M default \cf 'fcd'
|
||||||
|
bind -M insert \cp 'prj'
|
||||||
|
bind -M default \cp 'prj'
|
||||||
bind -M insert \x1F accept-autosuggestion
|
bind -M insert \x1F accept-autosuggestion
|
||||||
bind -M default \x1F accept-autosuggestion
|
bind -M default \x1F accept-autosuggestion
|
||||||
end
|
end
|
||||||
|
@ -4,6 +4,7 @@ function git-add-fuzzy
|
|||||||
--height 50% \
|
--height 50% \
|
||||||
-m \
|
-m \
|
||||||
--preview-window right:70% \
|
--preview-window right:70% \
|
||||||
|
--layout reverse \
|
||||||
--preview 'set -l IFS; set gd (git diff --color=always (echo {} | awk \'{$1=$1};1\' | cut -d" " -f2)); if test "$gd"; echo "$gd"; else; bat --color=always (echo {} | awk \'{$1=$1};1\' | cut -d" " -f2); end')
|
--preview 'set -l IFS; set gd (git diff --color=always (echo {} | awk \'{$1=$1};1\' | cut -d" " -f2)); if test "$gd"; echo "$gd"; else; bat --color=always (echo {} | awk \'{$1=$1};1\' | cut -d" " -f2); end')
|
||||||
and for gf in $gitfile
|
and for gf in $gitfile
|
||||||
set gf (echo $gf \
|
set gf (echo $gf \
|
||||||
|
6
fish.configlink/functions/git-push-upstream.fish
Normal file
6
fish.configlink/functions/git-push-upstream.fish
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
function git-push-upstream --description "Create upstream branch"
|
||||||
|
set -l branch (git branch 2>/dev/null | grep '^\*' | colrm 1 2)
|
||||||
|
set -l command "git push --set-upstream origin $branch"
|
||||||
|
commandline -r $command
|
||||||
|
commandline -f execute
|
||||||
|
end
|
@ -1,4 +1,4 @@
|
|||||||
function note-header
|
function note-header
|
||||||
set -g CURRENT_WEATHER (curl -s "https://wttr.in/?format=1")
|
set -g CURRENT_WEATHER (curl -s "https://wttr.in/?format=1")
|
||||||
set -g JOURNAL_HEADER "[Yesterday]($YESTERDAY_NOTE.md) | [Home](home.md) | [Tomorrow]($TOMORROW_NOTE.md)\n\n$LONG_DATE\n$CURRENT_WEATHER\n#journal\n\n---\n\n"
|
set -g JOURNAL_HEADER "[Yesterday]($YESTERDAY_NOTE.md) | [Home](../home.md) | [Today](obsidian://advanced-uri?daily=true) | [Tomorrow]($TOMORROW_NOTE.md)\n\n$LONG_DATE\n$CURRENT_WEATHER\n#journal\n\n---\n\n"
|
||||||
end
|
end
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
function prj --description "cd to a project"
|
function prj --description "cd to a project"
|
||||||
set projdir (ls $PROJ | fzf)
|
set projdir (ls $PROJ | fzf)
|
||||||
and cd $PROJ/$projdir
|
and cd $PROJ/$projdir
|
||||||
|
and commandline -f execute
|
||||||
end
|
end
|
||||||
|
42
fish.configlink/functions/repos.fish
Executable file
42
fish.configlink/functions/repos.fish
Executable file
@ -0,0 +1,42 @@
|
|||||||
|
#!/usr/local/bin/fish
|
||||||
|
|
||||||
|
function repos --description 'Clone GitHub repositories' -a 'organization'
|
||||||
|
set directory (gh-repos $organization)
|
||||||
|
and cd $directory
|
||||||
|
end
|
||||||
|
#switch $organization
|
||||||
|
# case t2; set organization "take-two"
|
||||||
|
# case d2c; set organization "take-two-t2gp"
|
||||||
|
# case t2gp; set organization "take-two-t2gp"
|
||||||
|
# case pd; set organization "private-division"
|
||||||
|
# case dots; set organization "playdots"
|
||||||
|
# case '*'; set organization "nmasur"
|
||||||
|
#end
|
||||||
|
|
||||||
|
#set selected (gh repo list "$organization" \
|
||||||
|
# --limit 50 \
|
||||||
|
# --no-archived \
|
||||||
|
# --json=name,description,isPrivate,updatedAt,primaryLanguage \
|
||||||
|
# | jq -r '.[] | .name + "," + if .description == "" then "-" else .description end + "," + .updatedAt + "," + .primaryLanguage.name' \
|
||||||
|
# | begin
|
||||||
|
# echo "REPO,DESCRIPTION,UPDATED,LANGUAGE"
|
||||||
|
# cat -
|
||||||
|
# end | column -s , -t
|
||||||
|
# | fzf \
|
||||||
|
# --header-lines=1 \
|
||||||
|
# --layout=reverse
|
||||||
|
#--bind "ctrl-o:execute:gh repo view -w $organization/{1}" \
|
||||||
|
#--preview "GH_FORCE_TTY=49% gh repo view $organization/{1} | glow -" \
|
||||||
|
#--preview-window up
|
||||||
|
#)
|
||||||
|
#if test -n (echo $selected | tr -d '\r')
|
||||||
|
# set directory "$HOME/dev/work"
|
||||||
|
# if test $organization = "nmasur"
|
||||||
|
# set directory "$HOME/dev/personal"
|
||||||
|
# end
|
||||||
|
# set repo (echo $selected | awk '{print $1}')
|
||||||
|
# set repo_full "$organization/$repo"
|
||||||
|
# gh repo clone "$repo_full" "$directory/$repo"
|
||||||
|
# cd "$directory/$repo"
|
||||||
|
#end
|
||||||
|
#end
|
16
fish.configlink/functions/uncommitted.fish
Executable file
16
fish.configlink/functions/uncommitted.fish
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/local/bin/fish
|
||||||
|
|
||||||
|
function uncommitted --description "Find uncommitted git repos"
|
||||||
|
set current_dir (pwd)
|
||||||
|
cd $HOME/dev
|
||||||
|
find . -type d -name '.git' | \
|
||||||
|
while read dir
|
||||||
|
cd $dir/../
|
||||||
|
and if test -n (echo (git status -s))
|
||||||
|
pwd
|
||||||
|
git status -s
|
||||||
|
end
|
||||||
|
cd -
|
||||||
|
end
|
||||||
|
cd $current_dir
|
||||||
|
end
|
29
fish.configlink/functions/up-or-search.fish
Normal file
29
fish.configlink/functions/up-or-search.fish
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# by @farcaller from https://github.com/fish-shell/fish-shell/issues/825#issuecomment-440286038
|
||||||
|
|
||||||
|
function up-or-search -d "Depending on cursor position and current mode, either search backward or move up one line"
|
||||||
|
# If we are already in search mode, continue
|
||||||
|
if commandline --search-mode
|
||||||
|
commandline -f history-search-backward
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
# If we are navigating the pager, then up always navigates
|
||||||
|
if commandline --paging-mode
|
||||||
|
commandline -f up-line
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
# We are not already in search mode.
|
||||||
|
# If we are on the top line, start search mode,
|
||||||
|
# otherwise move up
|
||||||
|
set lineno (commandline -L)
|
||||||
|
|
||||||
|
switch $lineno
|
||||||
|
case 1
|
||||||
|
commandline -f history-search-backward
|
||||||
|
history merge # <-- ADDED THIS
|
||||||
|
|
||||||
|
case '*'
|
||||||
|
commandline -f up-line
|
||||||
|
end
|
||||||
|
end
|
@ -39,15 +39,20 @@ function obj:init()
|
|||||||
|
|
||||||
-- Control was not down but is now
|
-- Control was not down but is now
|
||||||
if not self.lastModifiers['ctrl'] then
|
if not self.lastModifiers['ctrl'] then
|
||||||
|
|
||||||
|
-- Only prepare to send escape if no other modifier keys are in use
|
||||||
self.lastModifiers = newModifiers
|
self.lastModifiers = newModifiers
|
||||||
if (not self.lastModifiers['cmd'] and not self.lastModifiers['alt']) then
|
if (not self.lastModifiers['cmd'] and not self.lastModifiers['alt']) then
|
||||||
self.sendEscape = true
|
self.sendEscape = true
|
||||||
self.movements = 0
|
self.movements = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Control was down and is up, hasn't been blocked by another key, and
|
-- Control was down and is up, hasn't been blocked by another key, and
|
||||||
-- isn't above the movement threshold
|
-- isn't above the movement threshold
|
||||||
elseif (self.sendEscape == true and not newModifiers['ctrl'] and self.movements < 20) then
|
elseif (self.sendEscape == true and not newModifiers['ctrl'] and self.movements < 30) then
|
||||||
|
|
||||||
self.lastModifiers = newModifiers
|
self.lastModifiers = newModifiers
|
||||||
|
|
||||||
-- Allow for shift-escape
|
-- Allow for shift-escape
|
||||||
if newModifiers['shift'] then
|
if newModifiers['shift'] then
|
||||||
hs.eventtap.keyStroke({'shift'}, 'escape', 0)
|
hs.eventtap.keyStroke({'shift'}, 'escape', 0)
|
||||||
@ -56,8 +61,12 @@ function obj:init()
|
|||||||
end
|
end
|
||||||
self.sendEscape = false
|
self.sendEscape = false
|
||||||
self.movements = 0
|
self.movements = 0
|
||||||
|
self.numberOfCharacters = 0
|
||||||
|
|
||||||
|
-- Control was down and is up, but isn't ready to send escape
|
||||||
else
|
else
|
||||||
self.lastModifiers = newModifiers
|
self.lastModifiers = newModifiers
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
@ -65,7 +74,7 @@ function obj:init()
|
|||||||
-- If any other key is pressed, don't send escape
|
-- If any other key is pressed, don't send escape
|
||||||
self.asModifier = hs.eventtap.new({hs.eventtap.event.types.keyDown},
|
self.asModifier = hs.eventtap.new({hs.eventtap.event.types.keyDown},
|
||||||
function(event)
|
function(event)
|
||||||
self.sendEscape = false
|
self.sendEscape = false
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
77
hammerspoon.symlink/Spoons/Launcher.spoon/init.lua
Normal file
77
hammerspoon.symlink/Spoons/Launcher.spoon/init.lua
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
--- === Launcher ===
|
||||||
|
|
||||||
|
local obj = {}
|
||||||
|
obj.__index = obj
|
||||||
|
|
||||||
|
-- Metadata
|
||||||
|
obj.name = "Launcher"
|
||||||
|
obj.version = "0.1"
|
||||||
|
obj.license = "MIT - https://opensource.org/licenses/MIT"
|
||||||
|
|
||||||
|
function obj:init()
|
||||||
|
-- Begin launcher mode
|
||||||
|
self.launcher = hs.hotkey.modal.new("ctrl", "space")
|
||||||
|
|
||||||
|
-- Behaviors on enter
|
||||||
|
function self.launcher:entered()
|
||||||
|
-- hs.alert'Entered mode'
|
||||||
|
end
|
||||||
|
-- Behaviors on exit
|
||||||
|
function self.launcher:exited()
|
||||||
|
-- hs.alert'Exited mode'
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Use escape to exit launcher mode
|
||||||
|
self.launcher:bind("", "escape", function()
|
||||||
|
self.launcher:exit()
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- Launcher shortcuts
|
||||||
|
self.launcher:bind("", "space", function()
|
||||||
|
hs.hints.windowHints()
|
||||||
|
self.launcher:exit()
|
||||||
|
end)
|
||||||
|
self.launcher:bind("", "return", function()
|
||||||
|
self:switch("Alacritty.app")
|
||||||
|
end)
|
||||||
|
self.launcher:bind("", "C", function()
|
||||||
|
self:switch("Calendar.app")
|
||||||
|
end)
|
||||||
|
self.launcher:bind("", "D", function()
|
||||||
|
self:switch("Discord.app")
|
||||||
|
end)
|
||||||
|
self.launcher:bind("", "E", function()
|
||||||
|
self:switch("Mail.app")
|
||||||
|
end)
|
||||||
|
self.launcher:bind("", "F", function()
|
||||||
|
self:switch("Firefox.app")
|
||||||
|
end)
|
||||||
|
self.launcher:bind("", "G", function()
|
||||||
|
self:switch("Mimestream.app")
|
||||||
|
end)
|
||||||
|
self.launcher:bind("", "M", function()
|
||||||
|
self:switch("Messages.app")
|
||||||
|
end)
|
||||||
|
self.launcher:bind("", "O", function()
|
||||||
|
self:switch("Obsidian.app")
|
||||||
|
end)
|
||||||
|
self.launcher:bind("", "P", function()
|
||||||
|
self:switch("System Preferences.app")
|
||||||
|
end)
|
||||||
|
self.launcher:bind("", "R", function()
|
||||||
|
hs.reload()
|
||||||
|
end)
|
||||||
|
self.launcher:bind("", "S", function()
|
||||||
|
self:switch("Slack.app")
|
||||||
|
end)
|
||||||
|
self.launcher:bind("", "Z", function()
|
||||||
|
self:switch("zoom.us.app")
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function obj:switch(app)
|
||||||
|
hs.application.launchOrFocus(app)
|
||||||
|
self.launcher:exit()
|
||||||
|
end
|
||||||
|
|
||||||
|
return obj
|
@ -1 +1,2 @@
|
|||||||
hs.loadSpoon('ControlEscape'):start() -- Load Hammerspoon bits from https://github.com/jasonrudolph/ControlEscape.spoon
|
hs.loadSpoon('ControlEscape'):start() -- Load Hammerspoon bits from https://github.com/jasonrudolph/ControlEscape.spoon
|
||||||
|
hs.loadSpoon('Launcher'):init()
|
||||||
|
@ -3,36 +3,36 @@ tap "homebrew/cask"
|
|||||||
# Core Applications
|
# Core Applications
|
||||||
cask "alacritty" # Terminal
|
cask "alacritty" # Terminal
|
||||||
cask "firefox" # Browser
|
cask "firefox" # Browser
|
||||||
cask "slack" # Chat
|
#cask "slack" # Chat
|
||||||
cask "zoomus" # Video conference
|
#cask "zoomus" # Video conference
|
||||||
cask "1password" # Passwords
|
cask "1password" # Passwords
|
||||||
cask "dropbox" # File sync
|
cask "dropbox" # File sync
|
||||||
cask "docker" # Containers
|
#cask "docker" # Containers
|
||||||
|
|
||||||
# Helpful Applications
|
# Helpful Applications
|
||||||
cask "obsidian" # Notes
|
cask "obsidian" # Notes
|
||||||
cask "github-desktop" # Git GUI
|
|
||||||
cask "drawio" # Diagrams
|
|
||||||
|
|
||||||
# Auxiliary Tools
|
# Auxiliary Tools
|
||||||
cask "scroll-reverser" # Mouse vs. trackpad
|
cask "scroll-reverser" # Mouse vs. trackpad
|
||||||
cask "meetingbar" # Scheduling
|
cask "meetingbar" # Scheduling
|
||||||
cask "gitify" # GitHub notifications
|
cask "gitify" # GitHub notifications
|
||||||
cask "basictex" # Small LaTeX distribution
|
# cask "basictex" # Small LaTeX distribution
|
||||||
cask "hammerspoon"
|
cask "hammerspoon"
|
||||||
|
|
||||||
|
tap "homebrew/cask-drivers"
|
||||||
|
cask "logitech-g-hub" # Hardware drivers
|
||||||
|
|
||||||
# Fonts
|
# Fonts
|
||||||
tap "homebrew/cask-fonts"
|
tap "homebrew/cask-fonts"
|
||||||
cask "font-fira-mono-for-powerline"
|
cask "font-fira-mono-nerd-font"
|
||||||
|
|
||||||
# Personal
|
# Personal
|
||||||
cask "authy" # Authentication
|
|
||||||
cask "keybase" # Encryption
|
cask "keybase" # Encryption
|
||||||
cask "discord" # Chat
|
cask "discord" # Chat
|
||||||
cask "steam" # Games
|
#cask "steam" # Games
|
||||||
cask "epic-games" # Games
|
#cask "epic-games" # Games
|
||||||
cask "calibre" # E-Books
|
#cask "calibre" # E-Books
|
||||||
cask "signal" # Messaging
|
#cask "signal" # Messaging
|
||||||
|
|
||||||
# Maybe
|
# Maybe
|
||||||
cask "jira-client" # Project Management
|
#cask "jira-client" # Project Management
|
||||||
|
@ -13,3 +13,5 @@ brew "exa" # Better ls
|
|||||||
brew "bat" # Better cat
|
brew "bat" # Better cat
|
||||||
brew "fzf" # Fuzzy finder
|
brew "fzf" # Fuzzy finder
|
||||||
brew "tealdeer" # Mini man page
|
brew "tealdeer" # Mini man page
|
||||||
|
brew "direnv" # Environment variables
|
||||||
|
brew "glow" # Markdown previews
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# DevOps Packages
|
# DevOps Packages
|
||||||
|
|
||||||
tap "nmasur/repo"
|
tap "nmasur/repo"
|
||||||
|
tap "hashicorp/tap"
|
||||||
|
|
||||||
brew "ansible" # Deploy to local server
|
brew "ansible" # Deploy to local server
|
||||||
brew "terraform" # Deploy cloud infra
|
brew "terraform" # Deploy cloud infra
|
||||||
@ -9,3 +10,5 @@ brew "awscli" # AWS API tools
|
|||||||
brew "kubectl" # Kubernetes CLI
|
brew "kubectl" # Kubernetes CLI
|
||||||
brew "k9s" # Kubernetes TUI
|
brew "k9s" # Kubernetes TUI
|
||||||
brew "nmasur/repo/drips" # Retrieve AWS IPs
|
brew "nmasur/repo/drips" # Retrieve AWS IPs
|
||||||
|
brew "hashicorp/tap/terraform-ls"
|
||||||
|
brew "tflint"
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Fun / Unnecessary Packages
|
# Fun / Unnecessary Packages
|
||||||
|
|
||||||
tap "nmasur/repo"
|
#tap "nmasur/repo"
|
||||||
tap "tarkah/tickrs"
|
#tap "tarkah/tickrs"
|
||||||
|
|
||||||
brew "ffmpeg" # Convert videos
|
#brew "ffmpeg" # Convert videos
|
||||||
brew "nmasur/repo/bee" # Cheat on NYTimes Spelling Bee
|
#brew "nmasur/repo/bee" # Cheat on NYTimes Spelling Bee
|
||||||
brew "tarkah/tickrs/tickrs" # Interactive stock tickers
|
#brew "tarkah/tickrs/tickrs" # Interactive stock tickers
|
||||||
|
@ -4,14 +4,14 @@ tap "superfly/tap"
|
|||||||
tap "nmasur/repo"
|
tap "nmasur/repo"
|
||||||
tap "cjbassi/ytop"
|
tap "cjbassi/ytop"
|
||||||
|
|
||||||
brew "superfly/tap/flyctl" # Fly.io CLI
|
#brew "superfly/tap/flyctl" # Fly.io CLI
|
||||||
brew "ghc" # Haskell
|
#brew "ghc" # Haskell
|
||||||
brew "xsv" # CSV manipulation
|
#brew "xsv" # CSV manipulation
|
||||||
brew "gron" # JSON grep
|
#brew "gron" # JSON grep
|
||||||
brew "nushell" # Data manipulation shell
|
#brew "nushell" # Data manipulation shell
|
||||||
brew "tectonic" # Minimal LaTeX compiler
|
#brew "tectonic" # Minimal LaTeX compiler
|
||||||
brew "noti" # Create system notifications
|
brew "noti" # Create system notifications
|
||||||
brew "b2-tools" # BackBlaze B2 storage
|
#brew "b2-tools" # BackBlaze B2 storage
|
||||||
brew "cjbassi/ytop/ytop" # Fancy system performance
|
#brew "cjbassi/ytop/ytop" # Fancy system performance
|
||||||
brew "nmasur/repo/update-ssh-config" # Update .ssh/config
|
#brew "nmasur/repo/update-ssh-config" # Update .ssh/config
|
||||||
brew "awslogs" # View AWS log streams
|
brew "awslogs" # View AWS log streams
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
brew "shellcheck" # Lint for bash
|
brew "shellcheck" # Lint for bash
|
||||||
brew "shfmt" # Formatter for bash
|
brew "shfmt" # Formatter for bash
|
||||||
|
brew "stylua" # Formatter for lua
|
||||||
brew "python" # Latest version of Python
|
brew "python" # Latest version of Python
|
||||||
brew "ipython" # Better interactive Python shell
|
brew "ipython" # Better interactive Python shell
|
||||||
brew "poetry" # Project-based Python dependencies
|
brew "poetry" # Project-based Python dependencies
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# Utility Packages
|
# Utility Packages
|
||||||
|
|
||||||
|
tap "saulpw/vd"
|
||||||
|
|
||||||
brew "jq" # JSON manipulation
|
brew "jq" # JSON manipulation
|
||||||
brew "dos2unix" # File conversion
|
brew "dos2unix" # File conversion
|
||||||
brew "tree" # Display directory trees
|
brew "tree" # Display directory trees
|
||||||
@ -12,8 +14,7 @@ brew "gpg" # Encryption
|
|||||||
brew "qrencode" # Make a QR code
|
brew "qrencode" # Make a QR code
|
||||||
brew "mpv" # Video player
|
brew "mpv" # Video player
|
||||||
brew "youtube-dl" # Download YouTube videos
|
brew "youtube-dl" # Download YouTube videos
|
||||||
brew "googler" # Search Google
|
|
||||||
brew "gh" # GitHub commands
|
brew "gh" # GitHub commands
|
||||||
brew "pandoc" # Document converter
|
brew "pandoc" # Document converter
|
||||||
brew "visidata" # Spreadsheet manipulation
|
brew "saulpw/vd/visidata" # Spreadsheet manipulation
|
||||||
brew "mdp" # Terminal slideshows
|
brew "mdp" # Terminal slideshows
|
||||||
|
8
mpv.configlink/mpv.conf
Normal file
8
mpv.configlink/mpv.conf
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#script-opts=ytdl_hook-ytdl_path=/usr/local/bin/yt-dlp
|
||||||
|
|
||||||
|
[Youtube-dl]
|
||||||
|
profile = protocol.https
|
||||||
|
ytdl-format = bestvideo[height<=?1080]+bestaudio/best[height<=?1080]
|
||||||
|
demuxer-seekable-cache = yes
|
||||||
|
demuxer-max-bytes = 2048MiB
|
||||||
|
demuxer-max-back-bytes = 1024MiB
|
28
newsboat.configlink/com.noah.newsboat.plist
Normal file
28
newsboat.configlink/com.noah.newsboat.plist
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>Label</key>
|
||||||
|
<string>com.noah.newsboat</string>
|
||||||
|
|
||||||
|
<key>ProgramArguments</key>
|
||||||
|
<array>
|
||||||
|
<string>/usr/local/bin/newsboat -x reload</string>
|
||||||
|
</array>
|
||||||
|
|
||||||
|
<key>Nice</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
|
||||||
|
<key>StartInterval</key>
|
||||||
|
<integer>1800</integer>
|
||||||
|
|
||||||
|
<key>RunAtLoad</key>
|
||||||
|
<false/>
|
||||||
|
|
||||||
|
<key>StandardErrorPath</key>
|
||||||
|
<string>/tmp/newsboat.err</string>
|
||||||
|
|
||||||
|
<key>StandardOutPath</key>
|
||||||
|
<string>/tmp/newsboat.out</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
40
newsboat.configlink/config
Normal file
40
newsboat.configlink/config
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
browser "$BROWSER %u"
|
||||||
|
prepopulate-query-feeds yes
|
||||||
|
feed-sort-order lastupdated
|
||||||
|
reload-only-visible-feeds yes
|
||||||
|
text-width 72
|
||||||
|
|
||||||
|
bind-key j down
|
||||||
|
bind-key k up
|
||||||
|
bind-key j next articlelist
|
||||||
|
bind-key k prev articlelist
|
||||||
|
bind-key G end
|
||||||
|
bind-key g home
|
||||||
|
bind-key d pagedown
|
||||||
|
bind-key u pageup
|
||||||
|
bind-key n next-unread
|
||||||
|
bind-key p prev-unread
|
||||||
|
bind-key ; macro-prefix
|
||||||
|
bind-key B bookmark
|
||||||
|
bind-key f edit-flags
|
||||||
|
|
||||||
|
macro v set browser "mpv %u"; open-in-browser; set browser "$BROWSER %u"
|
||||||
|
macro p set browser "echo %u"; one; set browser "$BROWSER %u"
|
||||||
|
macro H set browser "clx view $(echo %u | cut -d '=' -f2)"; one; set browser "$BROWSER %u"
|
||||||
|
macro h set browser "clx view $(echo %u | cut -d '=' -f2)"; two; set browser "$BROWSER %u"
|
||||||
|
macro w set browser "w3m -o confirm_qq=false %u"; open-in-browser; set browser "$BROWSER %u"
|
||||||
|
macro r set browser "url-markdown %u | glow -p -w 72 -"; open-in-browser; set browser "$BROWSER %u"
|
||||||
|
macro d set browser "youtube-dl -o ~/Downloads/%(title)s.%(ext)s %u &"; open-in-browser-noninteractively; set browser "$BROWSER %u"
|
||||||
|
macro n set-tag News; reload-all
|
||||||
|
macro a set-tag All
|
||||||
|
macro e set-tag Reddit; reload-all
|
||||||
|
macro y set-tag YouTube; reload-all
|
||||||
|
|
||||||
|
bookmark-cmd "bookmark"
|
||||||
|
|
||||||
|
highlight article "^(Feed|Title|Author|Link|Date):.*" color243 default
|
||||||
|
highlight article "^(Links):.*" color243 default
|
||||||
|
highlight article "^(\\[[0-9]+\\]):.*" color243 default
|
||||||
|
highlight article "^(\\[[0-9]+\\])" color243 default
|
||||||
|
highlight article "^\\[.*\\]$" color243 default
|
||||||
|
highlight article "^(Title:).*" color249 default
|
146
nixos/configuration.nix
Normal file
146
nixos/configuration.nix
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
# Edit this configuration file to define what should be installed on
|
||||||
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ # Include the results of the hardware scan.
|
||||||
|
/etc/nixos/hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# Use the systemd-boot EFI boot loader.
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
# networking.hostName = "nixos"; # Define your hostname.
|
||||||
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
|
|
||||||
|
# Set your time zone.
|
||||||
|
time.timeZone = "America/New_York";
|
||||||
|
|
||||||
|
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
|
||||||
|
# Per-interface useDHCP will be mandatory in the future, so this generated config
|
||||||
|
# replicates the default behaviour.
|
||||||
|
networking.useDHCP = false;
|
||||||
|
networking.interfaces.enp0s31f6.useDHCP = true;
|
||||||
|
networking.interfaces.wlp3s0.useDHCP = true;
|
||||||
|
|
||||||
|
# Configure network proxy if necessary
|
||||||
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||||
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||||
|
|
||||||
|
# Select internationalisation properties.
|
||||||
|
# i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
# console = {
|
||||||
|
# font = "Lat2-Terminus16";
|
||||||
|
# keyMap = "us";
|
||||||
|
# };
|
||||||
|
|
||||||
|
# Enable the X11 windowing system.
|
||||||
|
# services.xserver.enable = true;
|
||||||
|
services.xserver = {
|
||||||
|
enable = true;
|
||||||
|
desktopManager = {
|
||||||
|
xterm.enable = false;
|
||||||
|
xfce.enable = true;
|
||||||
|
};
|
||||||
|
displayManager.defaultSession = "xfce";
|
||||||
|
|
||||||
|
# Disable mouse acceleration
|
||||||
|
libinput.mouse.accelProfile = "flat";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Configure keymap in X11
|
||||||
|
services.xserver.layout = "us";
|
||||||
|
services.xserver.xkbOptions = "eurosign:e";
|
||||||
|
|
||||||
|
# Enable CUPS to print documents.
|
||||||
|
# services.printing.enable = true;
|
||||||
|
|
||||||
|
# Enable sound.
|
||||||
|
sound.enable = true;
|
||||||
|
hardware.pulseaudio.enable = true;
|
||||||
|
|
||||||
|
# Enable touchpad support (enabled default in most desktopManager).
|
||||||
|
# services.xserver.libinput.enable = true;
|
||||||
|
|
||||||
|
# Replace sudo with doas
|
||||||
|
security = {
|
||||||
|
|
||||||
|
# Remove sudo
|
||||||
|
sudo.enable = false;
|
||||||
|
|
||||||
|
# Add doas
|
||||||
|
doas = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# No password required
|
||||||
|
wheelNeedsPassword = false;
|
||||||
|
|
||||||
|
# Pass environment variables from user to root
|
||||||
|
# Also requires removing password here
|
||||||
|
extraRules = [{
|
||||||
|
groups = [ "wheel" ];
|
||||||
|
noPass = true;
|
||||||
|
keepEnv = true;
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||||
|
users.users.noah = {
|
||||||
|
|
||||||
|
# Not sure what this means tbh
|
||||||
|
isNormalUser = true;
|
||||||
|
|
||||||
|
# Automatically create a password to start
|
||||||
|
initialPassword = "changeme";
|
||||||
|
|
||||||
|
# Enable sudo privileges
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
|
||||||
|
# Use the fish shell
|
||||||
|
shell = pkgs.fish;
|
||||||
|
};
|
||||||
|
|
||||||
|
# List packages installed in system profile. To search, run:
|
||||||
|
# $ nix search wget
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
fish
|
||||||
|
vim
|
||||||
|
wget
|
||||||
|
curl
|
||||||
|
home-manager
|
||||||
|
just
|
||||||
|
];
|
||||||
|
|
||||||
|
# Some programs need SUID wrappers, can be configured further or are
|
||||||
|
# started in user sessions.
|
||||||
|
# programs.mtr.enable = true;
|
||||||
|
# programs.gnupg.agent = {
|
||||||
|
# enable = true;
|
||||||
|
# enableSSHSupport = true;
|
||||||
|
# };
|
||||||
|
|
||||||
|
# List services that you want to enable:
|
||||||
|
|
||||||
|
# Enable the OpenSSH daemon.
|
||||||
|
# services.openssh.enable = true;
|
||||||
|
|
||||||
|
# Open ports in the firewall.
|
||||||
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||||
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||||
|
# Or disable the firewall altogether.
|
||||||
|
# networking.firewall.enable = false;
|
||||||
|
|
||||||
|
# This value determines the NixOS release from which the default
|
||||||
|
# settings for stateful data, like file locations and database versions
|
||||||
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||||
|
# this value at the release version of the first install of this system.
|
||||||
|
# Before changing this value read the documentation for this option
|
||||||
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
|
system.stateVersion = "21.05"; # Did you read the comment?
|
||||||
|
|
||||||
|
}
|
31
nixos/flakes/flake.nix
Normal file
31
nixos/flakes/flake.nix
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
description = "System Config";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "nixpkgs/nixos-21.05";
|
||||||
|
home-manager.url = "github:nix-community/home-manager/release-21.05";
|
||||||
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { nixpkgs, home-manager, ... }: {
|
||||||
|
let
|
||||||
|
system = "x86_64-linux";
|
||||||
|
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
config = { allowUnfree = true; };
|
||||||
|
};
|
||||||
|
|
||||||
|
lib = nixpkgs.lib;
|
||||||
|
|
||||||
|
in {
|
||||||
|
nixosConfigurations = {
|
||||||
|
nixos = lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
modules = [
|
||||||
|
./configuration.nix
|
||||||
|
]
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
157
nixos/home.nix
Normal file
157
nixos/home.nix
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
# Import unstable channel (for Neovim 0.5)
|
||||||
|
unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
firefox
|
||||||
|
unzip
|
||||||
|
# alacritty
|
||||||
|
# unstable.neovim
|
||||||
|
tmux
|
||||||
|
rsync
|
||||||
|
ripgrep
|
||||||
|
bat
|
||||||
|
fd
|
||||||
|
exa
|
||||||
|
sd
|
||||||
|
jq
|
||||||
|
tealdeer
|
||||||
|
zoxide
|
||||||
|
unstable._1password-gui
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.alacritty = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
window = {
|
||||||
|
dimensions = {
|
||||||
|
columns = 110;
|
||||||
|
lines = 30;
|
||||||
|
};
|
||||||
|
padding = {
|
||||||
|
x = 20;
|
||||||
|
y = 20;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
scrolling.history = 10000;
|
||||||
|
font = {
|
||||||
|
size = 15.0;
|
||||||
|
};
|
||||||
|
key_bindings = [
|
||||||
|
{
|
||||||
|
key = "F";
|
||||||
|
mods = "Super";
|
||||||
|
action = "ToggleFullscreen";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "L";
|
||||||
|
mods = "Super";
|
||||||
|
chars = "\x1F";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.fish = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
EDITOR = "nvim";
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.starship = {
|
||||||
|
enable = true;
|
||||||
|
enableFishIntegration = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.fzf = {
|
||||||
|
enable = true;
|
||||||
|
enableFishIntegration = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Other configs
|
||||||
|
xdg.configFile = {
|
||||||
|
"starship.toml".source = ../starship/starship.toml.configlink;
|
||||||
|
#"alacritty/alacritty.yml".source = ../alacritty.configlink/alacritty.yml;
|
||||||
|
# "nvim/init.lua".source = ../nvim.configlink/init.lua;
|
||||||
|
};
|
||||||
|
|
||||||
|
# nixpkgs.overlays = [(
|
||||||
|
# self: super: {
|
||||||
|
# neovim = unstable.neovim;
|
||||||
|
# })
|
||||||
|
# ];
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(import (builtins.fetchTarball {
|
||||||
|
url = https://github.com/nix-community/neovim-nightly-overlay/archive/master.tar.gz;
|
||||||
|
}))
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.neovim = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.neovim-nightly;
|
||||||
|
vimAlias = true;
|
||||||
|
plugins = with pkgs.vimPlugins; [
|
||||||
|
fzf-vim
|
||||||
|
fzfWrapper
|
||||||
|
vim-eunuch
|
||||||
|
vim-vinegar
|
||||||
|
surround
|
||||||
|
commentary
|
||||||
|
repeat
|
||||||
|
gruvbox-nvim
|
||||||
|
nvim-lspconfig
|
||||||
|
lsp-colors-nvim
|
||||||
|
vim-vsnip
|
||||||
|
vim-vsnip-integ
|
||||||
|
nvim-compe
|
||||||
|
tabular
|
||||||
|
vimwiki
|
||||||
|
vim-rooter
|
||||||
|
lualine-nvim
|
||||||
|
nvim-web-devicons
|
||||||
|
nvim-treesitter
|
||||||
|
vim-fish
|
||||||
|
nginx-vim
|
||||||
|
vim-terraform
|
||||||
|
vim-toml
|
||||||
|
vim-helm
|
||||||
|
vim-nix
|
||||||
|
gitsigns-nvim
|
||||||
|
plenary-nvim
|
||||||
|
vim-hexokinase
|
||||||
|
];
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
nodePackages.pyright
|
||||||
|
rust-analyzer
|
||||||
|
];
|
||||||
|
extraConfig = ''
|
||||||
|
lua << EOF
|
||||||
|
${builtins.readFile ./init.lua}
|
||||||
|
EOF
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# # Neovim config
|
||||||
|
# home.file = {
|
||||||
|
# ".config/nvim/init.lua".source = ../nvim.configlink/init.lua;
|
||||||
|
# };
|
||||||
|
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
userName = "Noah Masur";
|
||||||
|
userEmail = "7386960+nmasur@users.noreply.github.com";
|
||||||
|
extraConfig = {
|
||||||
|
core = {
|
||||||
|
editor = "nvim";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
285
nixos/init.lua
Normal file
285
nixos/init.lua
Normal file
@ -0,0 +1,285 @@
|
|||||||
|
-- LSP Settings
|
||||||
|
-- ============
|
||||||
|
|
||||||
|
require('lspconfig').rust_analyzer.setup{}
|
||||||
|
require('lspconfig').pyright.setup{
|
||||||
|
cmd = { "poetry", "run", "pyright-langserver", "--stdio" }
|
||||||
|
}
|
||||||
|
require'compe'.setup({
|
||||||
|
enabled = true,
|
||||||
|
source = {
|
||||||
|
path = true,
|
||||||
|
buffer = true,
|
||||||
|
nvim_lsp = true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if require('lspconfig/util').has_bins('diagnostic-languageserver') then
|
||||||
|
require('lspconfig').diagnosticls.setup{
|
||||||
|
cmd = { "diagnostic-languageserver", "--stdio" },
|
||||||
|
filetypes = { "sh" },
|
||||||
|
on_attach = on_attach,
|
||||||
|
init_options = {
|
||||||
|
filetypes = {
|
||||||
|
sh = "shellcheck",
|
||||||
|
},
|
||||||
|
linters = {
|
||||||
|
shellcheck = {
|
||||||
|
sourceName = "shellcheck",
|
||||||
|
command = "shellcheck",
|
||||||
|
debounce = 100,
|
||||||
|
args = { "--format=gcc", "-" },
|
||||||
|
offsetLine = 0,
|
||||||
|
offsetColumn = 0,
|
||||||
|
formatLines = 1,
|
||||||
|
formatPattern = {
|
||||||
|
"^[^:]+:(\\d+):(\\d+):\\s+([^:]+):\\s+(.*)$",
|
||||||
|
{
|
||||||
|
line = 1,
|
||||||
|
column = 2,
|
||||||
|
message = 4,
|
||||||
|
security = 3
|
||||||
|
}
|
||||||
|
},
|
||||||
|
securities = {
|
||||||
|
error = "error",
|
||||||
|
warning = "warning",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Auto-complete
|
||||||
|
-- ====================
|
||||||
|
|
||||||
|
-- Auto-complete mapping
|
||||||
|
local t = function(str)
|
||||||
|
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||||
|
end
|
||||||
|
|
||||||
|
local check_back_space = function()
|
||||||
|
local col = vim.fn.col('.') - 1
|
||||||
|
if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- Use (s-)tab to:
|
||||||
|
--- move to prev/next item in completion menuone
|
||||||
|
--- jump to prev/next snippet's placeholder
|
||||||
|
_G.tab_complete = function()
|
||||||
|
if vim.fn.pumvisible() == 1 then
|
||||||
|
return t "<C-n>"
|
||||||
|
elseif vim.fn.call("vsnip#available", {1}) == 1 then
|
||||||
|
return t "<Plug>(vsnip-expand-or-jump)"
|
||||||
|
elseif check_back_space() then
|
||||||
|
return t "<Tab>"
|
||||||
|
else
|
||||||
|
return vim.fn['compe#complete']()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
_G.s_tab_complete = function()
|
||||||
|
if vim.fn.pumvisible() == 1 then
|
||||||
|
return t "<C-p>"
|
||||||
|
elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then
|
||||||
|
return t "<Plug>(vsnip-jump-prev)"
|
||||||
|
else
|
||||||
|
return t "<S-Tab>"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Auto-complete keybinds
|
||||||
|
vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
||||||
|
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
||||||
|
vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
||||||
|
vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
||||||
|
|
||||||
|
-- Settings
|
||||||
|
-- ========
|
||||||
|
|
||||||
|
-- Basic Settings
|
||||||
|
vim.o.termguicolors = true -- Set to truecolor
|
||||||
|
vim.cmd[[colorscheme gruvbox]] -- Installed with a plugin
|
||||||
|
vim.o.hidden = true -- Don't unload buffers when leaving them
|
||||||
|
vim.wo.number = true -- Show line numbers
|
||||||
|
vim.wo.relativenumber = true -- Relative numbers instead of absolute
|
||||||
|
vim.o.list = true -- Reveal whitespace with dashes
|
||||||
|
vim.o.expandtab = true -- Tabs into spaces
|
||||||
|
vim.o.shiftwidth = 4 -- Amount to shift with > key
|
||||||
|
vim.o.softtabstop = 4 -- Amount to shift with <TAB> key
|
||||||
|
vim.o.ignorecase = true -- Ignore case when searching
|
||||||
|
vim.o.smartcase = true -- Check case when using capitals in search
|
||||||
|
vim.o.infercase = true -- Don't match cases when completing suggestions
|
||||||
|
vim.o.incsearch = true -- Search while typing
|
||||||
|
vim.o.visualbell = true -- No sounds
|
||||||
|
vim.o.scrolljump = 1 -- Number of lines to scroll
|
||||||
|
vim.o.scrolloff = 3 -- Margin of lines to see while scrolling
|
||||||
|
vim.o.splitright = true -- Vertical splits on the right side
|
||||||
|
vim.o.splitbelow = true -- Horizontal splits on the bottom side
|
||||||
|
vim.o.pastetoggle = "<F3>" -- Use F3 to enter raw paste mode
|
||||||
|
vim.o.clipboard = "unnamedplus" -- Uses system clipboard for yanking
|
||||||
|
vim.o.updatetime = 300 -- Faster diagnostics
|
||||||
|
vim.o.mouse = "nv" -- Mouse interaction / scrolling
|
||||||
|
|
||||||
|
-- Neovim features
|
||||||
|
vim.o.inccommand = "split" -- Live preview search and replace
|
||||||
|
vim.o.completeopt = "menuone,noselect" -- Required for nvim-compe completion
|
||||||
|
|
||||||
|
-- Remember last position when reopening file
|
||||||
|
vim.api.nvim_exec([[
|
||||||
|
if has("autocmd")
|
||||||
|
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
||||||
|
endif
|
||||||
|
]], false)
|
||||||
|
|
||||||
|
-- Better backup, swap and undo storage
|
||||||
|
vim.o.backup = true -- Easier to recover and more secure
|
||||||
|
vim.bo.swapfile = false -- Instead of swaps, create backups
|
||||||
|
vim.bo.undofile = true -- Keeps undos after quit
|
||||||
|
|
||||||
|
-- Create backup directories if they don't exist
|
||||||
|
vim.api.nvim_exec([[
|
||||||
|
set backupdir=~/.local/share/nvim/backup
|
||||||
|
set undodir=~/.local/share/nvim/undo
|
||||||
|
if !isdirectory(&backupdir)
|
||||||
|
call mkdir(&backupdir, "p")
|
||||||
|
endif
|
||||||
|
if !isdirectory(&undodir)
|
||||||
|
call mkdir(&undodir, "p")
|
||||||
|
endif
|
||||||
|
]], false)
|
||||||
|
|
||||||
|
-- Keep selection when tabbing
|
||||||
|
vim.api.nvim_set_keymap("v", "<", "<gv", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("v", ">", ">gv", {noremap=true})
|
||||||
|
|
||||||
|
-- Force filetype patterns that Vim doesn't know about
|
||||||
|
vim.api.nvim_exec([[
|
||||||
|
au BufRead,BufNewFile *.Brewfile setfiletype brewfile
|
||||||
|
au BufRead,BufNewFile tmux.conf* setfiletype tmux
|
||||||
|
au BufRead,BufNewFile *ignore.*link setfiletype gitignore
|
||||||
|
au BufRead,BufNewFile gitconfig.*link setfiletype gitconfig
|
||||||
|
au BufRead,BufNewFile *.toml.*link setfiletype toml
|
||||||
|
au BufRead,BufNewFile *.muttrc setfiletype muttrc
|
||||||
|
au BufRead,BufNewFile .env* set ft=text | set syntax=sh
|
||||||
|
]], false)
|
||||||
|
|
||||||
|
-- LaTeX options
|
||||||
|
vim.api.nvim_exec([[
|
||||||
|
au FileType tex inoremap ;bf \textbf{}<Esc>i
|
||||||
|
au BufWritePost *.tex silent! execute "!pdflatex -output-directory=%:p:h % >/dev/null 2>&1" | redraw!
|
||||||
|
]], false)
|
||||||
|
|
||||||
|
-- Highlight when yanking
|
||||||
|
vim.api.nvim_exec([[
|
||||||
|
au TextYankPost * silent! lua vim.highlight.on_yank { timeout = 250 }
|
||||||
|
]], false)
|
||||||
|
|
||||||
|
-- Rust stuff
|
||||||
|
-- vim.api.nvim_exec([[
|
||||||
|
-- au BufWritePost *.rs silent! execute "%! rustfmt"
|
||||||
|
-- ]], false)
|
||||||
|
|
||||||
|
-- Auto-pairs
|
||||||
|
vim.g.AutoPairsFlyMode = 0
|
||||||
|
|
||||||
|
-- Netrw
|
||||||
|
vim.g.netrw_liststyle = 3 -- Change style to 'tree' view
|
||||||
|
vim.g.netrw_banner = 0 -- Remove useless banner
|
||||||
|
vim.g.netrw_winsize = 15 -- Explore window takes % of page
|
||||||
|
vim.g.netrw_browse_split = 4 -- Open in previous window
|
||||||
|
vim.g.netrw_altv = 1 -- Always split left
|
||||||
|
|
||||||
|
-- Polyglot
|
||||||
|
vim.g.terraform_fmt_on_save = 1 -- Formats with terraform plugin
|
||||||
|
vim.g.rustfmt_autosave = 1 -- Formats with rust plugin
|
||||||
|
|
||||||
|
-- VimWiki
|
||||||
|
vim.g.vimwiki_list = {
|
||||||
|
{
|
||||||
|
["path"] = "$NOTES_PATH",
|
||||||
|
["syntax"] = "markdown",
|
||||||
|
["index"] = "home",
|
||||||
|
["ext"] = ".md"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vim.g.vimwiki_key_mappings = {
|
||||||
|
["all_maps"] = 1,
|
||||||
|
["mouse"] = 1,
|
||||||
|
}
|
||||||
|
vim.g.vimwiki_auto_chdir = 1 -- Set local dir to Wiki when open
|
||||||
|
vim.g.vimwiki_create_link = 0 -- Don't automatically create new links
|
||||||
|
vim.g.vimwiki_listsyms = " x" -- Set checkbox symbol progression
|
||||||
|
vim.g.vimwiki_table_mappings = 0 -- VimWiki table keybinds interfere with tab completion
|
||||||
|
vim.api.nvim_exec([[
|
||||||
|
au FileType markdown inoremap ;tt <Esc>:AddTag<CR>
|
||||||
|
|
||||||
|
function! PInsert(item)
|
||||||
|
let @z=a:item
|
||||||
|
norm "zpx
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
command! AddTag call fzf#run({'source': 'rg "#[A-Za-z/]+[ |\$]" -o --no-filename --no-line-number | sort | uniq', 'sink': function('PInsert')})
|
||||||
|
]], false)
|
||||||
|
|
||||||
|
-- Status bar
|
||||||
|
require('lualine').setup({
|
||||||
|
options = { theme = 'gruvbox' }
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Remap space as leader key
|
||||||
|
vim.api.nvim_set_keymap("", "<Space>", "<Nop>", {noremap=true, silent=true})
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
|
-- Unset search pattern register
|
||||||
|
vim.api.nvim_set_keymap("n", "<CR>", ":noh<CR><CR>", {noremap=true, silent=true})
|
||||||
|
|
||||||
|
-- Shuffle lines around
|
||||||
|
vim.api.nvim_set_keymap("n", "<A-j>", ":m .+1<CR>==", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<A-k>", ":m .-2<CR>==", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("i", "<A-j>", "<Esc>:m .+1<CR>==gi", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("i", "<A-k>", "<Esc>:m .-2<CR>==gi", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("v", "<A-j>", ":m '>+1<CR>gv=gv", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("v", "<A-k>", ":m '<-2<CR>gv=gv", {noremap=true})
|
||||||
|
|
||||||
|
-- Fzf (fuzzy finder)
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>/", ":Rg<CR>", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>ff", ":Files<CR>", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>fr", ":History<CR>", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>b", ":Buffers<CR>", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>s", ":BLines<CR>", {noremap=true})
|
||||||
|
|
||||||
|
-- File commands
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>q", ":quit<CR>", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>Q", ":quitall<CR>", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>fs", ":write<CR>", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>fe", ":!chmod 755 %<CR><CR>", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>fn", ":!chmod 644 %<CR><CR>", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>fd", ":lcd %:p:h<CR>", {silent=true, noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>fu", ":lcd ..<CR>", {silent=true, noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader><Tab>", ":b#<CR>", {silent=true, noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>gr", ":!gh repo view -w<CR><CR>", {silent=true, noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>tt", [[<Cmd>exe 'edit ~/notes/journal/'.strftime("%Y-%m-%d_%a").'.md'<CR>]], {noremap=true})
|
||||||
|
|
||||||
|
-- Window commands
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>wv", ":vsplit<CR>", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>wh", ":split<CR>", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>wm", ":only<CR>", {noremap=true})
|
||||||
|
|
||||||
|
-- Tabularize
|
||||||
|
vim.api.nvim_set_keymap("", "<Leader>ta", ":Tabularize /", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("", "<Leader>t#", ":Tabularize /#<CR>", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("", "<Leader>t\"", ":Tabularize /\"<CR>", {noremap=true})
|
||||||
|
|
||||||
|
-- Vimrc
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>fv", ":edit $MYVIMRC<CR>", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader>rr", ":luafile $MYVIMRC<CR>", {noremap=true})
|
||||||
|
|
||||||
|
-- Other
|
||||||
|
vim.api.nvim_set_keymap("n", "<Leader><Space>", ":HopWord<CR>", {noremap=true})
|
||||||
|
vim.api.nvim_set_keymap("t", "<A-CR>", "<C-\\><C-n>", {noremap=true}) -- Exit terminal mode
|
||||||
|
vim.api.nvim_set_keymap("n", "<A-CR>", ":noh<CR>", {noremap=true, silent=true})
|
||||||
|
vim.api.nvim_set_keymap('n', 'Y', 'y$', { noremap = true})
|
11
nixos/justfile
Normal file
11
nixos/justfile
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Show these options
|
||||||
|
default:
|
||||||
|
@just --list --list-heading $'Update NixOS config:\n'
|
||||||
|
|
||||||
|
# Update the system
|
||||||
|
system:
|
||||||
|
nixos-rebuild switch -I nixos-config=./configuration.nix
|
||||||
|
|
||||||
|
# Update the user environment
|
||||||
|
home:
|
||||||
|
home-manager switch -f ./home.nix
|
3
nixos/todo.txt
Normal file
3
nixos/todo.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
libratbag (ratbagd) for input devices
|
||||||
|
|
||||||
|
inspiration: https://github.com/JonathanReeve/dotfiles/blob/minimal/dotfiles/home.nix
|
@ -1,255 +1,498 @@
|
|||||||
-- Bootstrap the Packer plugin manager
|
-- Bootstrap the Packer plugin manager
|
||||||
local execute = vim.api.nvim_command
|
|
||||||
local fn = vim.fn
|
local fn = vim.fn
|
||||||
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||||
if fn.empty(fn.glob(install_path)) > 0 then
|
if fn.empty(fn.glob(install_path)) > 0 then
|
||||||
fn.system({'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path})
|
packer_bootstrap = fn.system({
|
||||||
execute 'packadd packer.nvim'
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--depth",
|
||||||
|
"1",
|
||||||
|
"https://github.com/wbthomason/packer.nvim",
|
||||||
|
install_path,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Packer plugin installations
|
-- Packer plugin installations
|
||||||
local use = require('packer').use
|
require("packer").startup(function(use)
|
||||||
require('packer').startup(function()
|
-- Maintain plugin manager
|
||||||
use 'wbthomason/packer.nvim' -- Maintain plugin manager
|
use("wbthomason/packer.nvim")
|
||||||
use 'tpope/vim-eunuch' -- File manipulation in Vim
|
|
||||||
use 'tpope/vim-vinegar' -- Fixes netrw file explorer
|
-- Startup speed hacks
|
||||||
use 'tpope/vim-fugitive' -- Git commands
|
use({
|
||||||
use 'tpope/vim-surround' -- Manipulate parentheses
|
"lewis6991/impatient.nvim",
|
||||||
use 'tpope/vim-commentary' -- Use gc or gcc to add comments
|
|
||||||
use 'tpope/vim-repeat' -- Actually repeat using .
|
|
||||||
use 'christoomey/vim-tmux-navigator' -- Hotkeys for tmux panes
|
|
||||||
use 'morhetz/gruvbox' -- Colorscheme
|
|
||||||
use 'phaazon/hop.nvim' -- Quick jump around the buffer
|
|
||||||
use 'neovim/nvim-lspconfig' -- Language server linting
|
|
||||||
use 'folke/lsp-colors.nvim' -- Pretty LSP highlights
|
|
||||||
use 'jiangmiao/auto-pairs' -- Parentheses
|
|
||||||
use 'rafamadriz/friendly-snippets'
|
|
||||||
use 'hrsh7th/vim-vsnip'
|
|
||||||
use 'hrsh7th/vim-vsnip-integ'
|
|
||||||
use 'hrsh7th/nvim-compe' -- Auto-complete
|
|
||||||
use 'godlygeek/tabular' -- Spacing and alignment
|
|
||||||
use 'vimwiki/vimwiki' -- Wiki Markdown System
|
|
||||||
use 'airblade/vim-rooter' -- Change directory to git route
|
|
||||||
use 'itchyny/lightline.vim' -- Status bar
|
|
||||||
use { -- Syntax highlighting for most languages
|
|
||||||
'nvim-treesitter/nvim-treesitter',
|
|
||||||
run = ':TSUpdate'
|
|
||||||
}
|
|
||||||
use 'bfontaine/Brewfile.vim' -- Brewfile syntax
|
|
||||||
use 'blankname/vim-fish' -- Fish syntax
|
|
||||||
use 'chr4/nginx.vim' -- Nginx syntax
|
|
||||||
use 'hashivim/vim-terraform' -- Terraform syntax
|
|
||||||
use 'cespare/vim-toml' -- TOML syntax
|
|
||||||
use 'towolf/vim-helm' -- Helm syntax
|
|
||||||
use { -- Git next to line numbers
|
|
||||||
'lewis6991/gitsigns.nvim',
|
|
||||||
requires = {'nvim-lua/plenary.nvim'},
|
|
||||||
config = function()
|
config = function()
|
||||||
require('gitsigns').setup()
|
require("impatient")
|
||||||
end
|
end,
|
||||||
}
|
})
|
||||||
use { -- Fuzzy finder
|
|
||||||
'junegunn/fzf.vim',
|
-- Important tweaks
|
||||||
requires = {'/usr/local/opt/fzf'}
|
use("tpope/vim-surround") --- Manipulate parentheses
|
||||||
}
|
use("tpope/vim-commentary") --- Use gc or gcc to add comments
|
||||||
-- use 'ludovicchabant/vim-gutentags'
|
|
||||||
|
-- Convenience tweaks
|
||||||
|
use("tpope/vim-eunuch") --- File manipulation in Vim
|
||||||
|
use("tpope/vim-vinegar") --- Fixes netrw file explorer
|
||||||
|
use("tpope/vim-fugitive") --- Git commands and syntax
|
||||||
|
use("tpope/vim-repeat") --- Actually repeat using .
|
||||||
|
use("christoomey/vim-tmux-navigator") --- Hotkeys for tmux panes
|
||||||
|
|
||||||
|
-- Colorscheme
|
||||||
|
use({
|
||||||
|
"morhetz/gruvbox",
|
||||||
|
config = function()
|
||||||
|
vim.cmd([[colorscheme gruvbox]])
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Git next to line numbers
|
||||||
|
use({
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
branch = "main",
|
||||||
|
requires = { "nvim-lua/plenary.nvim" },
|
||||||
|
config = function()
|
||||||
|
require("gitsigns").setup()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Status bar
|
||||||
|
use({
|
||||||
|
"hoob3rt/lualine.nvim",
|
||||||
|
requires = { "kyazdani42/nvim-web-devicons", opt = true },
|
||||||
|
config = function()
|
||||||
|
require("lualine").setup({
|
||||||
|
options = {
|
||||||
|
theme = "gruvbox",
|
||||||
|
icons_enabled = true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Improve speed and filetype detection
|
||||||
|
use({
|
||||||
|
"nathom/filetype.nvim",
|
||||||
|
config = function()
|
||||||
|
-- Filetype for .env files
|
||||||
|
local envfiletype = function()
|
||||||
|
vim.bo.filetype = "text"
|
||||||
|
vim.bo.syntax = "sh"
|
||||||
|
end
|
||||||
|
-- Force filetype patterns that Vim doesn't know about
|
||||||
|
require("filetype").setup({
|
||||||
|
overrides = {
|
||||||
|
extensions = {
|
||||||
|
Brewfile = "brewfile",
|
||||||
|
muttrc = "muttrc",
|
||||||
|
tfvars = "terraform",
|
||||||
|
tf = "terraform",
|
||||||
|
},
|
||||||
|
literal = {
|
||||||
|
Caskfile = "brewfile",
|
||||||
|
[".gitignore"] = "gitignore",
|
||||||
|
},
|
||||||
|
complex = {
|
||||||
|
[".*git/config"] = "gitconfig",
|
||||||
|
["tmux.conf%..*link"] = "tmux",
|
||||||
|
["gitconfig%..*link"] = "gitconfig",
|
||||||
|
[".*ignore%..*link"] = "gitignore",
|
||||||
|
[".*%.toml%..*link"] = "toml",
|
||||||
|
},
|
||||||
|
function_extensions = {},
|
||||||
|
function_literal = {
|
||||||
|
[".envrc"] = envfiletype,
|
||||||
|
[".env"] = envfiletype,
|
||||||
|
[".env.dev"] = envfiletype,
|
||||||
|
[".env.prod"] = envfiletype,
|
||||||
|
[".env.example"] = envfiletype,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Alignment tool
|
||||||
|
use("godlygeek/tabular")
|
||||||
|
|
||||||
|
-- Markdown renderer / wiki notes
|
||||||
|
use("vimwiki/vimwiki")
|
||||||
|
|
||||||
|
-- Markdown pretty view
|
||||||
|
use("ellisonleao/glow.nvim")
|
||||||
|
|
||||||
|
-- Snippet engine
|
||||||
|
use("L3MON4D3/LuaSnip")
|
||||||
|
|
||||||
|
-- =======================================================================
|
||||||
|
-- Language Server
|
||||||
|
-- =======================================================================
|
||||||
|
|
||||||
|
-- Language server engine
|
||||||
|
use({
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
requires = { "hrsh7th/cmp-nvim-lsp" },
|
||||||
|
config = function()
|
||||||
|
local capabilities = require("cmp_nvim_lsp").update_capabilities(
|
||||||
|
vim.lsp.protocol.make_client_capabilities()
|
||||||
|
)
|
||||||
|
require("lspconfig").rust_analyzer.setup({ capabilities = capabilities })
|
||||||
|
require("lspconfig").tflint.setup({ capabilities = capabilities })
|
||||||
|
require("lspconfig").terraformls.setup({ capabilities = capabilities })
|
||||||
|
require("lspconfig").pyright.setup({
|
||||||
|
cmd = { "poetry", "run", "pyright-langserver", "--stdio" },
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Pretty highlights
|
||||||
|
use("folke/lsp-colors.nvim")
|
||||||
|
|
||||||
|
-- Linting
|
||||||
|
use({
|
||||||
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
|
branch = "main",
|
||||||
|
requires = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("null-ls").setup({
|
||||||
|
sources = {
|
||||||
|
require("null-ls").builtins.formatting.stylua,
|
||||||
|
require("null-ls").builtins.formatting.black.with({
|
||||||
|
command = "poetry",
|
||||||
|
args = { "run", "black", "--quiet", "--fast", "-" },
|
||||||
|
}),
|
||||||
|
require("null-ls").builtins.formatting.fish_indent,
|
||||||
|
-- require("null-ls").builtins.formatting.nixfmt,
|
||||||
|
require("null-ls").builtins.formatting.rustfmt,
|
||||||
|
require("null-ls").builtins.diagnostics.shellcheck,
|
||||||
|
require("null-ls").builtins.formatting.shfmt.with({
|
||||||
|
extra_args = { "-i", "4", "-ci" },
|
||||||
|
}),
|
||||||
|
require("null-ls").builtins.formatting.terraform_fmt,
|
||||||
|
-- require("null-ls").builtins.diagnostics.luacheck,
|
||||||
|
-- require("null-ls").builtins.diagnostics.markdownlint,
|
||||||
|
-- require("null-ls").builtins.diagnostics.pylint,
|
||||||
|
},
|
||||||
|
-- Format on save
|
||||||
|
on_attach = function(client)
|
||||||
|
if client.resolved_capabilities.document_formatting then
|
||||||
|
vim.cmd([[
|
||||||
|
augroup LspFormatting
|
||||||
|
autocmd! * <buffer>
|
||||||
|
autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_seq_sync()
|
||||||
|
augroup END
|
||||||
|
]])
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- =======================================================================
|
||||||
|
-- Completion System
|
||||||
|
-- =======================================================================
|
||||||
|
|
||||||
|
-- Completion sources
|
||||||
|
use("hrsh7th/cmp-nvim-lsp") --- Language server completion plugin
|
||||||
|
use("hrsh7th/cmp-buffer") --- Generic text completion
|
||||||
|
use("hrsh7th/cmp-path") --- Local file completion
|
||||||
|
use("hrsh7th/cmp-cmdline") --- Command line completion
|
||||||
|
use("hrsh7th/cmp-nvim-lua") --- Nvim lua api completion
|
||||||
|
use("saadparwaiz1/cmp_luasnip") --- Luasnip completion
|
||||||
|
use("lukas-reineke/cmp-rg") --- Ripgrep completion
|
||||||
|
|
||||||
|
-- Completion engine
|
||||||
|
use({
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
requires = { "L3MON4D3/LuaSnip" },
|
||||||
|
config = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require("luasnip").lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = {
|
||||||
|
["<C-d>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
|
||||||
|
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
|
||||||
|
["<Esc>"] = function(fallback)
|
||||||
|
cmp.mapping({
|
||||||
|
i = cmp.mapping.abort(),
|
||||||
|
c = cmp.mapping.close(),
|
||||||
|
})
|
||||||
|
vim.cmd("stopinsert") --- Abort and leave insert mode
|
||||||
|
end,
|
||||||
|
-- ['<Tab>'] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 's' }),
|
||||||
|
-- ['<S-Tab>'] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 's' }),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({
|
||||||
|
behavior = cmp.ConfirmBehavior.Insert,
|
||||||
|
select = true,
|
||||||
|
}),
|
||||||
|
["<C-r>"] = cmp.mapping.confirm({
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
select = true,
|
||||||
|
}),
|
||||||
|
["<C-l>"] = cmp.mapping(function(fallback)
|
||||||
|
if require("luasnip").expand_or_jumpable() then
|
||||||
|
require("luasnip").expand_or_jump()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
{ name = "nvim_lua" },
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "path" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "buffer", keyword_length = 3, max_item_count = 10 },
|
||||||
|
{
|
||||||
|
name = "rg",
|
||||||
|
keyword_length = 6,
|
||||||
|
max_item_count = 10,
|
||||||
|
option = { additional_arguments = "--ignore-case" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
experimental = {
|
||||||
|
native_menu = false, --- Use cmp menu instead of Vim menu
|
||||||
|
ghost_text = true, --- Show preview auto-completion
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Use buffer source for `/`
|
||||||
|
cmp.setup.cmdline("/", {
|
||||||
|
sources = {
|
||||||
|
{ name = "buffer", keyword_length = 5 },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Use cmdline & path source for ':'
|
||||||
|
cmp.setup.cmdline(":", {
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "path" },
|
||||||
|
}, {
|
||||||
|
{ name = "cmdline" },
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- =======================================================================
|
||||||
|
-- Syntax
|
||||||
|
-- =======================================================================
|
||||||
|
|
||||||
|
-- Syntax engine
|
||||||
|
use({
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
run = ":TSUpdate",
|
||||||
|
config = function()
|
||||||
|
require("nvim-treesitter.configs").setup({
|
||||||
|
ensure_installed = {
|
||||||
|
"hcl",
|
||||||
|
"python",
|
||||||
|
"lua",
|
||||||
|
"nix",
|
||||||
|
"fish",
|
||||||
|
"toml",
|
||||||
|
"yaml",
|
||||||
|
"json",
|
||||||
|
},
|
||||||
|
highlight = { enable = true },
|
||||||
|
indent = { enable = true },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Additional syntax sources
|
||||||
|
use("bfontaine/Brewfile.vim") --- Brewfile syntax
|
||||||
|
use("chr4/nginx.vim") --- Nginx syntax
|
||||||
|
use("towolf/vim-helm") --- Helm syntax
|
||||||
|
use("rodjek/vim-puppet") --- Puppet syntax
|
||||||
|
|
||||||
|
-- =======================================================================
|
||||||
|
-- Fuzzy Launcher
|
||||||
|
-- =======================================================================
|
||||||
|
|
||||||
|
use({
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
requires = { "nvim-lua/plenary.nvim" },
|
||||||
|
config = function()
|
||||||
|
-- Telescope: quit instantly with escape
|
||||||
|
local actions = require("telescope.actions")
|
||||||
|
require("telescope").setup({
|
||||||
|
defaults = {
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
["<esc>"] = actions.close,
|
||||||
|
["<C-h>"] = "which_key",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
pickers = {
|
||||||
|
find_files = { theme = "ivy" },
|
||||||
|
oldfiles = { theme = "ivy" },
|
||||||
|
buffers = { theme = "dropdown" },
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
fzy_native = {},
|
||||||
|
tmux = {},
|
||||||
|
zoxide = {},
|
||||||
|
neoclip = {},
|
||||||
|
project = {
|
||||||
|
base_dirs = { "~/dev/work" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Faster sorting
|
||||||
|
use("nvim-telescope/telescope-fzy-native.nvim")
|
||||||
|
|
||||||
|
-- Jump around tmux sessions
|
||||||
|
use("camgraff/telescope-tmux.nvim")
|
||||||
|
|
||||||
|
-- Jump directories
|
||||||
|
use({
|
||||||
|
"jvgrootveld/telescope-zoxide",
|
||||||
|
requires = { "nvim-lua/popup.nvim" },
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Jump projects
|
||||||
|
use({
|
||||||
|
"nvim-telescope/telescope-project.nvim",
|
||||||
|
requires = { "nvim-telescope/telescope.nvim" },
|
||||||
|
config = function()
|
||||||
|
require("telescope").load_extension("project")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Clipboard history
|
||||||
|
use({
|
||||||
|
"AckslD/nvim-neoclip.lua",
|
||||||
|
branch = "main",
|
||||||
|
requires = {
|
||||||
|
{ "tami5/sqlite.lua", module = "sqlite" },
|
||||||
|
{ "nvim-telescope/telescope.nvim" },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("neoclip").setup({
|
||||||
|
enable_persistant_history = true,
|
||||||
|
default_register = { "+", '"' },
|
||||||
|
keys = {
|
||||||
|
telescope = {
|
||||||
|
i = { paste = "<c-v>" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
require("telescope").load_extension("neoclip")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Project bookmarks
|
||||||
|
use({
|
||||||
|
"ThePrimeagen/harpoon",
|
||||||
|
requires = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- TLDR Lookup
|
||||||
|
use({
|
||||||
|
"mrjones2014/tldr.nvim",
|
||||||
|
requires = { "nvim-telescope/telescope.nvim" },
|
||||||
|
})
|
||||||
|
|
||||||
|
-- =======================================================================
|
||||||
|
|
||||||
|
-- Install on initial bootstrap
|
||||||
|
if packer_bootstrap then
|
||||||
|
require("packer").sync()
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- LSP Plugins
|
-- ===========================================================================
|
||||||
require('lspconfig').rust_analyzer.setup{}
|
|
||||||
require('lspconfig').pyright.setup{
|
|
||||||
cmd = { "poetry", "run", "pyright-langserver", "--stdio" }
|
|
||||||
}
|
|
||||||
require'compe'.setup({
|
|
||||||
enabled = true,
|
|
||||||
source = {
|
|
||||||
path = true,
|
|
||||||
buffer = true,
|
|
||||||
nvim_lsp = true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
if require('lspconfig/util').has_bins('diagnostic-languageserver') then
|
|
||||||
require('lspconfig').diagnosticls.setup{
|
|
||||||
cmd = { "diagnostic-languageserver", "--stdio" },
|
|
||||||
filetypes = { "sh" },
|
|
||||||
on_attach = on_attach,
|
|
||||||
init_options = {
|
|
||||||
filetypes = {
|
|
||||||
sh = "shellcheck",
|
|
||||||
},
|
|
||||||
linters = {
|
|
||||||
shellcheck = {
|
|
||||||
sourceName = "shellcheck",
|
|
||||||
command = "shellcheck",
|
|
||||||
debounce = 100,
|
|
||||||
args = { "--format=gcc", "-" },
|
|
||||||
offsetLine = 0,
|
|
||||||
offsetColumn = 0,
|
|
||||||
formatLines = 1,
|
|
||||||
formatPattern = {
|
|
||||||
"^[^:]+:(\\d+):(\\d+):\\s+([^:]+):\\s+(.*)$",
|
|
||||||
{
|
|
||||||
line = 1,
|
|
||||||
column = 2,
|
|
||||||
message = 4,
|
|
||||||
security = 3
|
|
||||||
}
|
|
||||||
},
|
|
||||||
securities = {
|
|
||||||
error = "error",
|
|
||||||
warning = "warning",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Auto-complete
|
|
||||||
-- ====================
|
|
||||||
|
|
||||||
-- Auto-complete mapping
|
|
||||||
local t = function(str)
|
|
||||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
|
||||||
end
|
|
||||||
|
|
||||||
local check_back_space = function()
|
|
||||||
local col = vim.fn.col('.') - 1
|
|
||||||
if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- Use (s-)tab to:
|
|
||||||
--- move to prev/next item in completion menuone
|
|
||||||
--- jump to prev/next snippet's placeholder
|
|
||||||
_G.tab_complete = function()
|
|
||||||
if vim.fn.pumvisible() == 1 then
|
|
||||||
return t "<C-n>"
|
|
||||||
elseif vim.fn.call("vsnip#available", {1}) == 1 then
|
|
||||||
return t "<Plug>(vsnip-expand-or-jump)"
|
|
||||||
elseif check_back_space() then
|
|
||||||
return t "<Tab>"
|
|
||||||
else
|
|
||||||
return vim.fn['compe#complete']()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
_G.s_tab_complete = function()
|
|
||||||
if vim.fn.pumvisible() == 1 then
|
|
||||||
return t "<C-p>"
|
|
||||||
elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then
|
|
||||||
return t "<Plug>(vsnip-jump-prev)"
|
|
||||||
else
|
|
||||||
return t "<S-Tab>"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Auto-complete keybinds
|
|
||||||
vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
|
||||||
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
|
||||||
vim.api.nvim_set_keymap("i", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
|
||||||
vim.api.nvim_set_keymap("s", "<S-Tab>", "v:lua.s_tab_complete()", {expr = true})
|
|
||||||
|
|
||||||
-- Settings
|
-- Settings
|
||||||
-- ========
|
-- ===========================================================================
|
||||||
|
|
||||||
-- Basic Settings
|
vim.o.termguicolors = true --- Set to truecolor
|
||||||
vim.o.termguicolors = true -- Set to truecolor
|
vim.o.hidden = true --- Don't unload buffers when leaving them
|
||||||
vim.cmd[[colorscheme gruvbox]] -- Installed with a plugin
|
vim.wo.number = true --- Show line numbers
|
||||||
vim.o.hidden = true -- Don't unload buffers when leaving them
|
vim.wo.relativenumber = true --- Relative numbers instead of absolute
|
||||||
vim.wo.number = true -- Show line numbers
|
vim.o.list = true --- Reveal whitespace with dashes
|
||||||
vim.wo.relativenumber = true -- Relative numbers instead of absolute
|
vim.o.expandtab = true --- Tabs into spaces
|
||||||
vim.o.list = true -- Reveal whitespace with dashes
|
vim.o.shiftwidth = 4 --- Amount to shift with > key
|
||||||
vim.o.expandtab = true -- Tabs into spaces
|
vim.o.softtabstop = 4 --- Amount to shift with <TAB> key
|
||||||
vim.o.shiftwidth = 4 -- Amount to shift with > key
|
vim.o.ignorecase = true --- Ignore case when searching
|
||||||
vim.o.softtabstop = 4 -- Amount to shift with <TAB> key
|
vim.o.smartcase = true --- Check case when using capitals in search
|
||||||
vim.o.ignorecase = true -- Ignore case when searching
|
vim.o.infercase = true --- Don't match cases when completing suggestions
|
||||||
vim.o.smartcase = true -- Check case when using capitals in search
|
vim.o.incsearch = true --- Search while typing
|
||||||
vim.o.infercase = true -- Don't match cases when completing suggestions
|
vim.o.visualbell = true --- No sounds
|
||||||
vim.o.incsearch = true -- Search while typing
|
vim.o.scrolljump = 1 --- Number of lines to scroll
|
||||||
vim.o.visualbell = true -- No sounds
|
vim.o.scrolloff = 3 --- Margin of lines to see while scrolling
|
||||||
vim.o.scrolljump = 1 -- Number of lines to scroll
|
vim.o.splitright = true --- Vertical splits on the right side
|
||||||
vim.o.scrolloff = 3 -- Margin of lines to see while scrolling
|
vim.o.splitbelow = true --- Horizontal splits on the bottom side
|
||||||
vim.o.splitright = true -- Vertical splits on the right side
|
vim.o.pastetoggle = "<F3>" --- Use F3 to enter raw paste mode
|
||||||
vim.o.splitbelow = true -- Horizontal splits on the bottom side
|
vim.o.clipboard = "unnamedplus" --- Uses system clipboard for yanking
|
||||||
vim.o.pastetoggle = "<F3>" -- Use F3 to enter raw paste mode
|
vim.o.updatetime = 300 --- Faster diagnostics
|
||||||
vim.o.clipboard = "unnamedplus" -- Uses system clipboard for yanking
|
vim.o.mouse = "nv" --- Mouse interaction / scrolling
|
||||||
vim.o.updatetime = 300 -- Faster diagnostics
|
|
||||||
vim.o.mouse = "nv" -- Mouse interaction / scrolling
|
|
||||||
|
|
||||||
-- Neovim features
|
-- Neovim features
|
||||||
vim.o.inccommand = "split" -- Live preview search and replace
|
vim.o.inccommand = "split" --- Live preview search and replace
|
||||||
vim.o.completeopt = "menuone,noselect" -- Required for nvim-compe completion
|
vim.o.completeopt = "menu,menuone,noselect" --- Required for nvim-cmp completion
|
||||||
|
-- Required until 0.6.0: do not source the default filetype.vim
|
||||||
|
vim.g.did_load_filetypes = 1
|
||||||
|
|
||||||
-- Remember last position when reopening file
|
-- Remember last position when reopening file
|
||||||
vim.api.nvim_exec([[
|
vim.api.nvim_exec(
|
||||||
if has("autocmd")
|
[[
|
||||||
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
||||||
endif
|
]],
|
||||||
]], false)
|
false
|
||||||
|
)
|
||||||
|
|
||||||
-- Better backup, swap and undo storage
|
-- Better backup, swap and undo storage
|
||||||
vim.o.backup = true -- Easier to recover and more secure
|
vim.o.backup = true --- Easier to recover and more secure
|
||||||
vim.bo.swapfile = false -- Instead of swaps, create backups
|
vim.bo.swapfile = false --- Instead of swaps, create backups
|
||||||
vim.bo.undofile = true -- Keeps undos after quit
|
vim.bo.undofile = true --- Keeps undos after quit
|
||||||
|
|
||||||
-- Create backup directories if they don't exist
|
-- Create backup directories if they don't exist
|
||||||
vim.api.nvim_exec([[
|
-- Should be fixed in 0.6 by https://github.com/neovim/neovim/pull/15433
|
||||||
set backupdir=~/.local/share/nvim/backup
|
vim.o.backupdir = vim.fn.stdpath("cache") .. "/backup"
|
||||||
set undodir=~/.local/share/nvim/undo
|
vim.api.nvim_exec(
|
||||||
|
[[
|
||||||
if !isdirectory(&backupdir)
|
if !isdirectory(&backupdir)
|
||||||
call mkdir(&backupdir, "p")
|
call mkdir(&backupdir, "p")
|
||||||
endif
|
endif
|
||||||
if !isdirectory(&undodir)
|
]],
|
||||||
call mkdir(&undodir, "p")
|
false
|
||||||
endif
|
)
|
||||||
]], false)
|
|
||||||
|
|
||||||
-- Keep selection when tabbing
|
|
||||||
vim.api.nvim_set_keymap("v", "<", "<gv", {noremap=true})
|
|
||||||
vim.api.nvim_set_keymap("v", ">", ">gv", {noremap=true})
|
|
||||||
|
|
||||||
-- Force filetype patterns that Vim doesn't know about
|
|
||||||
vim.api.nvim_exec([[
|
|
||||||
au BufRead,BufNewFile *.Brewfile setfiletype brewfile
|
|
||||||
au BufRead,BufNewFile tmux.conf* setfiletype tmux
|
|
||||||
au BufRead,BufNewFile *ignore.*link setfiletype gitignore
|
|
||||||
au BufRead,BufNewFile gitconfig.*link setfiletype gitconfig
|
|
||||||
au BufRead,BufNewFile *.toml.*link setfiletype toml
|
|
||||||
au BufRead,BufNewFile *.muttrc setfiletype muttrc
|
|
||||||
au BufRead,BufNewFile .env* set ft=text | set syntax=sh
|
|
||||||
]], false)
|
|
||||||
|
|
||||||
-- LaTeX options
|
-- LaTeX options
|
||||||
vim.api.nvim_exec([[
|
vim.api.nvim_exec(
|
||||||
|
[[
|
||||||
au FileType tex inoremap ;bf \textbf{}<Esc>i
|
au FileType tex inoremap ;bf \textbf{}<Esc>i
|
||||||
au BufWritePost *.tex silent! execute "!pdflatex -output-directory=%:p:h % >/dev/null 2>&1" | redraw!
|
au BufWritePost *.tex silent! execute "!pdflatex -output-directory=%:p:h % >/dev/null 2>&1" | redraw!
|
||||||
]], false)
|
]],
|
||||||
|
false
|
||||||
|
)
|
||||||
|
|
||||||
-- Highlight when yanking
|
-- Highlight when yanking
|
||||||
vim.api.nvim_exec([[
|
vim.api.nvim_exec(
|
||||||
|
[[
|
||||||
au TextYankPost * silent! lua vim.highlight.on_yank { timeout = 250 }
|
au TextYankPost * silent! lua vim.highlight.on_yank { timeout = 250 }
|
||||||
]], false)
|
]],
|
||||||
|
false
|
||||||
-- Rust stuff
|
)
|
||||||
-- vim.api.nvim_exec([[
|
|
||||||
-- au BufWritePost *.rs silent! execute "%! rustfmt"
|
|
||||||
-- ]], false)
|
|
||||||
|
|
||||||
-- Auto-pairs
|
|
||||||
vim.g.AutoPairsFlyMode = 0
|
|
||||||
|
|
||||||
-- Netrw
|
-- Netrw
|
||||||
vim.g.netrw_liststyle = 3 -- Change style to 'tree' view
|
vim.g.netrw_liststyle = 3 -- Change style to 'tree' view
|
||||||
vim.g.netrw_banner = 0 -- Remove useless banner
|
vim.g.netrw_banner = 0 -- Remove useless banner
|
||||||
vim.g.netrw_winsize = 15 -- Explore window takes % of page
|
vim.g.netrw_winsize = 15 -- Explore window takes % of page
|
||||||
vim.g.netrw_browse_split = 4 -- Open in previous window
|
vim.g.netrw_browse_split = 4 -- Open in previous window
|
||||||
vim.g.netrw_altv = 1 -- Always split left
|
vim.g.netrw_altv = 1 -- Always split left
|
||||||
|
|
||||||
-- Polyglot
|
|
||||||
vim.g.terraform_fmt_on_save = 1 -- Formats with terraform plugin
|
|
||||||
vim.g.rustfmt_autosave = 1 -- Formats with rust plugin
|
|
||||||
|
|
||||||
-- VimWiki
|
-- VimWiki
|
||||||
vim.g.vimwiki_list = {
|
vim.g.vimwiki_list = {
|
||||||
@ -257,18 +500,19 @@ vim.g.vimwiki_list = {
|
|||||||
["path"] = "$NOTES_PATH",
|
["path"] = "$NOTES_PATH",
|
||||||
["syntax"] = "markdown",
|
["syntax"] = "markdown",
|
||||||
["index"] = "home",
|
["index"] = "home",
|
||||||
["ext"] = ".md"
|
["ext"] = ".md",
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
vim.g.vimwiki_key_mappings = {
|
vim.g.vimwiki_key_mappings = {
|
||||||
["all_maps"] = 1,
|
["all_maps"] = 1,
|
||||||
["mouse"] = 1,
|
["mouse"] = 1,
|
||||||
}
|
}
|
||||||
vim.g.vimwiki_auto_chdir = 1 -- Set local dir to Wiki when open
|
vim.g.vimwiki_auto_chdir = 1 -- Set local dir to Wiki when open
|
||||||
vim.g.vimwiki_create_link = 0 -- Don't automatically create new links
|
vim.g.vimwiki_create_link = 0 -- Don't automatically create new links
|
||||||
vim.g.vimwiki_listsyms = " x" -- Set checkbox symbol progression
|
vim.g.vimwiki_listsyms = " x" -- Set checkbox symbol progression
|
||||||
vim.g.vimwiki_table_mappings = 0 -- VimWiki table keybinds interfere with tab completion
|
vim.g.vimwiki_table_mappings = 0 -- VimWiki table keybinds interfere with tab completion
|
||||||
vim.api.nvim_exec([[
|
vim.api.nvim_exec(
|
||||||
|
[[
|
||||||
au FileType markdown inoremap ;tt <Esc>:AddTag<CR>
|
au FileType markdown inoremap ;tt <Esc>:AddTag<CR>
|
||||||
|
|
||||||
function! PInsert(item)
|
function! PInsert(item)
|
||||||
@ -277,76 +521,186 @@ vim.api.nvim_exec([[
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
command! AddTag call fzf#run({'source': 'rg "#[A-Za-z/]+[ |\$]" -o --no-filename --no-line-number | sort | uniq', 'sink': function('PInsert')})
|
command! AddTag call fzf#run({'source': 'rg "#[A-Za-z/]+[ |\$]" -o --no-filename --no-line-number | sort | uniq', 'sink': function('PInsert')})
|
||||||
]], false)
|
]],
|
||||||
|
false
|
||||||
|
)
|
||||||
|
|
||||||
-- Lightline status bar
|
-- ===========================================================================
|
||||||
vim.g.lightline = {
|
-- Custom Functions
|
||||||
["colorscheme"] = "jellybeans",
|
-- ===========================================================================
|
||||||
["active"] = {
|
|
||||||
["right"] = {
|
grep_notes = function()
|
||||||
{ "lineinfo" }
|
local opts = {
|
||||||
},
|
prompt_title = "Search Notes",
|
||||||
["left"] = {
|
cwd = "$NOTES_PATH",
|
||||||
{ "mode", "paste" },
|
|
||||||
{ "readonly", "relativepath", "gitbranch", "modified" }
|
|
||||||
}
|
}
|
||||||
},
|
require("telescope.builtin").live_grep(opts)
|
||||||
["component_function"] = {
|
end
|
||||||
["gitbranch"] = "fugitive#head"
|
|
||||||
},
|
find_notes = function()
|
||||||
}
|
local opts = {
|
||||||
|
prompt_title = "Find Notes",
|
||||||
|
cwd = "$NOTES_PATH",
|
||||||
|
}
|
||||||
|
require("telescope.builtin").find_files(opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
find_downloads = function()
|
||||||
|
local opts = {
|
||||||
|
prompt_title = "Find Downloads",
|
||||||
|
cwd = "~/Downloads",
|
||||||
|
}
|
||||||
|
require("telescope.builtin").file_browser(opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
choose_project = function()
|
||||||
|
local opts = require("telescope.themes").get_ivy({
|
||||||
|
layout_config = {
|
||||||
|
bottom_pane = {
|
||||||
|
height = 10,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
require("telescope").extensions.project.project(opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
clipboard_history = function()
|
||||||
|
local opts = require("telescope.themes").get_cursor({
|
||||||
|
layout_config = {
|
||||||
|
cursor = {
|
||||||
|
width = 150,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
require("telescope").extensions.neoclip.neoclip(opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
command_history = function()
|
||||||
|
local opts = require("telescope.themes").get_ivy({
|
||||||
|
layout_config = {
|
||||||
|
bottom_pane = {
|
||||||
|
height = 15,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
require("telescope.builtin").command_history(opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- ===========================================================================
|
||||||
|
-- Key Mapping
|
||||||
|
-- ===========================================================================
|
||||||
|
|
||||||
|
-- Function to cut down config boilerplate
|
||||||
|
local key = function(mode, key_sequence, action, params)
|
||||||
|
params = params or {}
|
||||||
|
params["noremap"] = true
|
||||||
|
vim.api.nvim_set_keymap(mode, key_sequence, action, params)
|
||||||
|
end
|
||||||
|
|
||||||
-- Remap space as leader key
|
-- Remap space as leader key
|
||||||
vim.api.nvim_set_keymap("", "<Space>", "<Nop>", {noremap=true, silent=true})
|
key("", "<Space>", "<Nop>", { silent = true })
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
vim.g.maplocalleader = " "
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
-- Unset search pattern register
|
-- Keep selection when changing indentation
|
||||||
vim.api.nvim_set_keymap("n", "<CR>", ":noh<CR><CR>", {noremap=true, silent=true})
|
key("v", "<", "<gv")
|
||||||
|
key("v", ">", ">gv")
|
||||||
|
|
||||||
|
-- Clear search register
|
||||||
|
key("n", "<CR>", ":noh<CR><CR>", { silent = true })
|
||||||
|
|
||||||
-- Shuffle lines around
|
-- Shuffle lines around
|
||||||
vim.api.nvim_set_keymap("n", "<A-j>", ":m .+1<CR>==", {noremap=true})
|
key("n", "<A-j>", ":m .+1<CR>==")
|
||||||
vim.api.nvim_set_keymap("n", "<A-k>", ":m .-2<CR>==", {noremap=true})
|
key("n", "<A-k>", ":m .-2<CR>==")
|
||||||
vim.api.nvim_set_keymap("i", "<A-j>", "<Esc>:m .+1<CR>==gi", {noremap=true})
|
key("i", "<A-j>", "<Esc>:m .+1<CR>==gi")
|
||||||
vim.api.nvim_set_keymap("i", "<A-k>", "<Esc>:m .-2<CR>==gi", {noremap=true})
|
key("i", "<A-k>", "<Esc>:m .-2<CR>==gi")
|
||||||
vim.api.nvim_set_keymap("v", "<A-j>", ":m '>+1<CR>gv=gv", {noremap=true})
|
key("v", "<A-j>", ":m '>+1<CR>gv=gv")
|
||||||
vim.api.nvim_set_keymap("v", "<A-k>", ":m '<-2<CR>gv=gv", {noremap=true})
|
key("v", "<A-k>", ":m '<-2<CR>gv=gv")
|
||||||
|
|
||||||
-- Fzf (fuzzy finder)
|
-- Telescope (fuzzy finder)
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>/", ":Rg<CR>", {noremap=true})
|
key("n", "<Leader>k", ":Telescope keymaps<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>ff", ":Files<CR>", {noremap=true})
|
key("n", "<Leader>/", ":Telescope live_grep<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>fr", ":History<CR>", {noremap=true})
|
key("n", "<Leader>ff", ":Telescope find_files<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>b", ":Buffers<CR>", {noremap=true})
|
key("n", "<Leader>fp", ":Telescope git_files<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>s", ":BLines<CR>", {noremap=true})
|
key("n", "<Leader>fN", "<Cmd>lua find_notes()<CR>")
|
||||||
|
key("n", "<Leader>N", "<Cmd>lua grep_notes()<CR>")
|
||||||
|
key("n", "<Leader>fD", "<Cmd>lua find_downloads()<CR>")
|
||||||
|
key("n", "<Leader>fa", ":Telescope file_browser<CR>")
|
||||||
|
key("n", "<Leader>fw", ":Telescope grep_string<CR>")
|
||||||
|
key("n", "<Leader>wt", ":Telescope tmux sessions<CR>")
|
||||||
|
key("n", "<Leader>ww", ":Telescope tmux windows<CR>")
|
||||||
|
key("n", "<Leader>w/", ":Telescope tmux pane_contents<CR>")
|
||||||
|
key("n", "<Leader>fz", ":Telescope zoxide list<CR>")
|
||||||
|
key("n", "<Leader>b", ":Telescope buffers<CR>")
|
||||||
|
key("n", "<Leader>hh", ":Telescope help_tags<CR>")
|
||||||
|
key("n", "<Leader>fr", ":Telescope oldfiles<CR>")
|
||||||
|
key("n", "<Leader>cc", ":Telescope commands<CR>")
|
||||||
|
key("n", "<Leader>cr", "<Cmd>lua command_history()<CR>")
|
||||||
|
key("n", "<Leader>y", "<Cmd>lua clipboard_history()<CR>")
|
||||||
|
key("i", "<c-y>", "<Cmd>lua clipboard_history()<CR>")
|
||||||
|
key("n", "<Leader>s", ":Telescope current_buffer_fuzzy_find<CR>")
|
||||||
|
key("n", "<Leader>gc", ":Telescope git_commits<CR>")
|
||||||
|
key("n", "<Leader>gf", ":Telescope git_bcommits<CR>")
|
||||||
|
key("n", "<Leader>gb", ":Telescope git_branches<CR>")
|
||||||
|
key("n", "<Leader>gs", ":Telescope git_status<CR>")
|
||||||
|
key("n", "<C-p>", "<Cmd>lua choose_project()<CR>")
|
||||||
|
|
||||||
|
-- Harpoon
|
||||||
|
key("n", "<Leader>m", "<Cmd>lua require('harpoon.mark').add_file()<CR><Esc>")
|
||||||
|
key("n", "<Leader>`", "<Cmd>lua require('harpoon.ui').toggle_quick_menu()<CR><Esc>")
|
||||||
|
key("n", "<Leader>1", "<Cmd>lua require('harpoon.ui').nav_file(1)<CR><Esc>")
|
||||||
|
key("n", "<Leader>2", "<Cmd>lua require('harpoon.ui').nav_file(2)<CR><Esc>")
|
||||||
|
key("n", "<Leader>3", "<Cmd>lua require('harpoon.ui').nav_file(3)<CR><Esc>")
|
||||||
|
|
||||||
|
-- LSP
|
||||||
|
key("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", { silent = true })
|
||||||
|
key("n", "gi", "<Cmd>lua vim.lsp.buf.implementation()<CR>", { silent = true })
|
||||||
|
key("n", "gh", "<Cmd>lua vim.lsp.buf.hover()<CR>", { silent = true })
|
||||||
|
key("n", "]e", "<Cmd>lua vim.lsp.diagnostic.goto_next()<CR>", { silent = true })
|
||||||
|
key("n", "[e", "<Cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", { silent = true })
|
||||||
|
key("n", "<Leader>e", "<Cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", { silent = true })
|
||||||
|
|
||||||
-- File commands
|
-- File commands
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>q", ":quit<CR>", {noremap=true})
|
key("n", "<Leader>q", ":quit<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>Q", ":quitall<CR>", {noremap=true})
|
key("n", "<Leader>Q", ":quitall<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>fs", ":write<CR>", {noremap=true})
|
key("n", "<Leader>fs", ":write<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>fe", ":!chmod 755 %<CR><CR>", {noremap=true})
|
key("n", "<Leader>fd", ":lcd %:p:h<CR>", { silent = true })
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>fn", ":!chmod 644 %<CR><CR>", {noremap=true})
|
key("n", "<Leader>fu", ":lcd ..<CR>", { silent = true })
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>fd", ":lcd %:p:h<CR>", {silent=true, noremap=true})
|
key("n", "<Leader><Tab>", ":b#<CR>", { silent = true })
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>fu", ":lcd ..<CR>", {silent=true, noremap=true})
|
key("n", "<Leader>gr", ":!gh repo view -w<CR><CR>", { silent = true })
|
||||||
vim.api.nvim_set_keymap("n", "<Leader><Tab>", ":b#<CR>", {silent=true, noremap=true})
|
key("n", "<Leader>tt", [[<Cmd>exe 'edit $NOTES_PATH/journal/'.strftime("%Y-%m-%d_%a").'.md'<CR>]])
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>gr", ":!gh repo view -w<CR><CR>", {silent=true, noremap=true})
|
key("n", "<Leader>jj", ":!journal<CR>:e<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>tt", [[<Cmd>exe 'edit ~/notes/journal/'.strftime("%Y-%m-%d_%a").'.md'<CR>]], {noremap=true})
|
|
||||||
|
|
||||||
-- Window commands
|
-- Window commands
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>wv", ":vsplit<CR>", {noremap=true})
|
key("n", "<Leader>wv", ":vsplit<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>wh", ":split<CR>", {noremap=true})
|
key("n", "<Leader>wh", ":split<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>wm", ":only<CR>", {noremap=true})
|
key("n", "<Leader>wm", ":only<CR>")
|
||||||
|
|
||||||
-- Tabularize
|
-- Tabularize
|
||||||
vim.api.nvim_set_keymap("", "<Leader>ta", ":Tabularize /", {noremap=true})
|
key("", "<Leader>ta", ":Tabularize /")
|
||||||
vim.api.nvim_set_keymap("", "<Leader>t#", ":Tabularize /#<CR>", {noremap=true})
|
key("", "<Leader>t#", ":Tabularize /#<CR>")
|
||||||
vim.api.nvim_set_keymap("", "<Leader>t\"", ":Tabularize /\"<CR>", {noremap=true})
|
key("", "<Leader>tl", ":Tabularize /---<CR>")
|
||||||
|
|
||||||
-- Vimrc
|
-- Vimrc editing
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>fv", ":edit $MYVIMRC<CR>", {noremap=true})
|
key("n", "<Leader>fv", ":edit $MYVIMRC<CR>")
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>rr", ":luafile $MYVIMRC<CR>", {noremap=true})
|
key("n", "<Leader>rr", ":luafile $MYVIMRC<CR>")
|
||||||
|
key("n", "<Leader>rp", ":luafile $MYVIMRC<CR>:PackerInstall<CR>:")
|
||||||
|
key("n", "<Leader>rc", ":luafile $MYVIMRC<CR>:PackerCompile<CR>")
|
||||||
|
|
||||||
|
-- Keep cursor in place
|
||||||
|
key("n", "n", "nzz")
|
||||||
|
key("n", "N", "Nzz")
|
||||||
|
key("n", "J", "mzJ`z") --- Mark and jump back to it
|
||||||
|
|
||||||
|
-- Add undo breakpoints
|
||||||
|
key("i", ",", ",<C-g>u")
|
||||||
|
key("i", ".", ".<C-g>u")
|
||||||
|
key("i", "!", "!<C-g>u")
|
||||||
|
key("i", "?", "?<C-g>u")
|
||||||
|
|
||||||
-- Other
|
-- Other
|
||||||
vim.api.nvim_set_keymap("n", "<Leader><Space>", ":HopWord<CR>", {noremap=true})
|
key("t", "<A-CR>", "<C-\\><C-n>") --- Exit terminal mode
|
||||||
vim.api.nvim_set_keymap("t", "<A-CR>", "<C-\\><C-n>", {noremap=true}) -- Exit terminal mode
|
key("n", "<A-CR>", ":noh<CR>", { silent = true }) --- Clear search in VimWiki
|
||||||
vim.api.nvim_set_keymap("n", "<A-CR>", ":noh<CR>", {noremap=true, silent=true})
|
key("n", "Y", "y$") --- Copy to end of line
|
||||||
vim.api.nvim_set_keymap('n', 'Y', 'y$', { noremap = true})
|
key("v", "<C-r>", "y<Esc>:%s/<C-r>+//gc<left><left><left>") --- Substitute selected
|
||||||
|
key("v", "D", "y'>gp") --- Duplicate selected
|
||||||
|
1
nvim.configlink/stylua.toml
Normal file
1
nvim.configlink/stylua.toml
Normal file
@ -0,0 +1 @@
|
|||||||
|
indent_type = "Spaces"
|
117
python/boto/poetry.lock
generated
117
python/boto/poetry.lock
generated
@ -1,129 +1,120 @@
|
|||||||
[[package]]
|
[[package]]
|
||||||
category = "main"
|
|
||||||
description = "The AWS SDK for Python"
|
|
||||||
name = "boto3"
|
name = "boto3"
|
||||||
|
version = "1.20.5"
|
||||||
|
description = "The AWS SDK for Python"
|
||||||
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = "*"
|
python-versions = ">= 3.6"
|
||||||
version = "1.14.46"
|
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
botocore = ">=1.17.46,<1.18.0"
|
botocore = ">=1.23.5,<1.24.0"
|
||||||
jmespath = ">=0.7.1,<1.0.0"
|
jmespath = ">=0.7.1,<1.0.0"
|
||||||
s3transfer = ">=0.3.0,<0.4.0"
|
s3transfer = ">=0.5.0,<0.6.0"
|
||||||
|
|
||||||
|
[package.extras]
|
||||||
|
crt = ["botocore[crt] (>=1.21.0,<2.0a0)"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
category = "main"
|
|
||||||
description = "Low-level, data-driven core of boto 3."
|
|
||||||
name = "botocore"
|
name = "botocore"
|
||||||
|
version = "1.23.5"
|
||||||
|
description = "Low-level, data-driven core of boto 3."
|
||||||
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = "*"
|
python-versions = ">= 3.6"
|
||||||
version = "1.17.46"
|
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
docutils = ">=0.10,<0.16"
|
|
||||||
jmespath = ">=0.7.1,<1.0.0"
|
jmespath = ">=0.7.1,<1.0.0"
|
||||||
python-dateutil = ">=2.1,<3.0.0"
|
python-dateutil = ">=2.1,<3.0.0"
|
||||||
|
urllib3 = ">=1.25.4,<1.27"
|
||||||
|
|
||||||
[package.dependencies.urllib3]
|
[package.extras]
|
||||||
python = "<3.4.0 || >=3.5.0"
|
crt = ["awscrt (==0.12.5)"]
|
||||||
version = ">=1.20,<1.26"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
category = "main"
|
|
||||||
description = "Docutils -- Python Documentation Utilities"
|
|
||||||
name = "docutils"
|
|
||||||
optional = false
|
|
||||||
python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
|
|
||||||
version = "0.15.2"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
category = "main"
|
|
||||||
description = "JSON Matching Expressions"
|
|
||||||
name = "jmespath"
|
name = "jmespath"
|
||||||
|
version = "0.10.0"
|
||||||
|
description = "JSON Matching Expressions"
|
||||||
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
|
python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
|
||||||
version = "0.10.0"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
category = "main"
|
|
||||||
description = "Extensions to the standard Python datetime module"
|
|
||||||
name = "python-dateutil"
|
name = "python-dateutil"
|
||||||
|
version = "2.8.2"
|
||||||
|
description = "Extensions to the standard Python datetime module"
|
||||||
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
|
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
|
||||||
version = "2.8.1"
|
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
six = ">=1.5"
|
six = ">=1.5"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
category = "main"
|
|
||||||
description = "An Amazon S3 Transfer Manager"
|
|
||||||
name = "s3transfer"
|
name = "s3transfer"
|
||||||
|
version = "0.5.0"
|
||||||
|
description = "An Amazon S3 Transfer Manager"
|
||||||
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = "*"
|
python-versions = ">= 3.6"
|
||||||
version = "0.3.3"
|
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
botocore = ">=1.12.36,<2.0a.0"
|
botocore = ">=1.12.36,<2.0a.0"
|
||||||
|
|
||||||
[[package]]
|
[package.extras]
|
||||||
category = "main"
|
crt = ["botocore[crt] (>=1.20.29,<2.0a.0)"]
|
||||||
description = "Python 2 and 3 compatibility utilities"
|
|
||||||
name = "six"
|
|
||||||
optional = false
|
|
||||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
|
|
||||||
version = "1.15.0"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
name = "six"
|
||||||
|
version = "1.16.0"
|
||||||
|
description = "Python 2 and 3 compatibility utilities"
|
||||||
category = "main"
|
category = "main"
|
||||||
description = "HTTP library with thread-safe connection pooling, file post, and more."
|
optional = false
|
||||||
marker = "python_version != \"3.4\""
|
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
name = "urllib3"
|
name = "urllib3"
|
||||||
|
version = "1.26.7"
|
||||||
|
description = "HTTP library with thread-safe connection pooling, file post, and more."
|
||||||
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4"
|
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4"
|
||||||
version = "1.25.10"
|
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
brotli = ["brotlipy (>=0.6.0)"]
|
brotli = ["brotlipy (>=0.6.0)"]
|
||||||
secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "pyOpenSSL (>=0.14)", "ipaddress"]
|
secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"]
|
||||||
socks = ["PySocks (>=1.5.6,<1.5.7 || >1.5.7,<2.0)"]
|
socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"]
|
||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
content-hash = "fc1d3a2527ef475cf30a75a0bccfbe2fc3ca0ed539edb55268147bce9b170ff5"
|
lock-version = "1.1"
|
||||||
lock-version = "1.0"
|
|
||||||
python-versions = "^3.8"
|
python-versions = "^3.8"
|
||||||
|
content-hash = "fc1d3a2527ef475cf30a75a0bccfbe2fc3ca0ed539edb55268147bce9b170ff5"
|
||||||
|
|
||||||
[metadata.files]
|
[metadata.files]
|
||||||
boto3 = [
|
boto3 = [
|
||||||
{file = "boto3-1.14.46-py2.py3-none-any.whl", hash = "sha256:1cfbadf41777dade69a3e5eaf1b71d15b4ae616fd94d16a894b692e14319f4a2"},
|
{file = "boto3-1.20.5-py3-none-any.whl", hash = "sha256:81ca80fbb3d551819c35c809cb159fd0bec6701d3d8f0e5906a22da7558d098e"},
|
||||||
{file = "boto3-1.14.46.tar.gz", hash = "sha256:cc3636828f1677ff93e8b1130c90dfe800187964e33786711450e8653d3f245f"},
|
{file = "boto3-1.20.5.tar.gz", hash = "sha256:cc620c289b12d7bf7c2706b517c9f8950f9be4622aacc9e7580b8b4ee0d3bc73"},
|
||||||
]
|
]
|
||||||
botocore = [
|
botocore = [
|
||||||
{file = "botocore-1.17.46-py2.py3-none-any.whl", hash = "sha256:6b134681c938f00b28424abf4b46fa6034b516d8add3a3f524e2292db61aa070"},
|
{file = "botocore-1.23.5-py3-none-any.whl", hash = "sha256:c8eaeee0bac356396386aa9165043808fe736fb9e03ac0dedb1dfd82f41ad1a3"},
|
||||||
{file = "botocore-1.17.46.tar.gz", hash = "sha256:2f15a755b990db13a7a9e06a124c6ca5fa1c4470d76672363024d7f2a6c2566c"},
|
{file = "botocore-1.23.5.tar.gz", hash = "sha256:49d1f012dc8467577a5fe603fc87cc13af816dd926b2bc2e28a3b2999ab14d36"},
|
||||||
]
|
|
||||||
docutils = [
|
|
||||||
{file = "docutils-0.15.2-py2-none-any.whl", hash = "sha256:9e4d7ecfc600058e07ba661411a2b7de2fd0fafa17d1a7f7361cd47b1175c827"},
|
|
||||||
{file = "docutils-0.15.2-py3-none-any.whl", hash = "sha256:6c4f696463b79f1fb8ba0c594b63840ebd41f059e92b31957c46b74a4599b6d0"},
|
|
||||||
{file = "docutils-0.15.2.tar.gz", hash = "sha256:a2aeea129088da402665e92e0b25b04b073c04b2dce4ab65caaa38b7ce2e1a99"},
|
|
||||||
]
|
]
|
||||||
jmespath = [
|
jmespath = [
|
||||||
{file = "jmespath-0.10.0-py2.py3-none-any.whl", hash = "sha256:cdf6525904cc597730141d61b36f2e4b8ecc257c420fa2f4549bac2c2d0cb72f"},
|
{file = "jmespath-0.10.0-py2.py3-none-any.whl", hash = "sha256:cdf6525904cc597730141d61b36f2e4b8ecc257c420fa2f4549bac2c2d0cb72f"},
|
||||||
{file = "jmespath-0.10.0.tar.gz", hash = "sha256:b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9"},
|
{file = "jmespath-0.10.0.tar.gz", hash = "sha256:b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9"},
|
||||||
]
|
]
|
||||||
python-dateutil = [
|
python-dateutil = [
|
||||||
{file = "python-dateutil-2.8.1.tar.gz", hash = "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c"},
|
{file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"},
|
||||||
{file = "python_dateutil-2.8.1-py2.py3-none-any.whl", hash = "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a"},
|
{file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"},
|
||||||
]
|
]
|
||||||
s3transfer = [
|
s3transfer = [
|
||||||
{file = "s3transfer-0.3.3-py2.py3-none-any.whl", hash = "sha256:2482b4259524933a022d59da830f51bd746db62f047d6eb213f2f8855dcb8a13"},
|
{file = "s3transfer-0.5.0-py3-none-any.whl", hash = "sha256:9c1dc369814391a6bda20ebbf4b70a0f34630592c9aa520856bf384916af2803"},
|
||||||
{file = "s3transfer-0.3.3.tar.gz", hash = "sha256:921a37e2aefc64145e7b73d50c71bb4f26f46e4c9f414dc648c6245ff92cf7db"},
|
{file = "s3transfer-0.5.0.tar.gz", hash = "sha256:50ed823e1dc5868ad40c8dc92072f757aa0e653a192845c94a3b676f4a62da4c"},
|
||||||
]
|
]
|
||||||
six = [
|
six = [
|
||||||
{file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"},
|
{file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"},
|
||||||
{file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"},
|
{file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"},
|
||||||
]
|
]
|
||||||
urllib3 = [
|
urllib3 = [
|
||||||
{file = "urllib3-1.25.10-py2.py3-none-any.whl", hash = "sha256:e7983572181f5e1522d9c98453462384ee92a0be7fac5f1413a1e35c56cc0461"},
|
{file = "urllib3-1.26.7-py2.py3-none-any.whl", hash = "sha256:c4fdf4019605b6e5423637e01bc9fe4daef873709a7973e195ceba0a62bbc844"},
|
||||||
{file = "urllib3-1.25.10.tar.gz", hash = "sha256:91056c15fa70756691db97756772bb1eb9678fa585d9184f24534b100dc60f4a"},
|
{file = "urllib3-1.26.7.tar.gz", hash = "sha256:4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece"},
|
||||||
]
|
]
|
||||||
|
6
python/requests/poetry.lock
generated
6
python/requests/poetry.lock
generated
@ -53,7 +53,7 @@ socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"]
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "urllib3"
|
name = "urllib3"
|
||||||
version = "1.26.2"
|
version = "1.26.5"
|
||||||
description = "HTTP library with thread-safe connection pooling, file post, and more."
|
description = "HTTP library with thread-safe connection pooling, file post, and more."
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
@ -91,6 +91,6 @@ requests = [
|
|||||||
{file = "requests-2.25.0.tar.gz", hash = "sha256:7f1a0b932f4a60a1a65caa4263921bb7d9ee911957e0ae4a23a6dd08185ad5f8"},
|
{file = "requests-2.25.0.tar.gz", hash = "sha256:7f1a0b932f4a60a1a65caa4263921bb7d9ee911957e0ae4a23a6dd08185ad5f8"},
|
||||||
]
|
]
|
||||||
urllib3 = [
|
urllib3 = [
|
||||||
{file = "urllib3-1.26.2-py2.py3-none-any.whl", hash = "sha256:d8ff90d979214d7b4f8ce956e80f4028fc6860e4431f731ea4a8c08f23f99473"},
|
{file = "urllib3-1.26.5-py2.py3-none-any.whl", hash = "sha256:753a0374df26658f99d826cfe40394a686d05985786d946fbe4165b5148f5a7c"},
|
||||||
{file = "urllib3-1.26.2.tar.gz", hash = "sha256:19188f96923873c92ccb987120ec4acaa12f0461fa9ce5d3d0772bc965a39e08"},
|
{file = "urllib3-1.26.5.tar.gz", hash = "sha256:a7acd0977125325f516bda9735fa7142b909a8d01e8b2e4c8108d0984e6e0098"},
|
||||||
]
|
]
|
||||||
|
@ -62,15 +62,10 @@ use_fish_shell() {
|
|||||||
echo "fish ✓"
|
echo "fish ✓"
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_poetry() {
|
|
||||||
poetry completions fish > "$(brew --prefix)/share/fish/vendor_completions.d/poetry.fish"
|
|
||||||
}
|
|
||||||
|
|
||||||
printf "\nbootstrapping...\n\n"
|
printf "\nbootstrapping...\n\n"
|
||||||
install_xcode
|
install_xcode
|
||||||
install_homebrew
|
install_homebrew
|
||||||
install_brews
|
install_brews
|
||||||
setup_poetry
|
|
||||||
use_fish_shell
|
use_fish_shell
|
||||||
("$DOTS/scripts/setup_symlinks")
|
("$DOTS/scripts/setup_symlinks")
|
||||||
|
|
||||||
|
@ -6,6 +6,9 @@ defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
|
|||||||
echo "Automatically show and hide the dock"
|
echo "Automatically show and hide the dock"
|
||||||
defaults write com.apple.dock autohide -bool true
|
defaults write com.apple.dock autohide -bool true
|
||||||
|
|
||||||
|
echo "Automatically show and hide the menu bar"
|
||||||
|
defaults write NSGlobalDomain _HIHideMenuBar -bool true
|
||||||
|
|
||||||
echo "Make Dock icons of hidden applications translucent"
|
echo "Make Dock icons of hidden applications translucent"
|
||||||
defaults write com.apple.dock showhidden -bool true
|
defaults write com.apple.dock showhidden -bool true
|
||||||
|
|
||||||
@ -111,6 +114,35 @@ echo "Set dock size"
|
|||||||
defaults write com.apple.dock largesize -int 48
|
defaults write com.apple.dock largesize -int 48
|
||||||
defaults write com.apple.dock tilesize -int 44
|
defaults write com.apple.dock tilesize -int 44
|
||||||
|
|
||||||
|
echo "Choose and order dock icons"
|
||||||
|
__dock_item() {
|
||||||
|
printf '%s%s%s%s%s' \
|
||||||
|
'<dict><key>tile-data</key><dict><key>file-data</key><dict>' \
|
||||||
|
'<key>_CFURLString</key><string>' \
|
||||||
|
"$1" \
|
||||||
|
'</string><key>_CFURLStringType</key><integer>0</integer>' \
|
||||||
|
'</dict></dict></dict>'
|
||||||
|
}
|
||||||
|
|
||||||
|
defaults write com.apple.dock persistent-apps -array \
|
||||||
|
"$(__dock_item /Applications/1Password\ 7.app)" \
|
||||||
|
"$(__dock_item /Applications/Slack.app)" \
|
||||||
|
"$(__dock_item /System/Applications/Calendar.app)" \
|
||||||
|
"$(__dock_item /Applications/Firefox.app)" \
|
||||||
|
"$(__dock_item /System/Applications/Messages.app)" \
|
||||||
|
"$(__dock_item /System/Applications/Mail.app)" \
|
||||||
|
"$(__dock_item /Applications/Mimestream.app)" \
|
||||||
|
"$(__dock_item /Applications/zoom.us.app)" \
|
||||||
|
"$(__dock_item /Applications/Obsidian.app)" \
|
||||||
|
"$(__dock_item /Applications/Alacritty.app)" \
|
||||||
|
"$(__dock_item /System/Applications/System\ Preferences.app)"
|
||||||
|
|
||||||
|
echo "No recent items in dock"
|
||||||
|
defaults write com.apple.dock show-recents -bool FALSE
|
||||||
|
|
||||||
|
echo "Switch to dark mode"
|
||||||
|
defaults write "Apple Global Domain" "AppleInterfaceStyle" "Dark"
|
||||||
|
|
||||||
echo "Turn on Scroll Reverser"
|
echo "Turn on Scroll Reverser"
|
||||||
open /Applications/Scroll\ Reverser.app
|
open /Applications/Scroll\ Reverser.app
|
||||||
osascript -e 'tell application "System Events" to make login item at end with properties {path:"/Applications/Scroll Reverser.app", hidden:false}'
|
osascript -e 'tell application "System Events" to make login item at end with properties {path:"/Applications/Scroll Reverser.app", hidden:false}'
|
||||||
|
5
scripts/npm
Executable file
5
scripts/npm
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
npm update -g
|
||||||
|
npm install -g pyright
|
||||||
|
npm install -g diagnostic-languageserver
|
@ -1,12 +1,14 @@
|
|||||||
#!/usr/bin/env fish
|
#!/usr/bin/env fish
|
||||||
|
|
||||||
set -U FISH_DIR (readlink ~/.config/fish) # Used for getting to this repo
|
set -U FISH_DIR (readlink ~/.config/fish) # Used for getting to this repo
|
||||||
set -Ux DOTS (dirname $FISH_DIR) # Directory of this config repo
|
set -Ux DOTS (dirname $FISH_DIR) # Directory of this config repo
|
||||||
set -U CDPATH . $HOME # Directories available for immediate cd
|
set -U CDPATH . $HOME # Directories available for immediate cd
|
||||||
set -Ux EDITOR nvim # Preferred text editor
|
set -Ux EDITOR nvim # Preferred text editor
|
||||||
set -U PROJ $HOME/dev/work # Projects directory
|
set -U PROJ $HOME/dev/work # Projects directory
|
||||||
set -Ux NOTES_PATH $HOME/notes # Notes directory
|
set -Ux NOTES_PATH "$HOME/Library/Mobile Documents/iCloud~md~obsidian/Documents/notes" # Notes directory
|
||||||
set -Ux MANPAGER "nvim +Man!" # Used for reading man pages
|
set -Ux MANPAGER "nvim +Man!" # Used for reading man pages
|
||||||
|
set -Ux DIRENV_LOG_FORMAT "" # Disable direnv output
|
||||||
|
set -Ux BROWSER "/Applications/Firefox.app/Contents/MacOS/firefox"
|
||||||
|
|
||||||
# Load abbreviations
|
# Load abbreviations
|
||||||
abbrs
|
abbrs
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "downloading ytfzf"
|
echo "downloading ytfzf"
|
||||||
curl -sL "https://raw.githubusercontent.com/pystardust/ytfzf/master/ytfzf" > ~/.local/bin/ytfzf
|
mkdir -p ~/.local/bin
|
||||||
|
curl -sL "https://raw.githubusercontent.com/pystardust/ytfzf/master/ytfzf" >~/.local/bin/ytfzf
|
||||||
chmod 755 ~/.local/bin/ytfzf
|
chmod 755 ~/.local/bin/ytfzf
|
||||||
echo "ytfzf ✓"
|
echo "ytfzf ✓"
|
||||||
|
@ -20,6 +20,11 @@ bind l select-pane -R
|
|||||||
# Split out pane
|
# Split out pane
|
||||||
bind b break-pane
|
bind b break-pane
|
||||||
|
|
||||||
|
# Synchronize panes
|
||||||
|
bind S set-window-option synchronize-panes
|
||||||
|
bind C-h resize-pane -L 10
|
||||||
|
bind C-l resize-pane -R 10
|
||||||
|
|
||||||
# Copy mode works as Vim
|
# Copy mode works as Vim
|
||||||
bind Escape copy-mode
|
bind Escape copy-mode
|
||||||
bind k copy-mode
|
bind k copy-mode
|
||||||
|
Reference in New Issue
Block a user