Skip to content

Latest commit

 

History

History
258 lines (213 loc) · 8.54 KB

darkanthey.org

File metadata and controls

258 lines (213 loc) · 8.54 KB

Local User Customizations

Starter Kit darkanthey

You must change the name of this file/ to the value of the Emacs variable user-login-name OR system-name, so that it will be picked up by init.el when Emacs starts up, and be loaded properly. To find the current value of these variables on your system, do C-h-v system-name [RET] and C-h-v user-login-name [RET]. For example, on my system user-login-name is ‘darkanthey’, so this file is named darkanthey.org, and when Emacs starts up with the starter kit it creates the file darkanthey.el.

You will also need to change the values for the location of bibtex databases and orgmode-mobile specified below, and some other settings. Search for ‘darkanthey’ in this file to find the paths that need to be updated. Change them as needed or comment them out if you don’t use these features.

User settings

;; My name and e-mail address
(setq user-full-name "Andrew Grytsenko")
(setq user-mail-address "[email protected]")

Font settings

Font-face setup. Check the availability of a some default fonts, in order of preference. The first of these alternatives to be found is set as the default font, together with base size and fg/bg colors. If none of the preferred fonts is found, nothing happens and Emacs carries on with the default setup. We do this here to prevent some of the irritating flickering and resizing that otherwise goes on during startup. You can reorder or replace the options here with the names of your preferred choices.

