Skip to content

Commit

Permalink
WSL 2024-02-29 (#35)
Browse files Browse the repository at this point in the history
* feat: databricks dotfiles

* refactor: cleanup dotfiles/.vimrc

* feat: go, databricks dotfiles

* chore: ignore ipython sqlite db

* refactor: shell funcs

* feat: lsd

* feat: ups

* feat: keeping on up

* feat: wsl fun

* fix: rm yaml fix from nix default

* feat: wsl fun

* feat: ups
  • Loading branch information
ADGEfficiency authored Feb 29, 2024
1 parent 3d7b3a6 commit fe09400
Show file tree
Hide file tree
Showing 11 changed files with 343 additions and 51 deletions.
27 changes: 14 additions & 13 deletions dotfiles/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export EDITOR=vim
export HISTCONTROL=ignoreboth:erasedups

# remember a lot
export HISTFILE=~/.zsh_history
export HISTFILE=~/.bash_history
export HISTFILESIZE=10000000
export HISTSIZE=$HISTFILESIZE
SAVEHIST=$HISTSIZE
Expand All @@ -24,18 +24,19 @@ source "$HOME"/dotfiles/scripts/funcs.sh
source "$HOME"/dotfiles/scripts/aliases.sh

# fzf bash hook
source "$HOME"/dotfiles/.fzf.bash

# pyenv
source "$HOME/dotfiles/macos/pyenv-flags"
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
source "$HOME"/dotfiles/dotfiles/.fzf.bash

# assuming all these been installed separately
# z script
source ~/z.sh
. "$HOME/.cargo/env"
. ~/z.sh
eval "$(zoxide init bash)"
source ~/dotfiles/dotfiles/z.sh
# not sure i need this really
# . "$HOME/.cargo/env"

export PATH="$HOME/dotfiles/scripts:$PATH"
source "$HOME/dotfiles/scripts/funcs.sh"
source "$HOME/dotfiles/scripts/aliases.sh"

export XDG_CONFIG_HOME=~/dotfiles
export EDITOR=$(which nvim)

eval "$(ssh-agent)"
8 changes: 4 additions & 4 deletions dotfiles/.fzf.bash
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Setup fzf
# ---------
if [[ ! "$PATH" == "*$HOME/.fzf/bin*" ]]; then
export PATH="$PATH:$HOME/.fzf/bin"
if [[ ! "$PATH" == */home/adam/.fzf/bin* ]]; then
PATH="${PATH:+${PATH}:}/home/adam/.fzf/bin"
fi

# Auto-completion
# ---------------
[[ $- == *i* ]] && source "$HOME/.fzf/shell/completion.bash" 2> /dev/null
source "/home/adam/.fzf/shell/completion.bash"

# Key bindings
# ------------
source "$HOME/.fzf/shell/key-bindings.bash"
source "/home/adam/.fzf/shell/key-bindings.bash"
38 changes: 38 additions & 0 deletions dotfiles/.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ "$BASH_VERSION" != "" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi

if [ -e /home/adam/.nix-profile/etc/profile.d/nix.sh ]; then . /home/adam/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer

eval "$(zoxide init bash)"

# pyenv
source "$HOME/dotfiles/macos/pyenv-flags"
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
1 change: 1 addition & 0 deletions dotfiles/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ setup_dotfile() {
}

setup_dotfile .bashrc
setup_dotfile .profile
setup_dotfile .zshrc
setup_dotfile .zshenv
setup_dotfile .zprofile
Expand Down
267 changes: 267 additions & 0 deletions dotfiles/z.sh

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion linux/setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
sudo apt -y update
sudo apt -y upgrade
sudo apt -y install build-essential
sudo apt -y install build-essential cmake
~/.fzf/install --key-bindings --completion --no-update-rc

# pyenv
Expand Down
22 changes: 0 additions & 22 deletions nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
-- Entrypoint
-- The order of the `require` below is important.
-- require("adam.plugins")
-- require("adam.color")
-- require("adam.alpha")
-- require("adam.cmp")
-- require("adam.gitsigns")
-- require("adam.lsp")
-- require("adam.format")
-- require("adam.lint")
-- require("adam.lualine")
-- require("adam.luasnip")
-- require("adam.pairs")
-- require("adam.telescope")
-- require("adam.treesitter")
-- require("adam.whichkey")
-- require("adam.barbar")
-- require("adam.copilot")
-- require("adam.signature")
-- require("adam.keys")

vim.lsp.set_log_level("debug")
require("config.options")
require("config.lazy")
require("config.keymaps")
2 changes: 1 addition & 1 deletion python/setup-general-venv-pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
echo $PATH
pip install --upgrade pip -q
pip install poetry -U -q
cd python; poetry install
cd python; poetry install --no-root
1 change: 1 addition & 0 deletions scripts/aliases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ alias funcs='$EDITOR $HOME/dotfiles/scripts/funcs.sh'
alias bashrc='$EDITOR $HOME/dotfiles/dotfiles/.bashrc'
alias zshrc='$EDITOR $HOME/dotfiles/dotfiles/.zshrc'
alias zs='source ~/.zshrc'
alias bs='source ~/.bashrc'

# git
alias amend='git commit --amend'
Expand Down
20 changes: 10 additions & 10 deletions scripts/funcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,49 +123,49 @@ tunnelnk() {
# tmux

tn () {
NAME=$($HOME/.pyenv/versions/general/bin/zxpy $HOME/dotfiles/scripts/random-name.py)
NAME=$(basename $(pwd))
tmux new -s $NAME -c $(pwd)
CLEAN=$(pwd | tr -d ' ')
NAME="$(basename $CLEAN)"
tmux new -s $NAME -c "$(pwd)"
}
alias t='tn'


# docker

docker-sh () {
docker_sh () {
docker exec -it $1 /bin/sh
}

docker-build () {
docker_build () {
NAME=$1
DOCKERFILE=$2
docker build -t $NAME . -f $DOCKERFILE --platform linux/amd64
}

docker-run () {
docker_run () {
NAME=$1
COMMAND=$2
docker run -it $NAME $COMMAND --platform linux/amd64
}

docker-ip () {
docker_ip () {
NAME=$1
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $NAME
}

docker-build-run () {
docker_build_run () {
NAME=$1
DOCKERFILE=$2
COMMAND=$3
build-docker $1 $2
run-docker $1 $3
}

docker-ls () {
docker_ls () {
docker network list
docker volume list
}

docker-exec-last () {
docker_exec_last () {
docker exec -it "$(docker ps | awk 'NR==2{print $1}')" /bin/bash
}
6 changes: 6 additions & 0 deletions wsl/.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source /home/adam/dotfiles/dotfiles/.bashrc
source /home/adam/dotfiles/scripts/aliases.sh

alias docs='cd ~/onedrive/docs'
alias od='cd ~/onedrive'
export TODO_DIR="/home/adam/onedrive/docs"

0 comments on commit fe09400

Please sign in to comment.