Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b856e1628 | |||
| 5de2b953c9 | |||
| d24877e683 | |||
| 75876a1bd2 | |||
| 9a3b39bbc9 |
|
|
@ -8,13 +8,6 @@ alias ll='ls -la'
|
||||||
alias lla='ls -htlr -A'
|
alias lla='ls -htlr -A'
|
||||||
alias l='ls -l'
|
alias l='ls -l'
|
||||||
|
|
||||||
# cdl=move to directory and instantly list its contents
|
|
||||||
# everyone needs this ;-)
|
|
||||||
cdl(){
|
|
||||||
cd $@
|
|
||||||
ls -l
|
|
||||||
}
|
|
||||||
|
|
||||||
# change directory
|
# change directory
|
||||||
alias ..='cd ..'
|
alias ..='cd ..'
|
||||||
alias ...='cd ../..'
|
alias ...='cd ../..'
|
||||||
|
|
@ -41,16 +34,19 @@ cd() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# cdl=move to directory and instantly list its contents
|
||||||
|
# everyone needs this ;-)
|
||||||
|
cdl(){
|
||||||
|
cd $@
|
||||||
|
ls -l
|
||||||
|
}
|
||||||
|
|
||||||
# directly cd into the latest modified directory
|
# directly cd into the latest modified directory
|
||||||
cdla(){
|
cdla(){
|
||||||
cd "$(\ls -1dt ./*/ | head -n 1)"
|
cd "$(\ls -1dt ./*/ | head -n 1)"
|
||||||
}
|
}
|
||||||
|
|
||||||
# create an excuse
|
alias mn-ansible='source /home/jscharre/workdir/ansible-2.10-py39/bin/activate && cd /home/jscharre/workdir/ansible-2.10-py39/ && ls -ld ans*'
|
||||||
excuse(){
|
|
||||||
curl -s https://bofh-api.bombeck.io/v1/excuses/random/ | jq -r '.[0].quote'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# making git-life easier
|
# making git-life easier
|
||||||
gitc(){
|
gitc(){
|
||||||
|
|
@ -64,6 +60,7 @@ alias gitchd='git checkout develop' #directly switch to develop branch (ManageNo
|
||||||
# misc
|
# misc
|
||||||
alias px="ps auxf"
|
alias px="ps auxf"
|
||||||
alias o="xdg-open"
|
alias o="xdg-open"
|
||||||
|
alias lg='lazygit'
|
||||||
|
|
||||||
# pretty print json
|
# pretty print json
|
||||||
alias ppjson='python -c "import sys, json; print json.dumps(json.load(sys.stdin), sort_keys=True, indent=4)"'
|
alias ppjson='python -c "import sys, json; print json.dumps(json.load(sys.stdin), sort_keys=True, indent=4)"'
|
||||||
|
|
@ -89,7 +86,7 @@ alias pign=ping
|
||||||
# other stuff
|
# other stuff
|
||||||
alias eierabend='xflock4 ; systemctl suspend --no-wall'
|
alias eierabend='xflock4 ; systemctl suspend --no-wall'
|
||||||
alias updgrade='sudo aptitude update && sudo aptitude upgrade -y'
|
alias updgrade='sudo aptitude update && sudo aptitude upgrade -y'
|
||||||
alias lock='xflock4'
|
alias lsld='ls -ld *'
|
||||||
|
|
||||||
# better passwords!
|
# better passwords!
|
||||||
alias apg='apg -M sncl -n 15 -m 10 -x 20'
|
alias apg='apg -M sncl -n 15 -m 10 -x 20'
|
||||||
|
|
@ -105,4 +102,3 @@ alias telnet='echo use the curl method: curl telnet:\/\/<ip>:<port>'
|
||||||
|
|
||||||
# hopefully, there's ack-grep installed on the system...
|
# hopefully, there's ack-grep installed on the system...
|
||||||
alias ag='ack'
|
alias ag='ack'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,19 +14,3 @@ if [ -f ~/.bashrc ]; then
|
||||||
. ~/.bashrc
|
. ~/.bashrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Load pyenv automatically by appending
|
|
||||||
# the following to
|
|
||||||
# ~/.bash_profile if it exists, otherwise ~/.profile (for login shells)
|
|
||||||
# and ~/.bashrc (for interactive shells) :
|
|
||||||
|
|
||||||
export PYENV_ROOT="$HOME/.pyenv"
|
|
||||||
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
|
|
||||||
eval "$(pyenv init - bash)"
|
|
||||||
|
|
||||||
# Restart your shell for the changes to take effect.
|
|
||||||
|
|
||||||
# Load pyenv-virtualenv automatically by adding
|
|
||||||
# the following to ~/.bashrc:
|
|
||||||
|
|
||||||
eval "$(pyenv virtualenv-init -)"
|
|
||||||
|
|
||||||
|
|
|
||||||
51
.bashrc
51
.bashrc
|
|
@ -75,28 +75,43 @@ parse_git_branch() {
|
||||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
|
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
|
||||||
}
|
}
|
||||||
|
|
||||||
# set a fancy prompt
|
## set a fancy prompt
|
||||||
if [ $UID == 0 ]; then
|
# --- 1. Color-Definitions (256-Colors) ---
|
||||||
# root: red
|
# Format: \[ \033[38;5;COLOR_IDm \] ('m' marks the end of the code)
|
||||||
#PS_COLOR="\[\033[1;31m\]"
|
|
||||||
export PS1="\t \[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;1m\]\u\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;7m\]@\h\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;1m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\]\$(parse_git_branch)\[\033[00m\]\n\\$ \[$(tput sgr0)\]"
|
# Reset standard text
|
||||||
|
F_RESET="\[\033[00m\]"
|
||||||
|
|
||||||
|
# Colors for user
|
||||||
|
U_USER="\[\033[38;5;3m\]" # Gelb/Orange
|
||||||
|
U_PWD="\[\033[38;5;39m\]" # soothing sky-blue
|
||||||
|
|
||||||
|
# Colors for Root
|
||||||
|
R_USER="\[\033[1;31m\]" # bold, red (important!)
|
||||||
|
R_PWD="\[\033[38;5;203m\]" # smooth salmon-rose
|
||||||
|
|
||||||
|
# Common colors
|
||||||
|
#C_HOST="\[\033[38;5;7m\]" # Light Grey
|
||||||
|
#C_HOST="\[\033[38;5;0m\]" # Black
|
||||||
|
C_HOST="\[\033[38;5;214m\]" # Orange
|
||||||
|
C_GIT="\[\033[38;5;15m\]" # White
|
||||||
|
C_CHAR="\[\033[38;5;15m\]" # White (for colon)
|
||||||
|
|
||||||
|
|
||||||
|
# --- 2. Logic and Prompt-Composition ---
|
||||||
|
if [ "$UID" -eq 0 ]; then
|
||||||
|
# --- ROOT PROMPT ---
|
||||||
|
# Structure: Time [RootColor]User [Normal]@[Host] : [RootPath]Path [Git] \n #
|
||||||
|
export PS1="\t ${R_USER}\u${C_HOST}@\h${C_CHAR}:${R_PWD}\w${C_GIT}\$(parse_git_branch)$F_RESET\n# "
|
||||||
else
|
else
|
||||||
# user
|
# --- USER PROMPT ---
|
||||||
#PS_COLOR="\[\033[33m\]"
|
# Structure: Time [UserFarbe]User [Normal]@[Host] : [PathFarbe]Path [Git] \n $
|
||||||
export PS1="\t \[$(tput sgr0)\]\[\033[38;5;3m\]\u\[$(tput sgr0)\]\[\033[38;5;7m\]@\h\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;87m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\]\$(parse_git_branch)\[\033[00m\]\n\\$ \[$(tput sgr0)\]"
|
export PS1="\t ${U_USER}\u${C_HOST}@\h${C_CHAR}:${U_PWD}\w${C_GIT}\$(parse_git_branch)$F_RESET\n\\$ "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#PS1="\t ${PS_COLOR}${debian_chroot:+($debian_chroot)}\u@\h:\w\$ "
|
# Cleanup (for the variables not to stau 'exported')
|
||||||
#export PS1="\t \[$(tput sgr0)\]\[\033[38;5;11m\]\u\[$(tput sgr0)\]${PS_COLOR}@\h:\[$(tput sgr0)\]\[\033[38;5;87m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\] \n\\$ \[$(tput sgr0)\]"
|
unset F_RESET U_USER U_PWD R_USER R_PWD C_HOST C_GIT C_CHAR
|
||||||
|
|
||||||
# if this is an xterm modify the title
|
|
||||||
case $TERM in
|
|
||||||
xterm*)
|
|
||||||
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME} $(date +%H:%M:%S) [${PWD}]\007"'
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# define your own aliases in ~/.bash_aliases
|
# define your own aliases in ~/.bash_aliases
|
||||||
[ -f ~/.bash_aliases ] && source ~/.bash_aliases
|
[ -f ~/.bash_aliases ] && source ~/.bash_aliases
|
||||||
|
|
|
||||||
71
.vimrc
71
.vimrc
|
|
@ -6,7 +6,7 @@
|
||||||
"set nocompatible " use vim defaults
|
"set nocompatible " use vim defaults
|
||||||
syntax on " use syntax highlighting
|
syntax on " use syntax highlighting
|
||||||
set background=dark " when using black background terminal
|
set background=dark " when using black background terminal
|
||||||
colorscheme ron " for bash in windows this fixes my colors in vim inside tmux
|
" colorscheme ron " for bash in windows this fixes my colors in vim inside tmux
|
||||||
|
|
||||||
set nomodeline " workaround to close a vuln
|
set nomodeline " workaround to close a vuln
|
||||||
|
|
||||||
|
|
@ -63,14 +63,8 @@ filetype on
|
||||||
let mapleader=" "
|
let mapleader=" "
|
||||||
let g:mapleader=" "
|
let g:mapleader=" "
|
||||||
|
|
||||||
" settings for vim 7
|
|
||||||
if version >= 700
|
|
||||||
set spellfile=~/.vimspell.de.add,~/.vimspell.en.add
|
|
||||||
" setlocal spell spelllang=de " enable spell checker
|
|
||||||
endif
|
|
||||||
|
|
||||||
hi LineTooLong cterm=bold ctermbg=red guibg=LightYellow
|
hi LineTooLong cterm=bold ctermbg=red guibg=LightYellow
|
||||||
match LineTooLong /\%>80v.\+/
|
match LineTooLong /\%>160v.\+/
|
||||||
|
|
||||||
"useful mappings for managing tabs
|
"useful mappings for managing tabs
|
||||||
map <leader>tn :tabnew<cr>
|
map <leader>tn :tabnew<cr>
|
||||||
|
|
@ -91,12 +85,7 @@ endfun
|
||||||
" grep will sometimes skip displaying the file name
|
" grep will sometimes skip displaying the file name
|
||||||
set grepprg=grep\ -nH\ $*
|
set grepprg=grep\ -nH\ $*
|
||||||
|
|
||||||
" Starting with Vim 7, the filetype of empty .tex files defaults to
|
let g:Tex_Folding=0 "I don't like folding.
|
||||||
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
|
|
||||||
" The following changes the default filetype back to 'tex':
|
|
||||||
let g:tex_flavor='latex'
|
|
||||||
|
|
||||||
"let g:Tex_Folding=0 "I don't like folding.
|
|
||||||
set iskeyword+=:
|
set iskeyword+=:
|
||||||
|
|
||||||
" Press Space to turn off highlighting and clear any message already displayed.
|
" Press Space to turn off highlighting and clear any message already displayed.
|
||||||
|
|
@ -113,9 +102,6 @@ function! Incr()
|
||||||
endfunction
|
endfunction
|
||||||
vnoremap <C-a> :call Incr()<CR>
|
vnoremap <C-a> :call Incr()<CR>
|
||||||
|
|
||||||
" Prss CTRL + _ (CTRL + SHIFT + -) to close a html tag
|
|
||||||
if filereadable(glob('~/.vim/scripts/closetag.vim')) | source ~/.vim/scripts/closetag.vim | endif
|
|
||||||
|
|
||||||
highlight ExtraWhitespace ctermbg=red guibg=red
|
highlight ExtraWhitespace ctermbg=red guibg=red
|
||||||
match ExtraWhitespace /\s\+$\| \+\ze\t/
|
match ExtraWhitespace /\s\+$\| \+\ze\t/
|
||||||
|
|
||||||
|
|
@ -125,23 +111,11 @@ nnoremap <F2> :<C-U>%retab!<CR>:set list<CR>:%s/^\(\t\+\) */\1/<CR>
|
||||||
nnoremap <F5> "=strftime("%c")<CR>P
|
nnoremap <F5> "=strftime("%c")<CR>P
|
||||||
inoremap <F5> <C-R>=strftime("%c")<CR>
|
inoremap <F5> <C-R>=strftime("%c")<CR>
|
||||||
|
|
||||||
" a few autocommands for when silly people send stupid file formats
|
" YAML and Ansible and so on
|
||||||
" Read-only .doc through antiword
|
augroup ansible_vim_fthosts
|
||||||
autocmd BufReadPre *.doc silent set ro
|
autocmd!
|
||||||
autocmd BufReadPost *.doc silent %!antiword "%"
|
autocmd BufNewFile,BufRead hosts setfiletype yaml.ansible
|
||||||
|
augroup END
|
||||||
" Read-only odt/odp through odt2txt
|
|
||||||
autocmd BufReadPre *.odt,*.odp silent set ro
|
|
||||||
autocmd BufReadPost *.odt,*.odp silent %!odt2txt "%"
|
|
||||||
|
|
||||||
" Read-only pdf through pdftotext
|
|
||||||
autocmd BufReadPre *.pdf silent set ro
|
|
||||||
autocmd BufReadPost *.pdf silent %!pdftotext -nopgbrk -layout -q -eol unix "%" -
|
|
||||||
"| fmt -w250
|
|
||||||
|
|
||||||
" Read-only rtf through unrtf
|
|
||||||
autocmd BufReadPre *.rtf silent set ro
|
|
||||||
autocmd BufReadPost *.rtf silent %!unrtf --text
|
|
||||||
|
|
||||||
" as long as vim isn't in diff-mode check the code at opening and closing
|
" as long as vim isn't in diff-mode check the code at opening and closing
|
||||||
" also: special vimdiff-settings
|
" also: special vimdiff-settings
|
||||||
|
|
@ -157,6 +131,14 @@ if ! &diff
|
||||||
nnoremap <leader>l <C-L>
|
nnoremap <leader>l <C-L>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" NerdTree Settings
|
||||||
|
nnoremap <leader>n :NERDTreeToggle<CR>
|
||||||
|
nnoremap <leader>nf :NERDTreeFocus<CR>
|
||||||
|
nnoremap <leader>nc :NERDTreeClose<CR>
|
||||||
|
|
||||||
|
" block-editing workaround for a windows-terminal-wsl situation
|
||||||
|
nnoremap <Leader>v <c-v>
|
||||||
|
|
||||||
"tweaking my statusline
|
"tweaking my statusline
|
||||||
function! GitBranch()
|
function! GitBranch()
|
||||||
return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
|
return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
|
||||||
|
|
@ -184,3 +166,24 @@ set statusline+=\ %p%%
|
||||||
set statusline+=\ %l:%c
|
set statusline+=\ %l:%c
|
||||||
set statusline+=\
|
set statusline+=\
|
||||||
|
|
||||||
|
call plug#begin('~/.vim/plugged')
|
||||||
|
|
||||||
|
" --- Your Plugin List Goes Here ---
|
||||||
|
" Example:
|
||||||
|
Plug 'tpope/vim-surround'
|
||||||
|
Plug 'preservim/nerdtree'
|
||||||
|
Plug 'pearofducks/ansible-vim'
|
||||||
|
|
||||||
|
" Automatically install plugins if they are not installed
|
||||||
|
" Call plug#config_commit() is the modern way to replace auto_install, save_state, etc.
|
||||||
|
" call plug#config_commit()
|
||||||
|
|
||||||
|
" Optional: For automatic plugin updates on startup if you want
|
||||||
|
" autocmd VimEnter *
|
||||||
|
" \ PlugUpgrade |
|
||||||
|
" \ execute PlugInstall |
|
||||||
|
" \ PlugClean
|
||||||
|
|
||||||
|
" Initialize plugin system, then load plugins
|
||||||
|
call plug#end()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user