Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ brew 'cmake'
brew 'colordiff'
brew 'coreutils'
brew 'cppcheck'
brew 'diff-so-fancy'
brew 'gmp'
brew 'mpfr'
brew 'gawk'
Expand Down
7 changes: 6 additions & 1 deletion aptgets
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
apt-listdifferences
autoconf
bash-completion
bat
btm
ccache
curl
fzf
git-delta
keychain
Comment thread
dkalowsk marked this conversation as resolved.
luarocks
neovim
nodejs
openocd
python-optcomplete
python3-pip
python3-venv
Expand All @@ -21,7 +26,7 @@ stow
tig
ubuntu-restricted-extras
universal-ctags
universal-ctags
vim
wl-clipboard
xclip
xsel
29 changes: 26 additions & 3 deletions bash/.bashrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
#!/usr/bin/env bash

# Simple function to check if a command exists
command_exists() {
type "$1" &> /dev/null ;
}

# Simple function to check if a .local/env exists
# and if it does parse it for all the values you want
# to add to the shell session.
function export_env()
{
if [ ! -f $HOME/.local/env ]; then
return
fi

pushd $HOME/.local > /dev/null
unamestr=$(uname)
if [ "$unamestr" = 'Linux' ]; then
export $(grep -v '^#' env | xargs -d '\n')
fi
popd > /dev/null
}
#
# Append to history file, don't over write it
# And limit the size it can grow to
Expand Down Expand Up @@ -96,8 +113,8 @@ if command_exists rg ; then
fi

if command_exists batcat ; then
alias bat="batcat --color-always --style=numbers"
alias fzf="fzf --preview 'batcat --color-always --style=numbers --line-range=:500 {}'"
alias bat="batcat --color always --style=numbers"
alias fzf="fzf --preview 'batcat --color always --style=numbers --line-range=:500 {}'"
fi

# Thanks to jvillalovos for this
Expand Down Expand Up @@ -144,10 +161,12 @@ fi
source_additions=(
"${HOME}/.dan_profile"
"${HOME}/.bashrc-private"
"${HOME}/.fzf.bash"
"${HOME}/.git-completion.bash"
"${HOME}/.stgit-completion.bash"
"${HOME}/.delta-completion.bash"
"/usr/share/bash-completion/completions/git"
"/usr/share/doc/fzf/examples/key-bindings.bash"
"/usr/share/doc/fzf/examples/completion.bash"
"/usr/share/virtualenvwrapper/virtualenvwrapper.sh"
)

Expand Down Expand Up @@ -211,3 +230,7 @@ fi
if command_exists ag ; then
alias ag="ag --ignore '*tags'"
fi

# if the custom bash function export_env exists, then run it and load the
# custom environment variables needed.
[[ $(type -t export_env) == function ]] && export_env
72 changes: 53 additions & 19 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ if [[ -n "${DEBUG_SCRIPT:-}" ]]; then
fi

DOTFILES_DIR="$( cd "$(dirname "$0")" ; pwd -P )"
PLATFORM="$(uname)"

readonly PLATFORM_LINUX="Linux"
readonly PLATFORM_DARWIN="Darwin"
readonly PLATFORM_MICROSOFT="MSYS"

DEBUG_PRINTS=0

# Font colors
Expand Down Expand Up @@ -55,6 +59,31 @@ debug() {
fi
}

_configure_platform() {
#
# Why add a function that basically mimics uname?
# Have run into cases where the uname value is different
# for some distros. This just gives a chance to ensure
# there is a consistent naming going forward.
#
local uname="$(uname)"

# by default assume Linux right now
if [ "${uname}" == "Darwin" ]; then
echo "${PLATFORM_DARWIN}"
return
fi

if [[ "${uname}" == *"MSYS"* ]]; then
echo "${PLATFORM_MICROSOFT}"
return
fi

echo "${PLATFORM_LINUX}"
}

PLATFORM="$(_configure_platform)"


