Compare commits

..

1 commit
master ... nvim

Author SHA1 Message Date
1b53da0091 changed Files: .bash_extra
nvim/init.lua
scripts/setup_minimal.sh

Signed-off-by: Michael Grote <michael.grote@posteo.de>
2024-06-21 11:16:35 +02:00
18 changed files with 110 additions and 143 deletions

View file

@ -25,14 +25,10 @@ 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 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}}'"
alias dcu="docker-compose up"
alias dcd="docker-compose down"
alias dcr="docker-compose down && docker-compose up -d"
# safeguard
alias mv="mv -i "
alias cp="cp -i "

View file

@ -10,7 +10,7 @@ source "${HOME}/dotfiles/.bash_ps1"
### PATH
# add my scripts to PATH
PATH=$PATH:"${HOME}/dotfiles/scripts"
PATH=$PATH:"${HOME}/dotfiles/scripts:${HOME}/.bin/nvim-linux64/bin/"
### tmux auto attach
# Check if the user ID is not 0 (root)
@ -43,10 +43,8 @@ export LESS_TERMCAP_us=$'\E[01;36m'
# bash history bei mehreren Session
shopt -s histappend
# bash History Zeitstempel am Anfang der Zeile
# bach 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,7 +8,6 @@ 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,8 +13,7 @@ autocorrect = 20 # https://opensource.com/article/20/11/git-aliases
[status]
showUntrackedFiles = all
[push]
default = current
autoSetupRemote = true
default = simple
[pull]
rebase = true
autostash = true
@ -29,7 +28,7 @@ wsErrorHighlight = all
[fetch]
prune = true
[safe]
directory = *
directory = ~/dotfiles
[advice]
addIgnoredFile = true
addEmptyPathspec = false

7
.gitignore vendored
View file

@ -1,7 +0,0 @@
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-2404.mgrote.net
Host vm-test-2204.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,69 +1,37 @@
# 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-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
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
# Farb-Optionen für Shell-Fenster
set -g default-terminal screen-256color
#------------ 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
# increase scrollback buffer size
set -g history-limit 50000
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
# 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
# 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
# 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,6 +244,10 @@ 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
@ -251,24 +255,3 @@ 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=

40
nvim/init.lua Normal file
View file

@ -0,0 +1,40 @@
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = false
-- Make line numbers default
vim.opt.number = true
-- Enable mouse mode, can be useful for resizing splits for example!
vim.opt.mouse = 'a'
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
vim.opt.ignorecase = true
vim.opt.smartcase = true
-- Preview substitutions live, as you type!
vim.opt.inccommand = 'split'
-- Minimal number of screen lines to keep above and below the cursor.
vim.opt.scrolloff = 10
-- Plugin-Manager
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{
'nvim-telescope/telescope.nvim',
lazy = true,
dependencies = {
{'nvim-lua/plenary.nvim'},
}
},
})

View file

@ -1,33 +1,28 @@
#!/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" && 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" && 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
esac

View file

@ -16,7 +16,6 @@ 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

@ -1,21 +1,20 @@
#!/bin/bash
# Aufruf: wget https://git.mgrote.net/mg/dotfiles/raw/branch/master/scripts/setup_minimal.sh && bash ./setup_minimal.sh
# 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 ripgrep ca-certificates
#neovim
mkdir -p ~/.bin
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
sudo tar -C ~/.bin -xzf nvim-linux64.tar.gz
rm nvim-linux64.tar.gz
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/
ln -s dotfiles/nvim/init.lua .config/nvim/init.lua
echo "source ~/dotfiles/.bash_extra" >> ~/.bashrc
vim +PluginInstall +qall
source ~/.bashrc

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

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

Binary file not shown.