From 2228c5896e63b4ae234cb5e124099486b07e1b4d Mon Sep 17 00:00:00 2001 From: Marcos Ronaldo Date: Wed, 2 Dec 2015 20:35:32 -0200 Subject: [PATCH] first commit --- .gitignore | 2 + config/.bashrc | 172 +++++++++++++++++++++++++++++++ config/.gitconfig | 19 ++++ config/.tmux.conf | 1 + config/.vimrc | 117 +++++++++++++++++++++ config/setup_config.sh | 17 +++ noosfero_environment/Vagrantfile | 31 ++++++ noosfero_environment/start | 22 ++++ 8 files changed, 381 insertions(+) create mode 100644 .gitignore create mode 100644 config/.bashrc create mode 100644 config/.gitconfig create mode 100644 config/.tmux.conf create mode 100644 config/.vimrc create mode 100755 config/setup_config.sh create mode 100644 noosfero_environment/Vagrantfile create mode 100755 noosfero_environment/start diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6a9419f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.swp +.vim/ diff --git a/config/.bashrc b/config/.bashrc new file mode 100644 index 0000000..b977bba --- /dev/null +++ b/config/.bashrc @@ -0,0 +1,172 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +parse_git_branch() { + git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' + } + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \[\033[0;31m\]$(parse_git_branch)\[\033[0;33m\]\$\[\033[00m\] ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\[\033[0;31m\]$(parse_git_branch)\[\033[0;33m\]\$\[\033[00m\] ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + alias la='ls -la' + alias ~='cd ~' + alias cd..='cd ..' + alias ..='cd ..' + alias .2='cd ../..' + alias .3='cd ../../..' + alias .4='cd ../../../..' + alias .5='cd ../../../../..' + alias path='echo -e ${PATH//:/\\n}' + alias sudoe='sudo -E' + alias svi='sudoe vim' + alias edit='vim' + alias mv='mv -i' + alias cp='cp -i' + alias ln='ln -i' + alias rm='rm -i' + + alias histg="history | grep" + + alias grep='grep --color=auto' + #alias fgrep='fgrep --color=auto' + #alias egrep='egrep --color=auto' + + alias update='sudo apt-get update' + +fi + +# colored GCC warnings and errors +#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# some more ls aliases +#alias ll='ls -l' +#alias la='ls -A' +#alias l='ls -CF' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi + +function extract { + if [ -z "$1" ]; then + # display usage if no parameters given + echo "Usage: extract ." + else + if [ -f $1 ] ; then + # NAME=${1%.*} + # mkdir $NAME && cd $NAME + case $1 in + *.tar.bz2) tar xvjf ../$1 ;; + *.tar.gz) tar xvzf ../$1 ;; + *.tar.xz) tar xvJf ../$1 ;; + *.lzma) unlzma ../$1 ;; + *.bz2) bunzip2 ../$1 ;; + *.rar) unrar x -ad ../$1 ;; + *.gz) gunzip ../$1 ;; + *.tar) tar xvf ../$1 ;; + *.tbz2) tar xvjf ../$1 ;; + *.tgz) tar xvzf ../$1 ;; + *.zip) unzip ../$1 ;; + *.Z) uncompress ../$1 ;; + *.7z) 7z x ../$1 ;; + *.xz) unxz ../$1 ;; + *.exe) cabextract ../$1 ;; + *) echo "extract: '$1' - unknown archive method" ;; + esac + else + echo "$1 - file does not exist" + fi +fi +} + +export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting +source $HOME/.rvm/scripts/rvm + diff --git a/config/.gitconfig b/config/.gitconfig new file mode 100644 index 0000000..91c3cdf --- /dev/null +++ b/config/.gitconfig @@ -0,0 +1,19 @@ +[user] + name = Marcos Ronaldo + email = marcos.rpj2@gmail.com +[alias] + le = log --oneline --decorate + ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat + ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate + ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative + co = checkout + ec = config --global -e + up = !git pull --rebase --prune + cob = checkout -b + cm = !git add -A && git commit + save = !git add -A && git commit -m 'SAVEPOINT' + undo = reset HEAD~1 --mixed + amend = commit -a --amend + wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard + #bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs -r git branch -d; }; f" + #bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f" diff --git a/config/.tmux.conf b/config/.tmux.conf new file mode 100644 index 0000000..cac0f5b --- /dev/null +++ b/config/.tmux.conf @@ -0,0 +1 @@ +set-option -g prefix C-a diff --git a/config/.vimrc b/config/.vimrc new file mode 100644 index 0000000..bcc8e39 --- /dev/null +++ b/config/.vimrc @@ -0,0 +1,117 @@ +" put this line first in ~/.vimrc +set nocompatible | filetype indent plugin on | syn on + +fun! SetupVAM() + let c = get(g:, 'vim_addon_manager', {}) + let g:vim_addon_manager = c + let c.plugin_root_dir = expand('$HOME', 1) . '/.vim/vim-addons' + + " Force your ~/.vim/after directory to be last in &rtp always: + " let g:vim_addon_manager.rtp_list_hook = 'vam#ForceUsersAfterDirectoriesToBeLast' + + " most used options you may want to use: + " let c.log_to_buf = 1 + " let c.auto_install = 0 + let &rtp.=(empty(&rtp)?'':',').c.plugin_root_dir.'/vim-addon-manager' + if !isdirectory(c.plugin_root_dir.'/vim-addon-manager/autoload') + execute '!git clone --depth=1 https://github.com/MarcWeber/vim-addon-manager ' + \ shellescape(c.plugin_root_dir.'/vim-addon-manager', 1) + endif + + " This provides the VAMActivate command, you could be passing plugin names, too + call vam#ActivateAddons(["ctrlp", "The_NERD_tree", "Syntastic"], {}) +endfun +call SetupVAM() + +set nu +set paste +set tabstop=2 +set expandtab +set softtabstop=2 +set shiftwidth=2 +set autoindent +set cindent + +set ignorecase + +set noswapfile +set nobackup +set nowritebackup + +autocmd BufWritePre * :%s/\s\+$//e + +" NERDTree +autocmd StdinReadPre * let s:std_in=1 +autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif +map :NERDTreeToggle +autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif +let g:NERDTreeIgnore = ['\.pyc$'] + +" CtrlP config +let g:ctrlp_map = '' +let g:ctrlp_cmd = 'CtrlP' +let g:ctrlp_working_path_mode = 'ra' +set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc " MacOSX/Linux +let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$' + + +set shellcmdflag=-ic + +set laststatus=2 + +set hlsearch + +function! StripTrailingWhitespaces() + " Preparation: save last search, and cursor position. + let _s=@/ + let l = line(".") + let c = col(".") + " Do the business: + %s/\s\+$//e + " Clean up: restore previous search history, and cursor position + let @/=_s + call cursor(l, c) +endfunction + +nnoremap :call StripTrailingWhitespaces() +autocmd BufWritePre *.py,*.js :call StripTrailingWhitespaces() + +let g:tex_flavor = "latex" + +let g:user_emmet_install_global = 0 +autocmd FileType html,css EmmetInstall +let g:user_emmet_mode='a' "enable all function in all mode. + +autocmd QuickFixCmdPost *grep* cwindow + +" The following items are available options, but do not need to be +" included in your .vimrc as they are currently set to their defaults. +set backspace=indent,eol,start +set encoding=UTF-8 + +set laststatus=2 +set linespace=0 +"let g:airline_theme = 'badwolf' +let g:airline_theme = 'wombat' +let g:airline_powerline_fonts = 1 +let g:airline#extensions#hunks#enabled = 0 +let g:airline#extensions#branch#enabled = 1 +let g:airline#extensions#tabline#enabled = 1 + +let g:gitgutter_override_sign_column_highlight = 0 +set modelines=1 + +" Make tab in v mode work like I think it should (keep highlighting): +vmap >gv +vmap