Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (39 sloc) 1.69 KB
;;Chmouel Boudjnah <>
;Initializations variables
(defvar my-init-directory "~/.emacs.d")
;Initializations Config
(push (expand-file-name (concat my-init-directory "/modes/")) load-path)
(push (expand-file-name (concat my-init-directory "/modes/local")) load-path)
;Initializations functions
(defun my-load-file(file)
(let* ((dir (concat my-init-directory "/configs") )
(fpath (concat dir "/" file ".el")))
(if (file-exists-p fpath)(load-file fpath) (format "File %s doen't exit" fpath) )))
(defun my-load-dir(dir)
(let ((files (directory-files dir nil "\.el$")))
(while files
(load-file (concat dir (pop files))))))
(defun my-short-hostname()
(string-match "[0-9A-Za-z-]+" system-name)
(substring system-name (match-beginning 0) (match-end 0))
;; Some macros.
(defmacro GUI (&rest x) (list 'if (not (null window-system)) (cons 'progn x)))
;Loading Packages
(if (fboundp 'normal-top-level-add-subdirs-to-load-path)
(let* ((my-lisp-dir (expand-file-name (concat my-init-directory "/packages/")))
(default-directory my-lisp-dir))
(setq load-path (cons my-lisp-dir load-path))
;Custome customize (lol)
(setq custom-file (concat my-init-directory "/configs/customed.el"))
(load custom-file)
;Loading Configs files
(my-load-dir (concat my-init-directory "/configs/"))
(my-load-dir (concat my-init-directory "/configs/programming/"))
;Loading Host
(if (file-exists-p (downcase (concat my-init-directory "/hosts/" (my-short-hostname) ".el")))
(load-file (downcase (concat my-init-directory "/hosts/" (my-short-hostname) ".el"))))
(cd (expand-file-name "~/"))
(put 'dired-find-alternate-file 'disabled nil)
Jump to Line
Something went wrong with that request. Please try again.