Merge branch 'master' into jenipapo

This commit is contained in:
Thomas Ruoff
2016-05-30 09:05:03 +02:00
6 changed files with 482 additions and 15 deletions

View File

@@ -0,0 +1,218 @@
priority -50
# JavaScript versions -- from the TextMate bundle + some additions
# for jasmine-jquery matchers
#
snippet des "Describe (js)" b
describe('${1:description}', function() {
$0
});
endsnippet
snippet it "it (js)" b
it('${1:description}', function() {
$0
});
endsnippet
snippet bef "before each (js)" b
beforeEach(function() {
$0
});
endsnippet
snippet aft "after each (js)" b
afterEach(function() {
$0
});
endsnippet
snippet befa "before all (js)" b
beforeAll(function() {
$0
});
endsnippet
snippet afta "after all (js)" b
afterAll(function() {
$0
});
endsnippet
snippet any "any (js)" b
jasmine.any($1)
endsnippet
snippet anyt "anything (js)" b
jasmine.anything()
endsnippet
snippet objc "object containing (js)" b
jasmine.objectContaining({
${VISUAL}$0
});
endsnippet
snippet arrc "array containing (js)" b
jasmine.arrayContaining([${1:value1}]);
endsnippet
snippet strm "string matching (js)" b
jasmine.stringMatching("${1:matcher}")
endsnippet
snippet ru "runs (js)" b
runs(function() {
$0
});
endsnippet
snippet wa "waits (js)" b
waits($1);
endsnippet
snippet ex "expect (js)" b
expect(${1:target})$0;
endsnippet
snippet ee "expect to equal (js)" b
expect(${1:target}).toEqual(${2:value});
endsnippet
snippet el "expect to be less than (js)" b
expect(${1:target}).toBeLessThan(${2:value});
endsnippet
snippet eg "expect to be greater than (js)" b
expect(${1:target}).toBeGreaterThan(${2:value});
endsnippet
snippet eb "expect to be (js)" b
expect(${1:target}).toBe(${2:value});
endsnippet
snippet em "expect to match (js)" b
expect(${1:target}).toMatch(${2:pattern});
endsnippet
snippet eha "expect to have attribute (js)" b
expect(${1:target}).toHaveAttr('${2:attr}'${3:, '${4:value}'});
endsnippet
snippet et "expect to be truthy (js)" b
expect(${1:target}).toBeTruthy();
endsnippet
snippet ef "expect to be falsy (js)" b
expect(${1:target}).toBeFalsy();
endsnippet
snippet ed "expect to be defined (js)" b
expect(${1:target}).toBeDefined();
endsnippet
snippet eud "expect to be defined (js)" b
expect(${1:target}).toBeUndefined();
endsnippet
snippet en "expect to be null (js)" b
expect(${1:target}).toBeNull();
endsnippet
snippet ec "expect to contain (js)" b
expect(${1:target}).toContain(${2:value});
endsnippet
snippet ev "expect to be visible (js)" b
expect(${1:target}).toBeVisible();
endsnippet
snippet eh "expect to be hidden (js)" b
expect(${1:target}).toBeHidden();
endsnippet
snippet notx "expect not (js)" b
expect(${1:target}).not$0;
endsnippet
snippet note "expect not to equal (js)" b
expect(${1:target}).not.toEqual(${2:value});
endsnippet
snippet notl "expect to not be less than (js)" b
expect(${1:target}).not.toBeLessThan(${2:value});
endsnippet
snippet notg "expect to not be greater than (js)" b
expect(${1:target})..not.toBeGreaterThan(${2:value});
endsnippet
snippet notm "expect not to match (js)" b
expect(${1:target}).not.toMatch(${2:pattern});
endsnippet
snippet notha "expect to not have attribute (js)" b
expect(${1:target}).not.toHaveAttr('${2:attr}'${3:, '${4:value}'});
endsnippet
snippet nott "expect not to be truthy (js)" b
expect(${1:target}).not.toBeTruthy();
endsnippet
snippet notf "expect not to be falsy (js)" b
expect(${1:target}).not.toBeFalsy();
endsnippet
snippet notd "expect not to be defined (js)" b
expect(${1:target}).not.toBeDefined();
endsnippet
snippet notn "expect not to be null (js)" b
expect(${1:target}).not.toBeNull();
endsnippet
snippet notc "expect not to contain (js)" b
expect(${1:target}).not.toContain(${2:value});
endsnippet
snippet notv "expect not to be visible (js)" b
expect(${1:target}).not.toBeVisible();
endsnippet
snippet noth "expect not to be hidden (js)" b
expect(${1:target}).not.toBeHidden();
endsnippet
snippet s "spy on (js)" b
spyOn(${1:object}, '${2:method}')$0;
endsnippet
snippet sr "spy on and return (js)" b
spyOn(${1:object}, '${2:method}').and.returnValue(${3:arguments});
endsnippet
snippet st "spy on and throw (js)" b
spyOn(${1:object}, '${2:method}').and.throwError(${3:exception});
endsnippet
snippet sct "spy on and call through (js)" b
spyOn(${1:object}, '${2:method}').and.callThrough();
endsnippet
snippet scf "spy on and call fake (js)" b
spyOn(${1:object}, '${2:method}').and.callFake(${3:function});
endsnippet
snippet ethbc "expect to have been called (js)" b
expect(${1:target}).toHaveBeenCalled();
endsnippet
snippet nthbc "expect not to have been called (js)" b
expect(${1:target}).not.toHaveBeenCalled();
endsnippet
snippet ethbcw "expect to have been called with (js)" b
expect(${1:target}).toHaveBeenCalledWith(${2:arguments});
endsnippet

