diff --git a/fg42-config.el b/fg42-config.el index fa64db5..43c1899 100644 --- a/fg42-config.el +++ b/fg42-config.el @@ -21,7 +21,25 @@ 'ruby ) -;; Load user config file in ~/.fg42 -(load-user-config "~/.fg42") +;; Load user config file in ~/.fg42.el +(load-user-config "~/.fg42.el") +;; NOTE: It's important to use ~/.fg42.el instead of this file +;; because updating fg42 will discard your changes in +;; this file. + +;; Example of things you can do in your ~/.fg42 config file: +;; +;; Setting your TODO file path: +;; (setq fg42-todo-file "~/.TODO.org") +;; or you can open a remote TODO file +;; (setq fg42-todo-file "/ssh:user@host:/home/USER/.TODO.org") +;; +;; Set some environment variables for your fg42 to use +;; (setenv "http_proxy" "localhost:8118") +;; (setenv "https_proxy" "localhost:8118") +;; +;; Alwasy open a your TODO file as your first buffer +;; (add-hook 'fg42-after-initialize-hook 'fg42-open-todo) +;; (fg42-initialize) diff --git a/lib/extensions/development/init.el b/lib/extensions/development/init.el index 6123f52..d31838a 100644 --- a/lib/extensions/development/init.el +++ b/lib/extensions/development/init.el @@ -1,4 +1,8 @@ ;; Functions ------------------------------------------------- +;;;###autoload +(defun disable-projectile () + (interactive) + (projectile-global-mode nil)) ;; Quick fix for company-mode and yasnippet clashing (defun company-yasnippet-or-completion () diff --git a/lib/extensions/editor.el b/lib/extensions/editor.el index ea13ec8..21205eb 100644 --- a/lib/extensions/editor.el +++ b/lib/extensions/editor.el @@ -9,6 +9,8 @@ (depends-on 'seq) (depends-on 'ov) (depends-on 'cheatsheet) +(with-ability tramp + (depends-on 'tramp)) (with-ability ivy (depends-on 'ivy)) diff --git a/lib/extensions/editor/init.el b/lib/extensions/editor/init.el index 40f257c..1976396 100644 --- a/lib/extensions/editor/init.el +++ b/lib/extensions/editor/init.el @@ -1,10 +1,26 @@ -;; Functions ------------------------------------------------- +;; Customizations -------------------------------------------- +(defcustom fg42-todo-file "~/.TODO.org" + "Path to your TODO file. You can use a tramp address here as well." + :type 'string + :group 'fg42) +;; Hooks ----------------------------------------------------- +(defvar fg42-before-open-todo-hook nil) +(defvar fg42-after-open-todo-hook nil) + +;; Functions ------------------------------------------------- (defun fg42-reload () "Reload the entire FG42." (interactive) (load-file (concat (getenv "FG42_HOME") "/fg42-config.el"))) +;;;###autoload +(defun fg42-open-todo () + (interactive) + (run-hooks 'fg42-before-open-todo-hook) + (find-file fg42-todo-file) + (run-hooks 'fg42-after-open-todo-hook)) + ;;;###autoload (defun extensions/editor-initialize () "Base plugin initialization." @@ -26,8 +42,11 @@ (setq initial-scratch-message nil) + ;; Tramp configuration ------------------------------------- - (setq tramp-default-method "ssh") + (ability tramp () + (setq tramp-default-method "ssh") + (global-set-key [f9] 'fg42-open-todo)) ;; replace strings (global-set-key (kbd "C-c M-s") 'replace-string) diff --git a/lib/fg42.el b/lib/fg42.el index 4f0bdd9..a1a94ca 100644 --- a/lib/fg42.el +++ b/lib/fg42.el @@ -31,10 +31,18 @@ (defvar fg42-home (getenv "FG42_HOME") "The pass to fg42-home") +(defvar fg42-before-initialize-hook nil + "This hook will be called before FG42 initilization process.") + +(defvar fg42-after-initialize-hook nil + "This hook will be called after FG42 initilization process.") + (defun fg42-initialize () "Initialize FG42 editor." + (run-hooks 'fg42-before-initialize-hook) (setq package-user-dir (concat fg42-home "/packages")) (fpkg-initialize) - (initialize-extensions)) + (initialize-extensions) + (run-hooks 'fg42-after-initialize-hook)) (provide 'fg42)