mirror of
https://github.com/tiyn/dotfiles.git
synced 2025-04-02 17:27:44 +02:00
synced dotfiles server branch with this branch
This commit is contained in:
parent
782b754edf
commit
b54b02965e
@ -12,12 +12,21 @@ alias "....."="cd ../../../.."
|
|||||||
alias "......"="cd ../../../../.."
|
alias "......"="cd ../../../../.."
|
||||||
alias "dockervol"="cd /var/lib/docker/volumes"
|
alias "dockervol"="cd /var/lib/docker/volumes"
|
||||||
|
|
||||||
|
# cp
|
||||||
|
alias cp="cp -i"
|
||||||
|
|
||||||
# clear
|
# clear
|
||||||
alias c="clear"
|
alias c="clear"
|
||||||
|
|
||||||
# config
|
# config
|
||||||
alias config="/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME"
|
alias config="/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME"
|
||||||
|
|
||||||
|
# git
|
||||||
|
alias ga="git add"
|
||||||
|
alias grm="git rm"
|
||||||
|
alias gc="git commit"
|
||||||
|
alias gp="git push"
|
||||||
|
|
||||||
# grep
|
# grep
|
||||||
alias grep="grep --color=auto"
|
alias grep="grep --color=auto"
|
||||||
|
|
||||||
@ -33,15 +42,24 @@ alias la="lsd -la"
|
|||||||
alias ll="lsd -l"
|
alias ll="lsd -l"
|
||||||
alias tree="lsd --tree"
|
alias tree="lsd --tree"
|
||||||
|
|
||||||
|
# mid3v2
|
||||||
|
alias tag="mid3v2"
|
||||||
|
|
||||||
# mkdir
|
# mkdir
|
||||||
alias mkdir="mkdir -p"
|
alias mkdir="mkdir -p"
|
||||||
|
|
||||||
|
# mv
|
||||||
|
alias mv="mv -i"
|
||||||
|
|
||||||
# mount
|
# mount
|
||||||
alias mount="mount |column -t"
|
alias mount="mount |column -t"
|
||||||
|
|
||||||
# ping
|
# ping
|
||||||
alias ping="ping -c 5"
|
alias ping="ping -c 5"
|
||||||
|
|
||||||
|
# rm
|
||||||
|
alias rm="rm -i"
|
||||||
|
|
||||||
# sc-im
|
# sc-im
|
||||||
alias sc="sc-im"
|
alias sc="sc-im"
|
||||||
|
|
||||||
@ -49,4 +67,17 @@ alias sc="sc-im"
|
|||||||
alias scriptclear="cat typescript | perl -pe 's/\e([^\[\]]|\[.*?[a-zA-Z]|\].*?\a)//g' | col -b > typescript-processed"
|
alias scriptclear="cat typescript | perl -pe 's/\e([^\[\]]|\[.*?[a-zA-Z]|\].*?\a)//g' | col -b > typescript-processed"
|
||||||
|
|
||||||
# nvim
|
# nvim
|
||||||
|
alias svim="sudo nvim"
|
||||||
|
alias svi="sudo nvim"
|
||||||
command -v nvim >/dev/null && alias vim="nvim" vimdiff="nvim -d"
|
command -v nvim >/dev/null && alias vim="nvim" vimdiff="nvim -d"
|
||||||
|
command -v nvim >/dev/null && alias vi="nvim" vidiff="nvim -d"
|
||||||
|
|
||||||
|
# weather
|
||||||
|
alias weather="curl wttr.in"
|
||||||
|
|
||||||
|
# wget
|
||||||
|
alias wget="wget --hsts-file=$XDG_CACHE_HOME/wget-hsts"
|
||||||
|
|
||||||
|
# youtube-dl
|
||||||
|
alias yta="youtube-dl -f 'bestaudio[ext=m4a]'"
|
||||||
|
alias ytv="youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]'"
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
" Begin Plugin section
|
let mapleader = ";"
|
||||||
|
|
||||||
|
" begin plugin section
|
||||||
if ! filereadable(expand('~/.config/nvim/autoload/plug.vim'))
|
if ! filereadable(expand('~/.config/nvim/autoload/plug.vim'))
|
||||||
echo "Downloading junegunn/vim-plug to manage plugins..."
|
echo "Downloading junegunn/vim-plug to manage plugins..."
|
||||||
silent !mkdir -p ~/.config/nvim/autoload/
|
silent !mkdir -p ~/.config/nvim/autoload/
|
||||||
@ -9,72 +11,152 @@ call plug#begin('~/.config/nvim/plugged')
|
|||||||
Plug 'qpkorr/vim-renamer'
|
Plug 'qpkorr/vim-renamer'
|
||||||
Plug 'tomasiser/vim-code-dark'
|
Plug 'tomasiser/vim-code-dark'
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
" end plugin section
|
||||||
" End Plugin section
|
|
||||||
|
|
||||||
let mapleader =","
|
|
||||||
|
|
||||||
set go=a
|
set go=a
|
||||||
|
|
||||||
|
" enable mouse for all modes
|
||||||
set mouse=a
|
set mouse=a
|
||||||
set ignorecase
|
set clipboard+=unnamedplus
|
||||||
" Some basics:
|
|
||||||
nnoremap c "_c
|
" enable command completion
|
||||||
set nocompatible
|
|
||||||
filetype plugin on
|
|
||||||
syntax on
|
|
||||||
set encoding=utf-8
|
|
||||||
set number relativenumber
|
|
||||||
" Enable autocompletion:
|
|
||||||
set wildmode=longest,list,full
|
set wildmode=longest,list,full
|
||||||
" Disables automatic commenting on newline:
|
|
||||||
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
|
" setting Tab-length
|
||||||
" Setting Tab-length
|
set expandtab
|
||||||
set tabstop=4
|
|
||||||
set softtabstop=4
|
set softtabstop=4
|
||||||
set shiftwidth=4
|
set shiftwidth=4
|
||||||
|
|
||||||
colorscheme codedark
|
" splits open at the bottom and right, which is non-retarded, unlike vim defaults.
|
||||||
|
|
||||||
" Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
|
|
||||||
set splitbelow splitright
|
set splitbelow splitright
|
||||||
|
|
||||||
" Mapping Dictionaries
|
" disable case sensitive matching
|
||||||
map <F5> :setlocal spell! spelllang=de<CR>
|
set ignorecase
|
||||||
map <F6> :set spelllang=en_us<CR>
|
|
||||||
|
|
||||||
""" Shortcuts
|
" enable nocompatible mode
|
||||||
" Navigating with guides
|
set nocompatible
|
||||||
inoremap <leader><leader> <Esc>/<++><Enter>"_c4l
|
|
||||||
vnoremap <leader><leader> <Esc>/<++><Enter>"_c4l
|
|
||||||
map <leader><leader> <Esc>/<++><Enter>"_c4l
|
|
||||||
|
|
||||||
" Navigating with guides
|
" enable Plugins
|
||||||
inoremap <leader><leader> <Esc>/<++><Enter>"_c4l
|
filetype plugin on
|
||||||
vnoremap <leader><leader> <Esc>/<++><Enter>"_c4l
|
|
||||||
map <leader><leader> <Esc>/<++><Enter>"_c4l
|
|
||||||
|
|
||||||
"""HTML
|
" enable syntax highlighting
|
||||||
autocmd BufRead,BufNewFile *.html set filetype=html
|
syntax on
|
||||||
|
|
||||||
autocmd FileType html inoremap ,b <b></b><Space><++><Esc>FbT>i
|
" enable true colors
|
||||||
autocmd FileType html inoremap ,it <em></em><Space><++><Esc>FeT>i
|
set termguicolors
|
||||||
autocmd FileType html inoremap ,1 <h1></h1><Enter><Enter><++><Esc>2kf<i
|
|
||||||
autocmd FileType html inoremap ,2 <h2></h2><Enter><Enter><++><Esc>2kf<i
|
|
||||||
autocmd FileType html inoremap ,3 <h3></h3><Enter><Enter><++><Esc>2kf<i
|
|
||||||
autocmd FileType html inoremap ,p <p></p><Enter><Enter><++><Esc>02kf>a
|
|
||||||
autocmd FileType html inoremap ,a <a<Space>href=""><++></a><Space><++><Esc>14hi
|
|
||||||
autocmd FileType html inoremap ,e <a<Space>target="_blank"<Space>href=""><++></a><Space><++><Esc>14hi
|
|
||||||
autocmd FileType html inoremap ,ul <ul><Enter><li></li><Enter></ul><Enter><Enter><++><Esc>03kf<i
|
|
||||||
autocmd FileType html inoremap ,li <Esc>o<li></li><Esc>F>a
|
|
||||||
autocmd FileType html inoremap ,ol <ol><Enter><li></li><Enter></ol><Enter><Enter><++><Esc>03kf<i
|
|
||||||
autocmd FileType html inoremap ,im <img src="" alt="<++>"><++><esc>Fcf"a
|
|
||||||
autocmd FileType html inoremap &<space> &<space>
|
|
||||||
autocmd FileType html inoremap ä ä
|
|
||||||
autocmd FileType html inoremap ö ö
|
|
||||||
autocmd FileType html inoremap ü ü
|
|
||||||
autocmd FileType html inoremap Ä Ä
|
|
||||||
autocmd FileType html inoremap Ö Ö
|
|
||||||
autocmd FileType html inoremap Ü Ü
|
|
||||||
|
|
||||||
" Delete trailing whitespaces on save
|
" set utf-8 encoding
|
||||||
autocmd BufWritePre * %s/\s\+$//e
|
set encoding=utf-8
|
||||||
|
|
||||||
|
" show relative numbers on left side
|
||||||
|
set number relativenumber
|
||||||
|
|
||||||
|
" speedup vim with long lines
|
||||||
|
set ttyfast
|
||||||
|
set lazyredraw
|
||||||
|
|
||||||
|
" textEdit might fail without hidden
|
||||||
|
set hidden
|
||||||
|
|
||||||
|
" disable Backupfiles for Lsp
|
||||||
|
set nobackup
|
||||||
|
set nowritebackup
|
||||||
|
|
||||||
|
" dont pass messages to ins-completion-menu
|
||||||
|
set shortmess+=c
|
||||||
|
|
||||||
|
" always show the signcolumn, otherwise it would shift the text each time
|
||||||
|
" diagnostics appear/become resolved.
|
||||||
|
if has("patch-8.1.1564")
|
||||||
|
" Recently vim can merge signcolumn and number column into one
|
||||||
|
set signcolumn=number
|
||||||
|
else
|
||||||
|
set signcolumn=yes
|
||||||
|
endif
|
||||||
|
|
||||||
|
" enable persistent undo
|
||||||
|
if has('persistent_undo')
|
||||||
|
set undofile
|
||||||
|
set undodir=$XDG_CACHE_HOME/vim/undo
|
||||||
|
endif
|
||||||
|
|
||||||
|
" unmap unwanted commands
|
||||||
|
nnoremap <F1> <NOP>
|
||||||
|
nnoremap <F2> <NOP>
|
||||||
|
nnoremap <F3> <NOP>
|
||||||
|
nnoremap <F4> <NOP>
|
||||||
|
nnoremap <F5> <NOP>
|
||||||
|
nnoremap <F8> <NOP>
|
||||||
|
nnoremap <F9> <NOP>
|
||||||
|
nnoremap <F10> <NOP>
|
||||||
|
nnoremap <F11> <NOP>
|
||||||
|
nnoremap <F12> <NOP>
|
||||||
|
|
||||||
|
inoremap <F1> <NOP>
|
||||||
|
inoremap <F2> <NOP>
|
||||||
|
inoremap <F3> <NOP>
|
||||||
|
inoremap <F4> <NOP>
|
||||||
|
inoremap <F5> <NOP>
|
||||||
|
inoremap <F6> <NOP>
|
||||||
|
inoremap <F7> <NOP>
|
||||||
|
inoremap <F8> <NOP>
|
||||||
|
inoremap <F9> <NOP>
|
||||||
|
inoremap <F10> <NOP>
|
||||||
|
inoremap <F11> <NOP>
|
||||||
|
inoremap <F12> <NOP>
|
||||||
|
|
||||||
|
" mapping Dictionaries
|
||||||
|
nnoremap <F6> :setlocal spell! spelllang=de_de<CR>
|
||||||
|
nnoremap <F7> :setlocal spell! spelllang=en_us<CR>
|
||||||
|
|
||||||
|
" compiler for languages
|
||||||
|
nnoremap <leader>c :w! \| !compiler <c-r>%<CR>
|
||||||
|
|
||||||
|
" open corresponding file (pdf/html/...)
|
||||||
|
nnoremap <leader>p :!opout <c-r>%<CR><CR>
|
||||||
|
|
||||||
|
" shortcut for split navigation
|
||||||
|
nnoremap <C-h> <C-w>h
|
||||||
|
nnoremap <C-j> <C-w>j
|
||||||
|
nnoremap <C-k> <C-w>k
|
||||||
|
nnoremap <C-l> <C-w>l
|
||||||
|
|
||||||
|
" save file as sudo on files that require root permission
|
||||||
|
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
|
||||||
|
|
||||||
|
" alias for replacing
|
||||||
|
nnoremap <leader>ss :%s//gI<Left><Left><Left>
|
||||||
|
|
||||||
|
" delete trailing whitespaces on save
|
||||||
|
fun! TrimWhitespace()
|
||||||
|
let l:save = winsaveview()
|
||||||
|
keeppatterns %s/\s\+$//e
|
||||||
|
call winrestview(l:save)
|
||||||
|
endfun
|
||||||
|
autocmd BufWritePre * :call TrimWhitespace()
|
||||||
|
|
||||||
|
" read files correctly
|
||||||
|
autocmd BufRead,BufNewFile *.tex set filetype=tex
|
||||||
|
autocmd BufRead,BufNewFile *.h set filetype=c
|
||||||
|
|
||||||
|
" formatting
|
||||||
|
autocmd FileType c setlocal formatprg=astyle\ --mode=c
|
||||||
|
autocmd FileType java setlocal formatprg=astyle\ --indent=spaces=2\ --style=google
|
||||||
|
autocmd FileType java setlocal shiftwidth=2 softtabstop=2
|
||||||
|
autocmd FileType markdown noremap <F8> :silent %!prettier --stdin-filepath % <CR>
|
||||||
|
autocmd FileType python setlocal formatprg=autopep8\ -
|
||||||
|
autocmd FileType tex,latex setlocal formatprg=latexindent\ -
|
||||||
|
autocmd FileType c,java,python,tex,latex noremap <F8> gggqG
|
||||||
|
|
||||||
|
" cleanup certain files after leaving the editor
|
||||||
|
autocmd VimLeave *.tex !texclear %
|
||||||
|
autocmd VimLeave *.c !cclear
|
||||||
|
|
||||||
|
" highlighting break line
|
||||||
|
autocmd BufEnter,FileType c set colorcolumn=80
|
||||||
|
autocmd BufEnter,FileType java set colorcolumn=100
|
||||||
|
autocmd BufEnter,FileType markdown set colorcolumn=80
|
||||||
|
|
||||||
|
" colorscheme
|
||||||
|
colorscheme codedark
|
||||||
|
highlight colorcolumn guibg=#772222
|
||||||
|
16
.profile
16
.profile
@ -2,9 +2,17 @@
|
|||||||
# Profile file. Runs on login.
|
# Profile file. Runs on login.
|
||||||
|
|
||||||
# Adds `~/.local/bin` and all subdirectories to $PATH
|
# Adds `~/.local/bin` and all subdirectories to $PATH
|
||||||
export PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')"
|
export PATH="$PATH:$(du "${HOME}/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')"
|
||||||
|
|
||||||
export EDITOR="nvim"
|
export EDITOR="nvim"
|
||||||
export ZDOTDIR="$HOME"
|
export ZDOTDIR="${HOME}"
|
||||||
|
|
||||||
|
export XDG_CACHE_HOME="${HOME}/.cache"
|
||||||
|
export XDG_CONFIG_HOME="${HOME}/.config"
|
||||||
|
export XDG_DATA_HOME="${HOME}/.local/share"
|
||||||
|
|
||||||
|
export HISTFILE="${XDG_CACHE_HOME}/shhistory"
|
||||||
|
export TMUX_TMPDIR="${XDG_CACHE_HOME}/tmux"
|
||||||
|
|
||||||
# less/man colors
|
# less/man colors
|
||||||
export LESS=-R
|
export LESS=-R
|
||||||
@ -16,5 +24,5 @@ export LESS_TERMCAP_se="$(printf '%b' '[[0m')"; a="${a%_}"
|
|||||||
export LESS_TERMCAP_us="$(printf '%b' '[[1;32m')"; a="${a%_}"
|
export LESS_TERMCAP_us="$(printf '%b' '[[1;32m')"; a="${a%_}"
|
||||||
export LESS_TERMCAP_ue="$(printf '%b' '[[0m')"; a="${a%_}"
|
export LESS_TERMCAP_ue="$(printf '%b' '[[0m')"; a="${a%_}"
|
||||||
|
|
||||||
echo "$0" | grep "bash$" >/dev/null && [ -f ~/.bashrc ] && source "$HOME/.bashrc"
|
echo "$0" | grep "bash$" >/dev/null && [ -f ~/.bashrc ] && source "${HOME}/.bashrc"
|
||||||
echo "$0" | grep "zsh$" >/dev/null && [ -f $ZDOTDIR/.zshrc ] && source "$ZDOTDIR/.zshrc"
|
echo "$0" | grep "zsh$" >/dev/null && [ -f ${ZDOTDIR}/.zshrc ] && source "${ZDOTDIR}/.zshrc"
|
||||||
|
2
.zshrc
2
.zshrc
@ -42,7 +42,7 @@ function +vi-git-stash() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
zstyle ':vcs_info:git*+set-message:*' hooks git-st git-stash
|
zstyle ':vcs_info:git*+set-message:*' hooks git-st git-stash
|
||||||
PS1='%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}#%b '
|
PS1='%B%{$fg[red]%}[%n@%M %~]%{$reset_color%}#%b '
|
||||||
RPROMPT='%B%{$fg[magenta]%}$vcs_info_msg_0_%{$reset_color%}%b'
|
RPROMPT='%B%{$fg[magenta]%}$vcs_info_msg_0_%{$reset_color%}%b'
|
||||||
|
|
||||||
# History in cache directory
|
# History in cache directory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user