doStow() {
if hash stow 2>/dev/null; then
Expand Down Expand Up @@ -127,7 +156,7 @@ doSync() {

doBrew() {

if [ "${PLATFORM}" != "Darwin" ]; then
if [ "${PLATFORM}" != "${PLATFORM_DARWIN}" ]; then
return
fi

Expand Down Expand Up @@ -163,12 +192,16 @@ doInstall() {

doFonts() {
info "Installing Fonts"
#
# Assuming Linux is the default here
#
fonts_dir="${HOME}/.local/share/fonts"

# Grab the latest Microsoft Cascadia Code font
curl --output cascadia.zip -O https://github.com/microsoft/cascadia-code/releases/download/v2404.23/CascadiaCode-2404.23.zip
curl --output cascadia.zip -O https://github.com/microsoft/cascadia-code/releases/download/v2407.24/CascadiaCode-2407.24.zip
unzip cascadia.zip

if [ "${PLATFORM}" == "MSYS" ]; then
if [ "${PLATFORM}" == "${PLATFORM_MICROSOFT}" ]; then
info "You will need to manually install the fonts by clicking on them."
info "I have not setup the PowerShell script to do so yet."
info "This might help: https://medium.com/@slmeng/how-to-install-powerline-fonts-in-windows-b2eedecace58"
Expand All @@ -177,10 +210,8 @@ doFonts() {

fi

if [ "${PLATFORM}" == "Darwin" ]; then
if [ "${PLATFORM}" == "${PLATFORM_DARWIN}" ]; then
fonts_dir="${HOME}/Library/Fonts"
elif [ "${PLATFORM}" == "Linux" ]; then
fonts_dir="${HOME}/.local/share/fonts"
fi

mkdir -p "${fonts_dir}"
Expand Down Expand Up @@ -215,13 +246,13 @@ doPython() {
}

doWindowsConfig() {
if [ "${PLATFORM}" != "MSYS" ]; then
if [ "${PLATFORM}" != "${PLATFORM_MICROSOFT}" ]; then
return
fi
}

doMacOSConfig() {
if [ "${PLATFORM}" != "Darwin" ]; then
if [ "${PLATFORM}" != "${PLATFORM_DARWIN}" ]; then
return
fi

Expand Down Expand Up @@ -336,10 +367,11 @@ doMacOSConfig() {
#
[ "${xcode_status:=2}" -ne 2 ] && doBrew
fi

}

doLinuxConfig() {
if [ "${PLATFORM}" != "Linux" ]; then
if [ "${PLATFORM}" != "${PLATFORM_LINUX}" ]; then
return
fi

Expand All @@ -360,6 +392,9 @@ doLinuxConfig() {

if [ "${distro}" == "Ubuntu" ]; then

info "Installing snaps"
sudo snap install diff-so-fancy

info "Installing from aptgets"
if ((EUID != 0)); then
if [[ -t 1 ]]; then
Expand Down Expand Up @@ -418,14 +453,20 @@ doConfig() {
doLinuxConfig
doWindowsConfig

if [ ! -d "${HOME}/.fzf" ]; then
if hash fzf 2>/dev/null; then
info "FZF already installed at $(which fzf)"
else
#if [ ! -d "${HOME}/.fzf" ]; then
info "Installing fzf"
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
"${HOME}"/.fzf/install --bin --no-update-rc --completion --key-bindings
fi

if [[ ${update} == true ]]; then
if [ -d "${HOME}/.fzf" ]; then
if [[ "$(which fzf)" != "/usr/bin/fzf" ]] && [[ -d "${HOME}/.fzf" ]]; then
# this is not a system installed FZF and likely a personally installed
# meaning we can update it
info "Updating fzf"
pushd "${HOME}"/.fzf > /dev/null
git pull --prune && ./install
popd > /dev/null
Expand All @@ -440,7 +481,6 @@ doConfig() {
[ -f "${HOME}/.git-completion.bash" ] && rm "${HOME}/.git-completion.bash"
[ -f "${HOME}/.tigrc.vim" ] && rm "${HOME}/.tigrc.vim"
[ -f "${HOME}/bin/git-quick-stats" ] && rm "${HOME}/bin/git-quick-stats"
[ -f "${HOME}/bin/diff-so-fancy" ] && rm "${HOME}/bin/diff-so-fancy"
[ -d "${HOME}/.yarn" ] && rm -Rf "${HOME}/.yarn"
fi

Expand Down Expand Up @@ -471,12 +511,6 @@ doConfig() {
rm -Rf "${HOME}/git-quick-stats"
fi

info "Installing diff-so-fancy"
if [ ! -f "${HOME}/bin/diff-so-fancy" ]; then
curl -L https://raw.githubusercontent.com/so-fancy/diff-so-fancy/master/third_party/build_fatpack/diff-so-fancy -o "${HOME}/bin/diff-so-fancy"
chmod +x "${HOME}/bin/diff-so-fancy"
fi

if ! command -v yarn > /dev/null; then
curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
fi
Expand Down
6 changes: 4 additions & 2 deletions config/.config/ghostty/config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
font-family = "Cascadia Code NF"
font-size = 16
theme = "Argonaut"
font-size = 12
theme = "TokyoNight Night"
shell-integration = "bash"
shell-integration-features = no-cursor,sudo,no-title
adjust-cell-height = 25%
Expand All @@ -12,5 +12,7 @@ mouse-scroll-multiplier = 2

window-save-state = always

clipboard-read = allow
clipboard-write = allow
copy-on-select = clipboard

51 changes: 27 additions & 24 deletions config/.config/nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
require "user.launch"
require "user.options"
require "user.keymaps"
spec "user.colorscheme"
spec "user.devicons"
spec "user.gitsigns"
spec "user.guard"
-- schemastore and mason need to be before lspconfig so we can get the right schemea
spec "user.schemastore"
spec "user.treesitter"
spec "user.mason"
--spec "user.osc52"
spec "user.lspconfig"
-- cmp must come after lspconfig it seems
spec "user.cmp"
spec "user.lualine"
spec "user.neoclip"
spec "user.neogit"
spec "user.telescope"
spec "user.trouble"
spec "user.undotree"
spec "user.whichkey"
-- spec "user.gutentags"
require "user.lazy"
-- This file simply bootstraps the installation of Lazy.nvim and then calls other files for execution
-- This file doesn't necessarily need to be touched, BE CAUTIOUS editing this file and proceed at your own risk.
local lazypath = vim.env.LAZY or vim.fn.stdpath "data" .. "/lazy/lazy.nvim"

if not (vim.env.LAZY or (vim.uv or vim.loop).fs_stat(lazypath)) then
-- stylua: ignore
local result = vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
if vim.v.shell_error ~= 0 then
-- stylua: ignore
vim.api.nvim_echo({ { ("Error cloning lazy.nvim:\n%s\n"):format(result), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {})
vim.fn.getchar()
vim.cmd.quit()
end
end

vim.opt.rtp:prepend(lazypath)

-- validate that lazy is available
if not pcall(require, "lazy") then
-- stylua: ignore
vim.api.nvim_echo({ { ("Unable to load lazy from: %s\n"):format(lazypath), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {})
vim.fn.getchar()
vim.cmd.quit()
end

require "lazy_setup"
require "polish"
13 changes: 13 additions & 0 deletions config/.config/nvim/lua/community.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- AstroCommunity: import any community modules here
-- We import this file in `lazy_setup.lua` before the `plugins/` folder.
-- This guarantees that the specs are processed before any user plugins.

---@type LazySpec
return {
"AstroNvim/astrocommunity",
{ import = "astrocommunity.pack.lua" },
-- import/override with your plugins folder
{ import = "astrocommunity.colorscheme.tokyonight-nvim" },
{ import = "astrocommunity.fuzzy-finder.fzf-lua" },
{ import = "astrocommunity.git.neogit" },
}
32 changes: 32 additions & 0 deletions config/.config/nvim/lua/lazy_setup.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
require("lazy").setup({
{
"AstroNvim/AstroNvim",
version = "^6", -- Remove version tracking to elect for nightly AstroNvim
import = "astronvim.plugins",
opts = { -- AstroNvim options must be set here with the `import` key
mapleader = " ", -- This ensures the leader key must be configured before Lazy is set up
maplocalleader = ",", -- This ensures the localleader key must be configured before Lazy is set up
icons_enabled = true, -- Set to false to disable icons (if no Nerd Font is available)
pin_plugins = nil, -- Default will pin plugins when tracking `version` of AstroNvim, set to true/false to override
update_notifications = true, -- Enable/disable notification about running `:Lazy update` twice to update pinned plugins
},
},
{ import = "community" },
{ import = "plugins" },
} --[[@as LazySpec]], {
-- Configure any other `lazy.nvim` configuration options here
install = { colorscheme = { "astrotheme", "habamax" } },
ui = { backdrop = 100 },
performance = {
rtp = {
-- disable some rtp plugins, add more to your liking
disabled_plugins = {
"gzip",
"netrwPlugin",
"tarPlugin",
"tohtml",
"zipPlugin",
},
},
},
} --[[@as LazyConfig]])
5 changes: 5 additions & 0 deletions config/.config/nvim/lua/polish.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if true then return end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE

-- This will run last in the setup process.
-- This is just pure lua so anything that doesn't
-- fit in the normal config locations above can go here
Loading