Compare commits

..

No commits in common. "1ec9110964c237168f981281d72651e87e843e9b" and "4889b323ff539e5358256024c0947c5d5883bc7f" have entirely different histories.

17 changed files with 164 additions and 44 deletions

View file

@ -6,10 +6,8 @@ These are my personal dotfiles. Free for personal use. Thanks to [@bebehei](http
* sway (wayland: window manager) * sway (wayland: window manager)
* i3 (xorg: window manager) (maybe outdated) * i3 (xorg: window manager) (maybe outdated)
* neovim (nvim)
* replaces `vim` completely
* vim * vim
* used as fallback, in case neovim is not available * forked off [vimrc](https://github.com/bebehei/vimrc/)
* NerdTree, autocompletion * NerdTree, autocompletion
* colored * colored
* [git diff integration](https://github.com/mhinz/vim-signify) * [git diff integration](https://github.com/mhinz/vim-signify)

View file

@ -20,7 +20,7 @@ export NEWT_COLORS='root=black,black;window=black,black;border=white,black;listb
alias reload=". ~/.bashrc" alias reload=". ~/.bashrc"
# Bind PageUp and PageDown to history search # Bind PageUp and PageDown to history search
if [ -n "$BASH_VERSION" ] && [ -n "$PS1" ]; then if [ -n "$BASH_VERSION" -a -n "$PS1" ]; then
bind '"\e[5~": history-search-backward' bind '"\e[5~": history-search-backward'
bind '"\e[6~": history-search-forward' bind '"\e[6~": history-search-forward'
fi fi

View file

@ -8,9 +8,10 @@
email = account@buehler.rocks email = account@buehler.rocks
[merge] [merge]
defaultToUpstream = true defaultToUpstream = true
tool = nvim -d tool = vimdiff
conflictstyle = zdiff3 conflictstyle = zdiff3
[core] [core]
editor = vim
eol = native eol = native
pager = delta || (diff-so-fancy | less --tabs=4 -RFX) pager = delta || (diff-so-fancy | less --tabs=4 -RFX)
quotepath = false quotepath = false
@ -31,7 +32,6 @@
ri = rebase --interactive ri = rebase --interactive
rc = rebase --continue rc = rebase --continue
ra = rebase --abort ra = rebase --abort
stauts = status
[rerere] [rerere]
enabled = true enabled = true
autoupdate = true autoupdate = true
@ -46,8 +46,8 @@
fetch = +refs/pull/*/head:refs/remotes/upstream/pull/* fetch = +refs/pull/*/head:refs/remotes/upstream/pull/*
fetch = +refs/merge-requests/*/head:refs/remotes/upstream/merge-requests/* fetch = +refs/merge-requests/*/head:refs/remotes/upstream/merge-requests/*
[diff] [diff]
tool = nvim -d tool = vimdiff
colorMoved = default colorMoved = plain
algorithm = histogram algorithm = histogram
mnemonicPrefix = true mnemonicPrefix = true
renames = true renames = true

View file

@ -41,6 +41,9 @@
~/.profile.d/10-liquidprompt.sh: shell/liquidprompt.sh ~/.profile.d/10-liquidprompt.sh: shell/liquidprompt.sh
~/.profile.d/20-aliases.sh: shell/aliases.sh ~/.profile.d/20-aliases.sh: shell/aliases.sh
~/.profile.d/20-cd.sh: shell/cd.sh ~/.profile.d/20-cd.sh: shell/cd.sh
~/.profile.d/40-extract.sh: shell/extract.sh
~/.profile.d/40-mysqlpw.sh: shell/mysqlpw.sh
~/.profile.d/80-command-not-found.sh: shell/command-not-found.sh
~/.profile.d/81-fzf.sh: shell/fzf.sh ~/.profile.d/81-fzf.sh: shell/fzf.sh
~/.profile.d/82-direnv.sh: shell/direnv.sh ~/.profile.d/82-direnv.sh: shell/direnv.sh
~/.profile.d/90-keychain.sh: shell/keychain.sh ~/.profile.d/90-keychain.sh: shell/keychain.sh

View file

@ -1,14 +1,13 @@
{ {
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"gitsigns.nvim": { "branch": "main", "commit": "abf82a65f185bd54adc0679f74b7d6e1ada690c9" }, "gitsigns.nvim": { "branch": "main", "commit": "42d6aed4e94e0f0bbced16bbdcc42f57673bd75e" },
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
"nvim-autopairs": { "branch": "master", "commit": "c2a0dd0d931d0fb07665e1fedb1ea688da3b80b4" }, "nvim-autopairs": { "branch": "master", "commit": "c2a0dd0d931d0fb07665e1fedb1ea688da3b80b4" },
"nvim-treesitter": { "branch": "main", "commit": "d19def46c112c26c17adeef88dd1253cc6d623a1" }, "nvim-treesitter": { "branch": "main", "commit": "d19def46c112c26c17adeef88dd1253cc6d623a1" },
"nvim-web-devicons": { "branch": "master", "commit": "803353450c374192393f5387b6a0176d0972b848" }, "nvim-web-devicons": { "branch": "master", "commit": "803353450c374192393f5387b6a0176d0972b848" },
"onedark.nvim": { "branch": "master", "commit": "213c23ae45a04797572242568d5d51937181792d" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"remember.nvim": { "branch": "master", "commit": "85aff6dc0a5adab088ef6b9210585ded31c32c7b" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
"telescope.nvim": { "branch": "master", "commit": "ad7d9580338354ccc136e5b8f0aa4f880434dcdc" }, "telescope.nvim": { "branch": "master", "commit": "a8c2223ea6b185701090ccb1ebc7f4e41c4c9784" },
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }
"tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }
} }

View file

@ -18,10 +18,12 @@ require("lazy").setup({
-- import your plugins -- import your plugins
{ import = "plugins" }, { import = "plugins" },
}, },
-- Check for plugin updates once a week -- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "onedark" } },
-- automatically check for plugin updates
checker = { checker = {
enabled = true, enabled = true,
frequency = 3600 * 24 * 7,
notify = false, notify = false,
}, },
-- disable luarocks -- disable luarocks

View file

@ -1,5 +1,6 @@
require('lualine').setup { require('lualine').setup {
options = { options = {
icons_enabled = true, icons_enabled = true,
theme = 'onedark'
} }
} }

View file

@ -0,0 +1,10 @@
return {
"navarasu/onedark.nvim",
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
require('onedark').setup {
style = 'warmer'
}
require('onedark').load()
end
}

View file

@ -1,4 +0,0 @@
return {
'vladdoster/remember.nvim',
opts = {},
}

View file

@ -1,8 +0,0 @@
return {
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd([[colorscheme tokyonight-moon]])
end,
}

View file

@ -12,14 +12,8 @@ alias :qa="exit"
alias :q!="exit" alias :q!="exit"
alias :qw="exit" alias :qw="exit"
if [ -n "$(type nvim 2>/dev/null)" ]; then alias vim="vim -p"
alias vimdiff='nvim -d' alias vi="vim -p"
alias vim="nvim -p"
alias vi="nvim -p"
else
alias vim="vim -p"
alias vi="vim -p"
fi
alias yt-dlp='yt-dlp -o "%(title)s.%(ext)s"' alias yt-dlp='yt-dlp -o "%(title)s.%(ext)s"'
alias yt-audio='yt-dlp -o "%(title)s.%(ext)s" --extract-audio' alias yt-audio='yt-dlp -o "%(title)s.%(ext)s" --extract-audio'
@ -54,6 +48,13 @@ if [ -n "$(type sudo 2>/dev/null)" ] && [ "$USER" != 'root' ]; then
done done
unset sudo unset sudo
#create sudo aliases WITH leading s
for sudo in ps vim chown chmod;
do
type $sudo > /dev/null 2>&1 && alias s$sudo="sudo $sudo";
done
unset sudo
type pacman >/dev/null 2>&1 && pacman(){ type pacman >/dev/null 2>&1 && pacman(){
local sudo_needed local sudo_needed
# Check if pacman has -S, -R or -U option # Check if pacman has -S, -R or -U option

13
shell/command-not-found.sh Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
# arch
if [ "${BASH_VERSION}" ] && [ -r /usr/share/doc/pkgfile/command-not-found.bash ]; then
# shellcheck source=/dev/null
. /usr/share/doc/pkgfile/command-not-found.bash
fi
if [ "${ZSH_VERSION}" ] && [ -r /usr/share/doc/pkgfile/command-not-found.zsh ]; then
# shellcheck source=/dev/null
. /usr/share/doc/pkgfile/command-not-found.zsh
fi

62
shell/extract.sh Executable file
View file

@ -0,0 +1,62 @@
#!/bin/sh
x() {
for zipfile in "$@"; do
_x_extractor
if [ -f "$zipfile" ]; then
case "$zipfile" in
*.deb)
_x_extractor="ar x" ;;
*.tar.lrz)
_x_extractor="lrztar -d" ;;
*.lrz)
_x_extractor="lrunzip" ;;
*.tar.bz2)
_x_extractor="bsdtar xjf" ;;
*.bz2)
_x_extractor="bunzip2" ;;
*.tar.gz)
_x_extractor="bsdtar xzf" ;;
*.gz)
_x_extractor="gunzip" ;;
*.tar.xz)
_x_extractor="bsdtar Jxf" ;;
*.xz)
_x_extractor="xz -d" ;;
*.rar)
_x_extractor="unrar e" ;;
*.tar)
_x_extractor="bsdtar xf" ;;
*.tbz2)
_x_extractor="bsdtar xjf" ;;
*.tgz)
_x_extractor="bsdtar xzf" ;;
*.zip)
_x_extractor="unzip" ;;
*.Z)
_x_extractor="uncompress" ;;
*.7z)
_x_extractor="7z x" ;;
*)
echo "Cannot extract '$zipfile': No extractor for filetype known ..." >&2
return 1
;;
esac
if ! command -v "$(echo "$_x_extractor" | awk '{print $1}')" >/dev/null 2>/dev/null; then
echo "Cannot extract '$zipfile': Cannot find extractor '$(echo "$_x_extractor" | awk '{print $1}')'." >&2
return 1
fi
echo "Extracting '$zipfile'..." >&2
eval "$_x_extractor" "$zipfile"
elif [ ! -e "$zipfile" ]; then
echo "Cannot extract '$zipfile': File does not exist!"
return 1
else
echo "Cannot extract '$zipfile': Not a valid file!"
return 1
fi
done
}

39
shell/mysqlpw.sh Executable file
View file

@ -0,0 +1,39 @@
#!/bin/sh
#The function will find the given user and search for a mysql-password
#in the home-directory, which will get printed out!
#arg1: user where to find a config-file
# if not given, it uses the current user in the $HOME and $USER-Variable
mysqlpw() {
_mysqlpw_H=$HOME
_mysqlpw_U=$USER
# use different user, if arg1 given
if [ -n "$1" ]; then
# check if given user is even existing
if ! id "$1" >/dev/null 2>/dev/null; then
echo user "$1" not existing >&2
return 1
fi
_mysqlpw_U=$1
_mysqlpw_H=$(grep ^"$1": /etc/passwd | cut -d ":" -f 6)
fi;
_mysqlpw_cnf="$_mysqlpw_H/.my.cnf"
if [ ! -e "$_mysqlpw_cnf" ]; then
echo "$_mysqlpw_cnf" not existing >&2 && return 1
fi
if [ ! -r "$_mysqlpw_cnf" ]; then
echo "$_mysqlpw_cnf" not readable >&2 && return 1
fi
_mysqlpw_PW=$( (grep "password=" "$_mysqlpw_cnf" || echo undefined) | cut -d "=" -f 2)
echo MySQL-Password for user "$_mysqlpw_U" is "$_mysqlpw_PW"
}

View file

@ -15,6 +15,17 @@ appendpath () {
appendpath ~/.local/bin appendpath ~/.local/bin
appendpath ~/.bin appendpath ~/.bin
if which ruby >/dev/null 2>&1 && which gem >/dev/null 2>&1; then
appendpath "$(ruby -r rubygems -e 'puts Gem.user_dir')"/bin
fi
# PERL cpan modules
appendpath "$HOME"/.perl/5/bin
export PERL5LIB="$HOME/.perl/5/lib/perl5:$PERL5LIB"
export PERL_LOCAL_LIB_ROOT="$HOME/.perl/5:$PERL_LOCAL_LIB_ROOT"
export PERL_MB_OPT="--install_base \"$HOME/.perl/5\""
export PERL_MM_OPT="INSTALL_BASE=$HOME/.perl/5"
export GOPATH=$HOME/.go export GOPATH=$HOME/.go
export GOBIN=$HOME/.gobin export GOBIN=$HOME/.gobin
appendpath "$GOPATH"/bin appendpath "$GOPATH"/bin

View file

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ -n "$(type nvim 2>/dev/null)" ]; then export EDITOR=vim
export EDITOR=nvim export VISUAL=vim
export VISUAL=nvim
else
export EDITOR=vim
export VISUAL=vim
fi
export BROWSER=firefox export BROWSER=firefox

View file

@ -1,5 +1,3 @@
#!/usr/bin/env zsh
# Path to your oh-my-zsh installation. # Path to your oh-my-zsh installation.
export ZSH=~/.oh-my-zsh export ZSH=~/.oh-my-zsh
fpath=( ~/.zcomplete "${fpath[@]}" ) fpath=( ~/.zcomplete "${fpath[@]}" )