Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

recent updates

  • Loading branch information...
commit 0ed99f8fb34483bef7ada5321d584c60b0696461 1 parent 9012bfe
@vijaydev authored
Showing with 159 additions and 13 deletions.
  1. +28 −2 bashrc
  2. +15 −2 gitconfig
  3. +18 −3 irbrc
  4. +8 −0 railsrc
  5. +90 −6 vimrc
View
30 bashrc
@@ -102,7 +102,7 @@ if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
-export PATH=$PATH:/opt/ruby-enterprise-1.8.7-2010.02/bin
+export PATH=/home/vijay/projects/github/scripts:/opt/ruby-enterprise-1.8.7-2010.02/bin:$PATH
export GEMPATH=$GEMPATH:/opt/ruby-enterprise-1.8.7-2010.02/bin
alias gph="git push"
@@ -113,10 +113,35 @@ alias gdfc="git diff --color-words"
alias gss="git status"
alias rdm="rake db:migrate"
alias open='gnome-open'
+alias tv='cd /home/vijay/projects/twitvance'
+alias rg='cd /home/vijay/projects/github/lifo-docrails/railties/guides/source'
+alias rs='cd /home/vijay/projects/github/rails-rails'
+alias rd='cd /home/vijay/projects/github/lifo-docrails'
+alias rgg='rake generate_guides'
alias 'ps?'='ps aux | grep'
alias 'makemp3'='mplayer -ao pcm -vo null -vc dummy -dumpaudio -dumpfile'
alias sudo='sudo env PATH=$PATH'
-
+alias sai='sudo apt-get install'
+alias sc='cd /home/vijay/projects/github/scripts'
+alias rr='rake routes'
+alias rjw='rake jobs:work'
+alias ack='ack-grep'
+alias crd='cap review deploy'
+alias cpd='cap production deploy'
+alias cpdp='cap production deploy:pending'
+alias cpdm='cap production deploy:migrations'
+alias prodn='git co production && git merge master'
+alias live='prodn && gph && crd && cpd'
+alias gsmu='git submodule sync && git submodule update'
+alias gsu='git submodule update'
+alias bi='bundle install'
+alias arec='cd activerecord'
+alias asup='cd activesupport'
+alias ares='cd activeresource'
+alias mdocrails='rs && ruby /home/vijay/projects/github/scripts/merge_docrails.rb'
+alias gprm='git pull rails master'
+alias png='ping google.com'
+alias rubyt='ruby -Ilib -Itest'
export EDITOR=vim
source $HOME/.git-completion.sh
@@ -140,3 +165,4 @@ parse_git_branch() {
}
PS1="${debian_chroot:+($debian_chroot)}[\w\$(parse_git_branch)]$ "
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
+[ -f ~/.bundler-exec.sh ] && source ~/.bundler-exec.sh
View
17 gitconfig
@@ -28,20 +28,33 @@
ds = diff --stat
au = add -u
s = show -s --pretty='tformat:%h (%s, %ad)' --date=short
- l = log --oneline --no-merges
+ l = log --oneline
+ ln = log --oneline --no-merges
logs = log --stat
logp = log -p
unadd = reset HEAD
+ hh = reset --hard ORIG_HEAD
dd = checkout @{-1}
+ shorten = "!bash -c 'curl -i http://git.io -F url=$1' -"
[apply]
whitespace = fix
[help]
- autocorrect = 1
+ autocorrect = 0
[diff]
mnemonicprefix = true
+ tool = diffmerge
[push]
default = tracking
[advice]
statusHints = false
[core]
excludesfile = /home/vijay/.gitignore
+[rerere]
+ enabled = 1
+[merge]
+ tool = diffmerge
+[mergetool "diffmerge"]
+ cmd = diffmerge --merge\n--result=$MERGED $LOCAL $BASE $REMOTE
+ trustExitCode = true
+[difftool "diffmerge"]
+ cmd = diffmerge $LOCAL $REMOTE
View
21 irbrc
@@ -4,7 +4,22 @@ require 'wirble'
Wirble.init
Wirble.colorize
-require 'logger'
-if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
- Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(STDOUT))
+class Class
+ def descendants
+ ObjectSpace.each_object(::Class).select { |c| c < self }
+ end
+end
+
+#require 'logger'
+#if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
+# Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(STDOUT))
+#end
+
+railsrc_path = File.expand_path('~/.railsrc')
+if ( ENV['RAILS_ENV'] || defined? Rails ) && File.exist?( railsrc_path )
+ begin
+ load railsrc_path
+ rescue Exception
+ warn "Could not load: #{ railsrc_path }" # because of $!.message
+ end
end
View
8 railsrc
@@ -26,3 +26,11 @@ end
def sql_ex(query)
ActiveRecord::Base.connection.execute(query)
end
+
+def show_tables
+ sql_ex("show tables").map.flatten
+end
+
+def show_cols(klass)
+ klass.columns.map(&:name).sort
+end
View
96 vimrc
@@ -19,9 +19,9 @@ set previewheight=50
" hack from here http://stackoverflow.com/questions/3712725/can-i-change-vim-completion-preview-window-height
au BufEnter ?* call PreviewHeightWorkAround()
func PreviewHeightWorkAround()
- if &previewwindow
- exec 'setlocal winheight='.&previewheight
- endif
+ if &previewwindow
+ exec 'setlocal winheight='.&previewheight
+ endif
endfunc
set wildmenu " auto complete commands
set wildmode=list:longest,full
@@ -42,11 +42,13 @@ set tabstop=2
set backspace=indent,eol,start
set history=100
set hidden
-set tabpagemax=30
+set tabpagemax=60
set dir=/home/vijay/.vim/backup
+set scrolloff=5
set backupdir=/home/vijay/.vim/backup
-" TODO check how to add %{fugitive#statusline()} to statusline
+"set undofile
+"set undodir=/home/vijay/.vim_undo
let mapleader=","
syntax on
@@ -55,10 +57,15 @@ filetype indent on
filetype plugin on
let NERDTreeIgnore=['^\.class$', '^\.old$']
+" Dont show Press ? for help
+let NERDTreeMinimalUI = 1
+" Use nicer arrows in the tree
+let NERDTreeDirArrows = 1
"let NERDTreeShowLineNumbers=1
-map <F4> :set nohls!<CR>:set nohls?<CR>
+"map <F6> :set nohls!<CR>:set nohls?<CR>
map <F3> :set nonu!<CR>:set nonu?<CR>
+map <F5> :set nolist!<CR>:set nolist?<CR>
noremap <S-tab> <C-b>
noremap <tab> <C-f>
@@ -67,18 +74,25 @@ noremap <space> <C-f>
nmap <C-c> :CommandT<CR>
nmap <C-d> :NERDTreeToggle<CR>
map <C-b> :TlistToggle<CR>
+
map <C-z> <Esc>:w<CR>
cmap w!! w !sudo tee % >/dev/null
nnoremap <leader>p :bp<CR>
nnoremap <leader>n :bn<CR>
+" switch betn last two buffers: https://github.com/krisleech/vimfiles/blob/master/vimrc
+nnoremap <leader><leader> <c-^>
+
+imap <C-l> <Space>=><Space>
nnoremap <C-j> ddpkJ
nnoremap <C-t> bi<tt><ESC>f i</tt><ESC>
nnoremap <C-p> bi+<ESC>ea+<ESC>
nnoremap <CR> o<ESC>
+nnoremap <Leader>s :%s//<left>
+
:command WQ wq
:command Wq wq
:command W w
@@ -87,11 +101,14 @@ nnoremap <CR> o<ESC>
:command Wqa wqa
"autocmd BufWritePre *.rb :%s/\s\+$//
+"autocmd InsertEnter * highlight LineNr ctermbg=red guibg=red
+"autocmd InsertLeave * highlight LineNr ctermbg=black guibg=black
" persist folds
" http://princ3.wordpress.com/2007/01/26/automaticaly-save-foldings-in-vim/
au BufWinLeave * silent! mkview
au BufWinEnter * silent! loadview
+
let Tlist_Ctags_Cmd = "/usr/bin/ctags"
let g:gist_detect_filetype = 1
@@ -111,3 +128,70 @@ function! TwiddleCase(str)
return result
endfunction
vnoremap ~ ygv"=TwiddleCase(@")<CR>Pgv
+
+" Copied from https://github.com/oinak/dotvim/blob/master/.vimrc
+function! StripWhitespace()
+ exec ':%s/ \+$//'
+endfunction
+map <leader>sw :call StripWhitespace()<CR>
+
+nmap <leader>m <C-w><C-w>_
+
+" https://bitbucket.org/sjl/dotfiles/src/1b6ffba66e9f/vim/.vimrc
+nnoremap D d$
+nnoremap Y y$
+" Keep search matches in the middle of the window.
+nnoremap n nzzzv
+nnoremap N Nzzzv
+
+" Copy full buffer to OS clipboard.
+function! CopyAll()
+ normal mzggVG"+y'z
+ call Say("Copied.")
+endfunction
+map <leader>a :call CopyAll()<CR>
+
+" Delete buffer contents and Paste from OS clipboard.
+function! PasteFromClipboard()
+ normal ggVGd"+p1G
+ "call Say("Pasted.")
+endfunction
+command B call PasteFromClipboard()
+
+"fold tag
+nnoremap <leader>ft Vatzf
+
+nnoremap <leader>tn :tabnew<CR>
+
+" Tab switching like firefox
+map <leader>] gt
+map <leader>[ gT
+map <leader>1 1gt
+map <leader>2 2gt
+map <leader>3 3gt
+map <leader>4 4gt
+map <leader>5 5gt
+map <leader>6 6gt
+map <leader>7 7gt
+map <leader>8 8gt
+map <leader>9 9gt
+map <leader>0 :tablast<CR>
+
+nnoremap <silent> j gj
+nnoremap <silent> k gk
+vnoremap <silent> j gj
+vnoremap <silent> k gk
+
+"
+set dictionary=/usr/share/dict/words
+
+set foldmethod=syntax
+augroup ft_ruby
+ au!
+ au Filetype ruby setlocal foldmethod=syntax
+augroup END
+
+set cursorline
+set virtualedit+=block
+
+nnoremap <leader><space> :nohls<cr>
Please sign in to comment.
Something went wrong with that request. Please try again.