From 9693d37ff83f8f2579b5b7b7f02a88d2b82730a7 Mon Sep 17 00:00:00 2001 From: Sebastian Burschel Date: Thu, 10 Oct 2019 13:57:06 +0200 Subject: [PATCH] First version, will be improved when I find out what I actually want... --- Raspberry Pi/first_install.sh | 0 dotfiles/.tmux.conf | 18 ++++ dotfiles/.vimrc | 163 ++++++++++++++++++++++++++++++++++ dotfiles/.zshrc | 70 +++++++++++++++ 4 files changed, 251 insertions(+) create mode 100644 Raspberry Pi/first_install.sh create mode 100644 dotfiles/.vimrc diff --git a/Raspberry Pi/first_install.sh b/Raspberry Pi/first_install.sh new file mode 100644 index 0000000..e69de29 diff --git a/dotfiles/.tmux.conf b/dotfiles/.tmux.conf index e69de29..dc8cddd 100644 --- a/dotfiles/.tmux.conf +++ b/dotfiles/.tmux.conf @@ -0,0 +1,18 @@ +# run: git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm + +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-net-speed' + + + +# Settings +set -g status-right "#{net_speed}" + + + + + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run -b '~/.tmux/plugins/tpm/tpm' \ No newline at end of file diff --git a/dotfiles/.vimrc b/dotfiles/.vimrc new file mode 100644 index 0000000..cade9c5 --- /dev/null +++ b/dotfiles/.vimrc @@ -0,0 +1,163 @@ +set encoding=utf-8 + +" Leader +let mapleader = " " + +set backspace=2 " Backspace deletes like most programs in insert mode +set nobackup +set nowritebackup +set noswapfile " http://robots.thoughtbot.com/post/18739402579/global-gitignore#comment-458413287 +set history=50 +set ruler " show the cursor position all the time +set showcmd " display incomplete commands +set incsearch " do incremental searching +set laststatus=2 " Always display the status line +set autowrite " Automatically :write before running commands +set modelines=0 " Disable modelines as a security precaution +set nomodeline + +" Switch syntax highlighting on, when the terminal has colors +" Also switch on highlighting the last used search pattern. +if (&t_Co > 2 || has("gui_running")) && !exists("syntax_on") + syntax on +endif + +if filereadable(expand("~/.vimrc.bundles")) + source ~/.vimrc.bundles +endif + +" Load matchit.vim, but only if the user hasn't installed a newer version. +if !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &rtp) ==# '' + runtime! macros/matchit.vim +endif + +filetype plugin indent on + +augroup vimrcEx + autocmd! + + " When editing a file, always jump to the last known cursor position. + " Don't do it for commit messages, when the position is invalid, or when + " inside an event handler (happens when dropping a file on gvim). + autocmd BufReadPost * + \ if &ft != 'gitcommit' && line("'\"") > 0 && line("'\"") <= line("$") | + \ exe "normal g`\"" | + \ endif + + " Set syntax highlighting for specific file types + autocmd BufRead,BufNewFile *.md set filetype=markdown + autocmd BufRead,BufNewFile .{jscs,jshint,eslint}rc set filetype=json + autocmd BufRead,BufNewFile aliases.local,zshrc.local,*/zsh/configs/* set filetype=sh + autocmd BufRead,BufNewFile gitconfig.local set filetype=gitconfig + autocmd BufRead,BufNewFile tmux.conf.local set filetype=tmux + autocmd BufRead,BufNewFile vimrc.local set filetype=vim +augroup END + + +" When the type of shell script is /bin/sh, assume a POSIX-compatible +" shell for syntax highlighting purposes. +let g:is_posix = 1 + +" Softtabs, 2 spaces +set tabstop=2 +set shiftwidth=2 +set shiftround +set expandtab + +" Display extra whitespace +set list listchars=tab:»·,trail:·,nbsp:· + +" Use one space, not two, after punctuation. +set nojoinspaces + +" Use The Silver Searcher https://github.com/ggreer/the_silver_searcher +if executable('ag') + " Use Ag over Grep + set grepprg=ag\ --nogroup\ --nocolor + + " Use ag in fzf for listing files. Lightning fast and respects .gitignore + let $FZF_DEFAULT_COMMAND = 'ag --literal --files-with-matches --nocolor --hidden -g ""' + + if !exists(":Ag") + command -nargs=+ -complete=file -bar Ag silent! grep! |cwindow|redraw! + nnoremap \ :Ag + endif +endif + +" Make it obvious where 80 characters is +set textwidth=80 +set colorcolumn=+1 + +" Numbers +set number +set numberwidth=5 + +" Tab completion +" will insert tab at beginning of line, +" will use completion if not at beginning +set wildmode=list:longest,list:full +function! InsertTabWrapper() + let col = col('.') - 1 + if !col || getline('.')[col - 1] !~ '\k' + return "\" + else + return "\" + endif +endfunction +inoremap =InsertTabWrapper() +inoremap + +" Switch between the last two files +nnoremap + +" Get off my lawn +nnoremap :echoe "Use h" +nnoremap :echoe "Use l" +nnoremap :echoe "Use k" +nnoremap :echoe "Use j" + +" vim-test mappings +nnoremap t :TestFile +nnoremap s :TestNearest +nnoremap l :TestLast +nnoremap a :TestSuite +nnoremap gt :TestVisit + +" Run commands that require an interactive shell +nnoremap r :RunInInteractiveShell + +" Treat
  • and

    tags like the block tags they are +let g:html_indent_tags = 'li\|p' + +" Open new split panes to right and bottom, which feels more natural +set splitbelow +set splitright + +" Quicker window movement +nnoremap j +nnoremap k +nnoremap h +nnoremap l + +" Move between linting errors +nnoremap ]r :ALENextWrap +nnoremap [r :ALEPreviousWrap + +" Map Ctrl + p to open fuzzy find (FZF) +nnoremap :Files + +" Set spellfile to location that is guaranteed to exist, can be symlinked to +" Dropbox or kept in Git and managed outside of thoughtbot/dotfiles using rcm. +set spellfile=$HOME/.vim-spell-en.utf-8.add + +" Autocomplete with dictionary words when spell check is on +set complete+=kspell + +" Always use vertical diffs +set diffopt+=vertical + +" Local config +if filereadable($HOME . "/.vimrc.local") + source ~/.vimrc.local +endif + diff --git a/dotfiles/.zshrc b/dotfiles/.zshrc index e69de29..b6ff43c 100644 --- a/dotfiles/.zshrc +++ b/dotfiles/.zshrc @@ -0,0 +1,70 @@ +source ~/.bash_profile + + + +# extra files in ~/.zsh/configs/pre , ~/.zsh/configs , and ~/.zsh/configs/post +# these are loaded first, second, and third, respectively. +_load_settings() { + _dir="$1" + if [ -d "$_dir" ]; then + if [ -d "$_dir/pre" ]; then + for config in "$_dir"/pre/**/*~*.zwc(N-.); do + . $config + done + fi + + for config in "$_dir"/**/*(N-.); do + case "$config" in + "$_dir"/(pre|post)/*|*.zwc) + : + ;; + *) + . $config + ;; + esac + done + + if [ -d "$_dir/post" ]; then + for config in "$_dir"/post/**/*~*.zwc(N-.); do + . $config + done + fi + fi +} +_load_settings "$HOME/.zsh/configs" + +# Local config +[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local + +# aliases +[[ -f ~/.aliases ]] && source ~/.aliases + + +# Save history +SAVEHIST=3000 +HISTSIZE=3000 +HISTFILE="$HOME/.zsh_history" +setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits. +setopt SHARE_HISTORY # Share history between all sessions. +setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history. +setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again. +setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate. +setopt HIST_FIND_NO_DUPS # Do not display a line previously found. +setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space. +setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file. +setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry. +setopt HIST_VERIFY # Don't execute immediately upon history expansion. +setopt HIST_BEEP # Beep when accessing nonexistent history. + + +# Prompt + +PS1="(%*) %F{green}%n%f@%F{magenta}%m%f %F{blue}%B%~%b%f %# " # https://wiki.gentoo.org/wiki/Zsh/Guide#Prompts + + +# Other settings + +setopt autocd # Change directory without typing "cd" in front of it. + + +zstyle ':completion:*' rehash true # Find new executables for autcompletion