Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcWeber committed Nov 15, 2012
1 parent eb32544 commit fe7b486
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 67 deletions.
2 changes: 1 addition & 1 deletion autoload/vim_addon_MarcWeber.vim
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fun! vim_addon_MarcWeber#Activate(vam_features)
let g:ft_addons = {
\ '^\%(cabal\|hs\|hsc\|lhs\)$': [ "vim-addon-haskell"],
\ '^\%(php\|inc\|php.inc\|hsc\|lhs\)$': ["phpcomplete", "vim-addon-xdebug","ZenCoding", 'vim-addon-php-manual'],
\ 'rb': [ 'vim-ruby', "vim-addon-rdebug", 'vim-addon-ruby-debug-ide' ],
\ 'ruby': [ 'vim-ruby', "vim-addon-rdebug", 'vim-addon-ruby-debug-ide' ],
\ 'nix': [ "vim-addon-nix" ],
\ 'vim': ["reload", 'vim-dev-plugin'],
\ }
Expand Down
32 changes: 19 additions & 13 deletions ftplugin/haskell_mw.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ setlocal aw
setlocal notagbsearch
setlocal autoindent

fun! s:LTSp(s)
return vim_addon_other#InsertLT(' ',a:s,' ')
endf

inoremap <buffer> <m-$> <c-r>=LTSp("$")<cr>
inoremap <buffer> <m-<> <c-r>=LTSp("<-")<cr>
inoremap <buffer> <m->> <c-r>=LTSp("->")<cr>
inoremap <buffer> <m-r> <c-r>=LTSp("=>")<cr>
inoremap <buffer> <m-.> <c-r>=LTSp(".")<cr>
inoremap <buffer> <m-p> <c-r>=LTSp("++")<cr>
inoremap <buffer> <m-q><m-d> <c-r>=LTSp("qualified")<cr>
inoremap <buffer> <m-l><m-m> <c-r>=LTSp("liftM")<cr>
inoremap <buffer> <m-l><m-2> <c-r>=LTSp("liftM2")<cr>
inoremap <buffer> <m-l><m-3> <c-r>=LTSp("liftM3")<cr>
inoremap <buffer> <m-l><m-b> <c-r>=LTSp("=<<")<cr>
inoremap <buffer> <m-r><m-b> <c-r>=LTSp(">>=")<cr>
inoremap <m-:> <c-r>=LTSp("::")<cr>
finish
noremap <buffer> <m-e><m-m> :e /pr/haskell/amendment/Missing/
call vl#dev#haskell#ghc#UI()

