diff --git a/dhall/0.0.1/config.dhall b/dhall/0.0.1/config.dhall new file mode 100644 index 0000000..43caef9 --- /dev/null +++ b/dhall/0.0.1/config.dhall @@ -0,0 +1,40 @@ +let Glyph = + https://tangled.org/dneaves.com/glyph/raw/main/dhall/0.0.1/glyph.dhall + +let settings = {=} + +let keybinds = + { modalLeader = ":" + , modalBindings = + [ { modal = + [ Glyph.ModalChars.SingleChar "?" + ] + , action = Glyph.Action.Help + } + , { modal = + [ Glyph.ModalChars.SingleChar "q" + , Glyph.ModalChars.SingleChar "a" + ] + , action = Glyph.Action.QuitAndAbandon + } + , { modal = + [ Glyph.ModalChars.SingleChar "q" + , Glyph.ModalChars.SingleChar "s" + ] + , action = Glyph.Action.QuitAndSave + } + ] + , chordBindings = + [ { chord = [ Glyph.ctrl "q", Glyph.press "a" ] + , action = Glyph.Action.QuitAndAbandon + } + , { chord = [ Glyph.ctrl "q", Glyph.press "s" ] + , action = Glyph.Action.QuitAndSave + } + ] + } + +in + { settings = settings + , keybinds = keybinds + } \ No newline at end of file diff --git a/dhall/Main.hs b/dhall/Main.hs index 83d809d..301d8c7 100644 --- a/dhall/Main.hs +++ b/dhall/Main.hs @@ -4,6 +4,7 @@ module Main where import Data.Version ( showVersion ) +import Glyph.Data.Config.Dhall.Config ( dhallConfigFile ) import Glyph.Data.Config.Dhall.Prelude_ ( dhallPrelude ) import qualified Glyph.Data.String as String @@ -16,10 +17,14 @@ import System.IO ( writeFile ) main :: IO () main = do dataDir <- Paths.getDataDir - let path = - "{{dataDir}}/dhall/{{version}}/glyph.dhall" + let basePath = + "{{dataDir}}/dhall/{{version}}" |> String.replaceMany [ ("{{version}}", showVersion Paths.version) , ("{{dataDir}}", dataDir) ] - writeFile path dhallPrelude + let path fileName = + basePath <> "/{{fileName}}" + |> String.replace "{{fileName}}" fileName + writeFile (path "glyph.dhall") dhallPrelude + writeFile (path "config.dhall") dhallConfigFile