Several functions added to manage personal todos

This commit is contained in:
Sameer Rahmani 2016-11-28 14:36:35 +03:30
parent 0b8909d8fb
commit 0d3a402dba
5 changed files with 56 additions and 5 deletions

View File

@ -21,7 +21,25 @@
'ruby 'ruby
) )
;; Load user config file in ~/.fg42 ;; Load user config file in ~/.fg42.el
(load-user-config "~/.fg42") (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) (fg42-initialize)

View File

@ -1,4 +1,8 @@
;; Functions ------------------------------------------------- ;; Functions -------------------------------------------------
;;;###autoload
(defun disable-projectile ()
(interactive)
(projectile-global-mode nil))
;; Quick fix for company-mode and yasnippet clashing ;; Quick fix for company-mode and yasnippet clashing
(defun company-yasnippet-or-completion () (defun company-yasnippet-or-completion ()

View File

@ -9,6 +9,8 @@
(depends-on 'seq) (depends-on 'seq)
(depends-on 'ov) (depends-on 'ov)
(depends-on 'cheatsheet) (depends-on 'cheatsheet)
(with-ability tramp
(depends-on 'tramp))
(with-ability ivy (with-ability ivy
(depends-on 'ivy)) (depends-on 'ivy))

View File

@ -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 () (defun fg42-reload ()
"Reload the entire FG42." "Reload the entire FG42."
(interactive) (interactive)
(load-file (concat (getenv "FG42_HOME") "/fg42-config.el"))) (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 ;;;###autoload
(defun extensions/editor-initialize () (defun extensions/editor-initialize ()
"Base plugin initialization." "Base plugin initialization."
@ -26,8 +42,11 @@
(setq initial-scratch-message nil) (setq initial-scratch-message nil)
;; Tramp configuration ------------------------------------- ;; Tramp configuration -------------------------------------
(setq tramp-default-method "ssh") (ability tramp ()
(setq tramp-default-method "ssh")
(global-set-key [f9] 'fg42-open-todo))
;; replace strings ;; replace strings
(global-set-key (kbd "C-c M-s") 'replace-string) (global-set-key (kbd "C-c M-s") 'replace-string)

View File

@ -31,10 +31,18 @@
(defvar fg42-home (getenv "FG42_HOME") (defvar fg42-home (getenv "FG42_HOME")
"The pass to 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 () (defun fg42-initialize ()
"Initialize FG42 editor." "Initialize FG42 editor."
(run-hooks 'fg42-before-initialize-hook)
(setq package-user-dir (concat fg42-home "/packages")) (setq package-user-dir (concat fg42-home "/packages"))
(fpkg-initialize) (fpkg-initialize)
(initialize-extensions)) (initialize-extensions)
(run-hooks 'fg42-after-initialize-hook))
(provide 'fg42) (provide 'fg42)