Skip to content

Commit

Permalink
tons of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Francisco J committed Apr 25, 2012
1 parent 6bb0c67 commit b06c589
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 31 deletions.
9 changes: 7 additions & 2 deletions Rakefile
Expand Up @@ -9,6 +9,11 @@ namespace :install do
install("ruby")
end

desc "Misc dotfiles"
task :misc do
install("misc")
end

desc "Install git related dotfiles"
task :git => "generate:gitconfig" do
install("git")
Expand All @@ -22,11 +27,11 @@ namespace :install do
desc "Install shell related dotfiles"
task :shell do
install("zsh")

#install oh-my-zsh
system %Q{rm -rf "$HOME/.oh-my-zsh"}
system %Q{/usr/bin/env git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh}

#Add customization to oh-my-zsh
replace_file("oh-my-zsh/custom/functions.zsh", true)
replace_file("oh-my-zsh/custom/completion.zsh", true)
Expand Down
2 changes: 2 additions & 0 deletions bash/bashrc
@@ -1 +1,3 @@
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
41 changes: 31 additions & 10 deletions gvimrc/vimrc
Expand Up @@ -6,7 +6,7 @@ set nocompatible
filetype off " Asked by Vundle

" ******************************************************************************
" Setup vundler and plugins
" Setup Vundle and plugins
" ******************************************************************************
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Expand Down Expand Up @@ -59,13 +59,23 @@ Bundle 'tpope/vim-bundler'

