Compare commits

...

28 commits
nvim ... master

Author SHA1 Message Date
6d67c096b3 vim: disable auto indent in insert mode
Signed-off-by: Michael Grote <michael.grote@posteo.de>
2024-11-12 22:33:08 +01:00
2663f8a594 setup: add git and ssh symlinks
Signed-off-by: Michael Grote <michael.grote@posteo.de>
2024-11-12 22:21:44 +01:00
3690d11118 add .gitignore
Signed-off-by: Michael Grote <michael.grote@posteo.de>
2024-11-12 21:50:23 +01:00
868a666c2a tmux: switch binds
Signed-off-by: Michael Grote <michael.grote@posteo.de>
2024-11-10 10:01:18 +01:00
c54411a2d9 tmux: open pane in same dir
Signed-off-by: Michael Grote <michael.grote@posteo.de>
2024-11-10 09:56:04 +01:00
1402d131d4 tmux: add move pane function 2024-10-29 14:10:52 +01:00
3576e74de0 alias: move docker aliases to "docker compose" with "-" 2024-10-23 18:26:19 +02:00
97df895805 alias: dps 2024-10-23 18:19:40 +02:00
35b369884e ssh: new host
Signed-off-by: Michael Grote <michael.grote@posteo.de>
2024-10-08 17:01:08 +02:00
Michael Grote
3c6a1b5bd1 git: add alias "gb"
Signed-off-by: Michael Grote <michael.grote@dataport.de>
2024-09-30 13:25:36 +02:00
Michael Grote
4bf7a51c46 gc: indentation
Signed-off-by: Michael Grote <michael.grote@dataport.de>
2024-09-16 10:04:36 +02:00
Michael Grote
6c0afe7a41 git: add autoSetupRemote
Signed-off-by: Michael Grote <michael.grote@dataport.de>
2024-09-16 09:47:02 +02:00
mg
2dedcfda5a revert 561a0647be
revert tmux: check if session is interactive
2024-09-13 19:06:40 +02:00
561a0647be tmux: check if session is interactive 2024-09-13 19:01:33 +02:00
4900f4aaa4 ssh: remove "ansible2" 2024-08-15 21:23:20 +02:00
38e95dcf37 bash: history 2024-08-12 15:20:45 +02:00
2a0b70e655 add munin host 2024-08-12 10:29:07 +02:00
838387ffe3 tmux: longer session-names 2024-07-30 10:26:23 +02:00
34dc4b46ab git: safe 2024-07-29 16:06:44 +02:00
7b889ab340 aliase: add dlogs 2024-07-26 00:13:34 +02:00
36be565e69 git-prompt: explicit source 2024-07-25 23:57:14 +02:00
Michael Grote
7c4689bcbf tmux: misc
Signed-off-by: Michael Grote <michael.grote@dataport.de>
2024-07-18 10:50:55 +02:00
Michael Grote
a2ff339214 tmux: remove unused things
Signed-off-by: Michael Grote <michael.grote@dataport.de>
2024-07-18 10:50:49 +02:00
Michael Grote
0c129dad17 tmux: comments
Signed-off-by: Michael Grote <michael.grote@dataport.de>
2024-07-18 10:50:43 +02:00
ccd5b5ea0c vim: spell: add symlink 2024-06-20 10:56:45 +02:00
4d786a09ac vim: add spellcheck (#1)
vim/spell/de.utf-8.spl
vim/spell/de.utf-8.sug
vim/spell/en.utf-8.spl
vim/spell/en.utf-8.sug
vim/spell/own.add
vim/spell/own.add.spl

Signed-off-by: Ubuntu <euser@grotemi-uu22-01.users.ausbildungscloud.dataport.de>

Co-authored-by: Ubuntu <euser@grotemi-uu22-01.users.ausbildungscloud.dataport.de>
Reviewed-on: #1
2024-06-19 12:53:13 +02:00
7286eb65cb setup: add packages 2024-06-10 11:31:41 +02:00
Michael Grote
d52be339b6 bash: git_pull_all print pwd
Signed-off-by: Michael Grote <michael.grote@dataport.de>
2024-06-10 08:16:44 +02:00
17 changed files with 138 additions and 62 deletions

View file

@ -25,10 +25,14 @@ alias gdel="git reset --hard ; git clean -f"
alias glast="git log -1 HEAD --stat"
alias gd="git difftool"
alias gsp="git stage -p"
alias gflog="git log -- "
alias gb="git branch"
# docker
alias dcu="docker-compose up"
alias dcd="docker-compose down"
alias dcr="docker-compose down && docker-compose up -d"
alias dcu="docker compose up"
alias dlogs="docker compose logs -f"
alias dcd="docker compose down"
alias dcr="docker compose down && docker compose up -d"
alias dps="docker ps --no-trunc --all --format 'table {{.Names}}\t{{.Status}}\t{{.State}}\t{{.CreatedAt}}\t{{.RunningFor}}\t{{.Size}}'"
# safeguard
alias mv="mv -i "
alias cp="cp -i "

View file

@ -43,8 +43,10 @@ export LESS_TERMCAP_us=$'\E[01;36m'
# bash history bei mehreren Session
shopt -s histappend
# bach History Zeitstempel am Anfang der Zeile
# bash History Zeitstempel am Anfang der Zeile
export HISTTIMEFORMAT='[%F_%T] '
# https://askubuntu.com/questions/15926/how-to-avoid-duplicate-entries-in-bash-history
export HISTCONTROL=ignoreboth:erasedups
# typo bei cd entfernen
shopt -s cdspell

View file

@ -8,6 +8,7 @@ BLACK='\[\e[30m\]'
RESET='\[\e[0m\]'
ORANGE='\[\e[0;33m\]'
# git-symbole: * unstaged, + staged, $ stashed, % untracked
source /usr/lib/git-core/git-sh-prompt
export GIT_PS1_SHOWUNTRACKEDFILES=1
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1

View file

@ -13,7 +13,8 @@ autocorrect = 20 # https://opensource.com/article/20/11/git-aliases
[status]
showUntrackedFiles = all
[push]
default = simple
default = current
autoSetupRemote = true
[pull]
rebase = true
autostash = true
@ -28,7 +29,7 @@ wsErrorHighlight = all
[fetch]
prune = true
[safe]
directory = ~/dotfiles
directory = *
[advice]
addIgnoredFile = true
addEmptyPathspec = false

7
.gitignore vendored Normal file
View file

@ -0,0 +1,7 @@
git.mgrote.net*
github*
github.pub*
mgrote.net*
mikrotik_ed25519*
qnap_papa*
known_hosts*

View file

@ -9,15 +9,15 @@ StrictHostKeyChecking=accept-new
### mgrote.net
Host fileserver3.mgrote.net
Host ansible2.mgrote.net
Host docker10.mgrote.net
Host pve5.mgrote.net
Host forgejo.mgrote.net
Host ldap.mgrote.net
Host pve5-test.mgrote.net
Host vm-test-2204.mgrote.net
Host vm-test-2404.mgrote.net
Host pbs-test.mgrote.net
Host pbs.mgrote.net
Host munin.mgrote.net
Host blocky.mgrote.net
Host *.mgrote.net
IdentityFile ~/.ssh/mgrote.net

View file

@ -1,37 +1,69 @@
set-option -g set-titles on # Automatically set window title
set-option -g status-position top # position the status bar at top of screen
set-option -g monitor-activity off # Deaktiviere "Markierung" aktiver Fenster
set-option -g renumber-windows on # Automatische Neu-Nummerierung der Fenster aktivieren; Beispielsweise nach dem Schließen eines Fensters
set-option -g base-index 1 # Nummerierung der Fenster und Teilfenster jeweils mit 1 beginnen
set -g pane-base-index 1 # Nummerierung der Fenster und Teilfenster jeweils mit 1 beginnen
set-option -g status-right "#(hostname -f)" # Statuszeile - rechts
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
# position the status bar at top of screen
set-option -g status-position top
# Deaktiviere "Markierung" aktiver Fenster
set-option -g monitor-activity off
# Automatische Neu-Nummerierung der Fenster aktivieren; Beispielsweise nach dem Schließen eines Fensters
set-option -g renumber-windows on
# Nummerierung der Fenster und Teilfenster jeweils mit 1 beginnen
set-window-option -g pane-base-index 1
set-option -g base-index 1
set -g pane-base-index 1
# Statuszeile
set-option -g status-right "#(hostname -f)"
set -g status-right-length 100
# resize
set-option -gw aggressive-resize on
set -g default-terminal screen-256color # Farb-Optionen für Shell-Fenster
set -g history-limit 50000 # increase scrollback buffer size
set -g mouse on # Maus-Unterstützung aktivieren
set-window-option -g clock-mode-style 24 # Uhrzeit auf 24h Format
set-window-option -g pane-base-index 1 # Nummerierung der Fenster und Teilfenster jeweils mit 1 beginnen:
set-window-option -g automatic-rename on # Automatically set window title
#------------ Buttons ------------#
bind k select-pane -U # Wechsle Fenster mit vim keybindings
bind j select-pane -D # Wechsle Fenster mit vim keybindings
bind h select-pane -L # Wechsle Fenster mit vim keybindings
bind l select-pane -R # Wechsle Fenster mit vim keybindings
unbind '"' # alte Tastenkombination deaktivieren
unbind % # alte Tastenkombination deaktivieren
bind | split-window -h # Vertikal splitten
bind - split-window -v # Horizontal splitten
# Farb-Optionen für Shell-Fenster
set -g default-terminal screen-256color
set -s escape-time 0 # address vim mode switching delay (http://superuser.com/a/252717/65504)
set -g display-time 4000 # tmux messages are displayed for 4 seconds
# increase scrollback buffer size
set -g history-limit 50000
# schließe windows mit prefix + w
bind w killw
# öffne windows mit prefix + t
bind t new-window
# gehe in copy mode und starte suche
# Maus-Unterstützung aktivieren
set -g mouse on
# Wechsle Fenster mit vim keybindings
bind k select-pane -U
bind j select-pane -D
bind h select-pane -L
bind l select-pane -R
# display more of the session name
set -g status-left-length 20
# Splits
unbind '"'
unbind %
# setze Bind auf logische Zeichen & öffne in Pane in aktuellen Dir
# https://github.com/jbranchaud/til/blob/master/tmux/open-new-splits-to-the-current-directory.md
bind - split-window -v -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
# Address vim mode switching delay (http://superuser.com/a/252717/65504)
set -s escape-time 0
# tmux messages are displayed for 4 seconds
set -g display-time 4000
# gehe in copy mode und starte suche
# prefix + f
set-window-option -g mode-keys vi
bind f copy-mode\; send-keys ?
# Focus events enabled for terminals that support them
set -g focus-events on
# Move Panes interactively
# https://www.reddit.com/r/commandline/comments/8wv0w6/interactively_moving_panes_to_other_windows/
unbind m
bind-key m choose-tree -Z "join-pane -t '%%'"

25
.vimrc
View file

@ -244,10 +244,6 @@ function! ToggleNERDTreeFind()
endif
endfunction
" yaml einrückung
autocmd FileType yaml setlocal ai ts=2 sw=2 et
autocmd FileType yml setlocal ai ts=2 sw=2 et
" timeouts
set timeoutlen=100
@ -255,3 +251,24 @@ set timeoutlen=100
if &diff
colorscheme nord
endif
augroup spell
autocmd!
autocmd FileType * highlight SpellBad cterm=underline ctermfg=red ctermbg=NONE
autocmd FileType * set spellfile=~/dotfiles/vim/spell/own.add
autocmd FileType * set spellsuggest=fast,10
autocmd FileType * set spell spelllang=de_de,en
augroup END
" z= Korrektur
" ]s/[s gehe vor/zurück nächsten fehlerhaften wort
" zg add to dictionary
augroup yaml
autocmd!
autocmd FileType yml setlocal ai ts=2 sw=2 et
autocmd FileType yaml,yml setlocal ai ts=2 sw=2 et
augroup END
" polyglot
" disable reindenting of the current line in insert mode
autocmd BufEnter * set indentexpr=

View file

@ -1,28 +1,33 @@
#!/bin/bash
case "$1" in
--help | -h)
cat <<EOF
--help | -h)
cat <<EOF
Description:
"git checkout" on steroids
Description:
"git checkout" on steroids
Usage:
gc [--help|--new-branch] [branch]
Usage:
gc [--help|--new-branch] [branch]
Options:
-h, --help Print this help.
-b, --new-branch Create a new Branch instead changing to an existing branch.
Options:
-h, --help Print this help.
-b, --new-branch Create a new Branch instead changing to an existing branch.
Author:
michael.grote@posteo.de - git.mgrote.net
Author:
michael.grote@posteo.de - git.mgrote.net
EOF
;;
--new-branch | -b)
(git checkout --quiet -b "$2" && git push --set-upstream "$(git remote | head -n 1)" "$2" && echo '>>> Create new branch "'"$2"'"') || (git checkout --quiet "$2" > /dev/null 2>&1 && echo '>>> Branch already exists, checking out... ')
;;
*)
if [ -n "$1" ] ; then (echo ">>> Try local checkout" && git checkout --quiet "$1" > /dev/null 2>&1) || (echo ">>> Try remote checkout" && git checkout --quiet -b "$1" origin/"$1" > /dev/null 2>&1 || echo ">>> Unkown branch! ")
else
(git checkout --quiet master > /dev/null 2>&1 && echo '>>> Try checking out master') || (git checkout --quiet main > /dev/null 2>&1 && echo '>>> Try checking out main') || (git checkout --quiet release > /dev/null 2>&1 && echo '>>> Try checking out release')
fi
;;
--new-branch | -b)
(git checkout --quiet -b "$2" && echo '>>> Create new branch "'"$2"'"') || \
(git checkout --quiet "$2" > /dev/null 2>&1 && echo '>>> Branch already exists, checking out... ')
;;
*)
if [ -n "$1" ] ; then
(echo ">>> Try local checkout" && git checkout --quiet "$1" > /dev/null 2>&1) || \
(echo ">>> Try remote checkout" && git checkout --quiet -b "$1" origin/"$1" > /dev/null 2>&1 || echo ">>> Unkown branch! ")
else
(git checkout --quiet master > /dev/null 2>&1 && echo '>>> Try checking out master') || \
(git checkout --quiet main > /dev/null 2>&1 && echo '>>> Try checking out main') || \
(git checkout --quiet release > /dev/null 2>&1 && echo '>>> Try checking out release')
fi
esac