Expand Down Expand Up @@ -141,30 +159,18 @@ inoremap <buffer> <m-s-L> Left
"inoremap <buffer> <m-s-R> Right
inoremap <buffer> <m-s-j> Just
inoremap <buffer> <m-s-n> Nothing
inoremap <buffer> <m-$> <c-r>=LTSp("$")<cr>
inoremap <buffer> <m-s><m-g> String
inoremap <buffer> <m-m><m-n> main<space>=<space>do<cr>
inoremap <buffer> <m-<> <c-r>=LTSp("<-")<cr>
inoremap <buffer> <m->> <c-r>=LTSp("->")<cr>
inoremap <buffer> <m-r> <c-r>=LTSp("=>")<cr>
inoremap <buffer> <m-.> <c-r>=LTSp(".")<cr>
inoremap <buffer> <m-p> <c-r>=LTSp("++")<cr>
inoremap <buffer> <m-m><m-b> Maybe<space>
inoremap <buffer> <m-i><m-c> instance<space>
inoremap <buffer> <m-d><m-v> deriving<space>(
inoremap <buffer> <m-q><m-d> <c-r>=LTSp("qualified")<cr>
inoremap <buffer> <m-bar> <space><lt><bar>><space>
inoremap <buffer> <m-r><m-n> return<space>
inoremap <buffer> <m-l><m-m> <c-r>=LTSp("liftM")<cr>
inoremap <buffer> <m-l><m-2> <c-r>=LTSp("liftM2")<cr>
inoremap <buffer> <m-l><m-3> <c-r>=LTSp("liftM3")<cr>
inoremap <buffer> <m-l><m-i> liftIO<space>
inoremap <buffer> <m-a><m-d><m-c> --<space>added<space>by<space>Marc<space>(debug<space>purposes)<space>on<space><c-r>=system('date')<cr>
inoremap <buffer> <m-f><m-o> f<space>`on`<space>op<space>=<space>\x<space>y<space>-><space>f<space>x<space>`op`<space>f<space>y
inoremap <buffer> <m-c><m-o><m-g><m-e> {-# OPTIONS_GHC -fglasgow-exts #-}
inoremap <buffer> <m-l><m-b> <c-r>=LTSp("=<<")<cr>
inoremap <buffer> <m-r><m-b> <c-r>=LTSp(">>=")<cr>
inoremap <m-:> <c-r>=LTSp("::")<cr>
inoremap <buffer> <m-w><m-a> <esc>-yejPa<space>
noremap <buffer> <m-s><m-a> /<c-r>=SearchAnyTypeExpression(input('name :'))<cr>
Expand Down
25 changes: 9 additions & 16 deletions ftplugin/haxe_mw.vim
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ inoremap <buffer> <m-v><m-d> Void
setlocal fdm=marker

call vl#lib#completion#contextcompletion#InitContextCompletion(
\ [ [ "Tab",'<c-tab>','b:tab_compl']
\ , [ "CR" ,'<cr>' ,'b:cr_compl' ,"\<cr>"] ])

AddTabCompletion spf \<bs>\<bs>tatic\<space>public\<space>function
AddTabCompletion p public
AddTabCompletion pd public
AddTabCompletion pv \<bs>rivate\<space>var
" call vl#lib#completion#contextcompletion#InitContextCompletion(
" \ [ [ "Tab",'<c-tab>','b:tab_compl']
" \ , [ "CR" ,'<cr>' ,'b:cr_compl' ,"\<cr>"] ])

" AddTabCompletion spf \<bs>\<bs>tatic\<space>public\<space>function
" AddTabCompletion p public
" AddTabCompletion pd public
" AddTabCompletion pv \<bs>rivate\<space>var
" setlocal autoindent
" AddTabCompletion i import
setlocal cindent

"au Haxe BufWritePost <buffer> exec "normal \<F2>:wincmd p\<cr>"
Expand All @@ -37,14 +38,6 @@ inoremap <buffer> <m-t> this.
noremap <buffer> qd :FlexDoc<space><c-r>=expand('<cword>')<cr>
call vl#lib#completion#contextcompletion#InitContextCompletion(
\ [ [ "Tab",'<c-tab>','b:tab_compl']
\ , [ "CR" ,'<cr>' ,'b:cr_compl' ,"\<cr>"] ])


AddTabCompletion i import


command! -buffer AdobeDocs -args=0 exec '!opera http://www.google.com/search?hl=de&q='.expand('<cword>').'+site%3Ahttp%3A%2F%2Flivedocs.adobe.com%2F&btnG=Suche&lr=&aq=f&oq='

" ====================== ENDE ==
Expand Down
3 changes: 1 addition & 2 deletions ftplugin/java_mw.vim
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ setlocal sw=2
let s:matchfunction='public\|private\|protected\|friendly\|void|\static\|class'
let s:java_identifier='\a[[:alnum:]]*'

exec vl#lib#vimscript#dontloadtwice#DontLoadTwice('b:ftpjava')
function! InsertMainClass()
exe "put='public class ".expand('%:t:r')."{'"
put='public static void Main(String args()){'
Expand Down Expand Up @@ -141,7 +140,7 @@ function! SingleComplete()
return "nothing"
endfunction

call ProvidePublicPrivateMappings()
" call ProvidePublicPrivateMappings()
inoremap <buffer> <cr> <c-r>=AfterReturn()<cr>
"inoremap <buffer> <cr> )<c-r>=GetLineEnding()<cr>
"inoremap <buffer> "<cr> )<c-r>=GetLineEnding()<cr>
Expand Down
6 changes: 4 additions & 2 deletions ftplugin/php_mw.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"set tabstop=4
"set sw=4
setlocal autoindent
inoremap <buffer> <m-d><m-e> define('','')<left><left><left><left><left>
noremap <m-g><m-e> :compiler php<bar>cf /var/marc/vimserver/error <bar> cope<cr>
finish
"
" switch files
Expand Down Expand Up @@ -142,7 +146,6 @@ noremap <buffer> <F3> :update <bar>call vl#lib#quickfix#runtaskinbackground#RunI
noremap <buffer> <m-f> :update <bar>exec 'BGQF /usr/lib/php4/bin/php '.expand('%')<cr>
noremap <buffer> <c-5> :update <bar>exec 'BGQF php5 '.expand('%')<cr>
inoremap <buffer> <m-d><m-e> define('','')<left><left><left><left><left>

" array
Inoremap <buffer> <m-a><m-k><m-e> array_key_exists('',)<esc>3l
Expand Down Expand Up @@ -238,7 +241,6 @@ command! -buffer SetServerBN :exec "!echo ".v:servername." > /var/marc/vimserver

