Permalink
Browse files

JS/Jasmine snippets.

  • Loading branch information...
1 parent a985410 commit ddb041154c250e2eefacdc2916e7bbd3c51f42c0 Peter Jaros & Sam Obukwelu committed May 6, 2011
Showing with 44 additions and 2 deletions.
  1. +2 −2 bundle/snipMate/snippets/javascript.snippets
  2. +19 −0 snippets/javascript.snippets
  3. +23 −0 vimrc
@@ -10,8 +10,8 @@ snippet fun
${3:// body...}
}
# Anonymous Function
-snippet f
- function(${1}) {${2}};
+#snippet f
+# function(${1}) {${2}};
# if
snippet if
if (${1:true}) {${2}};
@@ -0,0 +1,19 @@
+# Anonymous Function
+snippet f
+ function(${1}) {${2}}
+snippet it
+ it("${1}", function() {
+ ${2}
+ });
+snippet desc
+ describe("${1}", function() {
+ ${2}
+ });
+snippet con
+ context("${1}", function() {
+ ${2}
+ });
+snippet bef
+ beforeEach("${1}", function() {
+ ${2}
+ });
View
23 vimrc
@@ -8,6 +8,19 @@ set nocompatible
syntax on
filetype plugin indent on
+"ack current word in command mode
+function! AckGrep()
+ let command = "ack ".expand("<cword>")
+ cexpr system(command)
+ cw
+endfunction
+
+function! AckVisual()
+ normal gv"xy
+ let command = "ack ".@x
+ cexpr system(command)
+ cw
+endfunction
" SHORTCUT KEY MAPPINGS """""""""""""""""""
@@ -50,6 +63,8 @@ autocmd BufRead,BufNewFile *.jasmine_fixture set filetype=html
" SETTINGS """"""""""""""""""""""""""""""""
"set t_Co=256
colorscheme vividchalk
+colorscheme solarized
+set background=dark
"Show whitespace, fullstops for trailing whitespace
set list
@@ -126,6 +141,11 @@ map <leader>k ^Wk
" Add new windows towards the right and bottom.
set splitbelow splitright
+" AckGrep current word
+map <leader>a :call AckGrep()<CR>
+" AckVisual current selection
+vmap <leader>a :call AckVisual()<CR>
+
" set question mark to be part of a VIM word. in Ruby it is!
autocmd FileType ruby set iskeyword=@,48-57,_,?,!,192-255
autocmd FileType scss set iskeyword=@,48-57,_,-,?,!,192-255
@@ -143,6 +163,9 @@ map <leader>rf :FufRenewCache<CR>
map <leader>t :!/usr/local/bin/ctags -R --exclude=.git --exclude=log * `rvm gemhome`/*<CR>
map <leader>T :!rdoc -f tags -o tags * `rvm gemhome` --exclude=.git --exclude=log
+" git blame
+map <leader>g :Gblame<CR>
+
" F7 reformats the whole file and leaves you where you were (unlike gg)
map <silent> <F7> mzgg=G'z :delmarks z<CR>:echo "Reformatted."<CR>

0 comments on commit ddb0411

Please sign in to comment.