Created
December 20, 2010 15:34
Revisions
-
kana revised this gist
Dec 20, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,4 +12,4 @@ function! AddUse() endif endfunction nnoremap ,us :<C-u>call AddUse()<CR> -
kana revised this gist
Dec 20, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,4 +12,4 @@ function! AddUse() endif endfunction nnoremap ,us :call AddUse()<CR> -
kana revised this gist
Dec 20, 2010 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,8 +5,8 @@ function! AddUse() normal! yiw let default = @0 let package = input('Package? ', default) if (search('^use\s\+'.package, 'bnw') == 0) call search('^use\s\+', 'b') put ='use ' . package . ';' call cursor(line+1, col) endif -
kana revised this gist
Dec 20, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ function! AddUse() let line = line('.') let col = col('.') normal! yiw let default = @0 let package = input('Package? ', default) if (search('^use '.package, 'bnw') == 0) call search('^use ', 'b') -
kana revised this gist
Dec 20, 2010 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,9 +6,9 @@ function! AddUse() let default = @" let package = input('Package? ', default) if (search('^use '.package, 'bnw') == 0) call search('^use ', 'b') put ='use ' . package . ';' call cursor(line+1, col) endif endfunction -
kana revised this gist
Dec 20, 2010 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,11 @@ " perl: add 'use' statement for package name under the cursor function! AddUse() let line = line('.') let col = col('.') normal! yiw let default = @" let package = input('Package? ', default) if (search('^use '.package, 'bnw') == 0) call search('^use ','b') put ='use ' . package . ';' call cursor(line+1,col) -
kana revised this gist
Dec 20, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ function! AddUse() let package = input("Package? ", default) if (search("^use ".package, "bnw") == 0) call search('^use ','b') put ='use ' . package . ';' call cursor(line+1,col) endif endfunction -
kana revised this gist
Dec 20, 2010 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ function! AddUse() let line = line(".") let col = col(".") normal! yiw let default = @" let package = input("Package? ", default) if (search("^use ".package, "bnw") == 0) @@ -12,4 +12,4 @@ function! AddUse() endif endfunction noremap ,us :call AddUse()<CR> -
kana revised this gist
Dec 20, 2010 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,14 @@ " perl: add 'use' statement for package name under the cursor function! AddUse() let line = line(".") let col = col(".") normal yiw let default = @" let package = input("Package? ", default) if (search("^use ".package, "bnw") == 0) call search('^use ','b') execute "normal ouse ".package.";" call cursor(line+1,col) endif endfunction -
hanekomu created this gist
Dec 20, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ " perl: add 'use' statement for package name under the cursor function! AddUse() let s:line = line(".") let s:col = col(".") normal yiw let s:default = @" let s:package = input("Package? ", s:default) if (search("^use ".s:package, "bnw") == 0) call search('^use ','b') execute "normal ouse ".s:package.";" call cursor(s:line+1,s:col) endif endfunction map ,us :call AddUse()<CR>