Skip to content

Commit

Permalink
update: init.fnl,
Browse files Browse the repository at this point in the history
  • Loading branch information
Cassin01 committed May 6, 2024
1 parent 39b3ba6 commit cdff974
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
28 changes: 26 additions & 2 deletions UltiSnips/rust.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ snippet pre "pre write"
#![allow(unused_mut)]
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(unused_macros)]

use std::collections::HashSet;
use std::collections::HashMap;
Expand All @@ -74,6 +75,11 @@ use std::collections::VecDeque;
use std::cmp::{max, min};
use std::mem::swap;
use std::io::prelude::*; // input()
// use itertools::Itertools; // permutations and combinations

macro_rules! round {
($x:expr, $scale:expr) => (($x * $scale).round() / $scale)
}

fn input<T>() -> T
where T: std::str::FromStr {
Expand Down Expand Up @@ -194,11 +200,11 @@ fn input<T>() -> T
}
endsnippet

snippet inputc "input char"
snippet inn "input number"
let ${1:mut }n = input::<${2:usize}>();
endsnippet

snippet inputv "input vector"
snippet inv "input vector"
let ${1:mut }v = (0..${2:n})
.map(|_| input::<${3:usize}>())
.collect::<Vec<_>>();
Expand Down Expand Up @@ -316,6 +322,24 @@ pub mod modular {
use modular::Mod;
endsnippet

snippet math "math"
fn min<T: Ord>(a: T, b: T) -> T {
if a < b {
a
} else {
b
}
}

fn max<T: Ord>(a: T, b: T) -> T {
if a > b {
a
} else {
b
}
}
endsnippet

snippet pl "println"
println!("${1:{:?}}", ${VISUAL}${2:${VISUAL/(.*)//}});
endsnippet
Expand Down
7 changes: 5 additions & 2 deletions fnl/core/au/init.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@
(print (vim.inspect b)))
(au! :match-hi :ColorScheme
(do
(vim.api.nvim_set_hl 0 :Comment (link :Comment {:fg (blightness (get-hl :Comment :fg) 1.6)}))
(when (= vim.g.colors_name "fluoromachine")
(vim.api.nvim_set_hl 0 :Comment (link :Comment {:fg (blightness (get-hl :Comment :fg) 1.6)}))
(vim.api.nvim_set_hl 0 :Folded (link :Folded {:bg (blightness (get-hl :Folded :bg) 0.5)
:fg (blightness (get-hl :Folded :fg) 1.5)})))
(each [_ k (ipairs
[;[:Tabs {:bg (blightness (get-hl :Normal :bg) 0.9)}]
[:TrailingSpaces {:bg :#FFa331}]
Expand Down Expand Up @@ -251,8 +254,8 @@
)
:pattern [:*.scm]
:group pattern})

;; }}}

(when (vim.fn.has :mac)
(au! :adoc_preview :BufWritePost
(let [cmd (concat-with
Expand Down

0 comments on commit cdff974

Please sign in to comment.