diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..c9ca168 --- /dev/null +++ b/.vimrc @@ -0,0 +1,159 @@ +call pathogen#infect() " Call pathogen to enable the plugins in ~/.vim/bundle +call pathogen#helptags() + +filetype plugin on " Enable filetype plugins + +if &diff + colorscheme zellner +endif +set nocompatible +set hidden " Allow buffer switching without saving +set backup " Make a backup of the file before saving +set backupdir=~/.vim/backup " Directory to write backups to (should exist) +set directory=~/.vim/tmp " No more .sw[a-z] (swap) files all over the place (should exist) +set history=1000 " Save a lot of history (default is 20) +if has('persistent_undo') + set undofile " Use persistent undo file + set undodir=~/.vim/undo " Directory to write undo files to (should exist) + set undolevels=1000 " Maximum number of changes that can be undone + set undoreload=10000 " Maximum number of lines to save for undo on buffer reload +endif + +set tabstop=2 " Number of spaces that equals a tab +set shiftwidth=2 " Number of spaces to shift (e.g. >> and <<) with +set expandtab " Insert spaces instead of tabs +set autoindent " Automatically indent to the previous lines' indent level + +set visualbell " Use visual bell instead of a beep +set ttyfast " Let vim know we have a fast terminal, regardless of $TERM + +set encoding=utf-8 " Set default file encoding to utf-8 +set paste " Set paste on +"colorscheme solarized " Use solarized color scheme +set background=light " With a dark background +syntax on " Enable/Disable syntax highlighting +"set relativenumber " Show relative line numbers from current line (instead of `set nu`) +"set number +set cursorline " Highlight current line +highlight clear SignColumn " Make 'gutter' background match buffer background +set listchars=tab:▸\ ,eol:¬ " Characters to use for tabs and newlines for `set list` +set laststatus=2 " Always display the powerline statusline +set noshowmode " Hide the default mode text (e.g. '-- INSERT --') below the status line +set clipboard=unnamed +set backspace=2 +"set mouse=a +" highlight trailing whitespace in red, but not on the line we're typing +highlight TrailingWhitespace ctermbg=red guibg=red +match TrailingWhitespace /\s\+$/ +au InsertEnter * match TrailingWhitespace /\s\+\%#\@ ; q: +noremap e :NERDTreeFind +noremap :NERDTreeToggle +" Bind vs to setup a vsplit buffer, scrolling 'below' the current buffer +noremap vs :let @z=&so:set so=0 noscb:bo vsLjzt:setl scbp:setl scb:let &so=@z +" Go down to next row, instead of next line +nnoremap j gj +" Go up to previous row, instead of previous line +nnoremap k gk +" Bind Y to yank from the cursor to the end of the line +nnoremap Y y$ + +if has("autocmd") + " Restore cursor position + autocmd BufReadPost * + \ if line("'\"") > 1 && line("'\"") <= line("$") | + \ exe "normal! g`\"" | + \ endif + + " Set filetype to arduino on .pde files + autocmd! BufNewFile,BufRead *.pde setlocal ft=arduino + + " Change tab settings some file types + autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 + autocmd FileType rust setlocal tabstop=4 shiftwidth=4 softtabstop=4 + + " Enable omni completion. + autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS + autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags + autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS + autocmd FileType python setlocal omnifunc=pythoncomplete#Complete + autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags + autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete + autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc + + " Automatically invoke clang-format on buffer write + au FileType c ClangFormatAutoEnable +endif + +" Keep wrapped lines indented +if v:version > 704 || v:version == 704 && has("patch338") + set breakindent +endif + +" key bindings for fugitive +nnoremap gs :Gstatus +nnoremap gd :Gdiff +nnoremap gc :Gcommit -v +nnoremap gb :Gblame + +" key bindings for tabularize +nnoremap a= :Tabularize /= +vnoremap a= :Tabularize /= +nnoremap a: :Tabularize /: +vnoremap a: :Tabularize /: +nnoremap a :Tabularize / +vnoremap a :Tabularize / + +" Airline +let g:airline_powerline_fonts = 1 " Try to use powerline fonts +let g:airline#extensions#branch#enabled = 1 " fugitive integration +let g:airline#extensions#syntastic#enabled = 1 " syntastic integration +let g:airline#extensions#hunks#enabled = 1 " show a summary of changed hunks +let g:airline#extensions#hunks#non_zero_only = 0 " show only non-zero hunks +let g:airline#extensions#hunks#hunk_symbols = ['+', '~', '-'] " hunk count symbols + +" Syntastic +let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck'] + +" vim-go +" Enable goimports to automatically insert import paths instead of gofmt +let g:go_fmt_command = "goimports" +" More syntax highlighting +let g:go_highlight_functions = 1 +let g:go_highlight_methods = 1 +let g:go_highlight_structs = 1 +let g:go_highlight_operators = 1 +let g:go_highlight_build_constraints = 1 + +" YouCompleteMe extra_conf whitelist/blacklist +let g:ycm_extra_conf_globlist = ['~/dev/*','~/sync/dev/*','!~/*'] diff --git a/.zsh.d/00-path.zsh b/.zsh.d/00-path.zsh new file mode 100644 index 0000000..85c31df --- /dev/null +++ b/.zsh.d/00-path.zsh @@ -0,0 +1,6 @@ +for dir in /usr/bin /usr/sbin /sbin /bin /Users/snarbutas/Desktop/sqlline-master/bin /Users/snarbutas/temp/platform-tools; do + if test -d "$dir" && ! grep -q -e "^${dir}:" -e ":${dir}:" -e ":${dir}" <<< $PATH; then + PATH="${dir}:${PATH}" + fi +done +export PATH diff --git a/.zsh.d/10-rust.zsh b/.zsh.d/10-rust.zsh new file mode 100644 index 0000000..1050979 --- /dev/null +++ b/.zsh.d/10-rust.zsh @@ -0,0 +1,3 @@ +if test -d "$HOME/.cargo/bin"; then + export PATH="${PATH}:$HOME/.cargo/bin" +fi diff --git a/.zsh.d/11-go.zsh b/.zsh.d/11-go.zsh new file mode 100644 index 0000000..7754670 --- /dev/null +++ b/.zsh.d/11-go.zsh @@ -0,0 +1,4 @@ +if which go 2>&1 > /dev/null; then + export GOPATH=~/Documents/dev/go + export PATH=${PATH}:${GOPATH}/bin +fi diff --git a/.zsh.d/15-ruby.zsh b/.zsh.d/15-ruby.zsh new file mode 100644 index 0000000..3e2f369 --- /dev/null +++ b/.zsh.d/15-ruby.zsh @@ -0,0 +1,5 @@ +for dir in ~/.rbenv/bin ~/.rbenv/shims ~/.gem/ruby/*/bin(ocN); do + if test -d "$dir"; then + export PATH="${PATH}:${dir}" + fi +done diff --git a/.zsh.d/20-aliases.zsh b/.zsh.d/20-aliases.zsh new file mode 100644 index 0000000..957af37 --- /dev/null +++ b/.zsh.d/20-aliases.zsh @@ -0,0 +1,19 @@ +if ls --color=auto >&/dev/null; then + alias ls='ls -F --color=auto' +else + alias ls='ls -F' +fi +alias ll='ls -ltrh' + +if grep --color=auto >&/dev/null; then + alias grep='grep --color=auto' + alias egrep='egrep --color=auto' +fi + +if which vim > /dev/null; then + alias vi='vim' +fi + +alias find='noglob find' +alias git='noglob git' +alias history='history -100' diff --git a/.zsh.d/20-ssh.zsh b/.zsh.d/20-ssh.zsh new file mode 100644 index 0000000..7f8412c --- /dev/null +++ b/.zsh.d/20-ssh.zsh @@ -0,0 +1,13 @@ +PWDID=6731738634759616518 +BID=snarbutas@BOLCOM.NET +function ssh() { + if ! kswitch -p "$BID"; then + lpass show --password "$PWDID" | kinit --password-file=STDIN "$BID" + elif klist -l | grep "*"|grep Expired; then + lpass show --password "$PWDID" | kinit --password-file=STDIN "$BID" + fi + eval TERM=screen `/usr/bin/which ssh` $* +} +decrypt () { + ssh -qtt shd-puppet-server-001.bolcom.net "sudo /opt/puppetlabs/bin/puppetserver ruby /var/lib/puppetserver/jruby-gems/gems/hiera-eyaml-2.1.0/bin/eyaml decrypt -s "${1}" 2>/dev/null" +}