" Testing stuff "{{{
Bundle 'xolox/vim-notes'
Bundle 'jgdavey/tslime.vim'
Bundle 'jgdavey/vim-turbux'
Bundle 'tomtom/tlib_vim'
Bundle 'tomtom/tselectbuffer_vim'
Bundle 'vim-scripts/TailMinusF'
"}}}

" ******************************************************************************
" Make it pretty
" ******************************************************************************
set background=light
if !has('gui_running')
set background=light
let g:solarized_termtrans = 1
endif

colorscheme solarized

set guioptions=ac
set number
set cursorline
Expand All @@ -89,7 +99,8 @@ let g:notes_directory = '~/Documents/Notes'
let g:easytags_cmd = "/usr/local/bin/ctags"
" Use solarized to highlight trailing white spaces
let g:solarized_hitrail = 1

" Don't mess with yankring
let g:yankring_manual_clipboard_check = 1
"}}}

" Filetype highlighting and indentation activation"{{{
Expand Down Expand Up @@ -140,6 +151,13 @@ set ignorecase
set smartcase
"}}}

" Folding "{{{
set foldmethod=indent
set foldnestmax=10
set nofoldenable
set foldlevel=1
"}}}

" Don't forget to set missing ft for Ruby files
au BufRead,BufNewFile {caprc,autotest,.caprc} set ft=ruby

Expand All @@ -162,9 +180,7 @@ autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1

" Some extras to rails.vim "{{{
autocmd User Rails Rnavcommand steps features/step_definitions -glob=**/*
autocmd User Rails Rnavcommand routes config -glob=*.* -suffix= -default=routes.rb
autocmd User Rails Rnavcommand initializer config/initializers -glob=**/*
autocmd User Rails Rnavcommand factories spec test -glob=**/* -default=factories
autocmd User Rails Rnavcommand factories spec test -glob=factories/* -default=factories
"}}}
" ******************************************************************************
" Some custom key mapping
Expand All @@ -177,12 +193,15 @@ map <silent> <F2> :FixWhitespace<CR>
map <silent> ,n :noh<CR>
nnoremap <silent> ,<space> :NERDTreeToggle<CR>
noremap ,a :Ack<space>
map <Leader>e :e <C-R>=expand("%:p:h") . "/" <CR>
map <Leader>te :tabe <C-R>=expand("%:p:h") . "/" <CR>
map ,e :e <C-R>=expand("%:p:h") . "/" <CR>
map ,te :tabe <C-R>=expand("%:p:h") . "/" <CR>
map ,v <C-w>r
map ,s <C-w>s
nmap Q gqq
"}}}
" VIMRC mappings"{{{
nmap <silent> ,ev :e $MYVIMRC
nmap <silent> ,sv :so $MYVIMRC
nmap <silent> ,,ev :e $MYVIMRC
nmap <silent> ,,sv :so $MYVIMRC
"}}}
" Code indenting"{{{
imap ,f <Esc> mmgg=G`m^
Expand All @@ -207,6 +226,8 @@ nmap <C-Left> <C-W><<C-W><
nmap <C-Right> <C-W>><C-W>>
nmap <C-Up> <C-W>+<C-W>+
nmap <C-Down> <C-W>-<C-W>-
noremap ,b :TSelectBuffer<CR>
inoremap ,b <C-o>:TSelectBuffer<CR>
"}}}
" Tabularize mappings"{{{
nmap <silent> ,a= :Tabularize /=<CR>
Expand Down
38 changes: 38 additions & 0 deletions misc/tmux
@@ -0,0 +1,38 @@
set -g default-terminal screen-256color
bind R source-file ~/.tmux.conf \; display-message " Config reloaded..."

set -g mode-keys vi
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection

# Status colors
set -g status-bg black
set -g status-fg white
set -g status-left '#[fg=green]#H'
set-window-option -g window-status-current-bg red

# Right status
set -g status-right '#[fg=yelow]#(uptime | cut -d ":" -f4-)'

# Activity monitor
setw -g monitor-activity on
set -g visual-activity on
# Don't rename the windows
setw -g automatic-rename off

# Set movement keys as in Vim
unbind h
bind h select-pane -L
unbind j
bind j select-pane -D
unbind k
bind k select-pane -U
unbind l
bind l select-pane -R

# Go to last selected window
bind-key C-a last-window
22 changes: 11 additions & 11 deletions oh-my-zsh/custom/functions.zsh
@@ -1,29 +1,29 @@
function c(){
cd /projects/$1;
cd /projects/$1;
}

function v(){
cd /projects/$1;
cd /projects/$1;
mvim;
}

function h(){
cd ~/$1;
cd ~/$1;
}


# Completion functions

function _rake_tasks_completion(){
if [ -f Rakefile ]; then
recent=`last_modified .rake_tasks~ Rakefile **/*.rake`
if [[ $recent != '.rake_tasks~' ]]; then
rake --silent --tasks | cut -d " " -f 2 > .rake_tasks~
fi
compadd `cat .rake_tasks~`
fi
if [ -f Rakefile ]; then
recent=`last_modified .rake_tasks~ Rakefile **/*.rake`
if [[ $recent != '.rake_tasks~' ]]; then
rake --silent --tasks | cut -d " " -f 2 > .rake_tasks~
fi
compadd `cat .rake_tasks~`
fi
}

function last_modified(){
ls -t $* 2> /dev/null | head -n 1
ls -t $* 2> /dev/null | head -n 1
}
24 changes: 24 additions & 0 deletions others/config/schedule.rb
@@ -0,0 +1,24 @@
# Use this file to easily define all of your cron jobs.
#
# It's helpful, but not entirely necessary to understand cron before proceeding.
# http://en.wikipedia.org/wiki/Cron

# Example:
#
# set :output, "/path/to/my/cron_log.log"
#
# every 2.hours do
# command "/usr/bin/some_great_command"
# runner "MyModel.some_method"
# rake "some:great:rake:task"
# end
#
# every 4.days do
# runner "AnotherModel.prune_old_records"
# end

# Learn more: http://github.com/javan/whenever

every 1.day, at: '15:00' do
command "logrotate --state=/tmp/logrotate.state /projects/dot-files/others/logrotate.conf"
end
6 changes: 6 additions & 0 deletions others/logrotate.conf
@@ -0,0 +1,6 @@
/projects/*/log/*.log {
daily
missingok
rotate 2
copytruncate
}
14 changes: 7 additions & 7 deletions ruby/irbrc
@@ -1,9 +1,9 @@
#!/usr/bin/ruby

require 'rubygems'
require 'pry'

# Use pry for the console if it exists
Pry.start

exit
# require 'rubygems'
# require 'pry'
#
# # Use pry for the console if it exists
# Pry.start
#
# exit
4 changes: 3 additions & 1 deletion zsh/zshrc
Expand Up @@ -33,11 +33,13 @@ alias annotate="annotate --exclude tests,fixtures --position after --show-indexe
alias be="bundle exec"
alias rst="touch tmp/restart.txt"
alias git="hub"
alias cu='cucumber'
alias cu='bundle exec cucumber'

alias rvmnginx='rvmsudo /opt/nginx/sbin/nginx'
alias nginxconf='_ mvim /opt/nginx/conf/nginx.conf'
alias redisserv='redis-server /usr/local/etc/redis.conf'

alias less=$PAGER
alias zless=$PAGER

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

0 comments on commit b06c589

Please sign in to comment.