diff --git a/.bashrc.d/aws-azure-login.sh b/.bashrc.d/aws-azure-login.sh new file mode 100644 index 0000000..07cd9e2 --- /dev/null +++ b/.bashrc.d/aws-azure-login.sh @@ -0,0 +1,17 @@ +# If aws-azure-login is not installed do nothing +if ! command -v aws-azure-login >/dev/null 2>&1 +then + return +fi + +# In WSL the no-sandbox parameter is mandatory for aws-azure-login to function +# correctly +if truthy $DOTFILES_WSL +then + alias aws-azure-login="aws-azure-login --no-sandbox" +fi + +# Make it so I just have to type a command and the (optionally) a profile +function aws-token { + aws-azure-login --no-prompt ${1:+--profile $1} +} diff --git a/.bashrc.d/dotfiles_command.sh b/.bashrc.d/dotfiles_command.sh index 21fcd78..c29caf1 100644 --- a/.bashrc.d/dotfiles_command.sh +++ b/.bashrc.d/dotfiles_command.sh @@ -16,6 +16,7 @@ fi possible_locations=( "/usr/share/doc/git/contrib/completion/git-completion.bash" "/usr/share/git/completion/git-completion.bash" + "/usr/share/bash-completion/completions/git" ) for completion_file in "${possible_locations[@]}" diff --git a/.bashrc.d/dotfiles_install.sh b/.bashrc.d/dotfiles_install.sh index ebe5b50..9258d2b 100644 --- a/.bashrc.d/dotfiles_install.sh +++ b/.bashrc.d/dotfiles_install.sh @@ -32,18 +32,18 @@ if [[ $checksum != $DOTFILES_INSTALL_CHECKSUM ]]; then echo "Dotfiles: Downloading vim-plug..." if curl \ --fail \ - --location \ - --retry 5 \ - --retry-delay 1 \ + --location \ + --retry 5 \ + --retry-delay 1 \ --create-dirs \ - --progress-bar \ + --progress-bar \ --output ~/.local/share/nvim/site/autoload/plug.vim \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim then echo "Dotfiles: Done" else echo "Dotfiles: Error downloading vim-plug" - dotfiles_install_error="yes" + dotfiles_install_error="yes" fi fi diff --git a/.bashrc.d/fuck.sh b/.bashrc.d/fuck.sh index 57dcead..14082a0 100644 --- a/.bashrc.d/fuck.sh +++ b/.bashrc.d/fuck.sh @@ -3,6 +3,9 @@ function fuck { local nth_last=${1:-1} if [[ "$nth_last" =~ ^[0-9]+$ ]]; then sudo $(fc -ln -$nth_last -$nth_last) + else + echo "Usage: fuck [offset]" + return 1 fi } diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 96a8537..343dbb3 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -4,11 +4,13 @@ Plug 'semanser/vim-outdated-plugins' " Show trailing whitespaces (this could also easily be achieved by settings, " but the plugin is very neat) Plug 'ntpeters/vim-better-whitespace' +Plug 'vim-airline/vim-airline' +Plug 'w0rp/ale' call plug#end() " Add a set of commands that will make the 80th column of a document visible highlight ColorColumn ctermbg=244 guibg=lightgrey -command Col let &colorcolumn=join(range(81,999),",") +command Col let &colorcolumn=join(range(81,100),",") command NoCol set colorcolumn= Col @@ -29,3 +31,6 @@ set scrolloff=2 " Classic set number +" Yaml Indent +"autocmd BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml foldmethod=indent +"autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab diff --git a/.environment.d/aws.env b/.environment.d/aws.env index cfe69c1..37a787b 100644 --- a/.environment.d/aws.env +++ b/.environment.d/aws.env @@ -1,3 +1,5 @@ -AWS_PROFILE=default-role -AWS_DEFAULT_REGION=eu-west-1 +AWS_DEFAULT_REGION=eu-central-1 AWS_DEFAULT_OUTPUT=json + +AZURE_APP_ID_URI=https://signin.aws.amazon.com/saml +AZURE_DEFAULT_DURATION_HOURS=12 diff --git a/.environment.d/aws_secrets.env.skel b/.environment.d/aws_secrets.env.skel new file mode 100644 index 0000000..c78635f --- /dev/null +++ b/.environment.d/aws_secrets.env.skel @@ -0,0 +1,2 @@ +AZURE_TENANT_ID= +AZURE_DEFAULT_USERNAME= diff --git a/.environment.d/git_secrets.env.skel b/.environment.d/git_secrets.env.skel new file mode 100644 index 0000000..aecd8ce --- /dev/null +++ b/.environment.d/git_secrets.env.skel @@ -0,0 +1,5 @@ +GIT_AUTHOR_NAME="" +GIT_AUTHOR_EMAIL="" +GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME +GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL + diff --git a/.environment.d/wsl.env b/.environment.d/wsl.env new file mode 100644 index 0000000..73d2a29 --- /dev/null +++ b/.environment.d/wsl.env @@ -0,0 +1,6 @@ +if [[ $OSTYPE == linux-gnu && $(< /proc/sys/kernel/osrelease) == *Microsoft ]] +then + DOTFILES_WSL=true +else + DOTFILES_WSL=false +fi diff --git a/.gitconfig b/.gitconfig index da37e52..1c04ecc 100644 --- a/.gitconfig +++ b/.gitconfig @@ -12,6 +12,7 @@ default = simple [core] excludesfile = ~/.gitignore + autocrlf = input [status] submoduleSummary = true [pager] diff --git a/.github/README.md b/.github/README.md index 836ccf1..60be858 100644 --- a/.github/README.md +++ b/.github/README.md @@ -26,7 +26,7 @@ git --work-tree=$HOME --git-dir=$HOME/.dotgit checkout master - Status area horizonzal spacing - Vitals -# Missing Features (TODO) +## Missing Features (TODO) - Vim relative line numbering - unset all variables - Initial Setup @@ -37,4 +37,10 @@ git --work-tree=$HOME --git-dir=$HOME/.dotgit checkout master - missing executables warnings - environment templates? (git.env!) - fix the umask +- Vim put the Yaml indent Stuff in a proper filetype detection script (ftplugin?) +- Vim also add cfn filetype for cfn-lint + +## Echos to be replaced by msg() +- fuck error msg +- initial setup