ZG4C6OYJW2LSWDE3RSDFI3LNIZJ7VSWGM4SUETJ4L3YHP4KJDYHQC
VDSSQ7SMRDJDCLZGWBVOGZFBRE756QKS7Z65FHYHKMADTI2UOEMAC
6DG3LZCEKXVHABTGINGY4Q4T6LCYDSHR2D5L2NTOI2NUSDCR5HNAC
RXCY7LD6ZRIOIKZEYKLMCYPMQPXF4DOEEFBDLVR2B22BXLZJFFBQC
A3TVGLVHSVLMEHLHB3TPBSD3QGNVGX3DIK6BEBDTTHWBNW4ALMRAC
ITVIFUGAOQTGVI5XIRS2FTX7HIX3OKQO4HINJJ6XEGCQBTFBMUTQC
ZYEHQDDB635RZOU4YDJYS5SPJ6BBZEWGSYLNABXRTW5OA4AXU7LQC
JCMXOO3QYYWM33TFQRSD4SAJJTZS75FQDX4CW2FXEGE2TEJL5P4QC
PDGOEBKHWX4BPJZIU2HMZLL3347XWKQRRFTYBVEG6QR5FY5VTB6QC
5HXAVDJYG7ZJD6BVEVHKO347YEUG5S4VVX77NPJO3NGEHOFJYSJQC
RYJS56WZEVE7ZX5TXMQUZLB5ET6523U5VHTHLJLYKNBEHSTVSVEQC
IOXOZB2VUXVUEINLFBT4SPSJV32X5ZFT5FKSVRAIEXEFQJLG6MHQC
UTJWFJMYJWFZMMEZ2KC73RXBEOZU2TXPGSALX7PDNK5BWNPE7S4AC
HGGMS7P6BRIGWP6DZS3KLRXQPRETMB2GUULCQZAED6IYD5ENK2DQC
UIEUZTDCOPADVV5EJ7MKHZI6XMBDZYYC4HN4ZOXWPKQ2Q6ZFTDZAC
C3AF2JDURY4MNRFNU6AKPBX7D6HZ5YR47OSPIGGDNPVEJ7TNQHLAC
ZZFY3WNU3EJBUIL7SFARDOKXNF4WGUUQHEB7DTNXM7JDNX6POERAC
4B3BUZPKZPXBZIY2RI4LTMQXANCBDH33JRYFKFJXAT22TODFU2AAC
5TSCFKWOSFK6XSCBN5DY26GTKU6GDAFD3NW3PAVRTWMYIXKPONWQC
O3777TK2IVZ6LQATEWWIICGJY3GXO4MOUHZ73ENZFSY3VW4Q2DQAC
IUCV36F4Z4KOGTSSSQDSHIELU3BCI42RXBWLDMYOVW2A5SGZGKAQC
45GTY6PXBX353YADAZD5B4MRVCT7FO4PYEXUHJFUF3BLPSTWQBTQC
NK25JTAY2ACGGQ4UP3NDEUCMH2HFJXPLCZHS6KDSJOL7BDZ32DFQC
ABEBLCKQLYFBPFWHL3NPE2FW4G5LTP2DT3S3WE45AZWTYFXAOSOAC
YP6BNB5KC4GF6TK2N6V27LN2B6EPVDYBRM5UKEP7IRIT6FT2SUDAC
{
"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": [
{
"description": "Mouse Back/Forward",
"manipulators": [
{
"from": {
"pointing_button": "button4"
},
"to": [
{
"key_code": "open_bracket",
"modifiers": [
"left_command"
]
}
],
"type": "basic"
},
{
"from": {
"pointing_button": "button5"
},
"to": [
{
"key_code": "close_bracket",
"modifiers": [
"left_command"
]
}
],
"type": "basic"
}
]
},
{
"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 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,
"indicate_sticky_modifier_keys_state": true,
"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,
"indicate_sticky_modifier_keys_state": true,
"keyboard_type": "ansi",
"mouse_key_xy_scale": 100
}
}
]
}
{
"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": [
{
"description": "Mouse Back/Forward",
"manipulators": [
{
"type": "basic",
"from": {
"pointing_button": "button4"
},
"to": [
{
"key_code": "open_bracket",
"modifiers": ["left_command"]
}
]
},
{
"type": "basic",
"from": {
"pointing_button": "button5"
},
"to": [
{
"key_code": "close_bracket",
"modifiers": ["left_command"]
}
]
}
]
},
{
"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 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
}
}
]
}
;;; fwoar-pastebin.el --- Save htmlized version of buffer to a server -*- lexical-binding: t; tab-width: 8; -*-
;; Copyright (C) 2017 Edward Langley
;; Author: Edward Langley <fwoar@elangley.org>
;; Keywords: lisp
;; Version: 0.0.1
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 2 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; Put a description of the package here
;;; Code:
;; code goes here
(defgroup fwoar-pastebin nil
"Configuration for simple pastebin"
:prefix "fwoar-pastebin-"
:group 'application)
(defcustom fwoar-pastebin-tramp-url nil
"A tramp-writable url to the pastebin"
:group 'fwoar-pastebin
:type 'string)
(defcustom fwoar-pastebin-web-url-pattern nil
"An appropriate URL for viewing the uploaded files"
:group 'fwoar-pastebin
:type 'string)
;;;###autoload
(defun pastebin-buffer ()
(interactive)
(let* ((extension (file-name-extension (elt (split-string (buffer-name)
"<")
0)))
(htmlized-buffer (htmlize-buffer)))
(with-current-buffer htmlized-buffer
(let ((result-name-hash (sha1 (current-buffer))))
(write-file (format fwoar-pastebin-tramp-url
result-name-hash
extension))
(message "Wrote file to: %s.%s.html" result-name-hash extension)
(browse-url (format fwoar-pastebin-web-url-pattern
result-name-hash
extension))))))
(provide 'fwoar-pastebin)
;;; fwoar-pastebin.el ends here
;;; fwoar-json-navigator.el --- more functional utilities for emacs -*- lexical-binding: t; -*-
;; Copyright (C) 2020 Edward Langley
;; Author: Edward Langley <fwoar@elangley.org>
;; Version: 0.0.1
;; Keywords: json,navigator
;; URL: https://fwoar.co
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; simple attempts to navigate json
;;; Code:
(defvar-local fwoar/json-nav--data nil)
(defvar-local fwoar/json-nav--path nil)
(defun fwoar/json--ensure-data ()
(unless fwoar/json-nav--data
(save-excursion
(goto-char (point-min))
(setq-local fwoar/json-nav--data (json-parse-buffer :null-object nil))))
(values))
(defun fwoar/json-nav--pierce-vectors (fun it)
(cl-typecase it
(vector (map 'vector
(lambda (next)
(fwoar/json-nav--pierce-vectors fun next))
it))
(t (funcall fun it))))
(defun fwoar/json-nav--get-path (data path)
(cl-loop with cur = data for key in path
do
(setf cur
(cl-etypecase cur
(vector
(fwoar/json-nav--pierce-vectors (fwoar/key key)
cur))
(hash-table
(funcall (fwoar/key key)
cur))
(null ())))
finally (return cur)))
(cl-defmacro fwoar/json-nav--with-collector ((c) &body body)
(declare (indent 1))
(let ((v (gensym "v")))
`(let ((,v ()))
(cl-flet ((,c (it) (push it ,v)))
,@body
(nreverse ,v)))))
(defun fwoar/json-nav--get-keys ()
(fwoar/json--ensure-data)
(let ((data (fwoar/json-nav--get-path fwoar/json-nav--data
(reverse fwoar/json-nav--path))))
(sort (cl-etypecase data
(hash-table (hash-table-keys data))
(vector (remove-duplicates (sort (fwoar/json-nav--with-collector (c)
(fwoar/json-nav--pierce-vectors
(lambda (next)
(when next
(map nil #'c
(hash-table-keys next))))
data))
'string<)
:test 'equal)))
'string<)))
(defun fwoar/dive (s)
(interactive (list (completing-read "key? "
(fwoar/json-nav--get-keys))))
(fwoar/json--ensure-data)
(let* ((path (cons s fwoar/json-nav--path))
(data fwoar/json-nav--data))
(with-current-buffer (switch-to-buffer-other-window
(format "*test-buffer: %s*"
(s-join "/" (reverse path))))
(json-mode)
(setq-local fwoar/json-nav--data data
fwoar/json-nav--path path)
(setf (buffer-string)
(json-serialize (fwoar/json-nav--get-path fwoar/json-nav--data
(reverse path))
:null-object nil))
(json-pretty-print-buffer)
(goto-char (point-min))))
(goto-char (point-min)))
(defun fwoar/return ()
(interactive)
(fwoar/json--ensure-data)
(let ((prev-buffer (format "*test-buffer: %s*"
(s-join "/" (reverse (cdr fwoar/json-nav--path))))))
(kill-buffer)
(switch-to-buffer-other-window prev-buffer))
(point-min))
(provide 'fwoar-json-navigator)
;;; fwoar-json-navigator.el ends here
(use-package projectile
:ensure t
:config
(setq
;; projectile-enable-caching t
projectile-generic-command "rg --files -0"
)
(projectile-register-project-type
'clojure '("project.clj")
:compile "lein uberjar"
:test-dir "src/test/")
(projectile-register-project-type
'lisp '("*.asd"))
(projectile-register-project-type
'npm '("package.json")
:compile "npm install"
:test "npm test"
:run "npm start"
:test-suffix ".spec")
(define-key evil-normal-state-map "gf" 'project-aware-ffap)
(projectile-mode 1)
)
(use-package org-projectile
:ensure t
:after projectile company
:config
(progn
(org-projectile-per-project)
(setq org-agenda-skip-unavailable-files t)
(setq org-projectile-per-project-filepath
"notes/README.org")
(setq org-agenda-files (append org-agenda-files (org-projectile-todo-files)))
(push (org-projectile-project-todo-entry) org-capture-templates)
(define-key projectile-mode-map (kbd "C-c c") 'org-capture))
:ensure t)
(use-package projectile-ripgrep
:ensure t
:after projectile)
(use-package treemacs-projectile
:after treemacs projectile
:ensure t)
(use-package org-projectile-helm
:ensure t
:after org-projectile helm helm-org
:config
(define-key projectile-mode-map (kbd "C-c n p") 'org-projectile-helm-template-or-project))
(use-package helm-projectile
:after helm projectile
:ensure t
:config
(evil-define-key 'normal 'global (kbd "<leader>f") 'helm-projectile)
(evil-define-key 'normal 'global (kbd "<leader>S") 'helm-projectile-rg)
(evil-define-key 'normal 'global (kbd "<leader>h") 'helm-projectile-find-file-dwim))
(defun more-than-one-project-file-p ()
(= (length (projectile-select-files (projectile-current-project-files)))
1))
(defun global-find-known-file ())
(defun helm-find-known-file (&optional arg)
"Use projectile with Helm for finding files in project
With a prefix ARG invalidates the cache first."
(interactive "P")
(let ((projectile-enable-caching t))
(if (projectile-project-p)
(projectile-maybe-invalidate-cache arg)
(unless t
(error "You're not in a project"))))
(let ((helm-ff-transformer-show-only-basename nil)
(helm-boring-file-regexp-list nil))
(helm :sources 'helm-source-projectile-files-in-all-projects-list
:buffer (concat "*helm projectile: "
(projectile-project-name)
"*")
:truncate-lines helm-projectile-truncate-lines
:prompt (projectile-prepend-project-name "Find file in projects: "))))
(defun project-aware-ffap (&rest args)
(interactive "F")
(apply (if (and (projectile-project-p)
(more-than-one-project-file-p))
'helm-projectile-find-file-dwim
'find-file-at-point)
args))
(defun edit-init-el ()
(interactive)
(let ((default-directory *dotfiles-repo*))
(helm-projectile-find-file)))
(defun helm-projectile-rg ()
"Projectile version of `helm-rg'."
(interactive)
(if (require 'helm-rg nil t)
(if (projectile-project-p)
(let ((helm-rg-prepend-file-name-line-at-top-of-matches nil)
(helm-rg-include-file-on-every-match-line t))
(helm-rg (helm-projectile-rg--region-selection)
nil
(list (projectile-project-root))))
(error "You're not in a project"))
(when (yes-or-no-p "`helm-rg' is not installed. Install? ")
(condition-case nil
(progn
(package-install 'helm-rg)
(helm-projectile-rg))
(error "`helm-rg' is not available. Is MELPA in your `package-archives'?")))))