(defun load-exists-font ()
  "Load exists font from list"
  (let ((ordered-fonts nil))
    (setq ordered-fonts '("Hack" "Inconsolata" "Menlo" "Consolas" "Monospace" "Source Code Pro"))
    (add-hook 'server-visit-hook '(set-font-from-list ordered-fonts))
    (set-font-from-list ordered-fonts)))

(load-exists-font)

Install Git packages

;;; 'zenburn-theme 'material-theme
(setq install-packages (list 'doom-themes 'indent-guide 'doom-modeline 'powerline))
(dolist (package install-packages) (package-install package))

Theme settings

Chenge theme or/and color settings

;; (load-theme 'zenburn t)
;; (load-theme 'material t)

;; (require 'powerline)
;; (powerline-center-theme)

(require 'doom-themes)

(require 'indent-guide)
(indent-guide-global-mode)
(set-face-background 'indent-guide-face "dimgray")

;; Global settings (defaults)
(setq doom-themes-enable-bold t    ; if nil, bold is universally disabled
      doom-themes-enable-italic t) ; if nil, italics is universally disabled

;; Load the theme (doom-one, doom-molokai, etc); keep in mind that each
;; theme may have their own settings.
(load-theme 'doom-molokai t)

;; Enable flashing mode-line on errors
(doom-themes-visual-bell-config)

;; Enable custom neotree theme
(doom-themes-neotree-config)  ; all-the-icons fonts must be installed!

(require 'doom-modeline)
(doom-modeline-mode 1)
(setenv "PYTHONPATH" "/Users/darkanthey/.virtualenvs/int/lib/python3.7/site-packages")
(defun custom-persp/org ()
  (interactive)
  (custom-persp "@org"
    (find-file (first org-agenda-files))))

(global-set-key (kbd "C-x p o") 'custom-persp/org)

Prodigy Project

(prodigy-define-service
  :name "docker"
  :command "docker"
  :args '("start" "ws-postgres ws-rabbitmq")
  :cwd "/home/darkanthey/Code/BlockEx/ws-api/"
  :tags '(proj)
  :kill-signal 'sigkill
  :kill-process-buffer-on-stop t)

(prodigy-define-service
  :name "hop_pytest"
  :env '(("PYTHONHOME" "~/.virtualenvs/int/")
         ("PYTHONPATH" "~/Code/hopster/hopster-www/app/")
         ("VIRTUAL_ENV" "~/.virtualenvs/int/"))
  :command "pytest"
  :args '("pytest" "--sdk-path ./lib --ignore lib/ -nauto")
  :cwd "~/Code/hopster/hopster-www/app/"
  :tags '(hop_pytest)
  :kill-signal 'sigkill
  :kill-process-buffer-on-stop t)

Local Org-mode Settings

Agenda Settings

(setq org-todo-keywords
      '((sequence "TODO(t)" "PENDING(p)" "MEETING(m)" "|" "DONE(d)" "CANCELED(c)")))

;; Automatically mark todo items with todo subitems as DONE when all subitems are done.
(defun my-org-autodone (n-done n-not-done)
  "Switch entry to DONE when all subentries are done, to TODO otherwise."
  (let (org-log-done org-log-states)   ; turn off logging
    (org-todo (if (= n-not-done 0) "DONE" "TODO"))))

(add-hook 'org-after-todo-statistics-hook 'my-org-autodone)

;;File and refile notes to any main header in any file in my org-agenda-files list.
(setq org-refile-targets '((nil :level . 1)
                           (org-agenda-files :level . 1)))

Org Settings

Sync orgmode files with Dropbox.

;; Where archived projects and tasks go
(setq org-archive-location "~/Templates/Dropbox/Org/archive.org::From %s")
;; Set to the location of your Org files on your local system
(setq org-directory "~/Templates/Dropbox/Org")
;; Set to <your Dropbox root directory>/MobileOrg.
(setq org-mobile-directory "~/Templates/Dropbox/MobileOrg")
;; Set to the files (or directory of files) you want sync'd
(setq org-agenda-files (quote ("~/Templates/Dropbox/Org")))
;; Set to the name of the file where new notes will be stored
(setq org-mobile-inbox-for-pull "~/Templates/Dropbox/Org/from-mobile.org")

Searching the web can also be improved with Emacs.

(global-set-key (kbd "C-x e") 'webjump)

;; Add Urban Dictionary to webjump
(eval-after-load "webjump"
'(add-to-list 'webjump-sites
              '("Urban Dictionary" .
                [simple-query
                 "www.urbandictionary.com"
                 "http://www.urbandictionary.com/define.php?term="
                 ""])))

Auto-complete mode

Powerful autocompletion; experimentally added. Will pop-up autocomplete suggestions as you type; hit TAB to complete, or choose from the menu of options.

(require 'fuzzy)
(require 'auto-complete)
(setq ac-auto-show-menu t
      ac-quick-help-delay 0.5
      ac-use-fuzzy t)
(global-auto-complete-mode +1)

(require 'auto-complete-config)
(setq ac-modes (append ac-modes '(org-mode)))
(ac-config-default)
(define-key ac-complete-mode-map [tab] 'ac-expand)
(setq ac-auto-start 4)
(ac-flyspell-workaround)
(define-key ac-mode-map (kbd "M-\\") 'auto-complete)

IRC

;; connect to irc on invocation but don't autojoin any channels
(require 'rcirc)
;; (add-to-list 'rcirc-server-alist '("irc.freenode.net"))
(setq rcirc-server-alist
      '(("irc.freenode.net" :port 6697 :encryption tls :channels ("#haskell" "#emacs" "#python"))))

Local iBuffer Settings

Manage a lot of buffers easily with C-x C-b. Already set up elsewhere in the starter kit. Add local configuration here, e.g., display categories.

(setq ibuffer-saved-filter-groups
    '(("home"
       ("Python" (mode . python-mode))
       ("Haskell" (mode . haskell-mode))
       ("Org" (or (mode . org-mode)
                  (filename . "OrgMode")))
       ("Web Dev" (or (mode . html-mode)
                      (mode . css-mode)
                      (mode . js2-mode)
                      (mode . web-mode)
                      (mode . ng2-mode)
                      (mode . jinja2-mode)))
       ("Magit" (name . "\*magit"))
       ("Prodigy" (name . "\*prodigy"))
       ("Dired" (mode . dired-mode))
       ("LaTeX" (mode . latex-mode))
       ("IRC" (mode . rcirc))
       ("Help" (or (name . "\*Help\*")
                   (name . "\*Apropos\*")
                   (name . "\*info\*"))))))

     (add-hook 'ibuffer-mode-hook
       '(lambda () (ibuffer-switch-to-saved-filter-groups "home")))
     (setq ibuffer-show-empty-filter-groups nil)
     (setq ibuffer-expert t)
     (add-hook 'ibuffer-mode-hook
       '(lambda ()
         (ibuffer-auto-mode 1)
         (ibuffer-switch-to-saved-filter-groups "home")))