Compare commits

..

4 Commits

55 changed files with 812 additions and 414 deletions

View File

@@ -1,44 +1,33 @@
# repo containing configs and scripts to set up a box
# dotfiles, plus scripts for box setup
### prereqs, linux distros
- zsh is installed (scripts are written for zsh)
- sudo access is configured for current user
### prereqs, macos
- zsh is installed (scripts are written for zsh)
- install the package manager, [homebrew](https://brew.sh/)
- for aerospace window manager, have only 1 workspace/desktop
- manual settings, refer to [macos-system-settings](ref/macos-system-settings.txt)
### script run
- fulfill prerequisites below
- git clone this repo
- from the repo's root directory, run `./box_setup <OS name>`
### prerequisites
- package manager is configured (i.e. source repos, mirrors, etc. configured)
- zsh is installed (scripts are written for zsh)
- sudo access is configured for current user (as of 2025-01-27, not needed on macos)
- system-specific items below are fulfilled
##### prereqs, os specific, linux-placeholder
- (currently none)
##### prereqs, os specific, macos
- install the package manager, [homebrew](https://brew.sh/)
- for yabai window manager (so as to not mess with SIP settings)
- create 9 spaces/desktops
- system settings > keyboard shortcuts: set keys to switch between spaces/desktops
- system settings > desktop/dock/mission-control:
- `click wallpaper to reveal desktop`: set to "only in stage manager"
- all `drag windows to corner/edge/place` types of options: disabled
- `rearrange spaces based on recent use`: disabled
- `when switch to app... switch to space with open windows of app`: disabled
- `displays have separate spaces`: enabled
- `show files on desktop`: enabled
- if repo present on system, run from the repo's root:
- ```
./box_setup.sh <OS-name>
```
- if repo not present, run:
- ```
curl -LO https://git.drinkingtea.net/david/box-setup/raw/branch/master/box_setup.sh
sh box_setup.sh <OS-name>
```
- then delete the script file afterwards (repo should have been copied to dev dir)
### todo items
- add logic to the main run script to handle cloning of this repo
- config for window manager for linux (first, decide which wm to use)
- config for terminal emulator (currently ghostty)
- config for mpd, mpc, ncmpcpp
- config for mpv
- choose window manager for linux, then configure
- config for: terminal (ghostty); shell; mpd, mpc, ncmpcpp; mpv
- config for gimp, `src_files/.config/GIMP` (dir)
- set things in gtkrc only? still need to nest that within a sub dir?
- or configure in gimp, copy resulting dir to `src_files/.config/GIMP`, call it a day
- maybe build in flags/logic for skipping certain installs/builds (and maybe configs?)
on a given system (i.e. don't install on a company box, on a server, etc.)
- decide on and implement approach for languages and versioning
- asdf, or language-specific version managers?
- language-specific? asdf? no, not asdf, mise seems better from what i hear so far
- docker? or alternatives like podman? any license concerns?
- hybrid of the above?

View File

@@ -1,42 +0,0 @@
#!/bin/zsh
[[ -z $1 ]] &&
echo "OS must be passed as an arg (options: arch, artix, debian, macos)" &&
echo "example: ./box_setup arch" &&
exit 1
# set env vars for installs
local install_cmd=''
local update_pkg_manager_and_defs_cmd=''
local update_pkgs_cmd=''
case $1 in
(arch | artix)
install_cmd="sudo pacman -S"
update_pkg_manager_and_defs_cmd='' # don't; update system instead?
update_pkgs_cmd='sudo pacman -Syu'
;;
(debian)
install_cmd="sudo apt install"
update_pkg_manager_and_defs_cmd='sudo apt update'
update_pkgs_cmd='sudo apt upgrade'
;;
(macos)
install_cmd="brew install"
update_pkg_manager_and_defs_cmd='brew update'
update_pkgs_cmd='brew upgrade'
;;
esac
export BOX_SETUP_INSTALL_COMMAND="$install_cmd"
export BOX_SETUP_UPDATE_PKG_MANAGER_AND_DEFS_CMD="$update_pkg_manager_and_defs_cmd"
export BOX_SETUP_UPDATE_PKGS_CMD="$update_pkgs_cmd"
# make dirs and copy configs/dotfiles
source ./src_files/.config/zsh/.zshenv
./make_dirs
./copy_configs
# install programs
source $ZDOTDIR/.zshenv
source $ZDOTDIR/.zshrc
./install_programs

67
box_setup.sh Executable file
View File

@@ -0,0 +1,67 @@
#!/bin/zsh
[[ -z $1 ]] && {
echo "OS must be passed as an arg, run \`./box_setup.sh --help\` for more info"
exit 1
}
[[ $1 = "--help" ]] && {
echo "usage: ./box_setup.sh <OS-name> [system-type]\n"
echo "OS-name options: arch, artix, debian, macos"
echo "system-type options: personal, studio-music, work-placeholder\n"
echo "examples:\n./box_setup.sh arch studio-music\n./box_setup.sh macos\n"
exit 0
}
# TODO: test this git stuff, see if it works
temp_placement_git_dir="no"
[[ ! -d ".git" && "$(basename $(pwd))" != "box-setup" ]] && {
temp_placement_git_dir="yes"
git clone "https://git.drinkingtea.net/david/box-setup.git" || {
echo "failed to clone box-setup git repo"
exit 1
}
pushd box-setup > /dev/null
}
# set env vars for installs
install_cmd=''
update_pkg_manager_and_defs_cmd=''
update_pkgs_cmd=''
case $1 in
(arch | artix)
install_cmd="sudo pacman -S"
update_pkg_manager_and_defs_cmd='' # don't; update system instead?
update_pkgs_cmd='sudo pacman -Syu'
;;
(debian)
install_cmd="sudo apt install"
update_pkg_manager_and_defs_cmd='sudo apt update'
update_pkgs_cmd='sudo apt upgrade'
;;
(macos)
install_cmd="brew install"
update_pkg_manager_and_defs_cmd='brew update'
update_pkgs_cmd='brew upgrade'
;;
esac
export BOX_SETUP_INSTALL_COMMAND="$install_cmd"
export BOX_SETUP_UPDATE_PKG_MANAGER_AND_DEFS_CMD="$update_pkg_manager_and_defs_cmd"
export BOX_SETUP_UPDATE_PKGS_CMD="$update_pkgs_cmd"
# make dirs and copy configs/dotfiles
source ./src_files/.config/zsh/.zshenv
./make_dirs.sh
./copy_configs.sh $2
# install programs
source $ZDOTDIR/.zshenv
source $ZDOTDIR/.zshrc
./install_programs.sh $2
[[ $temp_placement_git_dir == "yes" ]] && {
popd > /dev/null
mv "box-setup" "$DIR_GIT_PROJECTS/me/"
}

View File

@@ -35,7 +35,7 @@ link_dir() {
ln -s $src_dir $link_dir
}
echo "---- copying dotfiles -------------------------"
echo "---- copying dotfiles ------------------------------------------------"
copy_file src_files/.config/zsh/.zshenv $HOME # duplicate, copy anyway, ensures $ZDOTDIR
@@ -43,7 +43,12 @@ copy_dir src_files/.config $XDG_CONFIG_HOME
copy_dir src_files/.local/bin $DIR_BIN
copy_dir src_files/.local/scripts $DIR_SCRIPTS
# on macos, gimp defaults to app-support, so sym-link to actual config
[[ "$BOX_SETUP_OS" = "macos" ]] &&
[[ "$BOX_SETUP_OS" = "macos" ]] && {
copy_dir src_files/executable_wrappers_macos $DIR_BIN
link_dir "$XDG_CONFIG_HOME/GIMP" "$HOME/Library/Application Support/GIMP"
}
# [[ $1 = "studio-music" ]] &&
# [[ "$BOX_SETUP_OS" = "macos" ]] &&
# link_dir "$XDG_CONFIG_HOME/REAPER" "$HOME/Library/Application Support/REAPER" && # TODO: get reaper config set up

View File

@@ -1,22 +0,0 @@
#!/bin/zsh
local single_script_filter=""
while [[ $# > 0 ]]; do
single_script_filter="$1" # if using param, export BOX_SETUP_OS first if needed
shift
done
echo "---- installing programs ----------------------"
local scripts=$(find ./installs_and_builds -maxdepth 1 -mindepth 1 -type f | sort)
for script in ${=scripts}; do
if [[ -x $script ]]; then
if echo "$script" | grep -qv "$single_script_filter"; then
continue # $single_script_filter set, ignore others
fi
echo "executing: $script"
./$script
fi
done

34
install_programs.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/zsh
find_scripts_in_dir() {
echo $(find $1 -maxdepth 1 -mindepth 1 -type f | sort)
}
install_scripts_from_list() {
for script in $@; do
if [[ -x $script ]]; then
echo "executing: $script"
./$script
fi
done
}
system_types_list="base"
scripts_from_dir=($(find_scripts_in_dir "./installs_and_builds"))
[[ $1 = "personal" ]] && {
system_types_list+=", personal"
scripts_from_dir+=($(find_scripts_in_dir "./installs_and_builds/personal"))
}
[[ $1 = "studio-music" ]] && {
system_types_list+=", studio-music"
scripts_from_dir+=($(find_scripts_in_dir "./installs_and_builds/studio_music"))
}
[[ $1 = "work-placeholder" ]] && {
system_types_list+=", work-placeholder"
scripts_from_dir+=($(find_scripts_in_dir "./installs_and_builds/work_placeholder"))
}
echo "---- installing programs ---------------------------------------------"
echo "-------- for system types: $system_types_list"
install_scripts_from_list "${scripts_from_dir[@]}"

View File

@@ -1,17 +1,17 @@
#!/bin/zsh
local neovim_dir=$HOME/.local/build/neovim
local neovim_version="v0.10.3"
[ ! -z $NVIM_VERSION ] && neovim_version="$NVIM_VERSION"
echo "neovim_version: \"$neovim_version\""
install_neovim_dir=$HOME/.local/build/neovim
install_neovim_version="v0.10.3"
[ ! -z $NVIM_VERSION ] && install_neovim_version="$NVIM_VERSION"
echo "install_neovim_version: \"$install_neovim_version\""
[ ! -d $neovim_dir ] && git clone https://github.com/neovim/neovim.git $neovim_dir
git -C $neovim_dir fetch --all
git -C $neovim_dir checkout $neovim_version
[ ! -d $install_neovim_dir ] && git clone https://github.com/neovim/neovim.git $install_neovim_dir
git -C $install_neovim_dir fetch --all
git -C $install_neovim_dir checkout $install_neovim_version
make -C $neovim_dir clean
make -C $neovim_dir CMAKE_BUILD_TYPE=RelWithDebInfo
sudo make -C $neovim_dir install
make -C $install_neovim_dir clean
make -C $install_neovim_dir CMAKE_BUILD_TYPE=RelWithDebInfo
sudo make -C $install_neovim_dir install
# from primeagen's dev repo, uncomment/edit as needed
# git clone https://github.com/ThePrimeagen/harpoon.git $HOME/personal/harpoon

View File

@@ -1,6 +1,6 @@
#!/bin/zsh
local option_prefix=''
[[ "$BOX_SETUP_OS" = "macos" ]] && option_prefix='--cask'
install_option_prefix=''
[[ "$BOX_SETUP_OS" = "macos" ]] && install_option_prefix='--cask'
# NOTE: ghostty not currently in debian repos, maybe build from source
${=BOX_SETUP_INSTALL_COMMAND} "$option_prefix" ghostty
${=BOX_SETUP_INSTALL_COMMAND} "$install_option_prefix" ghostty

View File

@@ -1,18 +1,18 @@
#!/bin/zsh
local linux_wm_and_utils() {
linux_wm_and_utils() {
# TODO: pick wm for linux; options: dwm, i3, others?
echo "linux_wm_and_utils not yet implemented"
}
local macos_wm_and_utils() {
brew install koekeishiya/formulae/yabai
macos_wm_and_utils() {
brew install koekeishiya/formulae/skhd
skhd --start-service
yabai --start-service
sleep 14 # time to give permission in accessibility settings
skhd --restart-service
yabai --restart-service
# NOTE: currently, aerospace seems to need system restart to take effect
brew install --cask nikitabobko/tap/aerospace
}
[[ "$BOX_SETUP_OS" = "macos" ]] && macos_wm_and_utils || linux_wm_and_utils

View File

@@ -1,8 +1,8 @@
#!/bin/zsh
# TODO: replace firefox with brave or another browser
# local option_prefix=''
# [[ "$BOX_SETUP_OS" = "macos" ]] && option_prefix='--cask'
# local firefox_package_name='firefox'
# install_option_prefix=''
# [[ "$BOX_SETUP_OS" = "macos" ]] && install_option_prefix='--cask'
# firefox_package_name='firefox'
# [[ "$BOX_SETUP_OS" = "debian" ]] && firefox_package_name='firefox-esr'
# ${=BOX_SETUP_INSTALL_COMMAND} "$option_prefix" "$firefox_package_name"
# ${=BOX_SETUP_INSTALL_COMMAND} "$install_option_prefix" "$firefox_package_name"

View File

@@ -1,6 +1,6 @@
#!/bin/zsh
# only audio editor(s) in this file; daws are handled separately
local option_prefix=''
[[ "$BOX_SETUP_OS" = "macos" ]] && option_prefix='--cask'
${=BOX_SETUP_INSTALL_COMMAND} "$option_prefix" audacity
install_option_prefix=''
[[ "$BOX_SETUP_OS" = "macos" ]] && install_option_prefix='--cask'
${=BOX_SETUP_INSTALL_COMMAND} "$install_option_prefix" audacity

View File

@@ -1,7 +1,7 @@
#!/bin/zsh
local option_prefix=''
[[ "$BOX_SETUP_OS" = "macos" ]] && option_prefix='--cask'
${=BOX_SETUP_INSTALL_COMMAND} "$option_prefix" gimp
install_option_prefix=''
[[ "$BOX_SETUP_OS" = "macos" ]] && install_option_prefix='--cask'
${=BOX_SETUP_INSTALL_COMMAND} "$install_option_prefix" gimp
# ${=BOX_SETUP_INSTALL_COMMAND} imagemagick # TODO: consider this program too

View File

@@ -2,10 +2,10 @@
# TODO: review and decide if the things below are needed
#local lua_package="lua5.1"
#[[ "$BOX_SETUP_OS" = "macos" ]] && lua_package="lua@5.1"
# install_lua_package="lua5.1"
#[[ "$BOX_SETUP_OS" = "macos" ]] && install_lua_package="lua@5.1"
#${=BOX_SETUP_INSTALL_COMMAND} "$lua_package" liblua5.1-0-dev
#${=BOX_SETUP_INSTALL_COMMAND} "$install_lua_package" liblua5.1-0-dev
# TODO: do i want to install luarocks? lazy.nvim plugin manager currently expects it
#luarocks install luacheck

View File

@@ -17,7 +17,10 @@ source ./src_files/.config/zsh/.zshenv # ensure env vars set for use below
# dirs for how i'm organizing my system
[[ ! -d "$DIR_HOME_BOX" ]] && mkdir $DIR_HOME_BOX
[[ ! -d "$DIR_MUSIC" ]] && mkdir $DIR_MUSIC
[[ ! -d "$DIR_DEV" ]] && mkdir $DIR_DEV
[[ ! -d "$DIR_DEV/git" ]] && mkdir $DIR_DEV/git
[[ ! -d "$DIR_DEV/git/me" ]] && mkdir $DIR_DEV/git/me
[[ ! -d "$DIR_DEV/git/other" ]] && mkdir $DIR_DEV/git/other
[[ ! -d "$DIR_GIT_PROJECTS" ]] && mkdir $DIR_GIT_PROJECTS
[[ ! -d "$DIR_GIT_PROJECTS/me" ]] && mkdir $DIR_DEV/git/me
[[ ! -d "$DIR_GIT_PROJECTS/other" ]] && mkdir $DIR_DEV/git/other
[[ ! -d "$DIR_SCRATCH_NOTES" ]] && mkdir -p $DIR_SCRATCH_NOTES
[[ ! -d "$DIR_SCRATCH_DRAWINGS" ]] && mkdir -p $DIR_SCRATCH_DRAWINGS

View File

@@ -0,0 +1,14 @@
// settings for manual configuration in macos system settings app
// NOTE: some of these could be scripted, but for now i'm okay with this manual list
- desktop/dock/mission-control:
- `click wallpaper to reveal desktop`: set to "only in stage manager"
- all `drag windows to corner/edge/place` types of options: disabled
- `rearrange spaces based on recent use`: disabled
- `when switch to app... switch to space with open windows of app`: disabled
- `displays have separate spaces`: disabled
- `show files on desktop`: enabled
- `group windows by application`: enabled
- in general, just go through most pages/options and set them as desired

View File

@@ -0,0 +1,24 @@
//////////////////////////////////////////////////////////////////////////////////////////
// idea from the primeagen, designated label/workspace/desktop per app/purpose
// current layout/plan // wm default layout/mode
1. drawing/thinking (scratch pads for text and images) stack (fullscreen)
2. music makeing - misc stack (fullscreen)
3. music making - daw floating
4. music/audio listening stack (fullscreen)
5. general misc (catch-all) stack (fullscreen)
6. comms (email, chats, etc) stack (fullscreen)
7. dev - misc stack (fullscreen)
8. terminal (primary, but audio/one-off/etc can be anywhere) stack (fullscreen)
9. web browser stack (fullscreen)
// ideas/guidelines:
- use this consistently accross all machines
- if something not applicable for a given machine, just don't have apps or screens
present, but maintain absolute position/numbering of each screen
- structure the above so that programs which i'm likely to use with one hand off of the
keyboard (i.e. to use a trackpad, mouse, stylus, etc) are on the screens that allow
for one hand (i.e. the one still on the keyboard) to navigate those screens
- for me, using peripherals with right hand, so put programs likely to be used with
peripherals where my left hand can switch to them single-handedly (screens 1 to 5)

View File

@@ -0,0 +1,129 @@
# options commands : https://nikitabobko.github.io/AeroSpace/commands
after-startup-command = []
start-at-login = true # start aerospace at login
# ref: https://nikitabobko.github.io/AeroSpace/guide#normalization
enable-normalization-flatten-containers = true
enable-normalization-opposite-orientation-for-nested-containers = true
accordion-padding = 0 # ref: https://nikitabobko.github.io/AeroSpace/guide#layouts
default-root-container-layout = 'accordion' # tiles|accordion
default-root-container-orientation = 'auto' # horizontal|vertical|auto
# refs: https://nikitabobko.github.io/AeroSpace/guide#on-focus-changed-callbacks
# https://nikitabobko.github.io/AeroSpace/commands#move-mouse
on-focused-monitor-changed = ['move-mouse monitor-lazy-center']
# ref: https://nikitabobko.github.io/AeroSpace/goodies#disable-hide-app
automatically-unhide-macos-hidden-apps = true
# See https://nikitabobko.github.io/AeroSpace/guide#key-mapping
[key-mapping]
preset = 'qwerty' # qwerty|dvorak|colemak
# ref: https://nikitabobko.github.io/AeroSpace/guide#assign-workspaces-to-monitors
# gaps between windows (inner-*) and between monitor edges (outer-*).
[gaps]
inner.horizontal = 0
inner.vertical = 0
outer.left = 0
outer.bottom = 0
outer.top = 0
outer.right = 0
# 'main' binding mode; ref: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
[mode.main.binding] # 'main' binding mode must be always presented
# All possible keys:
# - Letters. a, b, c, ..., z
# - Numbers. 0, 1, 2, ..., 9
# - Keypad numbers. keypad0, keypad1, keypad2, ..., keypad9
# - F-keys. f1, f2, ..., f20
# - Special keys. minus, equal, period, comma, slash, backslash, quote, semicolon,
# backtick, leftSquareBracket, rightSquareBracket, space, enter, esc,
# backspace, tab, pageUp, pageDown, home, end, forwardDelete,
# sectionSign (ISO keyboards only, european keyboards only)
# - Keypad special. keypadClear, keypadDecimalMark, keypadDivide, keypadEnter, keypadEqual,
# keypadMinus, keypadMultiply, keypadPlus
# - Arrows. left, down, up, right
# All possible modifiers: cmd, alt, ctrl, shift
# All possible commands: https://nikitabobko.github.io/AeroSpace/commands
# See: https://nikitabobko.github.io/AeroSpace/commands#exec-and-forget
# You can uncomment the following lines to open up terminal with alt + enter shortcut
# (like in i3)
# alt-enter = '''exec-and-forget osascript -e '
# tell application "Terminal"
# do script
# activate
# end tell'
# '''
# See: https://nikitabobko.github.io/AeroSpace/commands#layout
alt-slash = 'layout tiles horizontal vertical'
alt-comma = 'layout accordion horizontal vertical'
# See: https://nikitabobko.github.io/AeroSpace/commands#focus
alt-j = 'focus down'
alt-k = 'focus up'
# bindings: alt-l -> ctrl-tab, alt-h -> ctrl-shift-tab
# alt-l = "exec-and-forget osascript -e 'tell application \"System Events\" to key code 48 using control down'"
# alt-h = "exec-and-forget osascript -e 'tell application \"System Events\" to key code 48 using {control down, shift down}'"
# See: https://nikitabobko.github.io/AeroSpace/commands#move
alt-shift-h = 'move left'
alt-shift-j = 'move down'
alt-shift-k = 'move up'
alt-shift-l = 'move right'
# See: https://nikitabobko.github.io/AeroSpace/commands#resize
alt-minus = 'resize smart -50'
alt-equal = 'resize smart +50'
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace
alt-1 = 'workspace 1'
alt-2 = 'workspace 2'
alt-3 = 'workspace 3'
alt-4 = 'workspace 4'
alt-5 = 'workspace 5'
alt-6 = 'workspace 6'
alt-7 = 'workspace 7'
alt-8 = 'workspace 8'
alt-9 = 'workspace 9'
# See: https://nikitabobko.github.io/AeroSpace/commands#move-node-to-workspace
alt-shift-1 = 'move-node-to-workspace 1'
alt-shift-2 = 'move-node-to-workspace 2'
alt-shift-3 = 'move-node-to-workspace 3'
alt-shift-4 = 'move-node-to-workspace 4'
alt-shift-5 = 'move-node-to-workspace 5'
alt-shift-6 = 'move-node-to-workspace 6'
alt-shift-7 = 'move-node-to-workspace 7'
alt-shift-8 = 'move-node-to-workspace 8'
alt-shift-9 = 'move-node-to-workspace 9'
# See: https://nikitabobko.github.io/AeroSpace/commands#mode
alt-shift-semicolon = 'mode service'
# 'service' binding mode declaration.
# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
[mode.service.binding]
esc = ['reload-config', 'mode main']
backspace = ['close-all-windows-but-current', 'mode main']
r = ['flatten-workspace-tree', 'mode main'] # reset layout
f = ['flatten-workspace-tree', 'layout floating', 'mode main']
t = ['flatten-workspace-tree', 'layout tiling', 'mode main']
s = ['layout v_accordion', 'mode main']
g = ['layout v_tiles', 'mode main']
alt-shift-h = ['join-with left', 'mode main']
alt-shift-j = ['join-with down', 'mode main']
alt-shift-k = ['join-with up', 'mode main']
alt-shift-l = ['join-with right', 'mode main']
down = 'volume down'
up = 'volume up'
shift-down = ['volume set 0', 'mode main']

View File

@@ -0,0 +1,206 @@
# Place a copy of this config to ~/.aerospace.toml
# After that, you can edit ~/.aerospace.toml to your liking
# You can use it to add commands that run after AeroSpace startup.
# Available commands : https://nikitabobko.github.io/AeroSpace/commands
after-startup-command = []
# Start AeroSpace at login
start-at-login = false
# Normalizations. See: https://nikitabobko.github.io/AeroSpace/guide#normalization
enable-normalization-flatten-containers = true
enable-normalization-opposite-orientation-for-nested-containers = true
# See: https://nikitabobko.github.io/AeroSpace/guide#layouts
# The 'accordion-padding' specifies the size of accordion padding
# You can set 0 to disable the padding feature
accordion-padding = 30
# Possible values: tiles|accordion
default-root-container-layout = 'tiles'
# Possible values: horizontal|vertical|auto
# 'auto' means: wide monitor (anything wider than high) gets horizontal orientation,
# tall monitor (anything higher than wide) gets vertical orientation
default-root-container-orientation = 'auto'
# Mouse follows focus when focused monitor changes
# Drop it from your config, if you don't like this behavior
# See https://nikitabobko.github.io/AeroSpace/guide#on-focus-changed-callbacks
# See https://nikitabobko.github.io/AeroSpace/commands#move-mouse
# Fallback value (if you omit the key): on-focused-monitor-changed = []
on-focused-monitor-changed = ['move-mouse monitor-lazy-center']
# You can effectively turn off macOS "Hide application" (cmd-h) feature by toggling this flag
# Useful if you don't use this macOS feature, but accidentally hit cmd-h or cmd-alt-h key
# Also see: https://nikitabobko.github.io/AeroSpace/goodies#disable-hide-app
automatically-unhide-macos-hidden-apps = false
# Possible values: (qwerty|dvorak|colemak)
# See https://nikitabobko.github.io/AeroSpace/guide#key-mapping
[key-mapping]
preset = 'qwerty'
# Gaps between windows (inner-*) and between monitor edges (outer-*).
# Possible values:
# - Constant: gaps.outer.top = 8
# - Per monitor: gaps.outer.top = [{ monitor.main = 16 }, { monitor."some-pattern" = 32 }, 24]
# In this example, 24 is a default value when there is no match.
# Monitor pattern is the same as for 'workspace-to-monitor-force-assignment'.
# See:
# https://nikitabobko.github.io/AeroSpace/guide#assign-workspaces-to-monitors
[gaps]
inner.horizontal = 0
inner.vertical = 0
outer.left = 0
outer.bottom = 0
outer.top = 0
outer.right = 0
# 'main' binding mode declaration
# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
# 'main' binding mode must be always presented
# Fallback value (if you omit the key): mode.main.binding = {}
[mode.main.binding]
# All possible keys:
# - Letters. a, b, c, ..., z
# - Numbers. 0, 1, 2, ..., 9
# - Keypad numbers. keypad0, keypad1, keypad2, ..., keypad9
# - F-keys. f1, f2, ..., f20
# - Special keys. minus, equal, period, comma, slash, backslash, quote, semicolon,
# backtick, leftSquareBracket, rightSquareBracket, space, enter, esc,
# backspace, tab, pageUp, pageDown, home, end, forwardDelete,
# sectionSign (ISO keyboards only, european keyboards only)
# - Keypad special. keypadClear, keypadDecimalMark, keypadDivide, keypadEnter, keypadEqual,
# keypadMinus, keypadMultiply, keypadPlus
# - Arrows. left, down, up, right
# All possible modifiers: cmd, alt, ctrl, shift
# All possible commands: https://nikitabobko.github.io/AeroSpace/commands
# See: https://nikitabobko.github.io/AeroSpace/commands#exec-and-forget
# You can uncomment the following lines to open up terminal with alt + enter shortcut
# (like in i3)
# alt-enter = '''exec-and-forget osascript -e '
# tell application "Terminal"
# do script
# activate
# end tell'
# '''
# See: https://nikitabobko.github.io/AeroSpace/commands#layout
alt-slash = 'layout tiles horizontal vertical'
alt-comma = 'layout accordion horizontal vertical'
# See: https://nikitabobko.github.io/AeroSpace/commands#focus
alt-h = 'focus left'
alt-j = 'focus down'
alt-k = 'focus up'
alt-l = 'focus right'
# See: https://nikitabobko.github.io/AeroSpace/commands#move
alt-shift-h = 'move left'
alt-shift-j = 'move down'
alt-shift-k = 'move up'
alt-shift-l = 'move right'
# See: https://nikitabobko.github.io/AeroSpace/commands#resize
alt-minus = 'resize smart -50'
alt-equal = 'resize smart +50'
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace
alt-1 = 'workspace 1'
alt-2 = 'workspace 2'
alt-3 = 'workspace 3'
alt-4 = 'workspace 4'
alt-5 = 'workspace 5'
alt-6 = 'workspace 6'
alt-7 = 'workspace 7'
alt-8 = 'workspace 8'
alt-9 = 'workspace 9'
alt-a = 'workspace A' # In your config, you can drop workspace bindings that you don't need
alt-b = 'workspace B'
alt-c = 'workspace C'
alt-d = 'workspace D'
alt-e = 'workspace E'
alt-f = 'workspace F'
alt-g = 'workspace G'
alt-i = 'workspace I'
alt-m = 'workspace M'
alt-n = 'workspace N'
alt-o = 'workspace O'
alt-p = 'workspace P'
alt-q = 'workspace Q'
alt-r = 'workspace R'
alt-s = 'workspace S'
alt-t = 'workspace T'
alt-u = 'workspace U'
alt-v = 'workspace V'
alt-w = 'workspace W'
alt-x = 'workspace X'
alt-y = 'workspace Y'
alt-z = 'workspace Z'
# See: https://nikitabobko.github.io/AeroSpace/commands#move-node-to-workspace
alt-shift-1 = 'move-node-to-workspace 1'
alt-shift-2 = 'move-node-to-workspace 2'
alt-shift-3 = 'move-node-to-workspace 3'
alt-shift-4 = 'move-node-to-workspace 4'
alt-shift-5 = 'move-node-to-workspace 5'
alt-shift-6 = 'move-node-to-workspace 6'
alt-shift-7 = 'move-node-to-workspace 7'
alt-shift-8 = 'move-node-to-workspace 8'
alt-shift-9 = 'move-node-to-workspace 9'
alt-shift-a = 'move-node-to-workspace A'
alt-shift-b = 'move-node-to-workspace B'
alt-shift-c = 'move-node-to-workspace C'
alt-shift-d = 'move-node-to-workspace D'
alt-shift-e = 'move-node-to-workspace E'
alt-shift-f = 'move-node-to-workspace F'
alt-shift-g = 'move-node-to-workspace G'
alt-shift-i = 'move-node-to-workspace I'
alt-shift-m = 'move-node-to-workspace M'
alt-shift-n = 'move-node-to-workspace N'
alt-shift-o = 'move-node-to-workspace O'
alt-shift-p = 'move-node-to-workspace P'
alt-shift-q = 'move-node-to-workspace Q'
alt-shift-r = 'move-node-to-workspace R'
alt-shift-s = 'move-node-to-workspace S'
alt-shift-t = 'move-node-to-workspace T'
alt-shift-u = 'move-node-to-workspace U'
alt-shift-v = 'move-node-to-workspace V'
alt-shift-w = 'move-node-to-workspace W'
alt-shift-x = 'move-node-to-workspace X'
alt-shift-y = 'move-node-to-workspace Y'
alt-shift-z = 'move-node-to-workspace Z'
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace-back-and-forth
alt-tab = 'workspace-back-and-forth'
# See: https://nikitabobko.github.io/AeroSpace/commands#move-workspace-to-monitor
alt-shift-tab = 'move-workspace-to-monitor --wrap-around next'
# See: https://nikitabobko.github.io/AeroSpace/commands#mode
alt-shift-semicolon = 'mode service'
# 'service' binding mode declaration.
# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
[mode.service.binding]
esc = ['reload-config', 'mode main']
r = ['flatten-workspace-tree', 'mode main'] # reset layout
f = ['layout floating tiling', 'mode main'] # Toggle between floating and tiling layout
backspace = ['close-all-windows-but-current', 'mode main']
# sticky is not yet supported https://github.com/nikitabobko/AeroSpace/issues/2
#s = ['layout sticky tiling', 'mode main']
alt-shift-h = ['join-with left', 'mode main']
alt-shift-j = ['join-with down', 'mode main']
alt-shift-k = ['join-with up', 'mode main']
alt-shift-l = ['join-with right', 'mode main']
down = 'volume down'
up = 'volume up'
shift-down = ['volume set 0', 'mode main']

View File

@@ -2,4 +2,6 @@
defaultBranch = master
[user]
name = david
email = david@silverwolf.studio
email = david@pinewoods.xyz
[push]
autoSetupRemote = true

View File

@@ -1 +1,13 @@
require("david_standard")
local csGroup = vim.api.nvim_create_augroup("coreSettingsGroup", { clear = true })
local csgAutocmd = vim.api.nvim_create_autocmd
require("settings")
require("plugin_manager")
require("key_mappings")
require("colorscheme_settings")
csgAutocmd({"BufWritePre"}, {
group = csGroup,
pattern = "*",
command = [[%s/\s\+$//e]],
})

View File

@@ -0,0 +1,5 @@
return {
cmd = { 'clangd' },
root_markers = { '.clangd', 'compile_commands.json' },
filetypes = { 'c', 'cpp' },
}

View File

@@ -6,7 +6,7 @@ function SetColorSchemeWrapper(scheme)
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
end
SetColorSchemeWrapper()
SetColorSchemeWrapper("tokyonight-night")
-- TODO: get this working as desired for different file types
-- local dsGroup = vim.api.nvim_create_augroup("DavidStandardGroup", { clear = false })

View File

@@ -1,33 +0,0 @@
local dsGroup = vim.api.nvim_create_augroup("DavidStandardGroup", { clear = true })
local dsgAutocmd = vim.api.nvim_create_autocmd
require("david_standard.settings")
require("david_standard.key_mappings")
require("david_standard.plugin_config")
require("david_standard.plugin_key_mappings")
require("david_standard.colorscheme_settings")
require("david_standard.lsp_enables")
dsgAutocmd({"BufWritePre"}, {
group = dsGroup,
pattern = "*",
command = [[%s/\s\+$//e]],
})
-- TODO: put this into separate file(s) for lsp stuff? if so, pass in or make new autocmd
dsgAutocmd('LspAttach', {
group = dsGroup,
callback = function(e)
local opts = { buffer = e.buf }
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
vim.keymap.set("n", "<leader>vdv", function() vim.diagnostic.open_float() end, opts)
vim.keymap.set("n", "<leader>vdn", function() vim.diagnostic.goto_next() end, opts)
vim.keymap.set("n", "<leader>vdp", function() vim.diagnostic.goto_prev() end, opts)
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set("n", "<leader>vrl", function() vim.lsp.buf.references() end, opts)
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
end
})

View File

@@ -1,52 +0,0 @@
-- explore the directory of the current file (using netrw)
vim.keymap.set("n", "<leader>n", vim.cmd.Ex)
-- move selected lines up or down
vim.keymap.set("v", "J", ":m '>+1<CR>gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv")
-- vertically center cursor with half-page jumps iterating search results
vim.keymap.set("n", "<C-d>", "<C-d>zz")
vim.keymap.set("n", "<C-u>", "<C-u>zz")
vim.keymap.set("n", "n", "nzzzv")
vim.keymap.set("n", "N", "Nzzzv")
-- maintain cursor position after paragraph formatting
vim.keymap.set("n", "=ap", "ma=ap'a")
-- shortcuts for deleting into the void register
vim.keymap.set({ "n", "v" }, "<leader>d", "\"_d")
vim.keymap.set("x", "<leader>P", [["_dP]]) -- replace selected text, keep main register
-- shortcuts for using + register (system clipboard)
vim.keymap.set({ "n", "v" }, "<leader>y", [["+y]])
vim.keymap.set("n", "<leader>Y", [["+Y]])
vim.keymap.set("n", "<leader>p", [["+p]])
-- search-and-replace shortcuts
vim.keymap.set("n", "<leader>rw", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
vim.keymap.set("n", "<leader>ra", [[:%s//g<Left><Left>]])
-- toggle expandtab and show message
vim.keymap.set("n", "<leader>tab", function()
if vim.opt.expandtab:get() then
vim.opt.expandtab = false
print("using actual tabs")
else
vim.opt.expandtab = true
print("using spaces in place of tabs")
end
end)
-- quicker switching between panes/splits
vim.keymap.set("n", "<C-h>", [[<C-w>h]])
vim.keymap.set("n", "<C-j>", [[<C-w>j]])
vim.keymap.set("n", "<C-k>", [[<C-w>k]])
vim.keymap.set("n", "<C-l>", [[<C-w>l]])
-- TODO: learn about quickfix (:help quickfix), then maybe use these
-- vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz")
-- vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz")
-- vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz")
-- vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz")

View File

@@ -1,10 +0,0 @@
-- c
-- c++
-- ruby
vim.lsp.enable('ruby_lsp')
-- vim.lsp.enable('typeprof') -- ruby builtin/official (but still labled experimental)
-- vim.lsp.enable('standardrb')
-- vim.lsp.enable('solargraph')
-- vim.lsp.enable('herb_ls') -- targets html + ruby (erb files)

View File

@@ -1,54 +0,0 @@
-- telescope
local builtin = require('telescope.builtin')
local custom_tscope_grep = function()
builtin.grep_string({ search = vim.fn.input("grep > ")})
end
vim.keymap.set('n', '<leader>ft', builtin.live_grep, {
desc = 'Telescope find text (live_grep)'
})
vim.keymap.set('n', '<leader>fT', custom_tscope_grep, {
desc = 'Telescope find text (grep_string)'
})
vim.keymap.set('n', '<leader>fg', builtin.git_files, {
desc = 'Telescope find git-tracked files'
})
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
-- harpoon
local harpoon = require("harpoon")
vim.keymap.set("n", "<leader>hl", function()
harpoon.ui:toggle_quick_menu(harpoon:list())
end)
vim.keymap.set("n", "<leader>ha", function() harpoon:list():add() end)
vim.keymap.set("n", "<leader>hA", function() harpoon:list():prepend() end)
vim.keymap.set("n", "<leader>hn", function() harpoon:list():next() end)
vim.keymap.set("n", "<leader>hp", function() harpoon:list():prev() end)
vim.keymap.set("n", "<leader>hz", function() harpoon:list():select(1) end)
vim.keymap.set("n", "<leader>hx", function() harpoon:list():select(2) end)
vim.keymap.set("n", "<leader>hc", function() harpoon:list():select(3) end)
vim.keymap.set("n", "<leader>hv", function() harpoon:list():select(4) end)
vim.keymap.set("n", "<leader>hZ", function() harpoon:list():replace_at(1) end)
vim.keymap.set("n", "<leader>hX", function() harpoon:list():replace_at(2) end)
vim.keymap.set("n", "<leader>hC", function() harpoon:list():replace_at(3) end)
vim.keymap.set("n", "<leader>hV", function() harpoon:list():replace_at(4) end)
-- undotree
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
-- treesitter and treesitter-context
vim.keymap.set("n", "<leader>tc", function() vim.cmd.TSContext({ "toggle" }) end)
-- fugitive (git integration)
vim.keymap.set("n", "<leader>gG", vim.cmd.Git)
vim.keymap.set("n", "<leader>gg", ":Git ") -- shortcut, arbitrary git commands
vim.keymap.set("n", "<leader>ga", function() vim.cmd.Git({ "add %"}) end)
vim.keymap.set("n", "<leader>gs", function() vim.cmd.Git({ "-p status" }) end)
vim.keymap.set("n", "<leader>gc", function() vim.cmd.Git({ "commit -a" }) end)
-- conform (formatter)
vim.keymap.set("n", "<leader>fmt", function()
require("conform").format({ bufnr = 0 })
end)

View File

@@ -0,0 +1,140 @@
local kmGroup = vim.api.nvim_create_augroup("KeymappingsGroup", { clear = true })
local kmgAutocmd = vim.api.nvim_create_autocmd
------------------------------------------------------------------------------------------
-- core
-- explore the directory of the current file (using netrw)
vim.keymap.set("n", "<leader>n", vim.cmd.Ex)
-- move selected lines up or down
vim.keymap.set("v", "J", ":m '>+1<CR>gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv")
-- vertically center cursor with half-page jumps
vim.keymap.set("n", "<C-d>", "<C-d>zz")
vim.keymap.set("n", "<C-u>", "<C-u>zz")
-- open folds when iterating search results
vim.keymap.set("n", "n", "nzv")
vim.keymap.set("n", "N", "Nzv")
-- maintain cursor position after paragraph formatting
vim.keymap.set("n", "=ap", "ma=ap'a")
-- shortcuts for deleting into the void register
vim.keymap.set({ "n", "v" }, "<leader>d", "\"_d")
vim.keymap.set("x", "<leader>P", [["_dP]]) -- replace selected text, keep main register
-- shortcuts for using + register (system clipboard)
vim.keymap.set({ "n", "v" }, "<leader>y", [["+y]])
vim.keymap.set("n", "<leader>Y", [["+Y]])
vim.keymap.set("n", "<leader>D", [["+D]])
vim.keymap.set("n", "<leader>p", [["+p]])
-- search-and-replace shortcuts
vim.keymap.set("n", "<leader>rw", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
vim.keymap.set("n", "<leader>ra", [[:%s//g<Left><Left>]])
-- toggle expandtab and show message
vim.keymap.set("n", "<leader>tab", function()
if vim.opt.expandtab:get() then
vim.opt.expandtab = false
print("using actual tabs")
else
vim.opt.expandtab = true
print("using spaces in place of tabs")
end
end)
-- quicker switching between panes/splits
vim.keymap.set("n", "<C-h>", [[<C-w>h]])
vim.keymap.set("n", "<C-j>", [[<C-w>j]])
vim.keymap.set("n", "<C-k>", [[<C-w>k]])
vim.keymap.set("n", "<C-l>", [[<C-w>l]])
------------------------------------------------------------------------------------------
-- quickfix TODO: learn about quickfix (:help quickfix), then maybe use these
-- vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz")
-- vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz")
-- vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz")
-- vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz")
------------------------------------------------------------------------------------------
-- lsp
kmgAutocmd('LspAttach', {
group = kmGroup,
callback = function(e)
local opts = { buffer = e.buf }
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
vim.keymap.set("n", "<leader>vdv", function() vim.diagnostic.open_float() end, opts)
vim.keymap.set("n", "<leader>vdn", function() vim.diagnostic.goto_next() end, opts)
vim.keymap.set("n", "<leader>vdp", function() vim.diagnostic.goto_prev() end, opts)
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set("n", "<leader>vrl", function() vim.lsp.buf.references() end, opts)
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
end
})
------------------------------------------------------------------------------------------
-- plugins
-- telescope
local builtin = require('telescope.builtin')
local custom_tscope_grep = function()
builtin.grep_string({ search = vim.fn.input("grep > ")})
end
vim.keymap.set('n', '<leader>ft', builtin.live_grep, {
desc = 'Telescope find text (live_grep)'
})
vim.keymap.set('n', '<leader>fT', custom_tscope_grep, {
desc = 'Telescope find text (grep_string)'
})
vim.keymap.set('n', '<leader>fg', builtin.git_files, {
desc = 'Telescope find git-tracked files'
})
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
-- harpoon
local harpoon = require("harpoon")
vim.keymap.set("n", "<leader>hl", function()
harpoon.ui:toggle_quick_menu(harpoon:list())
end)
vim.keymap.set("n", "<leader>ha", function() harpoon:list():add() end)
vim.keymap.set("n", "<leader>hA", function() harpoon:list():prepend() end)
vim.keymap.set("n", "<leader>hn", function() harpoon:list():next() end)
vim.keymap.set("n", "<leader>hp", function() harpoon:list():prev() end)
vim.keymap.set("n", "<leader>hz", function() harpoon:list():select(1) end)
vim.keymap.set("n", "<leader>hx", function() harpoon:list():select(2) end)
vim.keymap.set("n", "<leader>hc", function() harpoon:list():select(3) end)
vim.keymap.set("n", "<leader>hv", function() harpoon:list():select(4) end)
vim.keymap.set("n", "<leader>hZ", function() harpoon:list():replace_at(1) end)
vim.keymap.set("n", "<leader>hX", function() harpoon:list():replace_at(2) end)
vim.keymap.set("n", "<leader>hC", function() harpoon:list():replace_at(3) end)
vim.keymap.set("n", "<leader>hV", function() harpoon:list():replace_at(4) end)
-- undotree
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
-- treesitter and treesitter-context
vim.keymap.set("n", "<leader>tc", function() vim.cmd.TSContext({ "toggle" }) end)
-- fugitive (git integration)
vim.keymap.set("n", "<leader>gG", vim.cmd.Git)
vim.keymap.set("n", "<leader>gg", ":Git ") -- shortcut, arbitrary git commands
vim.keymap.set("n", "<leader>ga", function() vim.cmd.Git({ "add %"}) end)
vim.keymap.set("n", "<leader>gs", function() vim.cmd.Git({ "-p status" }) end)
vim.keymap.set("n", "<leader>gc", function() vim.cmd.Git({ "commit -a" }) end)
-- conform (formatter)
vim.keymap.set("n", "<leader>fmt", function()
require("conform").format({ bufnr = 0 })
end)

View File

@@ -22,7 +22,7 @@ vim.opt.rtp:prepend(path_lazy_nvim)
require("lazy").setup({
spec = {
{ import = "david_standard.plugins_lazy" },
{ import = "plugins_lazy" },
},
checker = { enabled = false },
change_detection = { notify = false },

View File

@@ -28,9 +28,10 @@ return {
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = {
"clangd",
"lua_ls",
-- "gopls",
"ruby_lsp",
-- "gopls",
-- "tailwindcss",
},
handlers = {
@@ -68,7 +69,7 @@ return {
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-u>'] = cmp.mapping.scroll_docs(4),
}),
snippet = {
expand = function(args)
@@ -86,6 +87,9 @@ return {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
performance = {
max_view_entries = 14,
},
})
-- `/` cmdline setup.
@@ -110,5 +114,11 @@ return {
prefix = "",
},
})
end
-- TODO: enables needed? or does neovim/nvim-lspconfig cover by default?
-- vim.lsp.enable('clangd')
-- vim.lsp.enable('ruby_lsp')
-- vim.lsp.enable('standardrb')
-- vim.lsp.enable('herb_ls') -- targets html + ruby (erb files)
end,
}

View File

@@ -8,10 +8,21 @@ local glob_patterns_live_grep = {
}
return {
'nvim-telescope/telescope.nvim',
tag = '0.1.8',
dependencies = { 'nvim-lua/plenary.nvim' },
"nvim-telescope/telescope.nvim",
tag = "0.1.8",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
defaults = {
layout_strategy = "horizontal",
layout_config = {
horizontal = {
width = 0.98,
height = 0.98,
preview_width = 0.45,
},
},
path_display = { "truncate", },
},
pickers = {
find_files = {
find_command = {

View File

@@ -2,46 +2,6 @@
# staring file was at /opt/homebrew/opt/yabai/share/yabai/examples
# notes, stacks: https://github.com/koekeishiya/yabai/issues/203#issuecomment-650642142
##########################################################################################
# key bindings for yabai wm
# general idea: alt navigates (move my view); alt+shift modifies (move/change the window)
# switch to space (to leave SIP in place, configure these in macos system settings)
# alt - 1 # switch to space 1
# alt - 2 # switch to space 2 (and similar for other numbers)
# move focused window to the given space
alt + shift - 1 : yabai -m window --space 1 --focus
alt + shift - 2 : yabai -m window --space 2 --focus
alt + shift - 3 : yabai -m window --space 3 --focus
alt + shift - 4 : yabai -m window --space 4 --focus
alt + shift - 5 : yabai -m window --space 5 --focus
alt + shift - 6 : yabai -m window --space 6 --focus
alt + shift - 7 : yabai -m window --space 7 --focus
alt + shift - 8 : yabai -m window --space 8 --focus
alt + shift - 9 : yabai -m window --space 9 --focus
# all windows in a space to fullscreen in a single stack
alt + shift - s : yabai -m space --layout stack
# all windows in a space back to the grid (managed)
alt + shift - g : yabai -m space --layout bsp
# toggle float on/off for the focused window
alt + shift - f : yabai -m window --toggle float
# balance window sizes
alt + shift - 0 : yabai -m space --balance # TODO: figure out better key option
# focus on next/previous window
alt - j : yabai -m window --focus \
$(yabai -m query --spaces --space | jq '.type' | tr -d "\"" | sed "s/stack/stack./" | sed "s/.*[^.]\$//")prev
alt - k : yabai -m window --focus \
$(yabai -m query --spaces --space | jq '.type' | tr -d "\"" | sed "s/stack/stack./" | sed "s/.*[^.]\$//")next
# move current window up/down in stack
alt + shift - k : yabai -m window --swap \
$(yabai -m query --spaces --space | jq '.type' | tr -d "\"" | sed "s/stack/stack./" | sed "s/.*[^.]\$//")next
alt + shift - j : yabai -m window --swap \
$(yabai -m query --spaces --space | jq '.type' | tr -d "\"" | sed "s/stack/stack./" | sed "s/.*[^.]\$//")prev
##########################################################################################
# key bindings for general use

View File

@@ -0,0 +1,13 @@
tmux_omitted_dirs=(
$HOME
$DIR_HOME_BOX
$DIR_DEV
$DIR_GIT_PROJECTS
)
[[ ! ${tmux_omitted_dirs[(re)$(pwd)]} ]] &&
tmux new-window -d -n cmd &&
tmux rename-window $EDITOR &&
$EDITOR .
clear

View File

@@ -0,0 +1,11 @@
## example template
tmux new-window -d -n cmd
tmux send-keys -t :cmd "echo 'in cmd'" c-M
tmux new-window -d -n another
tmux send-keys -t :another "echo 'in another'" c-M
tmux rename-window $EDITOR
$EDITOR .
clear

View File

@@ -0,0 +1,7 @@
tmux new-window -d -n ncspot
tmux new-window -d -n fitness
tmux send-keys -t :fitness "cd $DIR_HOME_BOX/life/fitness/audio" c-M
tmux rename-window ncmpcpp
ncmpcpp

View File

@@ -0,0 +1,8 @@
tmux rename-window drawing
tmux new-window -n thinking
tmux send-keys -t :thinking "$EDITOR $(date "+%Y%m%d")-scratch" c-M
tmux send-keys -t :drawing "cd $DIR_SCRATCH_DRAWINGS" c-M
tmux send-keys -t :drawing "gimp" c-M

View File

@@ -8,7 +8,7 @@ set -g status-style 'bg=#111111 fg=#22cc00'
set -g base-index 0
# unbind keys
unbind-key f; unbind-key C-f; unbind-key C-s
unbind-key f; unbind-key C-f; unbind-key s; unbind-key C-s
unbind-key c; unbind-key n; unbind-key p
unbind-key C-o; unbind-key C-n; unbind-key C-p; unbind-key C-l; unbind-key C-h
@@ -35,7 +35,8 @@ bind-key n new-window
# find and switching for sessions, include using tmux-session-init
bind-key C-f run-shell "tmux neww $DIR_SCRIPTS/tmux-session-init"
bind-key C-s run-shell "tmux neww $DIR_SCRIPTS/tmux-session-init find-existing"
# bind-key C-s run-shell "tmux neww $DIR_SCRIPTS/tmux-session-init find-existing"
bind-key C-s choose-session
bind-key C-h run-shell "tmux neww $DIR_SCRIPTS/tmux-session-init hub"
bind-key -r C-l switch-client -l
bind-key -r C-o last-window

View File

@@ -1,35 +0,0 @@
#!/usr/bin/env sh
# global settings
yabai -m config \
external_bar off:40:0 \
menubar_opacity 1.0 \
mouse_follows_focus off \
focus_follows_mouse off \
display_arrangement_order default \
window_origin_display default \
window_placement first_child \
window_insertion_point focused \
window_zoom_persist on \
window_shadow off \
window_animation_duration 0.0 \
window_animation_easing ease_out_circ \
window_opacity_duration 0.0 \
active_window_opacity 1.0 \
normal_window_opacity 0.90 \
window_opacity off \
insert_feedback_color 0xffd75f5f \
split_ratio 0.0 \
split_type auto \
auto_balance off \
top_padding 00 \
bottom_padding 00 \
left_padding 00 \
right_padding 00 \
window_gap 00 \
layout bsp \
mouse_modifier fn \
mouse_action1 move \
mouse_action2 resize \
mouse_drop_action swap

View File

@@ -0,0 +1 @@
# source "$XDG_CONFIG_HOME/shell/profile" # TODO: where to put this?

View File

@@ -4,8 +4,11 @@ export EDITOR='nvim'
# env vars used for my organization structure
export DIR_HOME_BOX="$HOME/dbox"
export DIR_MUSIC="$DIR_HOME_BOX/media/music"
export DIR_DEV="$HOME/dev"
export DIR_GIT_PROJECTS="$DIR_DEV/git"
export DIR_SCRATCH_NOTES="$DIR_HOME_BOX/scratchpad/notes"
export DIR_SCRATCH_DRAWINGS="$DIR_HOME_BOX/scratchpad/drawings"
# util dirs; do not change without checking impact on xdg base dirs
export DIR_LOCAL="$HOME/.local"

View File

@@ -16,9 +16,8 @@ alias nv='nvim'
alias n='nvim'
alias tms='tmux-session-init'
# executable name overrides
# executable overrides
alias ls='ls -F'
alias yt-dlp='yt-dlp --write-info-json'
# misc commands
alias cal='khal calendar'

View File

@@ -11,6 +11,7 @@ alias gfo='git fetch origin'
alias git-push-to-temp='git branch -D temp; git checkout -b temp; git push origin temp -uf; git checkout -'
alias gpdev='git-push-to-temp'
alias gpo='git pull origin'
git config --global user.email "$EMAIL_PERSONAL_DEV" # TODO: maybe fit this into system-type filters?
# code/test/linter run and build commands
alias bel='bundle exec standardrb'

5
src_files/.local/bin/mvd Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/zsh
mvd_target_dir=$(dirname "${@: -1}")
[[ ! -d "$mvd_target_dir" ]] && mkdir -p "$mvd_target_dir"
exec mv "$@"

View File

@@ -1,21 +0,0 @@
local omitted_dirs=(
$HOME
$DIR_HOME_BOX
$DIR_DEV
$DIR_GIT_PROJECTS
)
[[ ! ${omitted_dirs[(re)$(pwd)]} ]] &&
tmux new-window -d -n cmd &&
tmux rename-window $EDITOR &&
$EDITOR .
clear
## example template for custom override
# tmux new-window -d -n cmd
# tmux send-keys -t :cmd "echo 'in cmd'" c-M
# tmux new-window -d -n another
# tmux send-keys -t :another "echo 'in another'" c-M
# tmux rename-window $EDITOR
# $EDITOR .
# clear

View File

@@ -1,36 +1,40 @@
#!/bin/zsh
switch_to() {
tmux_switch_to() {
[[ -z $TMUX ]] && tmux attach-session -t $1 || tmux switch-client -t $1
}
hydrate() {
local tmux_hydrate_path="$DIR_SCRIPTS/.tmux-session-hydrate-default"
tmux_hydrate() {
local tmux_hydrate_files_dir="$XDG_CONFIG_HOME/tmux/session-hydrate-files"
local tmux_hydrate_path="$tmux_hydrate_files_dir/.tmux-session-hydrate-default"
[[ $1 = "thinking" ]] && tmux_hydrate_path="$tmux_hydrate_files_dir/.tmux-session-hydrate-thinking"
[[ $1 = "listening" ]] && tmux_hydrate_path="$tmux_hydrate_files_dir/.tmux-session-hydrate-listening"
[[ -f $2/.tmux-session-hydrate ]] && tmux_hydrate_path="$2/.tmux-session-hydrate"
[[ -f $tmux_hydrate_path ]] && tmux send-keys -t $1 "source $tmux_hydrate_path" c-M
}
local name_regex="^\([-_A-Za-z0-9]*\):.*$"
local existing_sessions=$([[ -n $(pgrep tmux) ]] && tmux list-sessions | sed "s/$name_regex/\1/" || echo '')
local search_dirs=(
tmux_existing_sessions=$([[ -n $(pgrep tmux) ]] && tmux list-sessions || echo '')
tmux_search_dirs=(
$DIR_HOME_BOX
$DIR_DEV
$DIR_GIT_PROJECTS/*
)
local target_name=''
local target_path=''
tmux_target_name=''
tmux_target_path=''
[[ $# -eq 1 ]] && target_path=$1 ||
target_path=$(find $search_dirs -mindepth 1 -maxdepth 1 -type d | fzf)
[[ $# -eq 1 ]] && tmux_target_path=$1 ||
tmux_target_path=$(find $tmux_search_dirs -mindepth 1 -maxdepth 1 -type d | fzf)
if [[ $target_path = "find-existing" ]]; then target_name=$(echo $existing_sessions | fzf);
elif [[ $target_path = "hub" ]]; then target_name="hub" && target_path="$HOME";
elif [[ -n $target_path ]]; then target_name=$(basename "$target_path" | tr . _);
if [[ $tmux_target_path = "." ]]; then tmux_target_name=$(basename $(pwd)) && tmux_target_path=$(pwd);
elif [[ $tmux_target_path = "hub" ]]; then tmux_target_name="hub" && tmux_target_path="$HOME";
elif [[ $tmux_target_path = "thinking" ]]; then tmux_target_name="thinking" && tmux_target_path="$DIR_SCRATCH_NOTES";
elif [[ $tmux_target_path = "listening" ]]; then tmux_target_name="listening" && tmux_target_path="$DIR_MUSIC";
elif [[ -n $tmux_target_path ]]; then tmux_target_name=$(basename "$tmux_target_path" | tr . _);
fi
[[ -z $target_name ]] && exit 0
[[ -z $tmux_target_name ]] && exit 0
! (echo $existing_sessions | grep -q "$target_name") &&
tmux new-session -d -s $target_name -c $target_path &&
hydrate $target_name $target_path
switch_to $target_name
! (echo $tmux_existing_sessions | grep -q "$tmux_target_name") &&
tmux new-session -d -s $tmux_target_name -c $tmux_target_path &&
tmux_hydrate $tmux_target_name $tmux_target_path
tmux_switch_to $tmux_target_name

View File

@@ -0,0 +1,3 @@
#!/bin/sh
/Applications/GIMP.app/Contents/MacOS/gimp