Changed the worktree to one directory back (i.e. $HOME) and simplified the setup

This commit is contained in:
Michael Campagnaro 2023-06-13 15:53:57 -04:00
parent 0ee1e7666e
commit d19e60cfc3
140 changed files with 59 additions and 168 deletions

View File

@ -189,7 +189,7 @@ alias ls='ls -F --color'
alias l='ls -lh' alias l='ls -lh'
alias ll='ls -lha' alias ll='ls -lha'
alias aliases='vim ~/.dotfiles/aliases' alias aliases='vim ~/.aliases'
alias al='aliases' alias al='aliases'
if [[ "${platform,,}" == *'ming'* ]]; then if [[ "${platform,,}" == *'ming'* ]]; then

View File

10
.gitignore vendored
View File

@ -1,9 +1 @@
vim/.netrwhist *
vim/bundle/*
vim/plugged/*
vim/undo
vim/undo/*
vim/autoload/plug.vim.old
config/openbox/lxde-rc.xml
*.pyc
!bin

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "vim/bundle/Vundle.vim"]
path = vim/bundle/Vundle.vim
url = https://github.com/VundleVim/Vundle.vim.git

View File

View File

@ -271,3 +271,7 @@ memcpy
strlen strlen
u8 u8
s64 s64
Sculpey
grey
googly
favour

BIN
.vim/spell/en.utf-8.add.spl Normal file

Binary file not shown.

View File

@ -374,6 +374,8 @@ set complete-=i " Don't scan all included files since it's rea
set termguicolors set termguicolors
syntax on " Enable highlighting for syntax syntax on " Enable highlighting for syntax
let g:netrw_dirhistmax = 0 " Disable netrw
set wildmenu set wildmenu
set wildmode=longest,list,full set wildmode=longest,list,full
set wildignore+=*/log/*,*.so,*.swp,*.zip,*/rdoc/* set wildignore+=*/log/*,*.so,*.swp,*.zip,*/rdoc/*
@ -610,10 +612,6 @@ noremap <c-h> <c-w><Left>
:cnoremap <C-J> <S-Left> :cnoremap <C-J> <S-Left>
:cnoremap <C-K> <S-Right> :cnoremap <C-K> <S-Right>
" Move a line under the cursor.
noremap <S-j> :m-2<cr>
noremap <S-k> :m+<cr>
" Window splitting - couldn't figure out how to remap <c-w>v & <c-w>n to <c-m> " Window splitting - couldn't figure out how to remap <c-w>v & <c-w>n to <c-m>
" & <c-n> " & <c-n>
noremap <leader>m :vsplit<cr> noremap <leader>m :vsplit<cr>

View File

View File

View File

@ -1,11 +0,0 @@
# dotfiles
Various dotfiles and misc configs. Some of it is customized around my system setup
(like aliases pointing to paths) but you should be able to easily remove that stuff.
## Installing
There is an `install` script that facilitates the setup, however it's been a while since I did a
full system setup and this script may not be fully complete. An alternative method is to manually
symlink files in the root directory. OS specific configs are in their respective folders.

View File

@ -1,16 +0,0 @@
#!/usr/bin/env bash
# Copies vim data from the home directory to the dotfiles repo.
set -e
src="$HOME/.vim"
dest="$HOME/.dotfiles/vim/"
if [ -d $src ]; then
[ -d "$src/spell" ] && echo "Syncing user dictionary" && cp -r "$src/spell" $dest
[ -d "$src/colors" ] && echo "Syncing user colors" && cp -r "$src/colors" $dest
[ -d "$src/after" ] && echo "Syncing after directory" && cp -r "$src/after" $dest
[ -d "$src/ftdetect" ] && echo "Syncing ftdetect" && cp -r "$src/ftdetect" $dest
[ -d "$src/autoload" ] && echo "Syncing autoload" && cp -r "$src/autoload" $dest
fi

View File

@ -1,16 +0,0 @@
#!/usr/bin/env bash
# Copies vim data from the dotfiles repo to the home directory.
set -e
src="$HOME/.dotfiles/vim"
dest="$HOME/.vim/"
if [ -d $src ]; then
[ -d "$src/spell" ] && echo "Syncing user dictionary" && cp -r "$src/spell" $dest
[ -d "$src/colors" ] && echo "Syncing user colors" && cp -r "$src/colors" $dest
[ -d "$src/after" ] && echo "Syncing after directory" && cp -r "$src/after" $dest
[ -d "$src/ftdetect" ] && echo "Syncing ftdetect" && cp -r "$src/ftdetect" $dest
[ -d "$src/autoload" ] && echo "Syncing autoload" && cp -r "$src/autoload" $dest
fi

32
dotfiles/README.md Normal file
View File

@ -0,0 +1,32 @@
# dotfiles
Various dotfiles and misc configs. Some of it is customized around my system
setup (like aliases pointing to paths) but you should be able to easily remove
that stuff.
This unpacks files one directory back, which is assumed to be your home
directory. The gitignore ignores all files by default. If you want to add a new
file this you need to add the `-f` flag to the git add command. This setup was
inspired by Gary Bernhardt and https://gist.github.com/meleu/053275b6842646b95491bf1af4a6ca0e
## Installing
```bash
# Go to your home directory.
cd ~
# Clone the repo with the "--no-checkout" option (so we can checkout the files in our home directory)
git clone --no-checkout <repo_url>/dotfiles.git
# Go to the created directory and change the worktree to the home direcory.
cd dotfiles
git config core.worktree '../../'
# Checkout the files. This will overwrite existing dotfiles with the same name.
git reset --hard origin/master
```
If you want to install optional OS specific stuff, like various packages, run the `install` script in this folder.
OS specific configs are in their respective folders.

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source "$HOME/.dotfiles/script_helpers/all.sh" source "$HOME/dotfiles/script_helpers/all.sh"
cwd=$PWD cwd=$PWD
source_path="" source_path=""

View File

@ -2,8 +2,8 @@
# If you're getting signature errors, check out https://www.msys2.org/news/#2020-06-29-new-packagers and/or other news posts. # If you're getting signature errors, check out https://www.msys2.org/news/#2020-06-29-new-packagers and/or other news posts.
source "$HOME/.dotfiles/script_helpers/printing.sh" source "$HOME/dotfiles/script_helpers/printing.sh"
source "$HOME/.dotfiles/script_helpers/platform.sh" source "$HOME/dotfiles/script_helpers/platform.sh"
set -e set -e

87
install → dotfiles/install Executable file → Normal file
View File

@ -52,31 +52,6 @@ setup_zsh() {
if [[ $is_linux -eq 1 ]]; then if [[ $is_linux -eq 1 ]]; then
sudo apt install zsh sudo apt install zsh
fi fi
make_link .dotfiles/zsh/core .zsh
FILES=()
FILES+=('zshrc')
FILES+=('zlogin')
for file in "${FILES[@]}"
do
make_link .dotfiles/zsh/$file .$file
done
}
setup_bash() {
printf "${MAGENTA}==> ${NORMAL}Setting up bash...\n"
FILES=()
FILES+=('bashrc')
FILES+=('bash_profile')
FILES+=('inputrc')
for file in "${FILES[@]}"
do
make_link .dotfiles/bash/$file .$file
done
} }
#################################################################################################### ####################################################################################################
@ -85,40 +60,6 @@ setup_bash() {
pushd "$HOME" &>/dev/null pushd "$HOME" &>/dev/null
make_link $dotfiles_dir .dotfiles 1 # expand source path in case we're reinstalling and the cwd is a symlink.
if [[ $is_windows -eq 1 ]]; then
do_vim_copy=1
if [[ -d "$PWD/.vim" ]]; then
printf "\n${BOLD}Vim folder already found at destination. Overwrite? [1,0]\n> ${NORMAL}"
read -e copy_vim
if [[ $copy_vim != "0" && $copy_vim != "1" ]]; then
fatal "Invalid value '$copy_vim'"
elif [[ $copy_vim == "0" ]]; then
do_vim_copy=0
printf "\n"
fi
fi
if [[ $do_vim_copy -eq 1 ]]; then
printf "${MAGENTA}==> ${NORMAL}Copying ${YELLOW}.dotfiles/vim${NORMAL} to ${YELLOW}$PWD/.vim${NORMAL}\n"
cp -r .dotfiles/vim .vim
fi
else
make_link .dotfiles/vim .vim
fi
FILES=()
FILES+=('env.loader')
FILES+=('aliases')
FILES+=('gitconfig')
FILES+=('vimrc')
FILES+=('curlrc')
for file in "${FILES[@]}"
do
make_link .dotfiles/$file .$file
done
set +e set +e
git_comp_filename=".git-completion.bash" git_comp_filename=".git-completion.bash"
printf "${MAGENTA}==> ${NORMAL}Downloading Git completion list to ${YELLOW}$PWD/$git_comp_filename${NORMAL}\n" printf "${MAGENTA}==> ${NORMAL}Downloading Git completion list to ${YELLOW}$PWD/$git_comp_filename${NORMAL}\n"
@ -129,37 +70,19 @@ set -e
# Setup platform files # Setup platform files
######################### #########################
if [[ $is_windows -eq 1 ]]; then if [[ $is_macos -eq 1 ]]; then
printf "\n${BOLD}Setting up Windows${NORMAL}\n\n"
os_name="windows"
# Already using bash if running msys2.
setup_bash
elif [[ $is_macos -eq 1 ]]; then
printf "\n${BOLD}Setting up MacOS${NORMAL}\n\n" printf "\n${BOLD}Setting up MacOS${NORMAL}\n\n"
os_name="macos" $dotfiles_dir/macos/install
# might just switch back to bash since the zsh stuff is ancient.
setup_zsh setup_zsh
setup_bash
use_shell zsh use_shell zsh
elif [[ $is_linux -eq 1 ]]; then elif [[ $is_linux -eq 1 ]]; then
printf "\n${BOLD}Setting up Linux${NORMAL}\n\n" printf "\n${BOLD}Setting up Linux${NORMAL}\n\n"
os_name="linux" $dotfiles_dir/linux/install
setup_zsh
setup_bash
use_shell bash use_shell bash
fi fi
if [[ $os_name != "" ]]; then
if [ -f .dotfiles/$os_name/env.platform ]; then
make_link .dotfiles/$os_name/env.platform .env.platform
fi
if [ -f .dotfiles/$os_name/gitconfig.platform ]; then
make_link .dotfiles/$os_name/gitconfig.platform .gitconfig.platform
fi
$dotfiles_dir/$os_name/install
fi
popd "$HOME" &>/dev/null popd "$HOME" &>/dev/null
printf "${BOLD}${GREEN}Done!${NORMAL}\n" printf "${BOLD}${GREEN}Done!${NORMAL}\n"

Some files were not shown because too many files have changed in this diff Show More