Skip to content

Instantly share code, notes, and snippets.

yaml-mode

;;;; Devops tunings
;; (use-package ansible)
;; (ansible::set-default-keymap)

(use-package yaml-mode
  :config
  (add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode))
  (add-hook 'yaml-mode-hook
#+begin_src emacs-lisp
(use-package ivy
:disabled
:bind (("C-x b" . ivy-switch-buffer)
("<M-F2>" . ivy-switch-buffer)
("<f10>" . ivy-resume)
("C-c C-r" . ivy-resume)
("C-c v" . ivy-push-view)
("C-c V" . ivy-pop-view)
)
** python-mode
#+begin_src emacs-lisp
(use-package python
:mode ("\\.py" . python-mode)
:config
(setq py-python-command "python3")
(setq python-shell-interpreter "python3")
(setq python-indent-offset 4)
** chronos
#+begin_src emacs-lisp
;;;; chronos plugin
(use-package chronos
:config
;; (use-package chronos)
;; https://github.com/dxknight/chronos
;; now is 17:00
;; 5 gives an expiry time of 17:05
;; 1:30 gives 18:30
*** company
http://company-mode.github.io/
**** company
#+begin_src emacs-lisp
(use-package company
:bind (
:map company-active-map
("\C-n" . company-select-next)
*** python-mode
#+begin_src emacs-lisp
(use-package python
:mode ("\\.py" . python-mode)
:config
(setq py-python-command "python3")
(setq python-shell-interpreter "python3")
(setq python-indent-offset 4)
** dired
*** base settings
#+begin_src emacs-lisp
(put 'dired-find-alternate-file 'disabled nil)
;; если открыт другой буфер с dired, то по-умолчанию в пути подставлять его каталог
(setq dired-dwim-target t)
(if (eq system-type 'windows-nt) ;OR gnu/linux
(setq dired-listing-switches "-lah")
Вкратце за 5 минут получилось так
Краткая суть: http://betteri.ru/post/agile-results---novyy-podhod-k-lichnoy-effektivnosti-opisanie-osnovnyh-priemov-i-principov.html
Вот пример простого решения на блокнотах: http://gettingresults.com/how-to-use-agile-results-with-evernote/
Вот источник реализаций идей: http://doc.norang.ca/org-mode.html
В качестве минимизатора телодвижений использую org-capture-template
Все шаблоны автоматически вставляются по "C-c c <key>" в ~/notes/org-mode/diary.org.gpg.
Сделав пару записей по "C-c c <key>" сразу станет очевидна иерархия в diary.org.
Этот файл входит в состав org-agenda-files и все TODO оттуда автоматически попадают в Agenda в её часть Sheduled.
** hydra
*** transparency
#+begin_src emacs-lisp
(defun my--set-transparency (inc)
"Increase or decrease the selected frame transparency"
(let* ((alpha (frame-parameter (selected-frame) 'alpha))
(next-alpha (cond ((not alpha) 100)
((> (- alpha inc) 100) 100)
((< (- alpha inc) 0) 0)
(t (- alpha inc)))))