🚚 move dotfiles to own dir

This commit is contained in:
Daniel Thoren 2022-03-25 14:23:24 +01:00
parent 533cc45480
commit 0990bde2f2
5 changed files with 0 additions and 0 deletions

52
dotfiles/.bashrc_gitbash Normal file
View file

@ -0,0 +1,52 @@
#!/bin/bash
echo "running bashrc in git bash"
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export SHELL=/bin/bash
function get_hostname {
export SHORTNAME=${HOSTNAME%%.*}
}
function git_branch() {
gitbranch=$(git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/');
}
function user_color {
id | grep "Admin" > /dev/null
RETVAL=$?
if [[ $RETVAL == 0 ]]; then
usercolor="[0;31m";
else
usercolor="[0;32m";
fi
}
function settitle() {
u=${USERNAME}
h="$u@${HOSTNAME}"
echo -ne "\e]2;$h\a\e]1;$h\a";
}
# Set directory colors
eval `dircolors ~/.dir_colors`
# Set prompt and window title
inputcolor='[0;37m'
cwdcolor='[0;34m'
host_name='[1;31m'
branchcolor='[0;36m'
user_color
PROMPT_COMMAND='settitle; git_branch; get_hostname; history -a;'
PS1='\n\[\e${cwdcolor}\][${PWD}]\[\e${branchcolor}\]${gitbranch}\n\[\e${usercolor}\][\u]\[\e${host_name}\][${SHORTNAME}]\[\e${inputcolor}\] $ '
export PS1
# Aliases
alias ls='ls -l --color'
alias grep='grep -n --color'

64
dotfiles/.vimrc Normal file
View file

@ -0,0 +1,64 @@
" TODO:
" Switch to vim-plug
" [Vim bindings](https://stackoverflow.com/a/5400978/5684214)
" Find more plugins: https://vimawesome.com/
" Tested on Ubuntu 21.04 with VIM - Vi IMproved 8.2
set nocompatible " be iMproved, required
filetype off " required
" set runtime path and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive' " https://dev.to/iggredible/working-with-vim-and-git-4nkh
Plugin 'editorconfig/editorconfig-vim'
Plugin 'tmhedberg/SimpylFold'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'vim-syntastic/syntastic'
Plugin 'nvie/vim-flake8'
Plugin 'scrooloose/nerdtree'
Plugin 'kien/ctrlp.vim'
Plugin 'rrethy/vim-illuminate' " highlight other uses of the current word under the cursor
Plugin 'mileszs/ack.vim' " grep-like source code search tool
Bundle 'Valloric/YouCompleteMe'
" Plugin 'powerline/powerline', {'rtp': 'powerline/bindings/vim/'}
" remeber to call `:PluginInstall` after changing
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" Enable folding
set foldmethod=indent
set foldlevel=99
" flag extranous whitespace
" au BufRead,BufNewFile *.py match BadWhitespace /\s\+$/
"python with virtualenv support
python3 << EOF
import os
import sys
if 'VIRTUAL_ENV' in os.environ:
project_base_dir = os.environ['VIRTUAL_ENV']
activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
EOF
let python_highlight_all=1
syntax on
set backspace=indent,eol,start " more powerful backspacing
set nu " line numbers
set clipboard=unnamed " set clipboard
" Set splits
set splitbelow
set splitright
" increase vim-gitgutter update time (also vim swp update time)
" https://github.com/airblade/vim-gitgutter
set updatetime=100

134
dotfiles/.vimrc_gitbash Normal file
View file

@ -0,0 +1,134 @@
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" For plugins to load correctly
filetype plugin indent on
" TODO: Pick a leader key
let mapleader = ","
" Security
set modelines=0
" Show line numbers
set number
autocmd InsertEnter * :set norelativenumber
autocmd InsertLeave * :set relativenumber
" Show file stats
set ruler
" Blink cursor on error instead of beeping (grr)
set visualbell
" Encoding
set encoding=utf-8
" Whitespace
set wrap
set textwidth=88
set formatoptions=tcqrn1
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set noshiftround
" Cursor motion
set scrolloff=3
set backspace=indent,eol,start
set matchpairs+=<:> " use % to jump between pairs
runtime! macros/matchit.vim
" Move up/down editor lines
nnoremap j gj
nnoremap k gk
" Allow hidden buffers
set hidden
" Rendering
set ttyfast
" Status bar
set laststatus=2
" Last line
set showmode
set showcmd
" Searching
nnoremap / /\v
vnoremap / /\v
set hlsearch
set incsearch
set ignorecase
set smartcase
set showmatch
map <leader><space> :let @/=''<cr> " clear search
" Remap help key.
inoremap <F1> <ESC>:set invfullscreen<CR>a
nnoremap <F1> :set invfullscreen<CR>
vnoremap <F1> :set invfullscreen<CR>
" Textmate holdouts
" Formatting
map <leader>q gqip
" Visualize tabs and newlines
set listchars=tab:▸\ ,eol:¬
" Uncomment this to enable by default:
" set list " To enable by default
" Or use your leader key + l to toggle on/off
map <leader>l :set list!<CR> " Toggle tabs and EOL
" Color scheme (terminal)
"set t_Co=256
"let g:solarized_termcolors=256
"let g:solarized_termtrans=1
" put https://raw.github.com/altercation/vim-colors-solarized/master/colors/solarized.vim
" in ~/.vim/colors/ and uncomment:
"syntax enable
set background=dark "light " replace dark with light for light mode
colorscheme solarized
set noeb vb t_vb=
au GUIEnter * set vb t_vb=
function! InsertStatuslineColor(mode)
if a:mode == 'i'
hi statusline guibg=Cyan ctermfg=6 guifg=Black ctermbg=0
elseif a:mode == 'r'
hi statusline guibg=Purple ctermfg=5 guifg=Black ctermbg=0
else
hi statusline guibg=DarkRed ctermfg=1 guifg=Black ctermbg=0
endif
endfunction
au InsertEnter * call InsertStatuslineColor(v:insertmode)
au InsertLeave * hi statusline guibg=DarkGrey ctermfg=8 guifg=White ctermbg=15
" default the statusline to green when entering Vim
hi statusline guibg=DarkGrey ctermfg=8 guifg=White ctermbg=15
" Formats the statusline
set statusline=%f " file name
set statusline+=[%{strlen(&fenc)?&fenc:'none'}, "file encoding
set statusline+=%{&ff}] "file format
set statusline+=%y "filetype
set statusline+=%h "help file flag
set statusline+=%m "modified flag
set statusline+=%r "read only flag
set statusline+=\ %= " align left
set statusline+=Line:%l/%L[%p%%] " line X of Y [percent of file]
set statusline+=\ Col:%c " current column
set statusline+=\ Buf:%n " Buffer number
set statusline+=\ [%b][0x%B]\ " ASCII and byte code under cursor

11
dotfiles/.zshrc Normal file
View file

@ -0,0 +1,11 @@
" If zsh is not yet installed:
" https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH
" If oh-my-zsh is not yet installed:
" https://ohmyz.sh/#install
" During zsh setup, a `.zhrc` file is generated and left in the root.
" The following .zshrc content should extend (rather than replace) your `.zshrc`.
bindkey -v " use vim bindings in the terminal
alias doco="docker-compose" " never write docker-compose ever again

33
dotfiles/Brewfile Normal file
View file

@ -0,0 +1,33 @@
# 1. install bundle with brew: `$brew tap Homebrew/bundle`
# 2. Brew bundle: `$brew bundle` (must be run from same dir as file)
# or `brew bundle --file=~/.private/Brewfile`
tap "homebrew/cask"
brew "tree"
brew "mas"
brew "handbrake"
# brew "macvim"
brew "vim"
brew "ack"
brew "profanity" # XMPP client
cask "pgadmin4" # pgsql database admin tool
cask "macsvg" # svg editor
cask "firefox"
cask "iterm2"
# cask "karabiner-elements"
cask "telegram"
cask "shiftit"
cask "docker"
cask "vlc"
cask "disk-inventory-x"
cask "rekordbox"
cask "clickup"
cask "visual-studio-code"
cask "discord"
# cask "adium"
# # adium or pidgin?
# cask "pidgin"
# # Cask or brew install pidgin
# cask "fork"