diff options
author | George Abbott <george@gabbott.dev> | 2025-01-26 11:36:35 +0000 |
---|---|---|
committer | George Abbott <george@gabbott.dev> | 2025-01-26 11:36:35 +0000 |
commit | 725f1f1c08c2d7e338d649062622d313292a41fa (patch) | |
tree | cddf942baa9a522810ea4d5e1d80ab41150fc994 | |
parent | e9ab754fdf893b7b71ee7d0fbc84f567984a6bbe (diff) |
cfg
l--------- | cfg/fontconfig/fontconfig | 1 | ||||
-rw-r--r-- | cfg/fontconfig/fonts.conf | 37 | ||||
-rw-r--r-- | cfg/foot/foot.ini | 6 | ||||
-rw-r--r-- | cfg/helix/config.toml | 1 | ||||
l--------- | cfg/helix/helix | 1 | ||||
-rw-r--r-- | cfg/newsboat/config | 3 | ||||
-rw-r--r-- | cfg/nvim/init.vim | 36 | ||||
-rw-r--r-- | cfg/nvim/syntax/close.vim | 376 | ||||
-rwxr-xr-x | cfg/profile | 10 | ||||
-rwxr-xr-x | cfg/river/init | 58 | ||||
l--------- | cfg/river/river | 1 | ||||
-rwxr-xr-x | cfg/tmux/tmux.conf | 30 | ||||
-rw-r--r-- | cfg/waybar/config | 93 | ||||
-rw-r--r-- | cfg/waybar/style.css | 235 | ||||
-rwxr-xr-x | cfg/zsh/zprofile | 3 | ||||
-rwxr-xr-x | cfg/zsh/zshenv | 35 | ||||
-rwxr-xr-x | cfg/zsh/zshrc | 94 |
17 files changed, 1020 insertions, 0 deletions
diff --git a/cfg/fontconfig/fontconfig b/cfg/fontconfig/fontconfig new file mode 120000 index 0000000..1801512 --- /dev/null +++ b/cfg/fontconfig/fontconfig @@ -0,0 +1 @@ +/home/neo/git/neodot/cfg/fontconfig
\ No newline at end of file diff --git a/cfg/fontconfig/fonts.conf b/cfg/fontconfig/fonts.conf new file mode 100644 index 0000000..c34da9b --- /dev/null +++ b/cfg/fontconfig/fonts.conf @@ -0,0 +1,37 @@ +<?xml version='1.0'?> + +<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> +<fontconfig> + <alias> + <family>serif</family> + <prefer> + <family>Times New Roman</family> + </prefer> + </alias> + + <alias> + <family>sans</family> + <prefer> + <family>Ubuntu</family> + </prefer> + </alias> + + <alias> + <family>monospace</family> + <prefer> + <family>JetBrains Mono Nerd Font Mono</family> + <family>ProggyClean Nerd Font Mono</family> + <family>CodeNewRoman Nerd Font Mono</family> + <family>IosevkaTerm Nerd Font Propo</family> + <family>CaskaydiaCove Nerd Font Mono</family> + + <!-- others... --> + <family>NotoSansM Nerd Font Mono</family> + <family>VictorMono Nerd Font Mono</family> + <family>FiraMono Nerd Font</family> + <family>BigBlueTerm437 Nerd Font Mono</family> + </prefer> + </alias> + + <dir>~/.local/share/fonts</dir> +</fontconfig> diff --git a/cfg/foot/foot.ini b/cfg/foot/foot.ini new file mode 100644 index 0000000..50754dc --- /dev/null +++ b/cfg/foot/foot.ini @@ -0,0 +1,6 @@ +font=monospace:size=8 + +[main] +include=/usr/share/foot/themes/tango + +# vim: ft=dosini diff --git a/cfg/helix/config.toml b/cfg/helix/config.toml new file mode 100644 index 0000000..279b48e --- /dev/null +++ b/cfg/helix/config.toml @@ -0,0 +1 @@ +theme = "base16_default" diff --git a/cfg/helix/helix b/cfg/helix/helix new file mode 120000 index 0000000..c4fa38b --- /dev/null +++ b/cfg/helix/helix @@ -0,0 +1 @@ +/home/neo/git/neodot/cfg/helix
\ No newline at end of file diff --git a/cfg/newsboat/config b/cfg/newsboat/config new file mode 100644 index 0000000..d49c01c --- /dev/null +++ b/cfg/newsboat/config @@ -0,0 +1,3 @@ +auto-reload yes +reload-threads 100 +text-width 80 diff --git a/cfg/nvim/init.vim b/cfg/nvim/init.vim new file mode 100644 index 0000000..825403b --- /dev/null +++ b/cfg/nvim/init.vim @@ -0,0 +1,36 @@ +set nocompatible +set hlsearch +set shiftwidth=4 +set autoindent +set number +set relativenumber +set cc=80 +filetype plugin indent on +syntax on +set cursorline +color wildcharm +set autochdir + +call plug#begin() + +Plug 'nvim-lua/plenary.nvim' +Plug 'nvim-telescope/telescope-fzf-native.nvim' +Plug 'nvim-telescope/telescope.nvim', { 'branch': '0.1.x' } + +Plug 'NLKNguyen/papercolor-theme' +Plug 'https://gitlab.com/protesilaos/tempus-themes-vim.git' +Plug 'yorickpeterse/vim-paper' +Plug 'morhetz/gruvbox' +Plug 'EdenEast/nightfox.nvim' +Plug 'rebelot/kanagawa.nvim' +Plug 'craftzdog/solarized-osaka.nvim' +Plug 'nyoom-engineering/oxocarbon.nvim' +Plug 'whatyouhide/vim-gotham' +Plug 'miikanissi/modus-themes.nvim' +Plug 'tjdevries/colorbuddy.nvim' +Plug 'zootedb0t/citruszest.nvim' +Plug 'Love-Pengy/lillilac.nvim' +Plug 'kyazdani42/blue-moon' + +call plug#end() + diff --git a/cfg/nvim/syntax/close.vim b/cfg/nvim/syntax/close.vim new file mode 100644 index 0000000..1bc8994 --- /dev/null +++ b/cfg/nvim/syntax/close.vim @@ -0,0 +1,376 @@ +" Vim syntax file +" Language: Close +" Maintainer: George Abbott <george@gabbott.dev> +" Last Change: 2024-08-03 +" For bugs, patches and license go to https://github.com/close-lang/close.vim + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" Syntax definitions {{{1 +" Basic keywords {{{2 +syn keyword closeConditional switch if else elif unless +syn keyword closeRepeat loop while for until +" `:syn match` must be used to prioritize highlighting `for` keyword. +syn keyword closeStructure struct enum error record +syn keyword closeUnion union nextgroup=closeIdentifier skipwhite skipempty contained +syn match closeUnionContextual /\<union\_s\+\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*/ transparent contains=closeUnion +syn keyword closeOperator as +syn keyword closeExistential existential nextgroup=closeTypedef skipwhite skipempty contained +syn match closeExistentialContextual /\<existential\_s\+type/ transparent contains=closeExistential,closeTypedef + +syn match closeAssert "\<assert\(\w\)*!" contained +syn match closeAsync "\<async\%(\s\|\n\)\@=" +syn keyword closeKeyword then do end in out has with c asm goto label is where +syn keyword closeKeyword construct destruct deconstruct +syn keyword closeKeyword default default_initialized zero_initialized uninitialized +syn keyword closeKeyword panic recklessly recover rescue ensure retry +syn keyword closeKeyword type typeof sizeof sized unsized assert +syn keyword closeKeyword abstract virtual final override +syn keyword closeKeyword generic generator immediate packed repr +syn keyword closeKeyword permitted + +syn keyword closeKeyword break redo next skip +syn keyword closeKeyword box +syn keyword closeKeyword next +syn keyword closeKeyword crate +syn keyword closeKeyword priv typeof unsized abstract virtual final override nopanic +syn keyword closeKeyword extern nextgroup=closeExternCrate,closeObsoleteExternMod skipwhite skipempty +syn keyword closeKeyword fn nextgroup=closeFuncName skipwhite skipempty +syn keyword closeKeyword pub priv nextgroup=closePubScope skipwhite skipempty +syn keyword closeKeyword return +syn keyword closeKeyword yield +syn keyword closeKeyword import nextgroup=closeModPath skipwhite skipempty +" FIXME: Scoped impl's name is also fallen in this category +syn keyword closeKeyword module trait nextgroup=closeIdentifier skipwhite skipempty +syn keyword closeStorage move mut ref static const +syn match closeDefault /\<default\ze\_s\+\(impl\|fn\|type\|const\)\>/ +syn keyword closeAwait await +syn keyword closeKeyword try catch propagate or_else + +syn keyword closePubScopeCrate crate contained +syn match closePubScopeDelim /[()]/ contained +syn match closePubScope /([^()]*)/ contained contains=closePubScopeDelim,closePubScopeCrate,closeSuper,closeModPath,closeModPathSep,closeSelf transparent + +syn keyword closeExternCrate crate contained nextgroup=closeIdentifier,closeExternCrateString skipwhite skipempty +" This is to get the `bar` part of `extern crate "foo" as bar;` highlighting. +syn match closeExternCrateString /".*"\_s*as/ contained nextgroup=closeIdentifier skipwhite transparent skipempty contains=closeString,closeOperator +syn keyword closeObsoleteExternMod mod contained nextgroup=closeIdentifier skipwhite skipempty + +syn match closeIdentifier contains=closeIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained +syn match closeFuncName "\%(r#\)\=\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained + +syn region closeMacroRepeat matchgroup=closeMacroRepeatDelimiters start="$(" end="),\=[*+]" contains=TOP +syn match closeMacroVariable "$\w\+" +syn match closeRawIdent "\<r#\h\w*" contains=NONE + + +" Built-in types {{{2 +syn keyword closeType isize usize char bool u8 u16 u32 u64 u128 f32 +syn keyword closeType f64 i8 i16 i32 i64 i128 str void size noreturn + +" Things from the libstd v1 prelude (src/libstd/prelude/v1.rs) {{{2 +" This section is just straight transformation of the contents of the prelude, +" to make it easy to update. + +" Reexported core operators {{{3 +syn keyword closeTrait Copy Send Sized Sync +syn keyword closeTrait Drop Fn FnMut FnOnce + +" Reexported functions {{{3 +" There’s no point in highlighting these; when one writes drop( or drop::< it +" gets the same highlighting anyway, and if someone writes `let drop = …;` we +" don’t really want *that* drop to be highlighted. +"syn keyword closeFunction drop + +" Reexported types and traits {{{3 +syn keyword closeTrait Box +syn keyword closeTrait ToOwned +syn keyword closeTrait Clone +syn keyword closeTrait PartialEq PartialOrd Eq Ord +syn keyword closeTrait Default +syn keyword closeTrait Iterator Extend IntoIterator +syn keyword closeTrait DoubleEndedIterator ExactSizeIterator +syn keyword closeEnum Option +syn keyword closeEnumVariant Some None +syn keyword closeEnum Result +syn keyword closeEnumVariant Ok Err +syn keyword closeTrait SliceConcatExt +syn keyword closeTrait String ToString +syn keyword closeTrait Vec + +" Other syntax {{{2 +syn keyword closeSelf self +syn keyword closeBoolean true false + +" If foo::bar changes to foo.bar, change this ("::" to "\."). +" If foo::bar changes to Foo::bar, change this (first "\w" to "\u"). +syn match closeModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3 +syn match closeModPathSep "::" + +syn match closeFuncCall "\w\(\w\)*("he=e-1,me=e-1 +syn match closeFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::<T>(); + +" This is merely a convention; note also the use of [A-Z], restricting it to +" latin identifiers rather than the full Unicode uppercase. I have not used +" [:upper:] as it depends upon 'noignorecase' +"syn match closeCapsIdent display "[A-Z]\w\(\w\)*" + +syn match closeOperator display "\%(+\|-\|/\|*\|=\|\^\|&\||\|!\|>\|<\|%\)=\?" +" This one isn't *quite* right, as we could have binary-& with a reference +syn match closeSigil display /&\s\+[&~@*][^)= \t\r\n]/he=e-1,me=e-1 +syn match closeSigil display /[&~@*][^)= \t\r\n]/he=e-1,me=e-1 +" This isn't actually correct; a closure with no arguments can be `|| { }`. +" Last, because the & in && isn't a sigil +syn match closeOperator display "&&\|||" +" This is closeArrowCharacter rather than closeArrow for the sake of matchparen, +" so it skips the ->; see http://stackoverflow.com/a/30309949 for details. +syn match closeArrowCharacter display "->" +syn match closeQuestionMark display "?\([a-zA-Z]\+\)\@!" + +syn match closeMacro '\w\(\w\)*!' contains=closeAssert,closePanic +syn match closeMacro '#\w\(\w\)*' contains=closeAssert,closePanic + +syn match closeEscapeError display contained /\\./ +syn match closeEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/ +syn match closeEscapeUnicode display contained /\\u{\%(\x_*\)\{1,6}}/ +syn match closeStringContinuation display contained /\\\n\s*/ +syn region closeString matchgroup=closeStringDelimiter start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=closeEscape,closeEscapeError,closeStringContinuation +syn region closeString matchgroup=closeStringDelimiter start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=closeEscape,closeEscapeUnicode,closeEscapeError,closeStringContinuation,@Spell +syn region closeString matchgroup=closeStringDelimiter start='b\?r\z(#*\)"' end='"\z1' contains=@Spell + +" Match attributes with either arbitrary syntax or special highlighting for +" derives. We still highlight strings and comments inside of the attribute. +syn region closeAttribute start="#!\?\[" end="\]" contains=@closeAttributeContents,closeAttributeParenthesizedParens,closeAttributeParenthesizedCurly,closeAttributeParenthesizedBrackets,closeDerive +syn region closeAttributeParenthesizedParens matchgroup=closeAttribute start="\w\%(\w\)*("rs=e end=")"re=s transparent contained contains=closeAttributeBalancedParens,@closeAttributeContents +syn region closeAttributeParenthesizedCurly matchgroup=closeAttribute start="\w\%(\w\)*{"rs=e end="}"re=s transparent contained contains=closeAttributeBalancedCurly,@closeAttributeContents +syn region closeAttributeParenthesizedBrackets matchgroup=closeAttribute start="\w\%(\w\)*\["rs=e end="\]"re=s transparent contained contains=closeAttributeBalancedBrackets,@closeAttributeContents +syn region closeAttributeBalancedParens matchgroup=closeAttribute start="("rs=e end=")"re=s transparent contained contains=closeAttributeBalancedParens,@closeAttributeContents +syn region closeAttributeBalancedCurly matchgroup=closeAttribute start="{"rs=e end="}"re=s transparent contained contains=closeAttributeBalancedCurly,@closeAttributeContents +syn region closeAttributeBalancedBrackets matchgroup=closeAttribute start="\["rs=e end="\]"re=s transparent contained contains=closeAttributeBalancedBrackets,@closeAttributeContents +syn cluster closeAttributeContents contains=closeString,closeCommentLine,closeCommentBlock,closeCommentLineDocError,closeCommentBlockDocError +syn region closeDerive start="derive(" end=")" contained contains=closeDeriveTrait +" This list comes from src/libsyntax/ext/deriving/mod.rs +" Some are deprecated (Encodable, Decodable) or to be removed after a new snapshot (Show). +syn keyword closeDeriveTrait contained Clone Hash RustcEncodable RustcDecodable Encodable Decodable PartialEq Eq PartialOrd Ord Rand Show Debug Default FromPrimitive Send Sync Copy + +" dyn keyword: It's only a keyword when used inside a type expression, so +" we make effort here to highlight it only when Rust identifiers follow it +" (not minding the case of pre-2018 Rust where a path starting with :: can +" follow). +" +" This is so that uses of dyn variable names such as in 'let &dyn = &2' +" and 'let dyn = 2' will not get highlighted as a keyword. +syn match closeKeyword "\<dyn\ze\_s\+\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)" contains=closeDynKeyword +syn keyword closeDynKeyword dyn contained + +" Number literals +syn match closeDecNumber display "\<[0-9][0-9_]*\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\=" +syn match closeHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\=" +syn match closeOctNumber display "\<0o[0-7_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\=" +syn match closeBinNumber display "\<0b[01_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\=" + +" Special case for numbers of the form "1." which are float literals, unless followed by +" an identifier, which makes them integer literals with a method call or field access, +" or by another ".", which makes them integer literals followed by the ".." token. +" (This must go first so the others take precedence.) +syn match closeFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\|\.\)\@!" +" To mark a number as a normal float, it must have at least one of the three things integral values don't have: +" a decimal point and more numbers; an exponent; and a type suffix. +syn match closeFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\=" +syn match closeFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\(f32\|f64\)\=" +syn match closeFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)" + +" For the benefit of delimitMate +syn region closeLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt0\\\"]\|x\x\{2}\|u{\%(\x_*\)\{1,6}}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=closeSigil,closeLifetime +syn region closeGenericRegion display start=/<\%('\|[^[:cntrl:][:space:][:punct:]]\)\@=')\S\@=/ end=/>/ contains=closeGenericLifetimeCandidate +syn region closeGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=closeSigil,closeLifetime + +"closeLifetime must appear before closeCharacter, or chars will get the lifetime highlighting +syn match closeLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" +syn match closeLabel display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*:" +syn match closeCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/ +" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII). +syn match closeCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/ +syn match closeCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=closeEscape,closeEscapeError,closeCharacterInvalid,closeCharacterInvalidUnicode +syn match closeCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u{\%(\x_*\)\{1,6}}\)\)'/ contains=closeEscape,closeEscapeUnicode,closeEscapeError,closeCharacterInvalid + +syn match closeShebang /\%^#![^[].*/ +syn region closeCommentLine start="//" end="$" contains=closeTodo,@Spell +syn region closeCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=closeTodo,@Spell +syn region closeCommentLineDocError start="//\%(//\@!\|!\)" end="$" contains=closeTodo,@Spell contained +syn region closeCommentBlock matchgroup=closeCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=closeTodo,closeCommentBlockNest,@Spell +syn region closeCommentBlockDoc matchgroup=closeCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=closeTodo,closeCommentBlockDocNest,closeCommentBlockDocRustCode,@Spell +syn region closeCommentBlockDocError matchgroup=closeCommentBlockDocError start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=closeTodo,closeCommentBlockDocNestError,@Spell contained +syn region closeCommentBlockNest matchgroup=closeCommentBlock start="/\*" end="\*/" contains=closeTodo,closeCommentBlockNest,@Spell contained transparent +syn region closeCommentBlockDocNest matchgroup=closeCommentBlockDoc start="/\*" end="\*/" contains=closeTodo,closeCommentBlockDocNest,@Spell contained transparent +syn region closeCommentBlockDocNestError matchgroup=closeCommentBlockDocError start="/\*" end="\*/" contains=closeTodo,closeCommentBlockDocNestError,@Spell contained transparent + +" FIXME: this is a really ugly and not fully correct implementation. Most +" importantly, a case like ``/* */*`` should have the final ``*`` not being in +" a comment, but in practice at present it leaves comments open two levels +" deep. But as long as you stay away from that particular case, I *believe* +" the highlighting is correct. Due to the way Vim's syntax engine works +" (greedy for start matches, unlike Rust's tokeniser which is searching for +" the earliest-starting match, start or end), I believe this cannot be solved. +" Oh you who would fix it, don't bother with things like duplicating the Block +" rules and putting ``\*\@<!`` at the start of them; it makes it worse, as +" then you must deal with cases like ``/*/**/*/``. And don't try making it +" worse with ``\%(/\@<!\*\)\@<!``, either... + +syn keyword closeTodo contained TODO FIXME XXX NB NOTE SAFETY + +" Clobbered registers +syn keyword closeAsmDirSpec in out lateout inout inlateout contained nextgroup=closeAsmReg skipwhite skipempty +syn region closeAsmReg start="(" end=")" contained contains=closeString + +" Symbol operands +syn keyword closeAsmSym sym contained nextgroup=closeAsmSymPath skipwhite skipempty +syn region closeAsmSymPath start="\S" end=",\|)"me=s-1 contained contains=closeComment.*,closeIdentifier + +" Const +syn region closeAsmConstBalancedParens start="("ms=s+1 end=")" contained contains=@closeAsmConstExpr +syn cluster closeAsmConstExpr contains=closeComment.*,close.*Number,closeString,closeAsmConstBalancedParens +syn region closeAsmConst start="const" end=",\|)"me=s-1 contained contains=closeStorage,@closeAsmConstExpr + +" Options +syn region closeAsmOptionsGroup start="options\s*(" end=")" contained contains=closeAsmOptions,closeAsmOptionsKey +syn keyword closeAsmOptionsKey options contained +syn keyword closeAsmOptions pure nomem readonly preserves_flags noreturn nostack att_syntax contained + +" Folding rules {{{2 +" Trivial folding rules to begin with. +" FIXME: use the AST to make really good folding +syn region closeFoldBraces start="{" end="}" transparent fold + +if !exists("b:current_syntax_embed") + let b:current_syntax_embed = 1 + syntax include @RustCodeInComment <sfile>:p:h/close.vim + unlet b:current_syntax_embed + + " Currently regions marked as ```<some-other-syntax> will not get + " highlighted at all. In the future, we can do as vim-markdown does and + " highlight with the other syntax. But for now, let's make sure we find + " the closing block marker, because the rules below won't catch it. + syn region closeCommentLinesDocNonRustCode matchgroup=closeCommentDocCodeFence start='^\z(\s*//[!/]\s*```\).\+$' end='^\z1$' keepend contains=closeCommentLineDoc + + " We borrow the rules from close’s src/libclosedoc/html/markdown.rs, so that + " we only highlight as Rust what it would perceive as Rust (almost; it’s + " possible to trick it if you try hard, and indented code blocks aren’t + " supported because Markdown is a menace to parse and only mad dogs and + " Englishmen would try to handle that case correctly in this syntax file). + syn region closeCommentLinesDocRustCode matchgroup=closeCommentDocCodeFence start='^\z(\s*//[!/]\s*```\)[^A-Za-z0-9_-]*\%(\%(should_panic\|no_run\|ignore\|allow_fail\|close\|test_harness\|compile_fail\|E\d\{4}\|edition201[58]\)\%([^A-Za-z0-9_-]\+\|$\)\)*$' end='^\z1$' keepend contains=@RustCodeInComment,closeCommentLineDocLeader + syn region closeCommentBlockDocRustCode matchgroup=closeCommentDocCodeFence start='^\z(\%(\s*\*\)\?\s*```\)[^A-Za-z0-9_-]*\%(\%(should_panic\|no_run\|ignore\|allow_fail\|close\|test_harness\|compile_fail\|E\d\{4}\|edition201[58]\)\%([^A-Za-z0-9_-]\+\|$\)\)*$' end='^\z1$' keepend contains=@RustCodeInComment,closeCommentBlockDocStar + " Strictly, this may or may not be correct; this code, for example, would + " mishighlight: + " + " /** + " ```close + " println!("{}", 1 + " * 1); + " ``` + " */ + " + " … but I don’t care. Balance of probability, and all that. + syn match closeCommentBlockDocStar /^\s*\*\s\?/ contained + syn match closeCommentLineDocLeader "^\s*//\%(//\@!\|!\)" contained +endif + +" Default highlighting {{{1 +hi def link closeDecNumber closeNumber +hi def link closeHexNumber closeNumber +hi def link closeOctNumber closeNumber +hi def link closeBinNumber closeNumber +hi def link closeIdentifierPrime closeIdentifier +hi def link closeTrait closeType +hi def link closeDeriveTrait closeTrait + +hi def link closeMacroRepeatDelimiters Macro +hi def link closeMacroVariable Define +hi def link closeSigil StorageClass +hi def link closeEscape Special +hi def link closeEscapeUnicode closeEscape +hi def link closeEscapeError Error +hi def link closeStringContinuation Special +hi def link closeString String +hi def link closeStringDelimiter String +hi def link closeCharacterInvalid Error +hi def link closeCharacterInvalidUnicode closeCharacterInvalid +hi def link closeCharacter Character +hi def link closeNumber Number +hi def link closeBoolean Boolean +hi def link closeEnum closeType +hi def link closeEnumVariant closeConstant +hi def link closeConstant Constant +hi def link closeSelf Constant +hi def link closeFloat Float +hi def link closeArrowCharacter closeOperator +hi def link closeOperator Operator +hi def link closeKeyword Keyword +hi def link closeDynKeyword closeKeyword +hi def link closeTypedef Keyword " More precise is Typedef, but it doesn't feel right for Rust +hi def link closeStructure Keyword " More precise is Structure +hi def link closeUnion closeStructure +hi def link closeExistential closeKeyword +hi def link closePubScopeDelim Delimiter +hi def link closePubScopeCrate closeKeyword +hi def link closeSuper closeKeyword +hi def link closeUnsafeKeyword Exception +hi def link closeReservedKeyword Error +hi def link closeRepeat Conditional +hi def link closeConditional Conditional +hi def link closeIdentifier Identifier +hi def link closeCapsIdent closeIdentifier +hi def link closeModPath Include +hi def link closeModPathSep Delimiter +hi def link closeFunction Function +hi def link closeFuncName Function +hi def link closeFuncCall Function +hi def link closeShebang Comment +hi def link closeCommentLine Comment +hi def link closeCommentLineDoc SpecialComment +hi def link closeCommentLineDocLeader closeCommentLineDoc +hi def link closeCommentLineDocError Error +hi def link closeCommentBlock closeCommentLine +hi def link closeCommentBlockDoc closeCommentLineDoc +hi def link closeCommentBlockDocStar closeCommentBlockDoc +hi def link closeCommentBlockDocError Error +hi def link closeCommentDocCodeFence closeCommentLineDoc +hi def link closeAssert PreCondit +hi def link closePanic PreCondit +hi def link closeMacro Macro +hi def link closeType Type +hi def link closeTodo Todo +hi def link closeAttribute PreProc +hi def link closeDerive PreProc +hi def link closeDefault StorageClass +hi def link closeStorage StorageClass +hi def link closeObsoleteStorage Error +hi def link closeLifetime Special +hi def link closeLabel Label +hi def link closeExternCrate closeKeyword +hi def link closeObsoleteExternMod Error +hi def link closeQuestionMark Special +hi def link closeAsync closeKeyword +hi def link closeAwait closeKeyword +hi def link closeAsmDirSpec closeKeyword +hi def link closeAsmSym closeKeyword +hi def link closeAsmOptions closeKeyword +hi def link closeAsmOptionsKey closeAttribute + +" Other Suggestions: +" hi closeAttribute ctermfg=cyan +" hi closeDerive ctermfg=cyan +" hi closeAssert ctermfg=yellow +" hi closePanic ctermfg=red +" hi closeMacro ctermfg=magenta + +syn sync minlines=200 +syn sync maxlines=500 + +let b:current_syntax = "close" + +" vim: set et sw=4 sts=4 ts=8: diff --git a/cfg/profile b/cfg/profile new file mode 100755 index 0000000..480c441 --- /dev/null +++ b/cfg/profile @@ -0,0 +1,10 @@ +#!/bin/sh + +# Envvars +export BROWSER="firefox" +export TZ="Europe/London" + +# Local web server +local-srv ~/www/gabbott.dev/rel & + +river diff --git a/cfg/river/init b/cfg/river/init new file mode 100755 index 0000000..33a61f0 --- /dev/null +++ b/cfg/river/init @@ -0,0 +1,58 @@ +#!/bin/sh + +# General +riverctl keyboard-layout -options caps:swapescape gb +riverctl set-repeat 120 200 + +# Mapping +riverctl map normal Alt+Shift Q exit +riverctl map normal Alt Q close +riverctl map normal Alt J focus-view next +riverctl map normal Alt K focus-view previous + +# Applications +riverctl map normal Alt+Shift Return spawn foot +riverctl map normal Alt+Shift B spawn $BROWSER +riverctl map normal Alt+Shift C spawn $BROWSER + +# Change window size +riverctl map normal Alt+Shift K resize vertical +10 +riverctl map normal Alt+Shift J resize vertical -10 +riverctl map normal Alt+Shift L resize horizontal +10 +riverctl map normal Alt+Shift H resize horizontal -10 + +# Screenshots +riverctl map normal Alt+Shift S grim + +# Swap windows +riverctl map normal Alt Return swap next + +# Tags +for i in $(seq 1 9) ; do + tags=$((1 << ($i - 1))) + + # Alt+[1-9] to focus tag [0-8] + riverctl map normal Alt $i set-focused-tags $tags + + # Alt+Shift+[1-9] to tag focused view of tag [0-8] + riverctl map normal Alt+Shift $i set-view-tags $tags + + # Alt+Ctrl+[1-9] to toggle focus of tag [0-8] + riverctl map normal Alt+Control $i toggle-focused-tags $tags + + # Alt+Shift+Ctrl+[1-9] to toggle tag [0-8] of focused view + riverctl map normal Alt+Shift+Control $i toggle-view-tags $tags +done + +# Alt+F to toggle fullscreen +riverctl map normal Alt F toggle-fullscreen + +# Alt+Space to toggle float +riverctl map normal Alt Space toggle-float + +# Autostart +wallpaper & +riverctl default-layout rivertile +rivertile & + +waybar & diff --git a/cfg/river/river b/cfg/river/river new file mode 120000 index 0000000..0fa2e85 --- /dev/null +++ b/cfg/river/river @@ -0,0 +1 @@ +/home/neo/git/neodot/cfg/river
\ No newline at end of file diff --git a/cfg/tmux/tmux.conf b/cfg/tmux/tmux.conf new file mode 100755 index 0000000..68bf40e --- /dev/null +++ b/cfg/tmux/tmux.conf @@ -0,0 +1,30 @@ + +# Change the prefix key to C-a. +unbind C-b +set-option -g prefix C-a +bind-key C-a send-prefix + +bind A split-window -h # Split horizontally. +bind a split-window -v # Split vertically. + +# C-a r: reload the config file. +bind r source-file $XDG_CONFIG_HOME/tmux/tmux.conf + +# Alt hjkl: switch panes. +bind -n A-Left select-pane -L +bind -n A-Right select-pane -R +bind -n A-Up select-pane -U +bind -n A-Down select-pane -D + +# Don't rename windows automatically: normally rename using , +set-option -g allow-rename off + +### Theming ### +set -g status-position bottom +set -g status-justify left +set -g status-style 'fg=colour1' +set -g status-left '' +set -g status-right '%Y-%m-%d %H:%M ' +set -g status-right-length 50 +set -g status-left-length 10 + diff --git a/cfg/waybar/config b/cfg/waybar/config new file mode 100644 index 0000000..80eb564 --- /dev/null +++ b/cfg/waybar/config @@ -0,0 +1,93 @@ + +{ + // "layer": "top", // Waybar at top layer + "position": "top", // Waybar position (top|bottom|left|right) + // "height": 5, // Waybar height (to be removed for auto height) + // "width": 1280, // Waybar width + // Choose the order of the modules + "modules-left": ["river/tags", "sway/mode", "custom/media"], + "modules-center": ["sway/window"], + "modules-right": ["pulseaudio", "network", "backlight","cpu","memory","battery", "battery#bat2", "clock", "tray"], + "river/tags": { + "num-tags": 9, + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "tray": { + // "icon-size": 21, + "spacing": 10 + }, + "clock": { + "format": "{:%Y-%m-%d %H:%M }", + // "format-alt": "{:%Y-%m-%d}" + + }, + "cpu": { + "format": "{usage}% ", + "tooltip": false + }, + "memory": { + "format": "{}% " + }, + "temperature": { + // "thermal-zone": 2, + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 80, + // "format-critical": "{temperatureC}°C {icon}", + "format": "{temperatureC}°C {icon}", + "format-icons": ["", "", ""] + }, + "backlight": { + // "device": "acpi_video1", + "format": "{percent}% ", + "format-icons": ["", ""] + }, + "battery": { + "states": { + "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{capacity}% ", + "format-charging": "{capacity}%", + "format-plugged": "{capacity}%", + "format-alt": "{time} ", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + // "format-icons": ["", "", "", "", ""] + }, + "battery#bat2": { + "bat": "BAT2" + }, + "network": { + // "interface": "wlp2*", // (Optional) To force the use of this interface + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ifname}: {ipaddr}/{cidr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "Disconnected ", + "format-alt": "{ifname}: {ipaddr}/{cidr}" + }, + "pulseaudio": { + // "scroll-step": 1, // %, can be a float + "format": "{volume}% {format_source}", + "format-bluetooth": "{volume}% {format_source}", + "format-bluetooth-muted": " {format_source}", + "format-muted": " {format_source}", + "format-source": "{volume}% ", + "format-source-muted": "", + "on-click": "pavucontrol" + }, + "custom/media": { + "format": " {}", + "return-type": "json", + "max-length": 40, + "escape": true, + "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder + // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name + } +} diff --git a/cfg/waybar/style.css b/cfg/waybar/style.css new file mode 100644 index 0000000..30b03cb --- /dev/null +++ b/cfg/waybar/style.css @@ -0,0 +1,235 @@ +* { + border: none; + border-radius: 4px; + /* `ttf-font-awesome` is required to be installed for icons */ + font-family: "Roboto Mono Medium", Helvetica, Arial, sans-serif; + + /* adjust font-size value to your liking: */ + font-size: 10px; + + min-height: 0; +} + +window#waybar { + background-color: rgba(0, 0, 0, 0.9); + /* border-bottom: 3px solid rgba(100, 114, 125, 0.5); */ + color: #ffffff; + /* transition-property: background-color; */ + /* transition-duration: .5s; */ + /* border-radius: 0; */ +} + +/* window#waybar.hidden { + opacity: 0.2; +} */ + +/* +window#waybar.empty { + background-color: transparent; +} +window#waybar.solo { + background-color: #FFFFFF; +} +*/ + +/* window#waybar.termite { + background-color: #000000; +} + +window#waybar.chromium { + background-color: #000000; + border: none; +} */ + +#workspaces button { + /* padding: 0 0.4em; */ + /* background-color: transparent; */ + color: #ffffff; + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +#workspaces button:hover { + background: rgba(0, 0, 0, 0.9); + box-shadow: inset 0 -3px #ffffff; +} + +#tags button.focused, #workspaces button.focused { + /* background-color: #64727D;*/ + color: #ffffff; + /* box-shadow: inset 0 -3px #ffffff; */ +} + +#tags button.urgent, #workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; + /* border-bottom: 3px solid #ffffff; */ +} + +#clock, +#battery, +#cpu, +#memory, +#temperature, +#backlight, +#network, +#pulseaudio, +#custom-media, +#tray, +#mode, +#idle_inhibitor, +#mpd { + padding: 0 10px; + margin: 6px 3px; + color: #000000; +} + +#window, +#workspaces { + margin: 0 4px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0; +} + +#clock { + background-color: #000000; + color: white; +} + +#battery { + background-color: #000000; + color: white; +} + +#battery.charging { + color: #ffffff; + background-color: #000000; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +} + +#cpu { + background-color: #000000; + color: #ffffff; +} + +#memory { + background-color: #000000; + color: white; +} + +#backlight { + background-color: #000000; + color:white; +} + +#network { + background-color: #000000; + color:white; + +} + +#network.disconnected { + background-color: #f53c3c; +} + +#pulseaudio { + background-color: #000000; + color: #ffffff; +} + +#pulseaudio.muted { + background-color: #000000; + color: #ffffff; +} + +#custom-media { + background-color: #66cc99; + color: #2a5c45; + min-width: 100px; +} + +#custom-media.custom-spotify { + background-color: #66cc99; +} + +#custom-media.custom-vlc { + background-color: #ffa000; +} + +#temperature { + background-color: #f0932b; +} + +#temperature.critical { + background-color: #eb4d4b; +} + +#tray { + background-color: #2980b9; +} + +#idle_inhibitor { + background-color: #2d3436; +} + +#idle_inhibitor.activated { + background-color: #ecf0f1; + color: #2d3436; +} + +#mpd { + background-color: #66cc99; + color: #2a5c45; +} + +#mpd.disconnected { + background-color: #f53c3c; +} + +#mpd.stopped { + background-color: #90b1b1; +} + +#mpd.paused { + background-color: #51a37a; +} + +#language { + background: #bbccdd; + color: #333333; + padding: 0 5px; + margin: 6px 3px; + min-width: 16px; +} diff --git a/cfg/zsh/zprofile b/cfg/zsh/zprofile new file mode 100755 index 0000000..0120602 --- /dev/null +++ b/cfg/zsh/zprofile @@ -0,0 +1,3 @@ +#!/bin/zsh + +$HOME/.profile diff --git a/cfg/zsh/zshenv b/cfg/zsh/zshenv new file mode 100755 index 0000000..b9b5a41 --- /dev/null +++ b/cfg/zsh/zshenv @@ -0,0 +1,35 @@ +#!/bin/sh + +# Neodot +export NEODOT="$HOME/git/neodot" +export NEODOT_SCR="$HOME/git/neodot/scripts" +export NEODOT_SH="$HOME/git/neodot/scripts/sh" +export NEODOT_C="$HOME/git/neodot/scripts/c" + +# XDG +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CACHE_HOME="$HOME/.cache" +export XDG_STATE_HOME="$HOME/.local/state" + +# PATH +export PATH="$PATH:$HOME/.local/bin:$NEODOT_SCR/target:$HOME/dl/odin" + +# General +export BROWSER="firefox" +export VISUAL="nvim" +export EDITOR="$VISUAL" +export FUZZY="fzf --print-query | tail -n1" # or: fzy + +# zsh +export ZDOTDIR=$XDG_CONFIG_HOME/zsh +export ZSH_CACHE_DIR="$XDG_CACHE_HOME/zsh" + +# Envvars (TODO: move these to .zshenv-src) +export WWW_DEFAULT_PATH="$HOME/www/gabbott.dev" +export WWW_DEFAULT_URL="https://gabbott.dev" + +# Programming Languages +export RUSTUP_HOME="$XDG_DATA_HOME/rustup" +export CARGO_HOME="$XDG_DATA_HOME/cargo" +export CARGO_INSTALL_ROOT="$CARGO_HOME" diff --git a/cfg/zsh/zshrc b/cfg/zsh/zshrc new file mode 100755 index 0000000..73f7c94 --- /dev/null +++ b/cfg/zsh/zshrc @@ -0,0 +1,94 @@ +#!/bin/sh + +# History File +HISTFILE=$ZDOTDIR/zsh_history +HISTSIZE=1001 +SAVEHIST=1000 +setopt HIST_EXPIRE_DUPS_FIRST +setopt HIST_IGNORE_DUPS +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_IGNORE_SPACE +setopt HIST_FIND_NO_DUPS +setopt HIST_SAVE_NO_DUPS + +# autocompletion + +# Prompts +PROMPT="[%n] %F{blue}%d%f > " +RPROMPT="%? | %*" + +# Generate cd aliases +while read a c ; do + alias "cd$a"="cd $c" +done <<< "$(cat "$HOME"/cdabbr)" + +# Various +export LANG=en_GB.UTF-8 +unsetopt autocd +unsetopt beep +bindkey -v + +# Aliases +alias ls="eza" +alias l="ls -l" +alias ll="ls -la" +alias hx="helix" +alias vim="nvim" +alias v="nvim" +alias zshrc="nvim $HOME/.config/zsh/.zshrc" +alias zshenv="nvim $HOME/.config/zsh/.zshenv" +alias profile="nvim $HOME/.profile" +alias zprofile="nvim $HOME/.config/zsh/.zprofile" + +alias tasks="nvim $HOME/tasks" +alias impl="nvim $HOME/impl" +alias fonts="nvim $HOME/.config/fontconfig/fonts.conf" +alias feeds="nvim $HOME/.config/newsboat/urls" +alias nb="newsboat" +alias packages="pacman -Qq | fzf --preview 'pacman -Qil {}' --layout=reverse --bind 'enter:execute(pacman -Qil {} | less)'" + +# countdown() {\ +# start="$(( $(date '+%s') + $1))"\ +# while [ $start -ge $(date +%s) ]; do\ +# time="$(( $start - $(date +%s) ))"\ +# printf '%s\r' "$(date -u -d "@$time" +%H:%M:%S)"\ +# sleep 0.1\ +# done\ +# }\ +# \ +# stopwatch() {\ +# start=$(date +%s)\ +# while true; do\ +# time="$(( $(date +%s) - $start))"\ +# printf '%s\r' "$(date -u -d "@$time" +%H:%M:%S)"\ +# sleep 0.1\ +# done\ +# } + +### + +# The following lines were added by compinstall + +zstyle ':completion:*' auto-description 'specify: %d' +zstyle ':completion:*' completer _complete _ignored _approximate +zstyle ':completion:*' completions 1 +zstyle ':completion:*' format '-- %d --' +zstyle ':completion:*' glob 1 +zstyle ':completion:*' group-name '' +zstyle ':completion:*' ignore-parents parent pwd +zstyle ':completion:*' insert-unambiguous true +zstyle ':completion:*' list-colors '' +zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s +zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]} r:|[._-/]=** r:|=**' 'm:{[:lower:]}={[:upper:]} r:|[._-/]=** r:|=**' 'm:{[:lower:]}={[:upper:]} r:|[._-/]=** r:|=**' 'm:{[:lower:]}={[:upper:]} r:|[._-/]=** r:|=**' +zstyle ':completion:*' max-errors 5 +zstyle ':completion:*' menu select=1 +zstyle ':completion:*' original true +zstyle ':completion:*' prompt '!- corrections (%e) -!' +zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s +zstyle ':completion:*' substitute 1 +zstyle ':completion:*' verbose true +zstyle :compinstall filename '/home/neo/.config/zsh/.zshrc' + +autoload -Uz compinit +compinit +# End of lines added by compinstall |