diff --git a/.chezmoiignore b/.chezmoiignore new file mode 100644 index 0000000..8dfd8ae --- /dev/null +++ b/.chezmoiignore @@ -0,0 +1,2 @@ +install.sh +README.md diff --git a/.config/kitty/kitty-themes b/.config/kitty/kitty-themes deleted file mode 160000 index b1abdd5..0000000 --- a/.config/kitty/kitty-themes +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b1abdd54ba655ef34f75a568d78625981bf1722c diff --git a/.config/kitty/theme.conf b/.config/kitty/theme.conf deleted file mode 120000 index a7b0953..0000000 --- a/.config/kitty/theme.conf +++ /dev/null @@ -1 +0,0 @@ -./kitty-themes/themes/OneDark.conf \ No newline at end of file diff --git a/.config/nvim/syntax/gpl.vim b/.config/nvim/syntax/gpl.vim deleted file mode 100644 index 16e21d7..0000000 --- a/.config/nvim/syntax/gpl.vim +++ /dev/null @@ -1,47 +0,0 @@ -" Vim syntax file -" Language: gpl -" Maintainer: Tim Chaplin -" Last Change: 2006 Feb 6 - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -" gpl extentions -syn keyword gplConditional if else -syn keyword gplRepeat for -syn keyword gplKeyword print space on exit -syn keyword gplType int double string logical circle rectangle triangle textbox pixmap -syn keyword gplResVariable window_x window_y window_width window_height window_title window_red window_green window_blue animation_speed -syn keyword gplFunction initialization animation leftarrow rightarrow uparrow downarrow f1 akey skey dkey fkey hkeyjkey kkey lkey wkey leftmouse_down middlemouse_down rightmouse_down leftmouse_up middlemouse_up rightmouse_up mouse_move mouse_drag - -syn keyword gplDefine forward -syn keyword gplBoolean true false - -syn region gplComment start="//" end="$" keepend contains=Comment - -" Default highlighting -if version >= 508 || !exists("did_gpl_syntax_inits") - if version < 508 - let did_gpl_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink gplComment Comment - HiLink gplConditional Conditional - HiLink gplRepeat Repeat - HiLink gplKeyword Keyword - HiLink gplType Type - HiLink gplFunction Function - HiLink gplResVariable Constant - HiLink gplDefine Define - HiLink gplBoolean Boolean - delcommand HiLink -endif - -let b:current_syntax = "gpl" diff --git a/.gitmodules b/.gitmodules index 07a542c..9838eb5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,6 +10,3 @@ [submodule ".config/nvim/bundle/sidonia"] path = .config/nvim/bundle/sidonia url = git@github.com:alessandroyorba/sidonia -[submodule ".config/kitty/kitty-themes"] - path = .config/kitty/kitty-themes - url = git@github.com:dexpota/kitty-themes diff --git a/README.md b/README.md index 4f8b211..39cfa27 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,35 @@ # dotfiles -This repository fully bootstraps a new machine to be configured how I like it. It sets -up dotfiles, installs programs and development tools I use, and does several -miscellaneous things I've automated out of my new machine setup process. +This repository fully bootstraps a new machine to be configured how I like it. +It sets up dotfiles, installs programs and development tools I use, and does +several miscellaneous things I've automated out of my new machine setup process. -It will work for anyone, but it is very opinionated and custom built for my own needs. +It will work for anyone, but it is very opinionated and custom built for my own +needs. ## Installation -This repository does not need to be cloned; it clones itself. You do not need to set up -an SSH key first; it handles that for you. +This repository does not need to be cloned and you do not need to set up an SSH +key first. Just run: ```sh -/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/glacials/dotfiles/HEAD/install.sh)" +sh -c "$(curl -fsLS chezmoi.io/get)" -- init --apply glacials +$(chezmoi source-path)/install.sh ``` -This command is idempotent; it is safe to run multiple times. +### Updates + +To make updates to dotfiles, use `chezmoi edit $FILE`. Updates will be +automatically committed and pushed. ## Caveats -There are a few manual steps I haven't automated. The script will ask you to perform -them at the end of the process, in the style of [do-nothing scripting][donothing]. +This project aims to be compatible with macOS and Linux; however it gets far +more real-world testing on macOS, so Linux support may trip over a thing or two. -This project aims to be compatible with macOS and Linux; however it gets far more -real-world testing on macOS, so Linux support may trip over a thing or two. +## History -[donothing]: https://blog.danslimmon.com/2019/07/15/do-nothing-scripting-the-key-to-gradual-automation/ +This started as a series of dotfiles, then a Makefile to link them, then an +install script to manage installation of common tools and differences between +operating systems. Today, dotfile management is outsourced to +[`chezmoi`](https://github.com/twpayne/chezmoi). diff --git a/.ackrc b/dot_ackrc similarity index 100% rename from .ackrc rename to dot_ackrc diff --git a/.agignore b/dot_agignore similarity index 100% rename from .agignore rename to dot_agignore diff --git a/.amethyst b/dot_amethyst similarity index 100% rename from .amethyst rename to dot_amethyst diff --git a/dot_config/chezmoi/chezmoi.toml b/dot_config/chezmoi/chezmoi.toml new file mode 100644 index 0000000..458d1d5 --- /dev/null +++ b/dot_config/chezmoi/chezmoi.toml @@ -0,0 +1,3 @@ +[git] + autoCommit = true + autoPush = true diff --git a/fortunes/.gitignore b/dot_config/fortune/.gitignore similarity index 100% rename from fortunes/.gitignore rename to dot_config/fortune/.gitignore diff --git a/fortunes/arrested-development b/dot_config/fortune/arrested-development similarity index 100% rename from fortunes/arrested-development rename to dot_config/fortune/arrested-development diff --git a/fortunes/community b/dot_config/fortune/community similarity index 100% rename from fortunes/community rename to dot_config/fortune/community diff --git a/fortunes/doctor-who b/dot_config/fortune/doctor-who similarity index 100% rename from fortunes/doctor-who rename to dot_config/fortune/doctor-who diff --git a/fortunes/misc b/dot_config/fortune/misc similarity index 100% rename from fortunes/misc rename to dot_config/fortune/misc diff --git a/fortunes/parks-and-recreation b/dot_config/fortune/parks-and-recreation similarity index 100% rename from fortunes/parks-and-recreation rename to dot_config/fortune/parks-and-recreation diff --git a/fortunes/stargate b/dot_config/fortune/stargate similarity index 100% rename from fortunes/stargate rename to dot_config/fortune/stargate diff --git a/fortunes/strfile b/dot_config/fortune/strfile similarity index 100% rename from fortunes/strfile rename to dot_config/fortune/strfile diff --git a/fortunes/the-flash b/dot_config/fortune/the-flash similarity index 100% rename from fortunes/the-flash rename to dot_config/fortune/the-flash diff --git a/.config/git/ignore b/dot_config/git/ignore similarity index 100% rename from .config/git/ignore rename to dot_config/git/ignore diff --git a/.config/kitty/kitty.conf b/dot_config/kitty/kitty.conf similarity index 100% rename from .config/kitty/kitty.conf rename to dot_config/kitty/kitty.conf diff --git a/dot_config/kitty/theme.conf b/dot_config/kitty/theme.conf new file mode 100644 index 0000000..ad6cb4e --- /dev/null +++ b/dot_config/kitty/theme.conf @@ -0,0 +1,25 @@ +# One Dark by Giuseppe Cesarano, https://github.com/GiuseppeCesarano +# This work is licensed under the terms of the GPL-2.0 license. +# For a copy, see https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html. + +foreground #979eab +background #282c34 +cursor #cccccc +color0 #282c34 +color1 #e06c75 +color2 #98c379 +color3 #e5c07b +color4 #61afef +color5 #be5046 +color6 #56b6c2 +color7 #979eab +color8 #393e48 +color9 #d19a66 +color10 #56b6c2 +color11 #e5c07b +color12 #61afef +color13 #be5046 +color14 #56b6c2 +color15 #abb2bf +selection_foreground #282c34 +selection_background #979eab diff --git a/.config/nvim/filetype.vim b/dot_config/nvim/filetype.vim similarity index 100% rename from .config/nvim/filetype.vim rename to dot_config/nvim/filetype.vim diff --git a/.config/nvim/init.vim b/dot_config/nvim/init.vim similarity index 99% rename from .config/nvim/init.vim rename to dot_config/nvim/init.vim index c59a623..919205f 100644 --- a/.config/nvim/init.vim +++ b/dot_config/nvim/init.vim @@ -85,6 +85,9 @@ Plug 'hrsh7th/nvim-cmp' Plug 'neovim/nvim-lspconfig' " Official collection of common LSP configs Plug 'dense-analysis/ale' " Async language-agnostic linting server +" Chezmoi +Plug 'alker0/chezmoi-vim' # Syntax highlighting for chezmoi-managed dotfiles + " Go " Various Go niceties (remove 'do' if removing golines as the gofmt command) Plug 'fatih/vim-go', { 'do': 'go install github.com/segmentio/golines@latest' } diff --git a/.gitconfig b/dot_gitconfig similarity index 100% rename from .gitconfig rename to dot_gitconfig diff --git a/.gitignore_global b/dot_gitignore_global similarity index 100% rename from .gitignore_global rename to dot_gitignore_global diff --git a/.gnupg/gpg-agent.conf b/dot_gnupg/gpg-agent.conf similarity index 100% rename from .gnupg/gpg-agent.conf rename to dot_gnupg/gpg-agent.conf diff --git a/.gnupg/gpg.conf b/dot_gnupg/gpg.conf similarity index 100% rename from .gnupg/gpg.conf rename to dot_gnupg/gpg.conf diff --git a/.zshrc b/dot_zshrc similarity index 97% rename from .zshrc rename to dot_zshrc index 83a9f5b..6ba9a32 100644 --- a/.zshrc +++ b/dot_zshrc @@ -62,7 +62,7 @@ path+=("$HOME/.rbenv/shims") eval "$(rbenv init -)" # fun things at shell boot -fortune ~/pj/dotfiles/fortunes | cowsay -n +fortune ~/.config/fortune | cowsay -n source ~/.profile # direnv diff --git a/install.sh b/install.sh index e7fe004..e36aa98 100755 --- a/install.sh +++ b/install.sh @@ -18,6 +18,7 @@ dotfiles=$HOME/pj/dotfiles # TODO: Refactor so we only need to invoke `brew install` once. ########################################## Start bootstrap +# TODO: See if this section can be removed now that we use chezmoi sshkey="$HOME/.ssh/id_rsa" answer="n" @@ -42,22 +43,6 @@ if [[ ! -d $HOME/pj/dotfiles ]]; then fi ########################################## End bootstrap -########################################## Start symlinks -[[ $debug == "y" ]] && echo "Setting up symbolic links." - - -# Symlinks -# Note: If creating a symlink to something in a subdirectory of ~, first mkdir -p that directory. -mkdir -p $HOME/.config -[ -h $HOME/.ackrc ] && ln -fs $dotfiles/.ackrc $HOME || ln -is $dotfiles/.ackrc $HOME -[ -h $HOME/.amethyst ] && ln -fs $dotfiles/.amethyst $HOME || ln -is $dotfiles/.amethyst $HOME -[ -h $HOME/.config/kitty ] && ln -fs $dotfiles/.config/kitty $HOME/.config || ln -is $dotfiles/.config/kitty $HOME/.config -[ -h $HOME/.config/nvim ] && ln -fs $dotfiles/.config/nvim $HOME/.config || ln -is $dotfiles/.config/nvim $HOME/.config -[ -h $HOME/.gitconfig ] && ln -fs $dotfiles/.gitconfig $HOME || ln -is $dotfiles/.gitconfig $HOME -[ -h $HOME/.gitignore_global ] && ln -fs $dotfiles/.gitignore_global $HOME || ln -is $dotfiles/.gitignore_global $HOME -[ -h $HOME/.zshrc ] && ln -fs $dotfiles/.zshrc $HOME || ln -is $dotfiles/.zshrc $HOME -########################################## End symlinks - ########################################## Start package managers [[ $debug == "y" ]] && echo "Setting up package managers."