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7DAC
I2SZJNBX5ONYX2YN4L3EBAFHZCCI6WGZTJMOTPQNZXBBM6XJLMAAC
PCWSOJVY4P36OL7VL2H2YRQC2ZZ6NZDUJ7DG3VGRAJ3VMSECCFXQC
#!/home/edwlan/bin/sbcl --script
(load "~/quicklisp/setup.lisp")
(ql:quickload '(:lquery :fwoar-lisputils :alexandria :net.didierverna.clon))
(eval-when (:compile-toplevel :load-toplevel :execute)
(require :uiop))
(defpackage :fwoar.ct->sexp
(:use :cl)
(:local-nicknames (:clon :net.didierverna.clon))
(:export ))
(in-package :fwoar.ct->sexp)
(defparameter *args*
(uiop:command-line-arguments))
(defun extract-refs (work root)
(lquery:$
(inline root)
"p[title]"
(combine (attr "title")
(text))
(map-apply (lambda (ref text)
(list 'ref work
(serapeum:string-join (fwoar.string-utils:split " " (elt (fwoar.string-utils:split "," ref) 1)))
text)))))
(defun serialize-refs (out-fn refs)
(alexandria:with-output-to-file (s out-fn :if-exists :append :if-does-not-exist :create)
(let ((*print-case* :downcase))
(map nil
(lambda (ref)
(prin1 ref s)
(fresh-line s))
refs))))
(defun translate (in out)
(let ((root (plump:parse in))
(out-path (parse-namestring out)))
(serialize-refs out
(extract-refs (alexandria:make-keyword
(string-upcase (pathname-name out-path)))
root))))
(defparameter *synopsis*
(net.didierverna.clon:defsynopsis (:postfix "OUT FILES...")))
(defun main ()
(net.didierverna.clon:make-context :synopsis *synopsis*)
(let ((*package* (find-package :fwoar.ct->sexp)))
(destructuring-bind (out . files) (net.didierverna.clon:remainder)
(format *error-output*
"OUT: ~s~%FILES: ~s~%"
out files)
(map nil
(lambda (file)
(format *error-output* "PROCESSING FILE: ~s~%" file)
(translate (parse-namestring file)
out))
files))))
(net.didierverna.clon:dump (merge-pathnames "bin/ct-sexp"
(user-homedir-pathname))
main)
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": true
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 200,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"manipulators": [
{
"description": "Change caps_lock to command+control+option+shift.",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_option",
"modifiers": [
"left_command",
"left_control"
]
}
],
"type": "basic"
}
]
},
{
"manipulators": [
{
"description": "map left shift to opening parenthesis",
"from": {
"key_code": "left_shift",
"modifiers": {
"optional": []
}
},
"to": [
{
"key_code": "left_shift",
"modifiers": []
}
],
"to_if_alone": [
{
"key_code": "9",
"modifiers": [
"left_shift"
]
}
],
"type": "basic"
},
{
"description": "map left shift to opening parenthesis",
"from": {
"key_code": "left_control",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_control",
"modifiers": []
}
],
"to_if_alone": [
{
"key_code": "open_bracket",
"modifiers": [
"left_shift"
]
}
],
"type": "basic"
},
{
"description": "map left shift to opening parenthesis",
"from": {
"key_code": "right_control",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_control",
"modifiers": []
}
],
"to_if_alone": [
{
"key_code": "close_bracket",
"modifiers": [
"left_shift"
]
}
],
"type": "basic"
},
{
"description": "map right shift to closing parenthesis",
"from": {
"key_code": "right_shift",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_shift",
"modifiers": []
}
],
"to_if_alone": [
{
"key_code": "0",
"modifiers": [
"right_shift"
]
}
],
"type": "basic"
}
]
}
]
},
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 50475,
"vendor_id": 1133
},
"ignore": false,
"manipulate_caps_lock_led": false,
"simple_modifications": []
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 617,
"vendor_id": 1241
},
"ignore": false,
"manipulate_caps_lock_led": false,
"simple_modifications": []
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 591,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": []
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 36915,
"vendor_id": 2522
},
"ignore": false,
"manipulate_caps_lock_led": false,
"simple_modifications": []
},
{
"disable_built_in_keyboard_if_exists": true,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 45849,
"vendor_id": 1133
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [
{
"from": {
"key_code": "left_command"
},
"to": {
"key_code": "left_option"
}
},
{
"from": {
"key_code": "left_option"
},
"to": {
"key_code": "left_command"
}
},
{
"from": {
"key_code": "right_option"
},
"to": {
"key_code": "right_command"
}
}
]
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": true,
"product_id": 8963,
"vendor_id": 4617
},
"ignore": false,
"manipulate_caps_lock_led": false,
"simple_modifications": []
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 8963,
"vendor_id": 4617
},
"ignore": false,
"manipulate_caps_lock_led": false,
"simple_modifications": []
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 1,
"vendor_id": 6899
},
"ignore": false,
"manipulate_caps_lock_led": false,
"simple_modifications": []
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 8963,
"vendor_id": 4617
},
"ignore": false,
"manipulate_caps_lock_led": false,
"simple_modifications": []
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": {
"key_code": "display_brightness_decrement"
}
},
{
"from": {
"key_code": "f2"
},
"to": {
"key_code": "display_brightness_increment"
}
},
{
"from": {
"key_code": "f3"
},
"to": {
"key_code": "mission_control"
}
},
{
"from": {
"key_code": "f4"
},
"to": {
"key_code": "launchpad"
}
},
{
"from": {
"key_code": "f5"
},
"to": {
"key_code": "illumination_decrement"
}
},
{
"from": {
"key_code": "f6"
},
"to": {
"key_code": "illumination_increment"
}
},
{
"from": {
"key_code": "f7"
},
"to": {
"key_code": "rewind"
}
},
{
"from": {
"key_code": "f8"
},
"to": {
"key_code": "play_or_pause"
}
},
{
"from": {
"key_code": "f9"
},
"to": {
"key_code": "fastforward"
}
},
{
"from": {
"key_code": "f10"
},
"to": {
"key_code": "mute"
}
},
{
"from": {
"key_code": "f11"
},
"to": {
"key_code": "volume_decrement"
}
},
{
"from": {
"key_code": "f12"
},
"to": {
"key_code": "volume_increment"
}
}
],
"name": "shift->paren",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [],
"virtual_hid_keyboard": {
"caps_lock_delay_milliseconds": 0,
"country_code": 0,
"keyboard_type": "ansi",
"mouse_key_xy_scale": 100
}
},
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": []
},
"devices": [],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": {
"key_code": "display_brightness_decrement"
}
},
{
"from": {
"key_code": "f2"
},
"to": {
"key_code": "display_brightness_increment"
}
},
{
"from": {
"key_code": "f3"
},
"to": {
"key_code": "mission_control"
}
},
{
"from": {
"key_code": "f4"
},
"to": {
"key_code": "launchpad"
}
},
{
"from": {
"key_code": "f5"
},
"to": {
"key_code": "illumination_decrement"
}
},
{
"from": {
"key_code": "f6"
},
"to": {
"key_code": "illumination_increment"
}
},
{
"from": {
"key_code": "f7"
},
"to": {
"key_code": "rewind"
}
},
{
"from": {
"key_code": "f8"
},
"to": {
"key_code": "play_or_pause"
}
},
{
"from": {
"key_code": "f9"
},
"to": {
"key_code": "fastforward"
}
},
{
"from": {
"key_code": "f10"
},
"to": {
"key_code": "mute"
}
},
{
"from": {
"key_code": "f11"
},
"to": {
"key_code": "volume_decrement"
}
},
{
"from": {
"key_code": "f12"
},
"to": {
"key_code": "volume_increment"
}
}
],
"name": "no shift->paren",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": false,
"simple_modifications": [],
"virtual_hid_keyboard": {
"caps_lock_delay_milliseconds": 0,
"country_code": 0,
"keyboard_type": "ansi",
"mouse_key_xy_scale": 100
}
}
]
}
;;; Code:
(defun fwoar/doc-for-resource-type (resource-type)
(cl-format nil
"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/~{~a~^-~}"
(list* "aws" "resource"
(cdr (s-split "::" (s-downcase resource-type))))))
(defun fwoar/document-cf (min max)
"Jump to AWS Cloudformation docs for a resource type.
MIN: the point in the buffer where the resource type starts
MAX: the point in the buffer where the resource type ends
This uses (interactive \"r\") to automagically populate the arguments
from the selected region."
(interactive "r")
(browse-url
(fwoar/doc-for-resource-type
(buffer-substring min max))))
(use-package helm :ensure t :config
(require 'helm-config)
(helm-mode)
(global-set-key (kbd "M-x") 'helm-M-x)
(global-set-key (kbd "C-x C-f") 'helm-find-files)
(evil-define-key 'normal 'global (kbd "<leader>f") 'helm-projectile)
(evil-define-key 'normal 'global (kbd "<leader>j") 'helm-buffers-list)
(evil-define-key 'normal 'global (kbd "<leader>s") 'helm-occur)
(evil-define-key 'normal 'global (kbd "<leader>S") 'helm-projectile-rg)
(define-key helm-map (kbd "C-r") 'fwoar--paste-register-from-helm-current-buffer)
(define-key helm-map (kbd "<right>") 'helm-execute-persistent-action)
(define-key helm-map
(kbd "<left>")
'helm-find-files-up-one-level))
(use-package helm-org
:after helm
:ensure t)
(use-package org-projectile-helm
:after helm
:ensure t
:after org-projectile
:config
(define-key projectile-mode-map (kbd "C-c n p") 'org-projectile-helm-template-or-project))
(use-package helm-ag :after helm :ensure t)
(use-package helm-ag-r :after helm :ensure t)
(use-package helm-rg :after helm :ensure t)
(use-package helm-css-scss :after helm :ensure t)
(use-package helm-ls-git :after helm :ensure t)
(use-package helm-projectile :after helm :ensure t
:config
(evil-define-key 'normal 'global (kbd "<leader>h") 'helm-projectile-find-file-dwim)
)
(use-package project-explorer :after helm :ensure t)
(use-package helm :ensure t :config
(require 'helm-config)
(helm-mode)
(global-set-key (kbd "M-x") 'helm-M-x)
(global-set-key (kbd "C-x C-f") 'helm-find-files)
(evil-define-key 'normal 'global (kbd "<leader>f") 'helm-projectile)
(evil-define-key 'normal 'global (kbd "<leader>j") 'helm-buffers-list)
(evil-define-key 'normal 'global (kbd "<leader>s") 'helm-occur)
(evil-define-key 'normal 'global (kbd "<leader>S") 'helm-projectile-rg)
(define-key helm-map (kbd "C-r") 'fwoar--paste-register-from-helm-current-buffer)
(define-key helm-map (kbd "<right>") 'helm-execute-persistent-action)
(define-key helm-map
(kbd "<left>")
'helm-find-files-up-one-level))
(use-package helm-org
:after helm
:ensure t)
(use-package org-projectile-helm
:after helm
:ensure t
:after org-projectile
:config
(define-key projectile-mode-map (kbd "C-c n p") 'org-projectile-helm-template-or-project))
(use-package helm-ag :after helm :ensure t)
(use-package helm-ag-r :after helm :ensure t)
(use-package helm-rg :after helm :ensure t)
(use-package helm-css-scss :after helm :ensure t)
(use-package helm-ls-git :after helm :ensure t)
(use-package helm-projectile :after helm :ensure t
:config
(evil-define-key 'normal 'global (kbd "<leader>h") 'helm-projectile-find-file-dwim)
)
(use-package project-explorer :after helm :ensure t)
(evil-define-key 'normal 'global (kbd "<leader>f") 'helm-projectile)
(evil-define-key 'normal 'global (kbd "<leader>;") 'helm-semantic-or-imenu)
(evil-define-key 'normal 'global (kbd "<leader>j") 'helm-buffers-list)
(evil-define-key 'normal 'global (kbd "<leader>u") 'undo-tree-visualize))
(evil-define-key 'normal 'global (kbd ",~") 'sp-convolute-sexp)
(evil-define-key 'normal 'global (kbd ",a") 'sp-absorb-sexp)
(evil-define-key 'normal 'global (kbd ",e") 'sp-emit-sexp)
(evil-define-key 'normal 'global (kbd ",`") 'sp-clone-sexp)
(evil-define-key 'normal 'global (kbd ",J") 'sp-join-sexp)
(evil-define-key 'normal 'global (kbd ",|") 'sp-split-sexp))
(evil-define-key 'normal 'global (kbd "<leader>n(") 'sp-narrow-to-sexp)
(evil-define-key 'normal 'global (kbd "<leader>n)") 'sp-narrow-to-sexp)
(evil-define-key 'normal 'global (kbd "<leader>nn") 'narrow-to-defun)
(evil-define-key 'normal 'global (kbd "<leader>nr") 'narrow-to-region)
(evil-define-key 'normal 'global (kbd "<leader>nw") 'widen)))
(use-package centaur-tabs
:ensure t
:after evil
:config
(setq centaur-tabs-adjust-buffer-order t
centaur-tabs-adjust-buffer-order 'right)
(centaur-tabs-enable-buffer-reordering)
(comment
(use-package centaur-tabs
:ensure t
:after evil
:config
(setq centaur-tabs-adjust-buffer-order t
centaur-tabs-adjust-buffer-order 'right)
(centaur-tabs-enable-buffer-reordering)
(evil-define-key 'normal 'global (kbd "gt") 'centaur-tabs-forward-tab)
(evil-define-key 'normal 'global (kbd "gt") 'centaur-tabs-forward-tab)
(define-key global-map (kbd "<header-line> <wheel-up>") 'centaur-tabs-forward-tab)
(define-key global-map (kbd "s-}") 'centaur-tabs-forward-tab)
(evil-define-key 'normal 'global (kbd "gT") 'centaur-tabs-backward-tab)
(evil-define-key 'normal 'global (kbd "gT") 'centaur-tabs-backward-tab)
(define-key global-map (kbd "<header-line> <wheel-down>") 'centaur-tabs-backward-tab)
(define-key global-map (kbd "s-{") 'centaur-tabs-backward-tab))
(evil-define-key 'normal 'global (kbd "gt") 'centaur-tabs-forward-tab)
(define-key global-map (kbd "<header-line> <wheel-up>") 'centaur-tabs-forward-tab)
(define-key global-map (kbd "s-}") 'centaur-tabs-forward-tab)
(evil-define-key 'normal 'global (kbd "gT") 'centaur-tabs-backward-tab)
(define-key global-map (kbd "<header-line> <wheel-down>") 'centaur-tabs-backward-tab)
(define-key global-map (kbd "s-{") 'centaur-tabs-backward-tab)))