Compare commits
3 commits
07a58afaff
...
2b8634a56a
Author | SHA1 | Date | |
---|---|---|---|
2b8634a56a | |||
66c22f7a13 | |||
3ac8ca1f5e |
4 changed files with 21 additions and 33 deletions
10
flake.nix
10
flake.nix
|
@ -54,18 +54,8 @@
|
||||||
combine [
|
combine [
|
||||||
complete.toolchain
|
complete.toolchain
|
||||||
];
|
];
|
||||||
# rs-platform = pkgs.makeRustPlatform {
|
|
||||||
# cargo = rs-toolchain;
|
|
||||||
# rustc = rs-toolchain;
|
|
||||||
# };
|
|
||||||
crane-lib = (crane.mkLib nixpkgs.legacyPackages.${system}).overrideToolchain rs-toolchain;
|
crane-lib = (crane.mkLib nixpkgs.legacyPackages.${system}).overrideToolchain rs-toolchain;
|
||||||
rs-programs = final: prev: {
|
rs-programs = final: prev: {
|
||||||
# s10e-jrnl = rs-platform.buildRustPackage {
|
|
||||||
# pname = "jrnl";
|
|
||||||
# version = "0.0.1";
|
|
||||||
# src = ./programs/jrnl;
|
|
||||||
# cargoLock.lockFile = ./programs/jrnl/Cargo.lock;
|
|
||||||
# };
|
|
||||||
s10e-jrnl = crane-lib.buildPackage {
|
s10e-jrnl = crane-lib.buildPackage {
|
||||||
pname = "s10e-bs";
|
pname = "s10e-bs";
|
||||||
version = "0.0.1";
|
version = "0.0.1";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{...}: {
|
{...}: {
|
||||||
programs.niri.enable = true;
|
programs.niri.enable = true;
|
||||||
home-manager.users.jade = {...}: {
|
home-manager.users.jade = {pkgs, ...}: {
|
||||||
imports = [
|
imports = [
|
||||||
./notifications.nix
|
./notifications.nix
|
||||||
./terminal.nix
|
./terminal.nix
|
||||||
|
@ -17,6 +17,10 @@
|
||||||
services.network-manager-applet.enable = true;
|
services.network-manager-applet.enable = true;
|
||||||
xsession.enable = true;
|
xsession.enable = true;
|
||||||
|
|
||||||
|
home.packages = [
|
||||||
|
pkgs.fluent-reader
|
||||||
|
];
|
||||||
|
|
||||||
services.gpg-agent = {
|
services.gpg-agent = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableNushellIntegration = true;
|
enableNushellIntegration = true;
|
||||||
|
|
|
@ -54,15 +54,15 @@
|
||||||
"Mod+7".action.focus-workspace = 7;
|
"Mod+7".action.focus-workspace = 7;
|
||||||
"Mod+8".action.focus-workspace = 8;
|
"Mod+8".action.focus-workspace = 8;
|
||||||
"Mod+9".action.focus-workspace = 9;
|
"Mod+9".action.focus-workspace = 9;
|
||||||
"Mod+Shift+1".action.move-column-to-workspace = 1;
|
"Mod+Ctrl+1".action.move-column-to-workspace = 1;
|
||||||
"Mod+Shift+2".action.move-column-to-workspace = 2;
|
"Mod+Ctrl+2".action.move-column-to-workspace = 2;
|
||||||
"Mod+Shift+3".action.move-column-to-workspace = 3;
|
"Mod+Ctrl+3".action.move-column-to-workspace = 3;
|
||||||
"Mod+Shift+4".action.move-column-to-workspace = 4;
|
"Mod+Ctrl+4".action.move-column-to-workspace = 4;
|
||||||
"Mod+Shift+5".action.move-column-to-workspace = 5;
|
"Mod+Ctrl+5".action.move-column-to-workspace = 5;
|
||||||
"Mod+Shift+6".action.move-column-to-workspace = 6;
|
"Mod+Ctrl+6".action.move-column-to-workspace = 6;
|
||||||
"Mod+Shift+7".action.move-column-to-workspace = 7;
|
"Mod+Ctrl+7".action.move-column-to-workspace = 7;
|
||||||
"Mod+Shift+8".action.move-column-to-workspace = 8;
|
"Mod+Ctrl+8".action.move-column-to-workspace = 8;
|
||||||
"Mod+Shift+9".action.move-column-to-workspace = 9;
|
"Mod+Ctrl+9".action.move-column-to-workspace = 9;
|
||||||
|
|
||||||
# column editing stuffs
|
# column editing stuffs
|
||||||
"Mod+BracketLeft".action.consume-or-expel-window-left = [];
|
"Mod+BracketLeft".action.consume-or-expel-window-left = [];
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
#![feature(iter_array_chunks)]
|
#![feature(pattern, iter_array_chunks, round_char_boundary, iter_collect_into)]
|
||||||
#![feature(round_char_boundary)]
|
|
||||||
#![feature(iter_collect_into)]
|
|
||||||
#![feature(pattern)]
|
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
io::{Read, Write},
|
io::{Read, Write},
|
||||||
|
@ -17,17 +14,16 @@ const BOOLS: &[[&str; 2]] = &[
|
||||||
["no", "yes"],
|
["no", "yes"],
|
||||||
];
|
];
|
||||||
|
|
||||||
fn main() {
|
fn main() -> std::io::Result<()> {
|
||||||
let mut input = String::new();
|
let mut input = String::new();
|
||||||
let mut stdin = std::io::stdin();
|
let mut stdin = std::io::stdin();
|
||||||
let mut stdout = std::io::stdout();
|
let mut stdout = std::io::stdout();
|
||||||
|
|
||||||
stdin.read_to_string(&mut input).unwrap();
|
stdin.read_to_string(&mut input)?;
|
||||||
|
|
||||||
let bool_locs = find_bools(&input);
|
let bool_locs = find_bools(&input);
|
||||||
stdout
|
|
||||||
.write_all(replace_bools(&mut input, bool_locs).as_bytes())
|
stdout.write_all(replace_bools(&mut input, bool_locs).as_bytes())
|
||||||
.unwrap();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type BoolLocs = [[Vec<usize>; 2]; BOOL_COUNT];
|
type BoolLocs = [[Vec<usize>; 2]; BOOL_COUNT];
|
||||||
|
@ -96,14 +92,12 @@ fn find_bools(input: &str) -> [[Vec<usize>; 2]; BOOL_COUNT] {
|
||||||
&& char_guard(
|
&& char_guard(
|
||||||
input[it.1.floor_char_boundary(it.0 - 1)..it.0]
|
input[it.1.floor_char_boundary(it.0 - 1)..it.0]
|
||||||
.chars()
|
.chars()
|
||||||
.last()
|
.last()?,
|
||||||
.unwrap(),
|
|
||||||
)
|
)
|
||||||
&& char_guard(
|
&& char_guard(
|
||||||
input[(last_idx)..(input.ceil_char_boundary(last_idx + 1))]
|
input[(last_idx)..(input.ceil_char_boundary(last_idx + 1))]
|
||||||
.chars()
|
.chars()
|
||||||
.last()
|
.last()?,
|
||||||
.unwrap(),
|
|
||||||
))
|
))
|
||||||
.then_some(it.0)
|
.then_some(it.0)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue