<commit_before>function bell() { ruby 'print "\a"' }
function trunc(ch) { ruby 'env[:out].puts args[1][1]' :ch }
function chars() { ruby "env[:out].puts (('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a).join(' ')"}
function puncts() { ruby 'a=((33..47).to_a + (58..64).to_a + (91..96).to_a + (123..126).to_a).map {|e| "_" + e.chr + "_" }.join(" "); env[:out].puts a' } 
function ctrls() {ruby 'env[:out].puts ("a".."z").to_a.map {|e| "ctrl_#{e}" }.join(" ")' }
alias av="ruby 'puts args.length'"
function mode.keys.alpha() { for i in :(chars) { store &() { echo -n :i | push line/left } /v/modes/viper/key_:{i} } }
function view.keys.alpha() { for i in :(chars) { store &() { echo -n :i  } /v/views/viper/key_:{i} } }
function view.keys.punct() { for i in :(puncts) { key=:(trunc :i); fname=:(echo -n :key | xfkey); store &() { echo -n :key } /v/views/viper/:{fname} } } 
function mode.keys.punct() { for i in :(puncts) { key=:(trunc :i); fname=:(echo -n :key | xfkey); store &() { echo -n :key | push line/left } /v/modes/viper/:{fname} } }
function mode.keys.space() {
fname=:(echo -n ' '|xfkey); store &() { echo -n ' '| push line/left } /v/modes/viper/:{fname} 
store &() { pop line/left } /v/modes/viper/key_backspace
}
function view.keys.space() {
fname=:(echo -n ' '|xfkey); store &() { echo -n space } /v/views/viper/:{fname}
store &() { echo -n delete :(xfkey|xfkey -h) } /v/views/viper/key_backspace
}
function mode.ctrl() {
for i in :(ctrls) { store &() { nop } /v/modes/viper/:{i} }
}
function view.ctrl() {
for i in :(ctrls) { store &() { bell } /v/views/viper/:{i} }
store &() { cat < line } /v/views/viper/ctrl_l
store &() { peek line/right | xfkey | xfkey -h } /v/views/viper/ctrl_j
}
function mode.move.keys() {
store &() { pop line/left | enq line/right } /v/modes/viper/move_left
store &() { deq line/right | push line/left } /v/modes/viper/move_right
store &() { cd nl } /v/modes/viper/move_down
}
function view.move.keys() {
store &() { peek line/right | xfkey | xfkey -h } /v/views/viper/move_left
store &() { peek line/right | xfkey | xfkey -h } /v/views/viper/move_right
store &() { cat < line } /v/views/viper/move_down
}
function apply(ch) { exec /v/modes/viper/:{ch} | exec /v/views/viper/:{ch} }
function install() { 
mode.keys.alpha
mode.keys.punct
view.keys.alpha
view.keys.punct
mode.keys.space
view.keys.space
mode.ctrl
view.ctrl
store &() { nop } /v/modes/viper/unknown
store &() { bell } /v/views/viper/unknown
mode.move.keys
view.move.keys
}
function vip() { loop { fn=:(raw -|xfkey); eq :fn ctrl_q && break; apply :fn } }<commit_msg>\'added move_up , also added simple wc command to be used in ctrl_k\'<commit_after>function bell() { ruby 'print "\a"' }
function trunc(ch) { ruby 'env[:out].puts args[1][1]' :ch }
function chars() { ruby "env[:out].puts (('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a).join(' ')"}
function puncts() { ruby 'a=((33..47).to_a + (58..64).to_a + (91..96).to_a + (123..126).to_a).map {|e| "_" + e.chr + "_" }.join(" "); env[:out].puts a' } 
function ctrls() {ruby 'env[:out].puts ("a".."z").to_a.map {|e| "ctrl_#{e}" }.join(" ")' }
alias av="ruby 'puts args.length'"
function mode.keys.alpha() { for i in :(chars) { store &() { echo -n :i | push line/left } /v/modes/viper/key_:{i} } }
function view.keys.alpha() { for i in :(chars) { store &() { echo -n :i  } /v/views/viper/key_:{i} } }
function view.keys.punct() { for i in :(puncts) { key=:(trunc :i); fname=:(echo -n :key | xfkey); store &() { echo -n :key } /v/views/viper/:{fname} } } 
function mode.keys.punct() { for i in :(puncts) { key=:(trunc :i); fname=:(echo -n :key | xfkey); store &() { echo -n :key | push line/left } /v/modes/viper/:{fname} } }
function mode.keys.space() {
fname=:(echo -n ' '|xfkey); store &() { echo -n ' '| push line/left } /v/modes/viper/:{fname} 
store &() { pop line/left } /v/modes/viper/key_backspace
}
function view.keys.space() {
fname=:(echo -n ' '|xfkey); store &() { echo -n space } /v/views/viper/:{fname}
store &() { echo -n delete :(xfkey|xfkey -h) } /v/views/viper/key_backspace
}
function mode.ctrl() {
for i in :(ctrls) { store &() { nop } /v/modes/viper/:{i} }
}
function view.ctrl() {
for i in :(ctrls) { store &() { bell } /v/views/viper/:{i} }
store &() { cat < line } /v/views/viper/ctrl_l
store &() { peek line/right | xfkey | xfkey -h } /v/views/viper/ctrl_j
}
function mode.move.keys() {
store &() { pop line/left | enq line/right } /v/modes/viper/move_left
store &() { deq line/right | push line/left } /v/modes/viper/move_right
store &() { cd .. } /v/modes/viper/move_up
store &() { cd nl } /v/modes/viper/move_down
}
function view.move.keys() {
store &() { peek line/right | xfkey | xfkey -h } /v/views/viper/move_left
store &() { peek line/right | xfkey | xfkey -h } /v/views/viper/move_right
store &() { cat < line } /v/views/viper/move_up
store &() { cat < line } /v/views/viper/move_down
}
function apply(ch) { exec /v/modes/viper/:{ch} | exec /v/views/viper/:{ch} }
function install() { 
mode.keys.alpha
mode.keys.punct
view.keys.alpha
view.keys.punct
mode.keys.space
view.keys.space
mode.ctrl
view.ctrl
store &() { nop } /v/modes/viper/unknown
store &() { bell } /v/views/viper/unknown
mode.move.keys
view.move.keys
}
function vip() { loop { fn=:(raw -|xfkey); eq :fn ctrl_q && break; apply :fn } }
{'fraction_non_alphanumeric': 0.23502739467220857, 'fraction_numerical': 0.008312866049499339, 'mean_word_length': 3.5093696763202726, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '719772', 'n_tokens_mistral': 2284, 'n_tokens_neox': 2190, 'n_words': 490}