Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
JS/Jasmine snippets.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Jaros & Sam Obukwelu committed May 6, 2011
1 parent a985410 commit ddb0411
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bundle/snipMate/snippets/javascript.snippets
Expand Up @@ -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}};
Expand Down
19 changes: 19 additions & 0 deletions snippets/javascript.snippets
@@ -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}
});
23 changes: 23 additions & 0 deletions vimrc
Expand Up @@ -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 """""""""""""""""""

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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>
Expand Down

0 comments on commit ddb0411

Please sign in to comment.