View File

@@ -0,0 +1,65 @@
priority -50
snippet #! "shebang"
#!/usr/bin/env node
endsnippet
snippet vreq "assign a CommonJS-style module to a var"
var ${0:${1/(.+\/)*(\w+)(-|\b|$)(\..+$)?/\u$2/g}} = require('${1}');
endsnippet
snippet ex "module.exports"
module.exports = ${1};
endsnippet
snippet hcs "http.createServer"
http.createServer(${1}).listen(${2});
endsnippet
snippet ncs "net.createServer"
net.createServer(function(${1:socket}){
${1}.on('data', function(${3:data}){
${4}
});
${1}.on('end', function(){
${5}
});
}).listen(${6:8124});
endsnippet
snippet pipe "pipe"
pipe(${1:stream})${2}
endsnippet
# Express snippets
snippet eget "express GET"
${1:app}.get('${2}', ${3});
endsnippet
snippet epost "express POST"
${1:app}.post('${2}', ${3});
endsnippet
snippet eput "express PUT"
${1:app}.put('${2}', ${3});
endsnippet
snippet edelete "express DELETE"
${1:app}.delete('${2}', ${3});
endsnippet
# process snippets
snippet stdout "stdout"
process.stdout
endsnippet
snippet stdin "stdin"
process.stdin
endsnippet
snippet stderr "stderr"
process.stderr
endsnippet

View File

@@ -0,0 +1,51 @@
priority -30
# AMD (Asynchronous Module Definition) snippets
snippet def "define an AMD module"
define([
'${1:backbone}'
], function(
${2:Name})
) {
$0
}
endsnippet
# Jasmine
snippet des "Describe (js)" b
describe('${1:description}', function() {
$0
});
endsnippet
snippet it "it (js)" b
it('${1:description}', function() {
$0
});
endsnippet
snippet bef "before each (js)" b
beforeEach(function() {
$0
});
endsnippet
snippet aft "after each (js)" b
afterEach(function() {
$0
});
endsnippet
snippet befa "before all (js)" b
beforeAll(function() {
$0
});
endsnippet
snippet afta "after all (js)" b
afterAll(function() {
$0
});
endsnippet
# vim:ft=snippets:

151
vimrc
View File