"call vl#lib#files#switch_files#SwitchFileRegisterLocalRegexSwap('.php','.php5')
call tovl#errorformat#SetErrorFormat('plugins#tovl#errorformats#PluginErrorFormats#grep')
noremap <m-g><m-e> :call tovl#errorformat#SetErrorFormat('plugins#tovl#errorformats#PluginErrorFormats#php') <bar> cf /var/marc/vimserver/error <bar> cope<cr>
noremap <m-g><m-p> :call tovl#errorformat#SetErrorFormat('plugins#tovl#errorformats#PluginErrorFormats#php') <bar> cf /var/marc/vimserver/error-sel <bar> cope<cr>
Inoremap <buffer> <m-p><m-r><m-e> echo<space>'<lt>pre>';<cr>echo<space>'<lt>/pre>';
Expand Down
36 changes: 35 additions & 1 deletion ftplugin/ruby_mw.vim
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,46 @@ if (!filereadable(expand('%')))
exec "normal I# encoding: UTF-8"
endif

" if case study for % matching:
" # @api private
" # TODO: move the logic to create relative query into Query
" def scoped_query(query)
" if query.kind_of?(Query)
" query.dup
" else
" repository = if query.key?(:repository)
" query = query.dup
" repository = query.delete(:repository)

" if repository.kind_of?(Symbol)
" DataMapper.repository(repository)
" else
" repository
" end
" else
" self.repository
" end

" query = self.query.merge(query)

" if self.query.repository == repository
" query
" else
" repository.new_query(self, query.options)
" end
" end
" end

let b:match_words =
\ '\<\%(unless\|case\|while\|until\|for\|do\|class\|module\|def\|begin\)\>=\@!\|do\s\+|[^|]*|\|^\s*if\>' .
\ '\<\%(unless\|case\|while\|until\|for\|do\|class\|module\|def\|begin\)\>=\@!\|do\s\+|[^|]*|\|^\s*if\|=\s*if\>' .
\ ':' .
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
\ ':' .
\ '\<end\>' .
\ ',{:},\[:\],(:)'

inoremap <m-r><m-e> <c-r>='require "'.ruby_utils#InsertRequire().'"'<cr>

inoremap <m-r><m-e> <c-r>='require "'.ruby_utils#InsertRequire('require').'"'<cr>
inoremap <m-r><m-r> <c-r>='require_relative "'.ruby_utils#InsertRequire('require_rel').'"'<cr>
2 changes: 0 additions & 2 deletions ftplugin/sql.vim
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
" needs mwpluginmanager
exec vl#lib#vimscript#dontloadtwice#DontLoadTwice('b:sql')

set sw=2
setlocal fdm=indent
imap <buffer> <m-c> create<space>table<space>
Expand Down
58 changes: 29 additions & 29 deletions ftplugin/sql_mw.vim
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
inoremap <buffer> <C-x><C-q> <c-r>=vim_addon_completion#CompleteUsing('vim_addon_sql#Complete')<cr>
call vl#lib#completion#contextcompletion#InitContextCompletion(
\ [ [ "Tab",'<c-tab>','b:tab_compl']
\ , [ "CR" ,'<cr>' ,'b:cr_compl' ,"\<cr>"] ])

AddTabCompletion \\\\cd$ \<bs>ESCRIBE ts:
AddTabCompletion \\\\cs$ \<bs>SELECT ts:
AddTabCompletion \\\\cOB$ \<bs>\<bs>ORDER\<space>BY ts: fitness:break
AddTabCompletion \\\\cDT$ \<bs>\<bs>DROP\<space>TABLE\<space>IF\<space>EXISTS\<space> ts: fitness:break
AddTabCompletion ^\s*\\\\c\\\%(SELECT\\\\|DELETE\\\\).*FROM WHERE ls: ts: fitness:2
AddTabCompletion ^\s*\\\\c\\\%(UPDATE\\\\).* SET ls: ts: fitness:2
AddTabCompletion ^\s*\\\\c\\\%(UPDATE\\\\).*SET WHERE ls: ts: fitness:2
AddTabCompletion ^\s*SELECT FROM bcnm:FROM ls: ts:
AddTabCompletion ^\s*INSERT\\\\s\\\\+INTO VALUES ts:
AddTabCompletion \\\\cCT$ \<bs>\<bs>CREATE\<space>TABLE ts:
AddTabCompletion \\\\cU$ \<bs>UPDATE ts:
AddTabCompletion \\\\cII$ \<bs>\<bs>INSERT\<space>INTO ts:
AddTabCompletion \\\\cdf$ \<bs>\<bs>DELETE\<space>FROM ts:
AddTabCompletion \\\\cAT$ \<bs>\<bs>ALTER\<space>TABLE ts:
AddTabCompletion \\\\cgb$ \<bs>\<bs>GROUP\<space>BY ts: fitness:3
AddTabCompletion \\\\clj$ \<bs>\<bs>LEFT\<space>JOIN ts:
AddTabCompletion \\\\cde$ \<bs>\<bs>DESCRIBE ts:
AddTabCompletion ALTER\\\\s\\\\+TABLE.*\\\\cA$ DD ts: break:
AddTabCompletion ALTER\\\\s\\\\+TABLE.*\\\\cD$ ROP ts: break:
AddTabCompletion ALTER\\\\s\\\\+TABLE.*\\\\cC$ HANGE ts: break:
AddTabCompletion \s\+l$ ike ts:
AddTabCompletion \s\+like \=$ %
AddTabCompletion \\\\cnn$ \<bs>\<bs>\<bs>NOT\<space>NULL ts: ls:
AddTabCompletion L IKE\<space>
" call vl#lib#completion#contextcompletion#InitContextCompletion(
" \ [ [ "Tab",'<c-tab>','b:tab_compl']
" \ , [ "CR" ,'<cr>' ,'b:cr_compl' ,"\<cr>"] ])

