Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

JS/Jasmine snippets.

  • Loading branch information...
commit ddb041154c250e2eefacdc2916e7bbd3c51f42c0 1 parent a985410
authored May 06, 2011
4  bundle/snipMate/snippets/javascript.snippets
@@ -10,8 +10,8 @@ snippet fun
10 10
 		${3:// body...}
11 11
 	}
12 12
 # Anonymous Function
13  
-snippet f
14  
-	function(${1}) {${2}};
  13
+#snippet f
  14
+#	function(${1}) {${2}};
15 15
 # if
16 16
 snippet if
17 17
 	if (${1:true}) {${2}};
19  snippets/javascript.snippets
... ...
@@ -0,0 +1,19 @@
  1
+# Anonymous Function
  2
+snippet f
  3
+	function(${1}) {${2}}
  4
+snippet it
  5
+	it("${1}", function() {
  6
+		${2}
  7
+	});
  8
+snippet desc
  9
+	describe("${1}", function() {
  10
+		${2}
  11
+	});
  12
+snippet con
  13
+	context("${1}", function() {
  14
+		${2}
  15
+	});
  16
+snippet bef
  17
+	beforeEach("${1}", function() {
  18
+		${2}
  19
+	});
23  vimrc
@@ -8,6 +8,19 @@ set nocompatible
8 8
 syntax on
9 9
 filetype plugin indent on
10 10
 
  11
+"ack current word in command mode
  12
+function! AckGrep()
  13
+  let command = "ack ".expand("<cword>")
  14
+  cexpr system(command)
  15
+  cw
  16
+endfunction
  17
+
  18
+function! AckVisual()
  19
+  normal gv"xy
  20
+  let command = "ack ".@x
  21
+  cexpr system(command)
  22
+  cw
  23
+endfunction
11 24
 
12 25
 " SHORTCUT KEY MAPPINGS """""""""""""""""""
13 26
 
@@ -50,6 +63,8 @@ autocmd BufRead,BufNewFile *.jasmine_fixture set filetype=html
50 63
 " SETTINGS """"""""""""""""""""""""""""""""
51 64
 "set t_Co=256
52 65
 colorscheme vividchalk
  66
+colorscheme solarized
  67
+set background=dark
53 68
 
54 69
 "Show whitespace, fullstops for trailing whitespace
55 70
 set list
@@ -126,6 +141,11 @@ map <leader>k ^Wk
126 141
 " Add new windows towards the right and bottom.
127 142
 set splitbelow splitright
128 143
 
  144
+" AckGrep current word
  145
+map <leader>a :call AckGrep()<CR>
  146
+" AckVisual current selection
  147
+vmap <leader>a :call AckVisual()<CR>
  148
+
129 149
 " set question mark to be part of a VIM word. in Ruby it is!
130 150
 autocmd FileType ruby set iskeyword=@,48-57,_,?,!,192-255
131 151
 autocmd FileType scss set iskeyword=@,48-57,_,-,?,!,192-255
@@ -143,6 +163,9 @@ map <leader>rf :FufRenewCache<CR>
143 163
 map <leader>t :!/usr/local/bin/ctags -R --exclude=.git --exclude=log * `rvm gemhome`/*<CR>
144 164
 map <leader>T :!rdoc -f tags -o tags * `rvm gemhome` --exclude=.git --exclude=log
145 165
 
  166
+" git blame
  167
+map <leader>g :Gblame<CR>
  168
+
146 169
 " F7 reformats the whole file and leaves you where you were (unlike gg)
147 170
 map <silent> <F7> mzgg=G'z :delmarks z<CR>:echo "Reformatted."<CR>
148 171
 

0 notes on commit ddb0411

Please sign in to comment.
Something went wrong with that request. Please try again.