@@ -30,6 +30,7 @@ Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'scrooloose/syntastic'
Plug 'pmsorhaindo/syntastic-local-eslint.vim'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
@@ -48,7 +49,7 @@ Plug 'Raimondi/delimitMate'
Plug 'pangloss/vim-javascript'
Plug 'marijnh/tern_for_vim', { 'do': 'npm install', 'for': 'javascript'}
Plug 'mustache/vim-mustache-handlebars'
Plug 'mxw/vim-jsx'
"Plug 'mxw/vim-jsx'
Plug 'shime/vim-livedown'
Plug 'xuhdev/vim-latex-live-preview'
@@ -262,22 +263,141 @@ nnoremap <leader>sc :CloseSession<CR>
"" syntastic
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
"" lightline
let g:lightline = {
\ 'colorscheme': 'solarized',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'fugitive', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component': {
\ 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}'
\ },
\ 'component_visible_condition': {
\ 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())'
\ }
\}
\ 'colorscheme': 'solarized',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ], ['ctrlpmark'] ],
\ 'right': [ [ 'syntastic', 'lineinfo' ], ['percent'], [ 'fileformat', 'fileencoding', 'filetype' ] ]
\ },
\ 'component_function': {
\ 'fugitive': 'LightLineFugitive',
\ 'filename': 'LightLineFilename',
\ 'fileformat': 'LightLineFileformat',
\ 'filetype': 'LightLineFiletype',
\ 'fileencoding': 'LightLineFileencoding',
\ 'mode': 'LightLineMode',
\ 'ctrlpmark': 'CtrlPMark',
\ },
\ 'component_expand': {
\ 'syntastic': 'SyntasticStatuslineFlag',
\ },
\ 'component_type': {
\ 'syntastic': 'error',
\ },
\ 'subseparator': { 'left': '|', 'right': '|' }
\ }
function! LightLineModified()
return &ft =~ 'help' ? '' : &modified ? '+' : &modifiable ? '' : '-'
endfunction
function! LightLineReadonly()
return &ft !~? 'help' && &readonly ? 'RO' : ''
endfunction
function! LightLineFilename()
let fname = expand('%:t')
return fname == 'ControlP' ? g:lightline.ctrlp_item :
\ fname == '__Tagbar__' ? g:lightline.fname :
\ fname =~ '__Gundo\|NERD_tree' ? '' :
\ &ft == 'vimfiler' ? vimfiler#get_status_string() :
\ &ft == 'unite' ? unite#get_status_string() :
\ &ft == 'vimshell' ? vimshell#get_status_string() :
\ ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
\ ('' != fname ? fname : '[No Name]') .
\ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
endfunction
function! LightLineFugitive()
try
if expand('%:t') !~? 'Tagbar\|Gundo\|NERD' && &ft !~? 'vimfiler' && exists('*fugitive#head')
let mark = '' " edit here for cool mark
let _ = fugitive#head()
return strlen(_) ? mark._ : ''
endif
catch
endtry
return ''
endfunction
function! LightLineFileformat()
return winwidth(0) > 70 ? &fileformat : ''
endfunction
function! LightLineFiletype()
return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : ''
endfunction
function! LightLineFileencoding()
return winwidth(0) > 70 ? (strlen(&fenc) ? &fenc : &enc) : ''
endfunction
function! LightLineMode()
let fname = expand('%:t')
return fname == '__Tagbar__' ? 'Tagbar' :
\ fname == 'ControlP' ? 'CtrlP' :
\ fname == '__Gundo__' ? 'Gundo' :
\ fname == '__Gundo_Preview__' ? 'Gundo Preview' :
\ fname =~ 'NERD_tree' ? 'NERDTree' :
\ &ft == 'unite' ? 'Unite' :
\ &ft == 'vimfiler' ? 'VimFiler' :
\ &ft == 'vimshell' ? 'VimShell' :
\ winwidth(0) > 60 ? lightline#mode() : ''
endfunction
function! CtrlPMark()
if expand('%:t') =~ 'ControlP'
call lightline#link('iR'[g:lightline.ctrlp_regex])
return lightline#concatenate([g:lightline.ctrlp_prev, g:lightline.ctrlp_item
\ , g:lightline.ctrlp_next], 0)
else
return ''
endif
endfunction
let g:ctrlp_status_func = {
\ 'main': 'CtrlPStatusFunc_1',
\ 'prog': 'CtrlPStatusFunc_2',
\ }
function! CtrlPStatusFunc_1(focus, byfname, regex, prev, item, next, marked)
let g:lightline.ctrlp_regex = a:regex
let g:lightline.ctrlp_prev = a:prev
let g:lightline.ctrlp_item = a:item
let g:lightline.ctrlp_next = a:next
return lightline#statusline(0)
endfunction
function! CtrlPStatusFunc_2(str)
return lightline#statusline(0)
endfunction
let g:tagbar_status_func = 'TagbarStatusFunc'
function! TagbarStatusFunc(current, sort, fname, ...) abort
let g:lightline.fname = a:fname
return lightline#statusline(0)
endfunction
augroup AutoSyntastic
autocmd!
autocmd BufWritePost *.c,*.cpp call s:syntastic()
augroup END
function! s:syntastic()
SyntasticCheck
call lightline#update()
endfunction
let g:unite_force_overwrite_statusline = 0
let g:vimfiler_force_overwrite_statusline = 0
let g:vimshell_force_overwrite_statusline = 0
"" NERDTree configuration
nmap <leader>n :NERDTreeToggle<CR>
@@ -315,7 +435,7 @@ let g:tex_flavor = "latex"
let g:livepreview_previewer = 'zathura'
" JSX
let g:jsx_ext_required = 0 " Allow JSX in normal JS files
" let g:jsx_ext_required = 0 " Allow JSX in normal JS files
"
" Autocmd Rules
@@ -337,6 +457,9 @@ au FileType markdown set wrap wm=2 textwidth=78 nocindent spell
"" Python
au FileType python set noexpandtab
"" JavaScript
au FileType javascript map <leader>r <esc>:TernRename<CR>
"" Json
au BufRead,BufNewFile *.json set ft=json

View File

@@ -1,6 +1,8 @@
# extend path
export PATH="$HOME/local/bin:$PATH"
export EDITOR=$(which vim)
# nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
@@ -9,7 +11,7 @@ export NVM_DIR="$HOME/.nvm"
# Dist related settings
########################
case $OSTYPE in
"darwin14.0" )
"darwin14.0"|"darwin15.0" )
export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"
export MANPATH="$(brew --prefix coreutils)/libexec/gnuman:$MANPATH"
#eval $(ssh-agent -s)

8
zshrc
View File

@@ -40,6 +40,14 @@ alias ts='tmux new-session -s'
alias tl='tmux list-sessions'
rl () { $(npm bin)/$* }
# utt time tracking
alias uh='uttr --add hello'
alias ust='uttr --add standup'
alias ul='uttr --add "lunch**"'
alias ue='uttr --edit'
alias urw='uttr --report=week'
alias urm='uttr --report=month'
# colors
autoload -U colors && colors
alias ls='ls --color=tty'