Permalink
Browse files

Added DCPU16 syntax

  • Loading branch information...
1 parent fc76061 commit 0f0b386746cfba78cff351b788eac4e3aa077001 @rossfoley committed May 2, 2012
Showing with 46 additions and 23 deletions.
  1. +3 −0 .gitmodules
  2. +1 −1 bundle/bundler
  3. +1 −1 bundle/commentary
  4. +1 −1 bundle/cucumber
  5. +1 −0 bundle/dcpu16
  6. +1 −1 bundle/endwise
  7. +1 −1 bundle/fugitive
  8. +1 −1 bundle/git
  9. +1 −1 bundle/haml
  10. +1 −1 bundle/rails
  11. +1 −1 bundle/ruby
  12. +1 −0 bundle/supertab
  13. +1 −1 bundle/surround
  14. +1 −1 bundle/unimpaired
  15. +1 −1 bundle/zencoding
  16. +29 −11 vimrc
View
3 .gitmodules
@@ -49,3 +49,6 @@
[submodule "bundle/css3"]
path = bundle/css3
url = https://github.com/hail2u/vim-css3-syntax.git
+[submodule "bundle/dcpu16"]
+ path = bundle/dcpu16
+ url = https://github.com/dcpu16/dcpu16-vim-syntax.git
2 bundle/bundler
@@ -1 +1 @@
-Subproject commit 595b29a16e0ff45e0332c18ba44cf0245da34dfe
+Subproject commit de1f2a6e2b9b7511eda5a526ad869281effd2935
2 bundle/commentary
@@ -1 +1 @@
-Subproject commit 62b72580aba57cb5185bd077ac7a905c1c6893ea
+Subproject commit 8d06adbd56a761684701d1c60990b72c845be3d5
2 bundle/cucumber
@@ -1 +1 @@
-Subproject commit 51180532f4ceffc1613f57f8a35d1db941c11d81
+Subproject commit 2ef3e5a4876a4cd5ea83a0dcbf17f5c3edbf9de3
1 bundle/dcpu16
@@ -0,0 +1 @@
+Subproject commit ec35ac1c05f36a85950ffbcc55bc6d024d5ab7e3
2 bundle/endwise
@@ -1 +1 @@
-Subproject commit 74306aa18c03ee2fdb044609e6f0bc866872711d
+Subproject commit 9a9d1994eaeae3f2f23da6bb71111782ab70276c
2 bundle/fugitive
@@ -1 +1 @@
-Subproject commit b4b75ef682da3e946c648d3634ade39d0af49aba
+Subproject commit 1ecd40d0025f04dcb84e85732753322fd6ff0372
2 bundle/git
@@ -1 +1 @@
-Subproject commit d058250916346f9957e13e1a6a268d705011a993
+Subproject commit 291cbe97f2c367f40360949f19b4fa8fb0740e9f
2 bundle/haml
@@ -1 +1 @@
-Subproject commit a995d4aabb794bd60028537ecb41ca7f2c738e65
+Subproject commit de3e72a384c9b1cc8707c9bc37cefc24d8484ebf
2 bundle/rails
@@ -1 +1 @@
-Subproject commit e45164cbba5beee4bd65096dad31f31124a2cc18
+Subproject commit 7cc873769d891f567e8529618d482663a6db9ea2
2 bundle/ruby
@@ -1 +1 @@
-Subproject commit 0d4ae14e5ef0969048bee6f1d7ea52ed38fbd1ff
+Subproject commit f21c564a1d669ae66f44d2dfdd6411f29dfdf254
1 bundle/supertab
@@ -0,0 +1 @@
+Subproject commit 6bef3d39bed26ab63a094ad4b499a8a6eef0c053
2 bundle/surround
@@ -1 +1 @@
-Subproject commit 4eb2cdfccc016889acfa3b5d63e8f390a87863cf
+Subproject commit c9120390d8e51e42faef420f83ef0001a20643f3
2 bundle/unimpaired
@@ -1 +1 @@
-Subproject commit 52eef03408f0df43b7a05484e2278a2acb777944
+Subproject commit e49b8f2435e7d9e22926d123cc23353cabc93753
2 bundle/zencoding
@@ -1 +1 @@
-Subproject commit 62c8a5c39ed1c5f6ba1330d2ecb9adb848c30923
+Subproject commit 54924cb5d5937c98b1ebc98bafa06616cb36366a
View
40 vimrc
@@ -186,6 +186,7 @@ map Q gq
function! CucumberTables()
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a "
endfunction
+
augroup MyAbbrevs
autocmd!
autocmd BufNewFile,BufRead *.feature call CucumberTables()
@@ -207,17 +208,6 @@ endfunction
map ,rn :call RenameFile()<cr>
imap <c-l> <space>=><space>
nmap ,pp "+P
-
-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>
nnoremap ,, <c-^>
" Remap the tab key to do autocompletion or indentation depending on the
@@ -256,3 +246,31 @@ endfunction
" Zen Coding
let g:user_zen_expandabbr_key = '<c-e>'
let g:use_zen_complete_tag = 1
+
+
+function! OpenTestAlternate()
+ let new_file = AlternateForCurrentFile()
+ exec ':e ' . new_file
+endfunction
+function! AlternateForCurrentFile()
+ let current_file = expand("%")
+ let new_file = current_file
+ let in_spec = match(current_file, '^spec/') != -1
+ let going_to_spec = !in_spec
+ let in_app = match(current_file, '\<controllers\>') != -1 || match(current_file, '\<models\>') != -1 || match(current_file, '\<views\>') != -1
+ if going_to_spec
+ if in_app
+ let new_file = substitute(new_file, '^app/', '', '')
+ end
+ let new_file = substitute(new_file, '\.rb$', '_spec.rb', '')
+ let new_file = 'spec/' . new_file
+ else
+ let new_file = substitute(new_file, '_spec\.rb$', '.rb', '')
+ let new_file = substitute(new_file, '^spec/', '', '')
+ if in_app
+ let new_file = 'app/' . new_file
+ end
+ endif
+ return new_file
+endfunction
+nnoremap ,. :call OpenTestAlternate()<cr>

0 comments on commit 0f0b386

Please sign in to comment.