View file

@ -16,6 +16,7 @@ function update {
cd "$d" || exit > /dev/null
if [ -d ".git" ]; then
echo -e "\n${HIGHLIGHT}Updating pwd$NORMAL"
echo $PWD
git add .
git stash
git pull

View file

@ -2,13 +2,17 @@
# Aufruf: wget https://git.mgrote.net/mg/dotfiles/raw/branch/master/scripts/setup_minimal.sh && bash ./setup_minimal.sh
cd ~
sudo apt update && sudo apt install git tmux vim ripgrep ca-certificates
sudo apt update && sudo apt install git tmux vim ripgrep ca-certificates curl wget tree keychain
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
git clone https://git.mgrote.net/mg/dotfiles ~/dotfiles
ln -s ~/dotfiles/.tmux.conf ~/.tmux.conf
ln -s ~/dotfiles/.vimrc ~/.vimrc
ln -s ~/dotfiles/.gitconfig ~/.gitconfig
ln -s ~/dotfiles/.ssh ~/.ssh
ln -s ~/dotfiles/vim/spell/ ~/.vim/
echo "source ~/dotfiles/.bash_extra" >> ~/.bashrc

BIN
vim/spell/de.utf-8.spl Normal file

Binary file not shown.

BIN
vim/spell/de.utf-8.sug Normal file

Binary file not shown.

BIN
vim/spell/en.utf-8.spl Normal file

Binary file not shown.

BIN
vim/spell/en.utf-8.sug Normal file

Binary file not shown.

2
vim/spell/own.add Normal file
View file

@ -0,0 +1,2 @@
dotfiles
Ansible

BIN
vim/spell/own.add.spl Normal file

Binary file not shown.