From 8f514dd6797b82c38c0b2428bd98d554801b102e Mon Sep 17 00:00:00 2001 From: Hedy Li Date: Wed, 22 Sep 2021 17:42:45 +0800 Subject: [PATCH] Squashing commits to fix history ugh nvim: Setup script install plug only if isn't installed Part of my effort to make the scripts able to be run >once -- README: Installation stuff and modify ToC -- nvim: Add markdown ToC plugin -- git: Config file tabs to spaces -- aerc: Use ~/local/share/aerc and add setup script --- .config/aerc/aerc.conf | 10 ++--- .config/nvim/plugins.vim | 3 +- .gitconfig | 84 ++++++++++++++++++++-------------------- README.md | 44 +++++++++++---------- dotscripts/setup/aerc | 21 ++++++++++ dotscripts/setup/nvim | 10 +++-- 6 files changed, 102 insertions(+), 70 deletions(-) create mode 100755 dotscripts/setup/aerc diff --git a/.config/aerc/aerc.conf b/.config/aerc/aerc.conf index 96a30cc..d01358b 100644 --- a/.config/aerc/aerc.conf +++ b/.config/aerc/aerc.conf @@ -71,7 +71,7 @@ next-message-on-delete=true # list of directories. # # default: /usr/share/aerc/stylesets/ -#stylesets-dirs=/usr/share/aerc/stylesets/ +stylesets-dirs=~/local/share/aerc/stylesets/ # Sets the styleset to use for the aerc ui elements. # @@ -163,9 +163,9 @@ address-book-cmd= # You can also match on non-mimetypes, by prefixing with the header to match # against (non-case-sensitive) and a comma, e.g. subject,text will match a # subject which contains "text". Use header,~regex to match against a regex. -subject,~^\[PATCH=awk -f /usr/share/aerc/filters/hldiff -#text/html=/usr/share/aerc/filters/html -text/*=awk -f /usr/share/aerc/filters/plaintext +subject,~^\[PATCH=awk -f ~/local/share/aerc/filters/hldiff +text/html=~/local/share/aerc/filters/html +text/*=awk -f ~/local/share/aerc/filters/plaintext #image/*=catimg -w $(tput cols) - [triggers] @@ -187,7 +187,7 @@ new-email= # list of directories. # # default: /usr/share/aerc/templates/ -#template-dirs=/usr/share/aerc/templates/ +template-dirs=~/local/share/aerc/templates/ # The template to be used for quoted replies. # diff --git a/.config/nvim/plugins.vim b/.config/nvim/plugins.vim index 4463652..cadb753 100644 --- a/.config/nvim/plugins.vim +++ b/.config/nvim/plugins.vim @@ -47,7 +47,7 @@ Plug 'airblade/vim-gitgutter' " Show git diff overview stuff in the left colum Plug 'majutsushi/tagbar' " Quickly jump to a symbol in buffer (one of my most used omg!) " TODO: Figure out a way of using both endwise and auto pair -" === File type or syntax plugins === +" === File type, syntax, or language helper plugins === " gemtext syntax highlighting; I know there are more popular alternatives but " this is the best IMO Plug 'https://git.sr.ht/~torresjrjr/gemini.vim' @@ -55,6 +55,7 @@ Plug 'cespare/vim-toml' Plug 'blankname/vim-fish' Plug 'hedyhli/vim-bun' Plug 'https://git.rawtext.club/slope-lang/slope-vim-syntax' +Plug 'mzlogin/vim-markdown-toc' call plug#end() " Plugin declarations ends here diff --git a/.gitconfig b/.gitconfig index db7935c..8672d61 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,68 +1,70 @@ [core] - editor = nv - autocrlf = input - excludesfile = /home/hedy/.gitignore_global - pager = diff-so-fancy | less --tabs=4 -RFX + editor = nv + autocrlf = input + excludesfile = /home/hedy/.gitignore_global + pager = diff-so-fancy | less --tabs=4 -RFX [user] - name = Hedy Li - email = hedy@tilde.cafe # email overidden in [include] - signingkey = B51B5A8D1B176372 # and this + name = Hedy Li + email = hedy@tilde.cafe # email overidden in [include] + signingkey = B51B5A8D1B176372 # and this [init] # I don't want people to complain and main is shorter to type so yeah defaultBranch = main [alias] - s = status - c = commit - b = branch - ls-alias = config --get-regexp alias - l = log --oneline - ll = log - ss = status -s - ch = checkout - chb = checkout -b - mylog = log --pretty=format:'%C(yellow)%h %C(bold blue)%an, %C(green)%ar: %C(white)"%s"' - lgraph = log --oneline --graph --decorate --all - brd = branch -d - fame = !python3 -m gitfame - p = push - cmam = commit -am - pushall = !git remote | xargs -L1 git push --all + s = status + c = commit + b = branch + ls-alias = config --get-regexp alias + l = log --oneline + ll = log + ss = status -s + ch = checkout + chb = checkout -b + mylog = log --pretty=format:'%C(yellow)%h %C(bold blue)%an, %C(green)%ar: %C(white)"%s"' + lgraph = log --oneline --graph --decorate --all + brd = branch -d + fame = !python3 -m gitfame + p = push + cmam = commit -am + pushall = !git remote | xargs -L1 git push --all + # Same as pushall but not for all branches + pall = !git remote | xargs -L1 git push [credential] - helper = store --file="$HOME/.git_creds" - helper = cache --timeout 90000 + helper = store --file="$HOME/.git_creds" + helper = cache --timeout 90000 [help] - autocorrect = 30 + autocorrect = 30 [pull] - rebase = false + rebase = false [commit] - gpgsign = true + gpgsign = true # sendmail conig in [include] [include] - path = ~/.gitconfig-local + path = ~/.gitconfig-local # diff-so-fancy [color] - ui = true + ui = true [color "diff-highlight"] - oldNormal = red bold - oldHighlight = red bold 52 - newNormal = green bold - newHighlight = green bold 22 + oldNormal = red bold + oldHighlight = red bold 52 + newNormal = green bold + newHighlight = green bold 22 [color "diff"] - meta = 11 - frag = magenta bold - commit = yellow bold - old = red bold - new = green bold - whitespace = red reverse + meta = 11 + frag = magenta bold + commit = yellow bold + old = red bold + new = green bold + whitespace = red reverse [push] - followTags = true + followTags = true diff --git a/README.md b/README.md index 73d8ca0..9a07922 100644 --- a/README.md +++ b/README.md @@ -10,26 +10,27 @@ cross-platform as possible. Mirrors: [tildegit (gitea)](https://tildegit.org/hedy/dotfiles) | [GitHub](https://github.com/hedyhli/dotfiles) - **Table of Contents** -- [Overview](#overview) -- [Features](#features) -- [Installation](#installation) -- [Details](#details) - - [Shell](#shell) - - [oh my fish](#oh-my-fish) - - [fish functions](#fish-functions) - - [local](#local) - - [editor](#editor) - - [vim and nvim](#vim-and-nvim) - - [emacs](#emacs) - - [Vanilla emacs](#vanilla-emacs) - - [Doom emacs](#doom-emacs) - - [Gemini and Spartan client](#gemini-and-spartan-client) -- [TODO](#todo) + - +* [Overview](#overview) +* [Features](#features) +* [Installation](#installation) +* [Details](#details) + * [Shell](#shell) + * [oh my fish](#oh-my-fish) + * [fish functions](#fish-functions) + * [local](#local) + * [editor](#editor) + * [vim and nvim](#vim-and-nvim) + * [emacs](#emacs) + * [Vanilla emacs](#vanilla-emacs) + * [Doom emacs](#doom-emacs) + * [Gemini and Spartan client](#gemini-and-spartan-client) +* [TODO](#todo) + + ## Overview @@ -62,9 +63,12 @@ These are more like "what I tend to do" in this repo ## Installation 1. Install yadm -2. Clone the repo with yadm -3. Fix conflicts as you please -4. Selectively run scripts in [`dotscripts`](./dotscripts/) (in the future, you'll be able to use the `bin/dot` utility) +1. Clone the repo with yadm +1. Fix conflicts as you please +1. Reload sessions + - fish + - `tmux source ~/.tmux.conf` +1. Selectively run scripts in [`dotscripts`](./dotscripts/) using `dot ` such as `dot setup fish` ## Details diff --git a/dotscripts/setup/aerc b/dotscripts/setup/aerc new file mode 100755 index 0000000..9107113 --- /dev/null +++ b/dotscripts/setup/aerc @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +if ! command -v aerc &> /dev/null; then + echo aerc isnt installed! + echo you should install go, scdoc, clone the repo, make, make install + exit 1 +fi + +if [[ -d ~/local/share/aerc ]]; then + echo local/share/aerc already exists, youre all good + exit +else + if ! [[ -d /usr/share/aerc ]]; then + echo Neither ~/local/share/aerc nor /use/share/aerc exists! + echo Perhaps aerc wasnt installed properly. Please figure out where aerc share folder is + echo then ln -s manually + exit 1 + fi +fi +mkdir -vp ~/local/share +ln -vs /usr/share/aerc ~/local/share/aerc diff --git a/dotscripts/setup/nvim b/dotscripts/setup/nvim index b9940b8..c8ccacd 100755 --- a/dotscripts/setup/nvim +++ b/dotscripts/setup/nvim @@ -1,7 +1,11 @@ #!/usr/bin/env bash -echo "installing vim-plug for nvim" -sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ - https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' +DEST=${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim" + +if ! [[ -f "$DEST" ]]; then + echo "installing vim-plug for nvim" + sh -c 'curl -fLo "$DEST" --create-dirs \ + https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' +fi echo "installing nvim plugins" nvim +PlugInstall