" AddTabCompletion \\\\cd$ \<bs>ESCRIBE ts:
" AddTabCompletion \\\\cs$ \<bs>SELECT ts:
" AddTabCompletion \\\\cOB$ \<bs>\<bs>ORDER\<space>BY ts: fitness:break
" AddTabCompletion \\\\cDT$ \<bs>\<bs>DROP\<space>TABLE\<space>IF\<space>EXISTS\<space> ts: fitness:break
" AddTabCompletion ^\s*\\\\c\\\%(SELECT\\\\|DELETE\\\\).*FROM WHERE ls: ts: fitness:2
" AddTabCompletion ^\s*\\\\c\\\%(UPDATE\\\\).* SET ls: ts: fitness:2
" AddTabCompletion ^\s*\\\\c\\\%(UPDATE\\\\).*SET WHERE ls: ts: fitness:2
" AddTabCompletion ^\s*SELECT FROM bcnm:FROM ls: ts:
" AddTabCompletion ^\s*INSERT\\\\s\\\\+INTO VALUES ts:
" AddTabCompletion \\\\cCT$ \<bs>\<bs>CREATE\<space>TABLE ts:
" AddTabCompletion \\\\cU$ \<bs>UPDATE ts:
" AddTabCompletion \\\\cII$ \<bs>\<bs>INSERT\<space>INTO ts:
" AddTabCompletion \\\\cdf$ \<bs>\<bs>DELETE\<space>FROM ts:
" AddTabCompletion \\\\cAT$ \<bs>\<bs>ALTER\<space>TABLE ts:
" AddTabCompletion \\\\cgb$ \<bs>\<bs>GROUP\<space>BY ts: fitness:3
" AddTabCompletion \\\\clj$ \<bs>\<bs>LEFT\<space>JOIN ts:
" AddTabCompletion \\\\cde$ \<bs>\<bs>DESCRIBE ts:
" AddTabCompletion ALTER\\\\s\\\\+TABLE.*\\\\cA$ DD ts: break:
" AddTabCompletion ALTER\\\\s\\\\+TABLE.*\\\\cD$ ROP ts: break:
" AddTabCompletion ALTER\\\\s\\\\+TABLE.*\\\\cC$ HANGE ts: break:
" AddTabCompletion \s\+l$ ike ts:
" AddTabCompletion \s\+like \=$ %
" AddTabCompletion \\\\cnn$ \<bs>\<bs>\<bs>NOT\<space>NULL ts: ls:
" AddTabCompletion L IKE\<space>

set sw=2
setlocal fdm=indent
Expand All @@ -52,7 +52,7 @@ set comments+=:--
set formatoptions=croql


exec vl#lib#vimscript#dontloadtwice#DontLoadTwice('b:sql')
" exec vl#lib#vimscript#dontloadtwice#DontLoadTwice('b:sql')

command! ReplaceSpacesWithUnderscores %s/^\([^`]*\%(\%([^`]*`[^` ]*`\)*\)\?[^`]*\)`\([^`]*\) \([^`]*\)`/\1`\2_\3`/g

Expand Down
1 change: 0 additions & 1 deletion ftplugin/vim_mw.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
call theonevimlibsetup#Setup()
fun! s:LTSp(s)
return vim_addon_other#InsertLT(' ',a:s,' ')
endf
Expand Down

0 comments on commit fe7b486

Please sign in to comment.