Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: thoughtbot/dotfiles
...
head fork: morganick/dotfiles
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 12 commits
  • 6 files changed
  • 0 commit comments
  • 3 contributors
View
2  README.md
@@ -4,7 +4,7 @@ thoughtbot dotfiles
Install
-------
-First, [fork this repo](https://github.com/thoughtbot/dotfiles#fork_box) on Github.
+First, [fork this repo](https://github.com/thoughtbot/dotfiles/fork_select) on Github.
Then, clone your Github fork (replace "your-github-name" with your Github name) onto your laptop and install it:
View
20 aliases
@@ -1,3 +1,6 @@
+# Todo
+alias todo='$EDITOR ~/.todo'
+
# Unix
alias tlf="tail -f"
alias ln='ln -v'
@@ -15,13 +18,13 @@ alias -g ONE="| awk '{ print \$1}'"
alias g="git"
alias gci="git pull --rebase && rake && git push"
-# Ruby
-alias help-strftime='ruby ~/bin/help-strftime.rb'
-
# Bundler
alias b="bundle"
alias be="bundle exec"
alias bake="bundle exec rake"
+
+# Tests and Specs
+alias t="ruby -I test"
alias s="bundle exec rspec"
alias cuc="bundle exec cucumber"
@@ -36,18 +39,23 @@ alias remongrate="bundle exec rake mongoid:migrate mongoid:migrate:redo"
# Heroku staging
alias staging='heroku run console --remote staging'
+alias staging-name='echo `basename $PWD`-staging'
alias staging-process='watch heroku ps --remote staging'
alias staging-releases='heroku releases --remote staging'
alias staging-tail='heroku logs --tail --remote staging'
# Heroku production
alias production='heroku run console --remote production'
+alias production-name='echo `basename $PWD`-production'
alias production-process='watch heroku ps --remote production'
alias production-releases='heroku releases --remote production'
alias production-tail='heroku logs --tail --remote production'
# Heroku databases
-alias db-pull-staging='heroku db:pull --remote staging --confirm `basename $PWD`-staging'
-alias db-pull-production='heroku db:pull --remote production --confirm `basename $PWD`-production'
-alias db-copy-production-to-staging='heroku pgbackups:restore DATABASE `heroku pgbackups:url --remote production` --remote staging --confirm `basename $PWD`-staging'
+alias db-pull-staging='heroku db:pull --remote staging --confirm `staging-name`'
+alias db-pull-production='heroku db:pull --remote production --confirm `production-name`'
+alias db-copy-production-to-staging='heroku pgbackups:restore DATABASE `heroku pgbackups:url --app production-name` --app `staging-name` --confirm `staging-name`'
alias db-backup-production='heroku pgbackups:capture --remote production'
+
+# Network
+alias whats-my-ip="curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+'"
View
1,264 vim/autoload/rails.vim
599 additions, 665 deletions not shown
View
192 vim/colors/vividchalk.vim
@@ -0,0 +1,192 @@
+" Vim color scheme
+" Name: vividchalk.vim
+" Author: Tim Pope <vimNOSPAM@tpope.info>
+" Version: 2.0
+" GetLatestVimScripts: 1891 1 :AutoInstall: vividchalk.vim
+
+" Based on the Vibrank Ink theme for TextMate
+" Distributable under the same terms as Vim itself (see :help license)
+
+if has("gui_running")
+ set background=dark
+endif
+hi clear
+if exists("syntax_on")
+ syntax reset
+endif
+
+let colors_name = "vividchalk"
+
+" First two functions adapted from inkpot.vim
+
+" map a urxvt cube number to an xterm-256 cube number
+fun! s:M(a)
+ return strpart("0245", a:a, 1) + 0
+endfun
+
+" map a urxvt colour to an xterm-256 colour
+fun! s:X(a)
+ if &t_Co == 88
+ return a:a
+ else
+ if a:a == 8
+ return 237
+ elseif a:a < 16
+ return a:a
+ elseif a:a > 79
+ return 232 + (3 * (a:a - 80))
+ else
+ let l:b = a:a - 16
+ let l:x = l:b % 4
+ let l:y = (l:b / 4) % 4
+ let l:z = (l:b / 16)
+ return 16 + s:M(l:x) + (6 * s:M(l:y)) + (36 * s:M(l:z))
+ endif
+ endif
+endfun
+
+function! E2T(a)
+ return s:X(a:a)
+endfunction
+
+function! s:choose(mediocre,good)
+ if &t_Co != 88 && &t_Co != 256
+ return a:mediocre
+ else
+ return s:X(a:good)
+ endif
+endfunction
+
+function! s:hifg(group,guifg,first,second,...)
+ if a:0 && &t_Co == 256
+ let ctermfg = a:1
+ else
+ let ctermfg = s:choose(a:first,a:second)
+ endif
+ exe "highlight ".a:group." guifg=".a:guifg." ctermfg=".ctermfg
+endfunction
+
+function! s:hibg(group,guibg,first,second)
+ let ctermbg = s:choose(a:first,a:second)
+ exe "highlight ".a:group." guibg=".a:guibg." ctermbg=".ctermbg
+endfunction
+
+hi link railsMethod PreProc
+hi link rubyDefine Keyword
+hi link rubySymbol Constant
+hi link rubyAccess rubyMethod
+hi link rubyAttribute rubyMethod
+hi link rubyEval rubyMethod
+hi link rubyException rubyMethod
+hi link rubyInclude rubyMethod
+hi link rubyStringDelimiter rubyString
+hi link rubyRegexp Regexp
+hi link rubyRegexpDelimiter rubyRegexp
+"hi link rubyConstant Variable
+"hi link rubyGlobalVariable Variable
+"hi link rubyClassVariable Variable
+"hi link rubyInstanceVariable Variable
+hi link javascriptRegexpString Regexp
+hi link javascriptNumber Number
+hi link javascriptNull Constant
+highlight link diffAdded String
+highlight link diffRemoved Statement
+highlight link diffLine PreProc
+highlight link diffSubname Comment
+
+call s:hifg("Normal","#EEEEEE","White",87)
+if &background == "light" || has("gui_running")
+ hi Normal guibg=Black ctermbg=Black
+else
+ hi Normal guibg=Black ctermbg=NONE
+endif
+highlight StatusLine guifg=Black guibg=#aabbee gui=bold ctermfg=Black ctermbg=White cterm=bold
+highlight StatusLineNC guifg=#444444 guibg=#aaaaaa gui=none ctermfg=Black ctermbg=Grey cterm=none
+"if &t_Co == 256
+ "highlight StatusLine ctermbg=117
+"else
+ "highlight StatusLine ctermbg=43
+"endif
+
+highlight Ignore ctermfg=Black
+highlight WildMenu guifg=Black guibg=#ffff00 gui=bold ctermfg=Black ctermbg=Yellow cterm=bold
+highlight Cursor guifg=Black guibg=White ctermfg=Black ctermbg=White
+highlight CursorLine guibg=#333333 guifg=NONE
+highlight CursorColumn guibg=#333333 guifg=NONE
+highlight ColorColumn guibg=#333333 guifg=NONE
+highlight NonText guifg=#404040 ctermfg=8
+highlight SpecialKey guifg=#404040 ctermfg=8
+highlight Directory none
+high link Directory Identifier
+highlight ErrorMsg guibg=Red ctermbg=DarkRed guifg=NONE ctermfg=NONE
+highlight Search guifg=NONE ctermfg=NONE gui=none cterm=none
+call s:hibg("Search" ,"#555555","DarkBlue",81)
+highlight IncSearch guifg=White guibg=Black ctermfg=White ctermbg=Black
+highlight MoreMsg guifg=#00AA00 ctermfg=Green
+highlight LineNr guifg=#DDEEFF ctermfg=White
+call s:hibg("LineNr" ,"#222222","DarkBlue",80)
+highlight Question none
+high link Question MoreMsg
+highlight Title guifg=Magenta ctermfg=Magenta
+highlight VisualNOS gui=none cterm=none
+call s:hibg("Visual" ,"#555577","LightBlue",83)
+call s:hibg("VisualNOS" ,"#444444","DarkBlue",81)
+call s:hibg("MatchParen","#1100AA","DarkBlue",18)
+highlight WarningMsg guifg=Red ctermfg=Red
+highlight Error ctermbg=DarkRed
+highlight SpellBad ctermbg=DarkRed
+" FIXME: Comments
+highlight SpellRare ctermbg=DarkMagenta
+highlight SpellCap ctermbg=DarkBlue
+highlight SpellLocal ctermbg=DarkCyan
+
+call s:hibg("Folded" ,"#110077","DarkBlue",17)
+call s:hifg("Folded" ,"#aaddee","LightCyan",63)
+highlight FoldColumn none
+high link FoldColumn Folded
+highlight DiffAdd ctermbg=4 guibg=DarkBlue
+highlight DiffChange ctermbg=5 guibg=DarkMagenta
+highlight DiffDelete ctermfg=12 ctermbg=6 gui=bold guifg=Blue guibg=DarkCyan
+highlight DiffText ctermbg=DarkRed
+highlight DiffText cterm=bold ctermbg=9 gui=bold guibg=Red
+
+highlight Pmenu guifg=White ctermfg=White gui=bold cterm=bold
+highlight PmenuSel guifg=White ctermfg=White gui=bold cterm=bold
+call s:hibg("Pmenu" ,"#000099","Blue",18)
+call s:hibg("PmenuSel" ,"#5555ff","DarkCyan",39)
+highlight PmenuSbar guibg=Grey ctermbg=Grey
+highlight PmenuThumb guibg=White ctermbg=White
+highlight TabLine gui=underline cterm=underline
+call s:hifg("TabLine" ,"#bbbbbb","LightGrey",85)
+call s:hibg("TabLine" ,"#333333","DarkGrey",80)
+highlight TabLineSel guifg=White guibg=Black ctermfg=White ctermbg=Black
+highlight TabLineFill gui=underline cterm=underline
+call s:hifg("TabLineFill","#bbbbbb","LightGrey",85)
+call s:hibg("TabLineFill","#808080","Grey",83)
+
+hi Type gui=none
+hi Statement gui=none
+if !has("gui_mac")
+ " Mac GUI degrades italics to ugly underlining.
+ hi Comment gui=italic
+ hi railsUserClass gui=italic
+ hi railsUserMethod gui=italic
+endif
+hi Identifier cterm=none
+" Commented numbers at the end are *old* 256 color values
+"highlight PreProc guifg=#EDF8F9
+call s:hifg("Comment" ,"#9933CC","DarkMagenta",34) " 92
+" 26 instead?
+call s:hifg("Constant" ,"#339999","DarkCyan",21) " 30
+call s:hifg("rubyNumber" ,"#CCFF33","Yellow",60) " 190
+call s:hifg("String" ,"#66FF00","LightGreen",44,82) " 82
+call s:hifg("Identifier" ,"#FFCC00","Yellow",72) " 220
+call s:hifg("Statement" ,"#FF6600","Brown",68) " 202
+call s:hifg("PreProc" ,"#AAFFFF","LightCyan",47) " 213
+call s:hifg("railsUserMethod","#AACCFF","LightCyan",27)
+call s:hifg("Type" ,"#AAAA77","Grey",57) " 101
+call s:hifg("railsUserClass" ,"#AAAAAA","Grey",7) " 101
+call s:hifg("Special" ,"#33AA00","DarkGreen",24) " 7
+call s:hifg("Regexp" ,"#44B4CC","DarkCyan",21) " 74
+call s:hifg("rubyMethod" ,"#DDE93D","Yellow",77) " 191
+"highlight railsMethod guifg=#EE1122 ctermfg=1
View
140 vim/plugin/rails.vim
@@ -1,19 +1,13 @@
" rails.vim - Detect a rails application
-" Author: Tim Pope <vimNOSPAM@tpope.info>
+" Author: Tim Pope <http://tpo.pe/>
" GetLatestVimScripts: 1567 1 :AutoInstall: rails.vim
-" URL: http://rails.vim.tpope.net/
" Install this file as plugin/rails.vim. See doc/rails.txt for details. (Grab
" it from the URL above if you don't have it.) To access it from Vim, see
" :help add-local-help (hint: :helptags ~/.vim/doc) Afterwards, you should be
" able to do :help rails
-" ============================================================================
-
-" Exit quickly when:
-" - this plugin was already loaded (or disabled)
-" - when 'compatible' is set
-if &cp || (exists("g:loaded_rails") && g:loaded_rails) && !(exists("g:rails_debug") && g:rails_debug)
+if exists('g:loaded_rails') || &cp || v:version < 700
finish
endif
let g:loaded_rails = 1
@@ -61,22 +55,17 @@ call s:SetOptDefault("rails_statusline",1)
call s:SetOptDefault("rails_syntax",1)
call s:SetOptDefault("rails_mappings",1)
call s:SetOptDefault("rails_abbreviations",1)
-call s:SetOptDefault("rails_ctags_arguments","--exclude=\"*.js\"")
-call s:SetOptDefault("rails_expensive",1)
-call s:SetOptDefault("rails_dbext",g:rails_expensive)
+call s:SetOptDefault("rails_ctags_arguments","--languages=-javascript")
call s:SetOptDefault("rails_default_file","README")
-call s:SetOptDefault("rails_default_database","")
call s:SetOptDefault("rails_root_url",'http://localhost:3000/')
call s:SetOptDefault("rails_modelines",0)
-call s:SetOptDefault("rails_menu",1)
+call s:SetOptDefault("rails_menu",0)
call s:SetOptDefault("rails_gnu_screen",1)
call s:SetOptDefault("rails_history_size",5)
-call s:SetOptDefault("rails_generators","controller\nintegration_test\nmailer\nmigration\nmodel\nobserver\nplugin\nresource\nscaffold\nsession_migration")
-if g:rails_dbext
- if exists("g:loaded_dbext") && executable("sqlite3") && ! executable("sqlite")
- " Since dbext can't find it by itself
- call s:SetOptDefault("dbext_default_SQLITE_bin","sqlite3")
- endif
+call s:SetOptDefault("rails_generators","controller\ngenerator\nhelper\nintegration_test\nmailer\nmetal\nmigration\nmodel\nobserver\nperformance_test\nplugin\nresource\nscaffold\nscaffold_controller\nsession_migration\nstylesheets")
+if exists("g:loaded_dbext") && executable("sqlite3") && ! executable("sqlite")
+ " Since dbext can't find it by itself
+ call s:SetOptDefault("dbext_default_SQLITE_bin","sqlite3")
endif
" }}}1
@@ -90,6 +79,9 @@ function! s:escvar(r)
endfunction
function! s:Detect(filename)
+ if exists('b:rails_root')
+ return s:BufInit(b:rails_root)
+ endif
let fn = substitute(fnamemodify(a:filename,":p"),'\c^file://','','')
let sep = matchstr(fn,'^[^\\/]\{3,\}\zs[\\/]')
if sep != ""
@@ -118,7 +110,7 @@ function! s:Detect(filename)
return s:BufInit(fn)
endif
let ofn = fn
- let fn = fnamemodify(ofn,':s?\(.*\)[\/]\(app\|config\|db\|doc\|features\|lib\|log\|public\|script\|spec\|stories\|test\|tmp\|vendor\)\($\|[\/].*$\)?\1?')
+ let fn = fnamemodify(ofn,':s?\(.*\)[\/]\(app\|config\|db\|doc\|extras\|features\|lib\|log\|public\|script\|spec\|stories\|test\|tmp\|vendor\)\($\|[\/].*$\)?\1?')
endwhile
return 0
endfunction
@@ -146,6 +138,42 @@ augroup END
command! -bar -bang -nargs=* -complete=dir Rails :if s:autoload()|call rails#new_app_command(<bang>0,<f-args>)|endif
" }}}1
+" abolish.vim support {{{1
+
+function! s:function(name)
+ return function(substitute(a:name,'^s:',matchstr(expand('<sfile>'), '<SNR>\d\+_'),''))
+endfunction
+
+augroup railsPluginAbolish
+ autocmd!
+ autocmd VimEnter * call s:abolish_setup()
+augroup END
+
+function! s:abolish_setup()
+ if exists('g:Abolish') && has_key(g:Abolish,'Coercions')
+ if !has_key(g:Abolish.Coercions,'l')
+ let g:Abolish.Coercions.l = s:function('s:abolish_l')
+ endif
+ if !has_key(g:Abolish.Coercions,'t')
+ let g:Abolish.Coercions.t = s:function('s:abolish_t')
+ endif
+ endif
+endfunction
+
+function! s:abolish_l(word)
+ let singular = rails#singularize(a:word)
+ return a:word ==? singular ? rails#pluralize(a:word) : singular
+endfunction
+
+function! s:abolish_t(word)
+ if a:word =~# '\u'
+ return rails#pluralize(rails#underscore(a:word))
+ else
+ return rails#singularize(rails#camelize(a:word))
+ endif
+endfunction
+
+" }}}1
" Menus {{{1
if !(g:rails_menu && has("menu"))
@@ -179,40 +207,40 @@ function! s:CreateMenus() abort
let menucmd = s:menucmd(200)
if exists("$CREAM")
exe menucmd.g:rails_installed_menu.'.-PSep- :'
- exe menucmd.g:rails_installed_menu.'.&Related\ file\ :R\ /\ Alt+] :R<CR>'
- exe menucmd.g:rails_installed_menu.'.&Alternate\ file\ :A\ /\ Alt+[ :A<CR>'
- exe menucmd.g:rails_installed_menu.'.&File\ under\ cursor\ Ctrl+Enter :Rfind<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Related\ file\ :R\ /\ Alt+] :R<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Alternate\ file\ :A\ /\ Alt+[ :A<CR>'
+ exe menucmd.g:rails_installed_menu.'.&File\ under\ cursor\ Ctrl+Enter :Rfind<CR>'
else
exe menucmd.g:rails_installed_menu.'.-PSep- :'
- exe menucmd.g:rails_installed_menu.'.&Related\ file\ :R\ /\ ]f :R<CR>'
- exe menucmd.g:rails_installed_menu.'.&Alternate\ file\ :A\ /\ [f :A<CR>'
- exe menucmd.g:rails_installed_menu.'.&File\ under\ cursor\ gf :Rfind<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Related\ file\ :R\ /\ ]f :R<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Alternate\ file\ :A\ /\ [f :A<CR>'
+ exe menucmd.g:rails_installed_menu.'.&File\ under\ cursor\ gf :Rfind<CR>'
endif
- exe menucmd.g:rails_installed_menu.'.&Other\ files.Application\ &Controller :find app/controllers/application.rb<CR>'
- exe menucmd.g:rails_installed_menu.'.&Other\ files.Application\ &Helper :find app/helpers/application_helper.rb<CR>'
- exe menucmd.g:rails_installed_menu.'.&Other\ files.Application\ &Javascript :find public/javascripts/application.js<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Other\ files.Application\ &Controller :Rcontroller application<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Other\ files.Application\ &Helper :Rhelper application<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Other\ files.Application\ &Javascript :Rjavascript application<CR>'
exe menucmd.g:rails_installed_menu.'.&Other\ files.Application\ &Layout :Rlayout application<CR>'
- exe menucmd.g:rails_installed_menu.'.&Other\ files.Application\ &README :find doc/README_FOR_APP<CR>'
- exe menucmd.g:rails_installed_menu.'.&Other\ files.&Environment :find config/environment.rb<CR>'
- exe menucmd.g:rails_installed_menu.'.&Other\ files.&Database\ Configuration :find config/database.yml<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Other\ files.Application\ &README :R doc/README_FOR_APP<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Other\ files.&Environment :Renvironment<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Other\ files.&Database\ Configuration :R config/database.yml<CR>'
exe menucmd.g:rails_installed_menu.'.&Other\ files.Database\ &Schema :Rmigration 0<CR>'
- exe menucmd.g:rails_installed_menu.'.&Other\ files.R&outes :find config/routes.rb<CR>'
- exe menucmd.g:rails_installed_menu.'.&Other\ files.&Test\ Helper :find test/test_helper.rb<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Other\ files.R&outes :Rinitializer<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Other\ files.&Test\ Helper :Rintegrationtest<CR>'
exe menucmd.g:rails_installed_menu.'.-FSep- :'
- exe menucmd.g:rails_installed_menu.'.Ra&ke\ :Rake :Rake<CR>'
+ exe menucmd.g:rails_installed_menu.'.Ra&ke\ :Rake :Rake<CR>'
let menucmd = substitute(menucmd,'200 $','500 ','')
- exe menucmd.g:rails_installed_menu.'.&Server\ :Rserver.&Start\ :Rserver :Rserver<CR>'
- exe menucmd.g:rails_installed_menu.'.&Server\ :Rserver.&Force\ start\ :Rserver! :Rserver!<CR>'
- exe menucmd.g:rails_installed_menu.'.&Server\ :Rserver.&Kill\ :Rserver!\ - :Rserver! -<CR>'
- exe substitute(menucmd,'<script>','<script> <silent>','').g:rails_installed_menu.'.&Evaluate\ Ruby\.\.\.\ :Rp :call <SID>menuprompt("Rp","Code to execute and output: ")<CR>'
- exe menucmd.g:rails_installed_menu.'.&Console\ :Rscript :Rscript console<CR>'
- exe menucmd.g:rails_installed_menu.'.&Preview\ :Rpreview :Rpreview<CR>'
- exe menucmd.g:rails_installed_menu.'.&Log\ file\ :Rlog :Rlog<CR>'
- exe substitute(s:sub(menucmd,'anoremenu','vnoremenu'),'<script>','<script> <silent>','').g:rails_installed_menu.'.E&xtract\ as\ partial\ :Rextract :call <SID>menuprompt("'."'".'<,'."'".'>Rextract","Partial name (e.g., template or /controller/template): ")<CR>'
- exe menucmd.g:rails_installed_menu.'.&Migration\ writer\ :Rinvert :Rinvert<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Server\ :Rserver.&Start\ :Rserver :Rserver<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Server\ :Rserver.&Force\ start\ :Rserver! :Rserver!<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Server\ :Rserver.&Kill\ :Rserver!\ - :Rserver! -<CR>'
+ exe substitute(menucmd,'<script>','<script> <silent>','').g:rails_installed_menu.'.&Evaluate\ Ruby\.\.\.\ :Rp :call <SID>menuprompt("Rp","Code to execute and output: ")<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Console\ :Rscript :Rscript console<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Preview\ :Rpreview :Rpreview<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Log\ file\ :Rlog :Rlog<CR>'
+ exe substitute(s:sub(menucmd,'anoremenu','vnoremenu'),'<script>','<script> <silent>','').g:rails_installed_menu.'.E&xtract\ as\ partial\ :Rextract :call <SID>menuprompt("'."'".'<,'."'".'>Rextract","Partial name (e.g., template or /controller/template): ")<CR>'
+ exe menucmd.g:rails_installed_menu.'.&Migration\ writer\ :Rinvert :Rinvert<CR>'
exe menucmd.' '.g:rails_installed_menu.'.-HSep- :'
- exe substitute(menucmd,'<script>','<script> <silent>','').g:rails_installed_menu.'.&Help\ :help\ rails :if <SID>autoload()<Bar>exe RailsHelpCommand("")<Bar>endif<CR>'
- exe substitute(menucmd,'<script>','<script> <silent>','').g:rails_installed_menu.'.Abo&ut\ :if <SID>autoload()<Bar>exe RailsHelpCommand("about")<Bar>endif<CR>'
+ exe substitute(menucmd,'<script>','<script> <silent>','').g:rails_installed_menu.'.&Help\ :help\ rails :if <SID>autoload()<Bar>exe RailsHelpCommand("")<Bar>endif<CR>'
+ exe substitute(menucmd,'<script>','<script> <silent>','').g:rails_installed_menu.'.Abo&ut\ :if <SID>autoload()<Bar>exe RailsHelpCommand("about")<Bar>endif<CR>'
let g:rails_did_menus = 1
call s:ProjectMenu()
call s:menuBufLeave()
@@ -231,7 +259,7 @@ function! s:ProjectMenu()
let menu = s:gsub(g:rails_installed_menu,'\&','')
silent! exe "aunmenu <script> ".menu.".Projects"
let dots = s:gsub(menu,'[^.]','')
- exe 'anoremenu <script> <silent> '.(exists("$CREAM") ? '87' : '').dots.'.100 '.menu.'.Pro&jects.&New\.\.\.\ :Rails :call <SID>menuprompt("Rails","New application path and additional arguments: ")<CR>'
+ exe 'anoremenu <script> <silent> '.(exists("$CREAM") ? '87' : '').dots.'.100 '.menu.'.Pro&jects.&New\.\.\.\ :Rails :call <SID>menuprompt("Rails","New application path and additional arguments: ")<CR>'
exe 'anoremenu <script> '.menu.'.Pro&jects.-FSep- :'
while history =~ '\n'
let proj = matchstr(history,'^.\{-\}\ze\n')
@@ -256,12 +284,12 @@ function! s:menuBufEnter()
silent! exe 'aunmenu '.menu.'.Generate'
silent! exe 'aunmenu '.menu.'.Destroy'
if rails#app().cache.needs('rake_tasks') || empty(rails#app().rake_tasks())
- exe substitute(s:menucmd(300),'<script>','<script> <silent>','').g:rails_installed_menu.'.Rake\ &tasks\ :Rake.Fill\ this\ menu :call rails#app().rake_tasks()<Bar>call <SID>menuBufLeave()<Bar>call <SID>menuBufEnter()<CR>'
+ exe substitute(s:menucmd(300),'<script>','<script> <silent>','').g:rails_installed_menu.'.Rake\ &tasks\ :Rake.Fill\ this\ menu :call rails#app().rake_tasks()<Bar>call <SID>menuBufLeave()<Bar>call <SID>menuBufEnter()<CR>'
else
let i = 0
while i < len(rails#app().rake_tasks())
let task = rails#app().rake_tasks()[i]
- exe s:menucmd(300).g:rails_installed_menu.'.Rake\ &tasks\ :Rake.'.s:sub(task,':',':.').' :Rake '.task.'<CR>'
+ exe s:menucmd(300).g:rails_installed_menu.'.Rake\ &tasks\ :Rake.'.s:sub(task,':',':.').' :Rake '.task.'<CR>'
let i += 1
endwhile
endif
@@ -269,8 +297,8 @@ function! s:menuBufEnter()
let menucmd = substitute(s:menucmd(400),'<script>','<script> <silent>','').g:rails_installed_menu
while i < len(rails#app().generators())
let generator = rails#app().generators()[i]
- exe menucmd.'.&Generate\ :Rgen.'.s:gsub(generator,'_','\\ ').' :call <SID>menuprompt("Rgenerate '.generator.'","Arguments for script/generate '.generator.': ")<CR>'
- exe menucmd.'.&Destroy\ :Rdestroy.'.s:gsub(generator,'_','\\ ').' :call <SID>menuprompt("Rdestroy '.generator.'","Arguments for script/destroy '.generator.': ")<CR>'
+ exe menucmd.'.&Generate\ :Rgen.'.s:gsub(generator,'_','\\ ').' :call <SID>menuprompt("Rgenerate '.generator.'","Arguments for script/generate '.generator.': ")<CR>'
+ exe menucmd.'.&Destroy\ :Rdestroy.'.s:gsub(generator,'_','\\ ').' :call <SID>menuprompt("Rdestroy '.generator.'","Arguments for script/destroy '.generator.': ")<CR>'
let i += 1
endwhile
endif
@@ -280,15 +308,15 @@ function! s:menuBufLeave()
if exists("g:rails_installed_menu") && g:rails_installed_menu != ""
let menu = s:gsub(g:rails_installed_menu,'\&','')
exe 'amenu disable '.menu.'.*'
- exe 'amenu enable '.menu.'.Help\ '
- exe 'amenu enable '.menu.'.About\ '
+ exe 'amenu enable '.menu.'.Help\ '
+ exe 'amenu enable '.menu.'.About\ '
exe 'amenu enable '.menu.'.Projects'
silent! exe 'aunmenu '.menu.'.Rake\ tasks'
silent! exe 'aunmenu '.menu.'.Generate'
silent! exe 'aunmenu '.menu.'.Destroy'
- exe s:menucmd(300).g:rails_installed_menu.'.Rake\ tasks\ :Rake.-TSep- :'
- exe s:menucmd(400).g:rails_installed_menu.'.&Generate\ :Rgen.-GSep- :'
- exe s:menucmd(400).g:rails_installed_menu.'.&Destroy\ :Rdestroy.-DSep- :'
+ exe s:menucmd(300).g:rails_installed_menu.'.Rake\ tasks\ :Rake.-TSep- :'
+ exe s:menucmd(400).g:rails_installed_menu.'.&Generate\ :Rgen.-GSep- :'
+ exe s:menucmd(400).g:rails_installed_menu.'.&Destroy\ :Rdestroy.-DSep- :'
endif
endfunction
View
30 vimrc
@@ -1,11 +1,12 @@
-set nocompatible " Use Vim settings, rather then Vi settings
+set history=50
+set incsearch " do incremental searching
+set laststatus=2 " Always display the status line
set nobackup
+set nocompatible " Use Vim settings, rather then Vi settings
+set noswapfile
set nowritebackup
-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
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
@@ -39,8 +40,8 @@ set expandtab
set list listchars=tab:»·,trail:·
" Local config
-if filereadable(".vimrc.local")
- source .vimrc.local
+if filereadable("~/.vimrc.local")
+ source ~/.vimrc.local
endif
" Use Ack instead of Grep when available
@@ -49,7 +50,7 @@ if executable("ack")
endif
" Color scheme
-colorscheme github
+colorscheme vividchalk
highlight NonText guibg=#060606
highlight Folded guibg=#0A0A0A guifg=#9090D0
@@ -64,6 +65,18 @@ let g:snippetsEmu_key = "<S-Tab>"
set wildmode=list:longest,list:full
set complete=.,w,t
+" Indent if we're at the beginning of a line. Else, do completion.
+function! InsertTabWrapper()
+ let col = col('.') - 1
+ if !col || getline('.')[col - 1] !~ '\k'
+ return "\<tab>"
+ else
+ return "\<c-p>"
+ endif
+endfunction
+inoremap <tab> <c-r>=InsertTabWrapper()<cr>
+inoremap <s-tab> <c-n>
+
" Tags
let g:Tlist_Ctags_Cmd="ctags --exclude='*.js'"
@@ -83,3 +96,6 @@ nnoremap <Down> :echoe "Use j"<CR>
" Treat <li> and <p> tags like the block tags they are
let g:html_indent_tags = 'li\|p'
+" Improve syntax highlighting
+au BufRead,BufNewFile Gemfile set filetype=ruby
+au BufRead,BufNewFile *.md set filetype=markdown

No commit comments for this range

Something went wrong with that request. Please try again.