Permalink
Browse files

Improved vim handling of Perl6.

Added _perltidyrc
  • Loading branch information...
1 parent 62ba486 commit ec11cb651680dbe5c2951d38e6e59900e420f480 Christopher Bottoms committed Apr 20, 2011
Showing with 20 additions and 16 deletions.
  1. +3 −0 _perltidyrc
  2. +8 −8 _vimrc
  3. +8 −7 templates/perl6/module.pm
  4. +1 −1 templates/perl6/test.t
View
@@ -0,0 +1,3 @@
+-fws
+-bt=0 # Medium brace tightness
+-bbt=0 # Medium block brace tightness
View
@@ -148,16 +148,16 @@ set statusline=%F%m%r%h%w\ [POS=%04l,%04v]\ [%p%%]\ [LEN=%L]
" (Based on http://vim.wikia.com/wiki/VimTip646)
"
" Define maps for Normal and Visual modes, then re-use
- " them for Insert and Select modes. (note lack of 'nore')
+ " them for Select modes. (note lack of 'nore')
+ " Removed use for imap because C-K is used for composing special
+ " characters
"
nnoremap <silent> <C-J> :move -2<CR>
nnoremap <silent> <C-K> :move +<CR>
- xnoremap <silent> <C-J> :move '<-2<CR>gv
- xnoremap <silent> <C-K> :move '>+<CR>gv
- imap <silent> <C-J> <C-O><C-J>
- imap <silent> <C-K> <C-O><C-K>
- smap <silent> <C-J> <C-G><C-J><C-G>
- smap <silent> <C-K> <C-G><C-K><C-G>
+ "xnoremap <silent> <C-J> :move '<-2<CR>gv
+ "xnoremap <silent> <C-K> :move '>+<CR>gv
+ "smap <silent> <C-J> <C-G><C-J><C-G>
+ "smap <silent> <C-K> <C-G><C-K><C-G>
"
" Movement
@@ -167,7 +167,7 @@ set statusline=%F%m%r%h%w\ [POS=%04l,%04v]\ [%p%%]\ [LEN=%L]
" Perl Specific
" Run Perl6
- nnoremap <Leader>, <Esc>:! perl6 %<CR>
+ nnoremap <Leader>, <Esc>:w<CR>:! perl6 %<CR>
"Abbreviations
iab pself  my $self = shift;
@@ -7,12 +7,13 @@ module MODULE;
our sub run ( $input_filename, $output_filename = 'out.txt' ) {
my $fh = open $input_filename;
return 1;
- CATCH {
- say qq{
- USAGE
-
- $*PROGRAM_NAME input_filename [output_filename]
- };
- }
+ CATCH { usage() }
}
+sub usage {
+say qq{
+ USAGE
+
+ $*PROGRAM_NAME input_filename [output_filename]
+};
+}
@@ -3,7 +3,7 @@
use v6; # Require Perl 6
use Test; # Testing module
-BEGIN { @*INC.push('DIRPATH/MODULE/lib'); }
+BEGIN { @*INC.unshift('DIRPATH/MODULE/lib'); }
use MODULE;
MODULE::run();

0 comments on commit ec11cb6

Please sign in to comment.