dot

packages and services management
Log | Files | Refs | README

commit c010c54df7e266b6c9973bcdbb807b744f859dc9
parent 3d676c6df7995630470b86e1caa2143d56e6b2a8
Author: josuah <mail@josuah.net>
Date:   Wed,  5 Oct 2016 17:47:17 -0400

quick!

Diffstat:
Rlsync -> bin/lsync2 | 0
Demacs/.emacs | 414-------------------------------------------------------------------------------
Aemacs/.emacs.d/init.el | 411+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mshell/.profile | 40++++++++++++++++------------------------
Atmux/.config/tmux/new-session | 21+++++++++++++++++++++
Atmux/.config/tmux/status | 96+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtmux/.tmux.conf | 44++++++++++++++++++++------------------------
Dtmux/.tmux/new-session | 15---------------
Dtmux/.tmux/status | 71-----------------------------------------------------------------------
9 files changed, 564 insertions(+), 548 deletions(-)

diff --git a/lsync b/bin/lsync2 diff --git a/emacs/.emacs b/emacs/.emacs @@ -1,414 +0,0 @@ -;;; init --- I used to have my .emacs.d as my unique dotfile repo. -;;; Commentary: /\ -; ___ ________ _____ ____ ____ ___/ / -; .'__ \ / __ __ \ .'__ // ___\ / __/ .'__ / -; / ____// / / / / // /_/ // /__ __\ \ __ / /_/ / -; \___\ \/ \/ \/ \____/ \____\ \___/ \/ \____/ -;=============================================================================== -;; Code: - -(setq - user-full-name "Josuah Demangeon" - user-mail-address "mail@josuah.net" - - custom-file - (expand-file-name "emacs-custom.el" temporary-file-directory)) - -;; Appearance - -(when (fboundp 'menu-bar-mode) (menu-bar-mode -1)) -(when (fboundp 'fringe-mode) (fringe-mode 0)) -(when (fboundp 'tool-bar-mode) (tool-bar-mode -1)) -(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) - -(load-theme 'wombat t) - -(set-frame-font "mono:antialias=false:size=15") -(add-to-list 'default-frame-alist - '(font . "mono:antialias=false:size=15")) - -(set-display-table-slot standard-display-table 'vertical-border "|") -(aset standard-display-table ?\^L (make-vector fill-column "_")) - -;; Progress bar & logs -(defvar ///-steps 7 "Number of calls to `///'.") -(defvar ///-counter 0 "Initializing the counter.") -(defvar ///-time (current-time) "Time counter.") -(defvar ///-previous nil "Previous loaded package.") -(defun /// (&optional title) - "A progress bar on the mode-line and TITLE in the echo area." - (redisplay) - (when ///-previous - (message " done in %.3fs\n" - (float-time (time-subtract (current-time) ///-time)))) - (when title (message "Loading %s" title)) - (setq - ///-time (current-time) - ///-previous title - mode-line-format (make-string - (* ///-counter (/ (window-total-size nil 'width) - ///-steps)) - ?|) - ///-counter (1+ ///-counter))) -(add-hook 'after-init-hook '///) - - -(/// "packages") -(require 'package) - -(setq package-list '(ivy swiper counsel which-key undo-tree)) -(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) - -(package-initialize) - -(unless package-archive-contents - (package-refresh-contents)) - -(dolist (package package-list) - (unless (package-installed-p package) - (package-install package))) - - -(/// "core settings") - -(setq - visible-bell t ;Keystrokes - echo-keystrokes 0.1 - - inhibit-startup-message t ;Startup - initial-scratch-message nil - - hscroll-step 1 ;Scrolling - scroll-conservatively 1000 - truncate-lines t - - tab-always-indent 'complete) ;Supertab - -(defalias 'display-startup-echo-area-message - (lambda () (message "Emacs loaded in %s" (emacs-init-time)))) -(defalias 'yes-or-no-p 'y-or-n-p) - -(require 'proced) -(global-set-key (kbd "C-x p") 'proced) - -(require 'files) -(setq - backup-directory-alist ;Backup and autosaves - `((".*" . ,(expand-file-name "tmp" user-emacs-directory))) - auto-save-file-name-transforms - `((".*" ,(expand-file-name "tmp" user-emacs-directory)))) - -(require 'dired) -(require 'dired-x) -(setq dired-listing-switches "-alh --group-directories-first") - -(require 'hl-line) -(global-hl-line-mode 1) - -(require 'frame) -(blink-cursor-mode 0) - -(require 'hideshow) -(add-hook 'prog-mode-hook 'hs-minor-mode) - -(require 'hideif) -(hide-ifdef-mode 1) - -(provide 'reveal) -(global-reveal-mode) - -(require 'which-func) -(add-hook 'prog-mode-hook 'which-function-mode) -(add-hook 'text-mode-hook 'which-function-mode) - -(require 'prog-mode) -(setq prettify-symbols-unprettify-at-point 'right-edge) -(prettify-symbols-mode) - -(require 'paren) -(setq show-paren-when-point-inside-paren t - show-paren-when-point-in-periphery t - show-paren-style 'mixed) - -(show-paren-mode 1) - -(require 'elec-pair) -(electric-pair-mode 1) - -(require 'ehelp) -(define-key global-map (kbd "C-h") 'ehelp-command) - -(require 'elide-head) -(add-hook 'prog-mode-hook 'elide-head) - -(require 'simple) -(line-number-mode 0) -(add-hook 'text-mode-hook 'auto-fill-mode) - -(require 'misc) -(global-set-key (kbd "M-z") 'zap-up-to-char) - -(require 'eldoc) -(add-hook 'prog-mode-hook 'eldoc-mode) - -(require 'cua-rect) -(global-set-key (kbd "C-M-m") 'cua-rectangle-mark-mode) - -(require 'hippie-exp) -(global-set-key (kbd "M-/") 'hippie-expand) - -(require 'autoinsert) -(auto-insert-mode 1) - -(require 'server) -(unless (server-running-p) (server-start)) - -(require 'doc-view) -(setq doc-view-resolution 100) - -(require 'ediff) -(setq ediff-window-setup-function 'ediff-setup-windows-plain) - -(require 'shr-color) -(setq shr-color-visible-luminance-min 70) - -(require 'browse-url) -(setq browse-url-browser-function 'eww-browse-url) - -(require 'autorevert) -(auto-revert-mode 1) - - -(/// "linum") -(require 'linum) - -(setq linum-format (concat "%3d ")) - -(add-hook 'prog-mode-hook 'linum-mode) -(add-hook 'text-mode-hook 'linum-mode) - - -(/// "ibuffer") -(require 'ibuffer) -(require 'ibuf-ext) - -(setq - ibuffer-saved-filter-groups - '(("default" - ("Gnus" - (or (mode . message-mode) - (mode . mail-mode) - (mode . gnus-group-mode) - (mode . gnus-summary-mode) - (mode . gnus-article-mode) - (mode . gnus-edit-form-mode) - (name . "^\\.newsrc-dribble"))) - ("Erc" (mode . erc-mode)) - ("Web" (mode . eww-mode)) - ("Shell" - (or (name . "^\\*Shell Command Output\\*$") - (name . "^\\*Async Shell Command\\*$") - (name . "^\\*Whois\\*$") - (mode . eshell-mode) - (mode . shell-mode))) - ("Emacs" - (or (name . "^\\*scratch\\*$") - (name . "^\\*backtrace\\*$") - (name . "^\\*Dired log\\*$") - (mode . messages-buffer-mode) - (mode . completion-list-mode) - (mode . Info-mode) - (mode . help-mode) - (mode . compilation-mode) - (mode . package-menu-mode) - (mode . occur-mode) - (mode . Custom-mode))) - ("VC" - (or (name . "^\\*vc\\*$") - (mode . diff-mode) - (mode . vc-dir-mode))) - ("Dired" (mode . dired-mode)) - ("Elisp" (mode . emacs-lisp-mode)) - ("Org" (mode . org-mode)) - ("Documents" (filename . ".pdf\\|.ps\\|.odt\\|.ods")) - ("Other Files" (filename . ""))))) - -(add-hook - 'ibuffer-mode-hook - (lambda () (ibuffer-switch-to-saved-filter-groups "default"))) - -(defalias 'list-buffers 'ibuffer) - - -(/// "eshell") -(require 'eshell) -(require 'em-prompt) -(require 'em-term) -(require 'em-cmpl) -(require 'em-smart) -(require 'em-banner) - -(setq - eshell-where-to-jump 'begin - eshell-review-quick-commands nil - eshell-smart-space-goes-to-end t - pcomplete-cycle-completions nil - eshell-prompt-function 'my-eshell-prompt-function - eshell-prompt-regexp "^> " - eshell-banner-message "") - -(defmacro with-face (string &rest properties) - "Set face for STRING without defining it, according to PROPERTIES." - `(propertize ,string 'face (list ,@properties))) - -(defun my-eshell-prompt-function () - "Function generating the eshell prompt." - (concat - "\n" - (with-face (concat " " (abbreviate-file-name (eshell/pwd)) " ") - :inverse-video t) - (with-face (format-time-string " %H:%M " (current-time)) - :inherit 'hl-line) - - (with-face (or (ignore-errors - (format "%s %s" - (vc-responsible-backend default-directory) - (vc-state default-directory))) - "") - :inherit 'hl-line) - (with-face "\n" - :inherit 'hl-line) - "> ")) - -(add-to-list 'eshell-visual-commands "alsamixer") -(add-to-list 'eshell-visual-commands "cfdisk") - -(global-set-key (kbd "C-c t") 'eshell) ;"t" for terminal - -(add-hook 'eshell-mode-hook 'eshell-smart-initialize) - - -(/// "erc") -(require 'erc) - -(setq - erc-fill-function 'erc-fill-static - erc-fill-column 70 - erc-fill-static-center 13 - erc-prompt ">" - erc-show-my-nick nil - erc-accidental-paste-threshold-seconds 2) - - -(/// "org") -(require 'org) -(require 'ox-publish) - -(setq - - org-hide-leading-stars t ;Appearance - org-descriptive-links nil - org-startup-folded nil) - -(org-babel-do-load-languages ;Babel - 'org-babel-load-languages - '((emacs-lisp . t) (python . t) (R . t))) - - -(/// "gnus") -(require 'nnimap) -(require 'gnus-mlspl) -(require 'nnir) - -(setq - ;; E-mails - - gnus-select-method - '(nnimap - "gmail" - - (nnimap-stream ssl) ;Reading - (nnimap-address "imap.gmail.com") - (nnimap-inbox "INBOX") - - (smtpmail-smtp-server "smtp.gmail.com") ;Sending - (smtpmail-smtp-service 587) - (send-mail-function smtpmail-send-it) - - (nnir-search-engine imap) ;Searching - - (nnimap-split-methods nnmail-split-fancy) ;Splitting - (nnimap-unsplittable-articles nil) - - (nnmail-split-fancy - (& (| (: nnmail-split-fancy-with-parent) - (: gnus-group-split-fancy)) - (from "josuah\\.demangeon@gmail\\.com" "mail.sent"))) - - (gnus-group-split-default-catch-all-group "INBOX") - - (gnus-parameters ;Group parameters - ((".*\\[Gmail\\].*" - (subscribed . t)) - ("mail\\..*" - (display . all) - (subscribed . t)) - ("mail\\.me" - (to-list . "josuah.demangeon@gmail.com")) - ("mail\\.sfbi" - (to-list . "bioinfo@sfbi.fr")) - ("mail\\.fsf" - (to-list . "info@fsf.org")) - ("mail\\.univ-rennes1" - (split-regexp . ".*univ-rennes1\\.fr")) - ("mail\\.github" - (to-list . "notifications@github\\.com") - (split-regexp . ".*github\\.com")) - ("mail\\.expenses" - (split-regexp . "@amazon.*") - (split-regexp . "@.*sfr\\.fr")) - ("list\\..*" - (display . all))))) - - message-subscribed-address-functions - '(gnus-find-subscribed-addresses) - - gnus-ignored-from-addresses nil ;Hide no group or email adress - gnus-ignored-newsgroups "" - - mm-attachment-override-types '("image/.*") ;Display images inline - - gnus-use-full-window nil ;So not change window config - - ;; NTP - - gnus-secondary-select-methods '((nntp "news.gmane.org") - (nntp "news.gnus.org"))) - -(add-hook 'gnus-group-mode-hook 'gnus-topic-mode) - - -(global-set-key (kbd "C-c g") 'gnus) - - -(/// "ivy") -(require 'ivy) -(require 'swiper) -(require 'counsel) -(ivy-mode) -(counsel-mode) - -(global-set-key (kbd "C-s") 'swiper) -(global-set-key (kbd "M-x") 'counsel-M-x) - -(/// "which-key") -(require 'which-key) -(which-key-mode) - -(/// "undo-tree") -(require 'undo-tree) -(undo-tree-mode) - -(/// "emacs") -(provide 'init) -;;; init.el ends here diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el @@ -0,0 +1,411 @@ +;; init --- I used to have my .emacs.d as my unique dotfile repo. +;;; Commentary: /\ +; ___ ________ _____ ____ ____ ___/ / +; .'__ \ / __ __ \ .'__ // ___\ / __/ .'__ / +; / ____// / / / / // /_/ // /__ __\ \ __ / /_/ / +; \___\ \/ \/ \/ \____/ \____\ \___/ \/ \____/ 2016-10-05 +;=============================================================================== +;; Code: +;;------------------------------------------------------------------------------ +(setq + user-full-name "Josuah Demangeon" + user-mail-address "mail@josuah.net" + + custom-file + (expand-file-name "emacs-custom.el" temporary-file-directory)) + +;; Appearance + +(when (fboundp 'menu-bar-mode) (menu-bar-mode -1)) +(when (fboundp 'fringe-mode) (fringe-mode 0)) +(when (fboundp 'tool-bar-mode) (tool-bar-mode -1)) +(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) + +(load-theme 'wombat t) + +(set-frame-font "mono:antialias=false:size=15") +(add-to-list 'default-frame-alist + '(font . "mono:antialias=false:size=15")) + +;; Progress bar & logs +(defvar ///-steps 7 "Number of calls to `///'.") +(defvar ///-counter 0 "Initializing the counter.") +(defvar ///-time (current-time) "Time counter.") +(defvar ///-previous nil "Previous loaded package.") +(defun /// (&optional title) + "A progress bar on the mode-line and TITLE in the echo area." + (redisplay) + (when ///-previous + (message " done in %.3fs\n" + (float-time (time-subtract (current-time) ///-time)))) + (when title (message "Loading %s" title)) + (setq + ///-time (current-time) + ///-previous title + mode-line-format (make-string + (* ///-counter (/ (window-total-size nil 'width) + ///-steps)) + ?#) + ///-counter (1+ ///-counter))) +(add-hook 'after-init-hook '///) + +;;------------------------------------------------------------------------------ +(/// "packages") +(require 'package) + +(setq package-list '(ivy swiper counsel which-key undo-tree)) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) + +(package-initialize) + +(unless package-archive-contents + (package-refresh-contents)) + +(dolist (package package-list) + (unless (package-installed-p package) + (package-install package))) + +;;------------------------------------------------------------------------------ +(/// "core settings") + +(setq + visible-bell t ;Keystrokes + echo-keystrokes 0.1 + + inhibit-startup-message t ;Startup + initial-scratch-message nil + + hscroll-step 1 ;Scrolling + scroll-conservatively 1000 + truncate-lines t + + tab-always-indent 'complete) ;Supertab + +(defalias 'display-startup-echo-area-message + (lambda () (message "Emacs loaded in %s" (emacs-init-time)))) +(defalias 'yes-or-no-p 'y-or-n-p) + +(require 'proced) +(global-set-key (kbd "C-x p") 'proced) + +(require 'files) +(setq + backup-directory-alist ;Backup and autosaves + `((".*" . ,(expand-file-name "tmp" user-emacs-directory))) + auto-save-file-name-transforms + `((".*" ,(expand-file-name "tmp" user-emacs-directory)))) + +(require 'dired) +(require 'dired-x) +(setq dired-listing-switches "-alh --group-directories-first") + +(require 'hl-line) +(global-hl-line-mode 1) + +(require 'frame) +(blink-cursor-mode 0) + +(require 'hideshow) +(add-hook 'prog-mode-hook 'hs-minor-mode) + +(require 'hideif) +(hide-ifdef-mode 1) + +(provide 'reveal) +(global-reveal-mode) + +(require 'which-func) +(add-hook 'prog-mode-hook 'which-function-mode) +(add-hook 'text-mode-hook 'which-function-mode) + +(require 'prog-mode) +(setq prettify-symbols-unprettify-at-point 'right-edge) +(prettify-symbols-mode) + +(require 'paren) +(setq show-paren-when-point-inside-paren t + show-paren-when-point-in-periphery t + show-paren-style 'mixed) + +(show-paren-mode 1) + +(require 'elec-pair) +(electric-pair-mode 1) + +(require 'ehelp) +(define-key global-map (kbd "C-h") 'ehelp-command) + +(require 'elide-head) +(add-hook 'prog-mode-hook 'elide-head) + +(require 'simple) +(line-number-mode 0) +(add-hook 'text-mode-hook 'auto-fill-mode) + +(require 'misc) +(global-set-key (kbd "M-z") 'zap-up-to-char) + +(require 'eldoc) +(add-hook 'prog-mode-hook 'eldoc-mode) + +(require 'cua-rect) +(global-set-key (kbd "C-M-m") 'cua-rectangle-mark-mode) + +(require 'hippie-exp) +(global-set-key (kbd "M-/") 'hippie-expand) + +(require 'autoinsert) +(auto-insert-mode 1) + +(require 'server) +(unless (server-running-p) (server-start)) + +(require 'doc-view) +(setq doc-view-resolution 100) + +(require 'ediff) +(setq ediff-window-setup-function 'ediff-setup-windows-plain) + +(require 'shr-color) +(setq shr-color-visible-luminance-min 70) + +(require 'browse-url) +(setq browse-url-browser-function 'eww-browse-url) + +(require 'autorevert) +(auto-revert-mode 1) + +;;------------------------------------------------------------------------------ +(/// "linum") +(require 'linum) + +(setq linum-format (concat "%3d ")) + +(add-hook 'prog-mode-hook 'linum-mode) +(add-hook 'text-mode-hook 'linum-mode) + +;;------------------------------------------------------------------------------ +(/// "ibuffer") +(require 'ibuffer) +(require 'ibuf-ext) + +(setq + ibuffer-saved-filter-groups + '(("default" + ("Gnus" + (or (mode . message-mode) + (mode . mail-mode) + (mode . gnus-group-mode) + (mode . gnus-summary-mode) + (mode . gnus-article-mode) + (mode . gnus-edit-form-mode) + (name . "^\\.newsrc-dribble"))) + ("Erc" (mode . erc-mode)) + ("Web" (mode . eww-mode)) + ("Shell" + (or (name . "^\\*Shell Command Output\\*$") + (name . "^\\*Async Shell Command\\*$") + (name . "^\\*Whois\\*$") + (mode . eshell-mode) + (mode . shell-mode))) + ("Emacs" + (or (name . "^\\*scratch\\*$") + (name . "^\\*backtrace\\*$") + (name . "^\\*Dired log\\*$") + (mode . messages-buffer-mode) + (mode . completion-list-mode) + (mode . Info-mode) + (mode . help-mode) + (mode . compilation-mode) + (mode . package-menu-mode) + (mode . occur-mode) + (mode . Custom-mode))) + ("VC" + (or (name . "^\\*vc\\*$") + (mode . diff-mode) + (mode . vc-dir-mode))) + ("Dired" (mode . dired-mode)) + ("Elisp" (mode . emacs-lisp-mode)) + ("Org" (mode . org-mode)) + ("Documents" (filename . ".pdf\\|.ps\\|.odt\\|.ods")) + ("Other Files" (filename . ""))))) + +(add-hook + 'ibuffer-mode-hook + (lambda () (ibuffer-switch-to-saved-filter-groups "default"))) + +(defalias 'list-buffers 'ibuffer) + +;;------------------------------------------------------------------------------ +(/// "eshell") +(require 'eshell) +(require 'em-prompt) +(require 'em-term) +(require 'em-cmpl) +(require 'em-smart) +(require 'em-banner) + +(setq + eshell-where-to-jump 'begin + eshell-review-quick-commands nil + eshell-smart-space-goes-to-end t + pcomplete-cycle-completions nil + eshell-prompt-function 'my-eshell-prompt-function + eshell-prompt-regexp "^> " + eshell-banner-message "") + +(defmacro with-face (string &rest properties) + "Set face for STRING without defining it, according to PROPERTIES." + `(propertize ,string 'face (list ,@properties))) + +(defun my-eshell-prompt-function () + "Function generating the eshell prompt." + (concat + "\n" + (with-face (concat " " (abbreviate-file-name (eshell/pwd)) " ") + :inverse-video t) + (with-face (format-time-string " %H:%M " (current-time)) + :inherit 'hl-line) + + (with-face (or (ignore-errors + (format "%s %s" + (vc-responsible-backend default-directory) + (vc-state default-directory))) + "") + :inherit 'hl-line) + (with-face "\n" + :inherit 'hl-line) + "> ")) + +(add-to-list 'eshell-visual-commands "alsamixer") +(add-to-list 'eshell-visual-commands "cfdisk") + +(global-set-key (kbd "C-c t") 'eshell) ;"t" for terminal + +(add-hook 'eshell-mode-hook 'eshell-smart-initialize) + + +(/// "erc") +(require 'erc) + +(setq + erc-fill-function 'erc-fill-static + erc-fill-column 70 + erc-fill-static-center 13 + erc-prompt ">" + erc-show-my-nick nil + erc-accidental-paste-threshold-seconds 2) + +;;------------------------------------------------------------------------------ +(/// "org") +(require 'org) +(require 'ox-publish) + +(setq + + org-hide-leading-stars t ;Appearance + org-descriptive-links nil + org-startup-folded nil) + +(org-babel-do-load-languages ;Babel + 'org-babel-load-languages + '((emacs-lisp . t) (python . t) (R . t))) + +;;------------------------------------------------------------------------------ +(/// "gnus") +(require 'nnimap) +(require 'gnus-mlspl) +(require 'nnir) + +(setq + ;; E-mails + + gnus-select-method + '(nnimap + "gmail" + + (nnimap-stream ssl) ;Reading + (nnimap-address "imap.gmail.com") + (nnimap-inbox "INBOX") + + (smtpmail-smtp-server "smtp.gmail.com") ;Sending + (smtpmail-smtp-service 587) + (send-mail-function smtpmail-send-it) + + (nnir-search-engine imap) ;Searching + + (nnimap-split-methods nnmail-split-fancy) ;Splitting + (nnimap-unsplittable-articles nil) + + (nnmail-split-fancy + (& (| (: nnmail-split-fancy-with-parent) + (: gnus-group-split-fancy)) + (from "josuah\\.demangeon@gmail\\.com" "mail.sent"))) + + (gnus-group-split-default-catch-all-group "INBOX") + + (gnus-parameters ;Group parameters + ((".*\\[Gmail\\].*" + (subscribed . t)) + ("mail\\..*" + (display . all) + (subscribed . t)) + ("mail\\.me" + (to-list . "josuah.demangeon@gmail.com")) + ("mail\\.sfbi" + (to-list . "bioinfo@sfbi.fr")) + ("mail\\.fsf" + (to-list . "info@fsf.org")) + ("mail\\.univ-rennes1" + (split-regexp . ".*univ-rennes1\\.fr")) + ("mail\\.github" + (to-list . "notifications@github\\.com") + (split-regexp . ".*github\\.com")) + ("mail\\.expenses" + (split-regexp . "@amazon.*") + (split-regexp . "@.*sfr\\.fr")) + ("list\\..*" + (display . all))))) + + message-subscribed-address-functions + '(gnus-find-subscribed-addresses) + + gnus-ignored-from-addresses nil ;Hide no group or email adress + gnus-ignored-newsgroups "" + + mm-attachment-override-types '("image/.*") ;Display images inline + + gnus-use-full-window nil ;So not change window config + + ;; NTP + + gnus-secondary-select-methods '((nntp "news.gmane.org") + (nntp "news.gnus.org"))) + +(add-hook 'gnus-group-mode-hook 'gnus-topic-mode) + + +(global-set-key (kbd "C-c g") 'gnus) + +;;------------------------------------------------------------------------------ +(/// "ivy") +(require 'ivy) +(require 'swiper) +(require 'counsel) +(ivy-mode) +(counsel-mode) + +(global-set-key (kbd "C-s") 'swiper) +(global-set-key (kbd "M-x") 'counsel-M-x) + +(/// "which-key") +(require 'which-key) +(which-key-mode) + +(/// "undo-tree") +(require 'undo-tree) +(undo-tree-mode) + +(/// "emacs") +(provide 'init) +;;; init.el ends here diff --git a/shell/.profile b/shell/.profile @@ -3,21 +3,25 @@ # ____ _____ ____ .' ___\ \/ /\ ___ # / __ \ / ____\/ __ \ / .'_ /\ / /.'__ \ # / /_/ // / / /_/ // ___/ / // // ____/ -#/ ____/ \/ \____/ \/ \/ \/ \___\ - Variables & shell config +#/ ____/ \/ \____/ \/ \/ \/ \___\ 2016-10-05 #\/============================================================================= +# Variables & shell config # VARIABLES #------------------------------------------------------------------------------- -export PS1="$(printf '\n\033[1;31m>\033[33m>\033[34m>\033[0m ')" +export PS1="$(printf '\n \033[1;31m>\033[33m>\033[34m>\033[0m ')" export PS2='| ' export PATH="$CONFIG/bin:$LOCAL/bin:$PATH" +# Black Red Green Yellow +# Blue Magenta Cyan White + solarized_light="\ \033]P0ffddbb \033]P1d0154b \033]P2779900 \033]P3ffa700\ -\033]P4096daf \033]P5897f74 \033]P600aa88 \033]P7000000\ +\033]P4096daf \033]P5dd6699 \033]P600aa88 \033]P7000000\ \033]P8bb9988 \033]P9d0154b \033]PA779900 \033]PBffa700\ \033]PC096daf \033]PD897f74 \033]PE00aa88 \033]PF222222" @@ -34,13 +38,9 @@ coal="\ \033]PCaaddff \033]PDaaaaaa \033]PE99ffbb \033]PFffffff" # Parse and merge ~/.pam_environment -[ -z "$CONFIG" ] && tee << EOF -$(sed -r ' - /^ *#/ d - /^ *$/ d - s/@/$/g - s/ *([^ ]*) *[^ ]*=/\1=/ -' ~/.pam_environment) +[ -z "$CONFIG" ] && eval << EOF +$(sed -r '/^ *#/ d; /^ *$/ d; s/@/$/g; s/ *([^ ]*) *[^ ]*=/\1=/' \ + ~/.pam_environment) EOF @@ -59,7 +59,6 @@ alias c='cd "$(find . -maxdepth 4 -mindepth 1 -type d | fzf)"' alias a='buffers attach' alias r='buffers run' alias g='grep --color=always' -alias weather='curl -4 wttr.in' alias lines='find . -name "*.[ch]" | xargs wc -l' alias myip='curl icanhazip.com' @@ -81,21 +80,12 @@ ps1() printf '\033[1m%s\033[0m ' "$pwd" # Git branch and status - if git rev-parse &> /dev/null - then - local color branch="$(git branch | sed -n 's/^\* // p')" - [ "$(git status --porcelain)" ] && color=31 || color=32 - printf '\033[2C \033[%sm%s\033[0m ' "$color" "$branch" - fi printf '\r' # Error code [ "$code" -eq 0 ] || printf '\033[62C\033[31;1m %s \033[0m\r' "$code" - # Non printable: terminal status, bell, empty line at the bottom. - printf '\a' #\n\n\033[2A' - # Last line for prompt printf '\n$ ' } @@ -115,12 +105,14 @@ light() )" } -# -# Mount /dev/sdb1 or $1 in /mnt -# mnt() { - sudo mount -o uid=$USER -o rw ${1-/dev/sdb1} ${2-/mnt} + sudo mount -o uid=$USER -o rw "${1-/dev/sdb1}" "${2-/mnt}" +} + +weather() +{ + curl -4 "wttr.in/$1" } extract() diff --git a/tmux/.config/tmux/new-session b/tmux/.config/tmux/new-session @@ -0,0 +1,21 @@ +#!/bin/sh +# __ +# ____ ___ __ /\ ____ ___ ____ ____ \/ ____ ____ +# / __ \ .'__ \ / /\/ / / __/.'__ \ / __/ / __/ /\ / __ \ / __ \ +# / / / // ____// / / /__\ \ / ____/__\ \ __\ \ / // /_/ // / / / +# \/ \/ \___\ \____/ \___/ \___\ \___/ \___/ \/ \____/ \/ \/ 2016-10-05 +#=============================================================================== + +dir="$( + find "$HOME/" -maxdepth 3 ! -path '*/.*' -type d | while read line + do printf '%s\n' "~${line#$HOME}" + done | fzf --margin=4,8 +)" + +cd "$HOME${dir#\~}" + +dir="${dir##*/}" +dir="$(printf '%s\n' "$dir" | cut -c 1 | tr [a-z] [A-Z])${dir#?}" +tmux rename-session "$dir" + +clear diff --git a/tmux/.config/tmux/status b/tmux/.config/tmux/status @@ -0,0 +1,96 @@ +#!/bin/sh +# /\ /\ +# ____ / /_ _____ / /_ __ /\ ____ +# / __// ___\.'__ // ___\/ / / / / __/ +# __\ \ / / / /_/ // / / /_/ /__\ \ +# \___/ \/ \____/ \/ \____/ \___/ 2016-10-05 +#=============================================================================== +# Status line, with tmux color escape sequence + + +# VARIABLES 2016-10-05 +#------------------------------------------------------------------------------- + +help='USAGE: ~/.tmux/status segmentname1 segmentname2 ...' +PWD="$(tmux display -p '#{pane_current_path}')" + +BG_COLOR=black +SEPARATOR="${SEPARATOR- }" + + +# FUNCTIONS 2016-10-05 +#------------------------------------------------------------------------------- +# +# Each segment's function has to print 3 lines: +# +# 1 The color +# +# 2 The label, with $color as background +# +# 3 The text, with $color as foreground +# +# Either of 2 and 3 can be empty, and any can contain aditionnal tmux color +# escape sequences: #[fg=color1,bg=color2,bold] + +mails() +{ + local count='' inbox='' + + count="$(find "$MAIL/new" -mindepth 1 2>/dev/null | wc -l)" + [ "$count" -le 0 ] && count='' || inbox='mail' + + printf '%s\n' red mail "$count" +} + +directory() +{ + local color='' pwd='' + + [ "${PWD##$HOME**}" ] && pwd="$PWD" || pwd="~${PWD#$HOME}" + + printf '%s\n' "$color" "" "$pwd" +} + +git() +{ + local branch='' status='' + + if git rev-parse &> /dev/null + then + branch="$(git branch | sed -n 's/^\* // p')" + status="$(git status --porcelain | wc -l)" + [ "$status" -gt 0 ] && color=red || color=green + else color='black,bold' branch='-' + fi + + printf '%s\n' "$color" "$branch" "${status#0}" +} + +clock() +{ + printf '%s\n' white '' "$(date +'%Y-%m-%d #[reverse]%H:%M')" +} + + +# ALGORYTHM 2016-10-05 +#------------------------------------------------------------------------------- + +for segment in $@ +do + $1 | { + read color + read label + read text + + if [ "$text" ] + then printf '#[bg=%s,fg=%s] %s #[default]' "$c" "black" "$l" + fi + + if [ "$label" ] + then printf '#[bg=%s,fg=%s] %s #[default]' "$BG_COLOR" "$c" "$t" + fi + } + + shift + [ $# -gt 0 ] && printf '%s' "$SEPARATOR" +done diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf @@ -2,11 +2,11 @@ # / /_ ________ __ /\ __ __ # / ___\/ __ __ \ / / / / \ \' / # / / / / / / / // /_/ / ,' ,' -# \/ \/ \/ \/ \____/ /_,\_\ 2016-10-04 +# \/ \/ \/ \/ \____/ /_,\_\ 2016-10-05 #=============================================================================== -# KEYBINDINGS 2016-10-04 +# KEYBINDINGS 2016-10-05 #------------------------------------------------------------------------------- set -g status-keys vi @@ -26,10 +26,10 @@ bind -r j select-pane -D bind -r h select-pane -L bind -r l select-pane -R bind -r o select-pane -t :.+ -bind -r C-k resize-pane -U 3 -bind -r C-j resize-pane -D 3 -bind -r C-h resize-pane -L 8 -bind -r C-l resize-pane -R 8 +bind -r C-k resize-pane -U 1 +bind -r C-j resize-pane -D 1 +bind -r C-h resize-pane -L 1 +bind -r C-l resize-pane -R 1 bind % split -h -c '#{pane_current_path}' bind '"' split -v -c '#{pane_current_path}' @@ -44,7 +44,7 @@ bind C new-window # Sessions management bind -n C-z detach -bind S new-session\; send ". ~/.tmux/new-session\n" +bind S new-session\; send ". ~/.config/tmux/new-session\n" # Reload config bind r source ~/.tmux.conf\; display "Config loaded" @@ -83,36 +83,30 @@ set -g mode-style bg=white,fg=black # STATUS 2016-10-04 #------------------------------------------------------------------------------- -# Layout +# Global set -g status-position top set -g status-justify left - -# Global set -g status-style bg=black,fg=white # Left -set -g status-left " #S #(#~/.tmux/status left)" +set -g status-left \ + "#[fg=black,bg=white] #S #[default]#(#~/.config/tmux/status left) " set -g status-left-length 30 -set -g status-left-style bold,fg=white +set -g status-left-style fg=white # Right -set -g status-right "#(#~/.tmux/status right)" +set -g status-right " #(#~/.config/tmux/status right) " set -g status-right-style fg=white -set -g window-status-separator " " +set -g window-status-separator " " -# WINDOWS -#------------------------------------------------------------------------------- - # Background windows -set -g window-status-format \ - " #{?window_zoomed_flag,[, }#I #W#{?window_zoomed_flag,], } " +set -g window-status-format " #I #W " set -g window-status-style bold,fg=black # Foreground windows -set -g window-status-current-format \ - " #{?window_zoomed_flag,[, }#I #W#{?window_zoomed_flag,], } " +set -g window-status-current-format " #I #W " set -g window-status-current-style bold,fg=white # Urgent windows @@ -123,7 +117,9 @@ set -g window-status-activity-style fg=white,bg=yellow # BORDERS 2016-10-04 #------------------------------------------------------------------------------- -set -g pane-border-style fg=white -set -g pane-active-border-style bold,reverse,fg=white +set -g pane-border-style bold,fg=white +set -g pane-active-border-style bold,fg=white set -g pane-border-status top -set -g pane-border-format " #{pane_index} #{pane_current_command} " +set -g pane-border-format \ + "#{?pane_active,#[fg=white],#[fg=black]} \ + #{pane_index} #{pane_current_command} " diff --git a/tmux/.tmux/new-session b/tmux/.tmux/new-session @@ -1,15 +0,0 @@ -#!/bin/sh - -dir="$( - find "$HOME/" -maxdepth 3 ! -path '*/.*' -type d | while read line - do printf '%s\n' "~${line#$HOME}" - done | fzf --margin=4,8 -)" - -cd "$HOME${dir#\~}" - -dir="${dir##*/}" -dir="$(printf '%s\n' "$dir" | cut -c 1 | tr [a-z] [A-Z])${dir#?}" -tmux rename-session "$dir" - -clear diff --git a/tmux/.tmux/status b/tmux/.tmux/status @@ -1,71 +0,0 @@ -#!/bin/sh -# /\ /\ -# ____ / /_ _____ / /_ __ /\ ____ -# / __// ___\.'__ // ___\/ / / / / __/ -# __\ \ / / / /_/ // / / /_/ /__\ \ -# \___/ \/ \____/ \/ \____/ \___/ 2016-10-05 -#=============================================================================== -# Status line, with tmux color escape sequence - - -# VARIABLES 2016-10-05 -#------------------------------------------------------------------------------- - -BACKGROUND=black - - -# FUNCTIONS 2016-10-05 -#------------------------------------------------------------------------------- - -# Draw a segment -s() -{ - local segment="$1" color="$2" code - - $segment | { - code="$?" - - read -r label - read -r text - - if [ $code -eq 0 ] - then printf '#[bg=%s,fg=%s] %s #[bg=%s,fg=%s] %s #[default]' \ - "$color" "black" "$label" "$BACKGROUND" "$color" "$text" - fi - } -} - - -# SEGMENTS 2016-10-05 -#------------------------------------------------------------------------------- - -mails() -{ - local count="$(find "$MAIL/new" -mindepth 1 2>/dev/null | wc -l)" - - printf 'M\n%s\n' "$count" - - [ "$count" -gt 0 ] && return 0 || return 1 -} - -directory() -{ - local - printf 'M\n%s\n' "$count" - return 0 -} - - -date() -{ - printf '%s\n%s\n' "$(date +'%Y-%m-%d')" "$(date +'%H:%M')" - return 0 -} - -# ALGORYTHM 2016-10-05 -#------------------------------------------------------------------------------- - -case "$1" in -left ) s mail red; s date green ;; -right ) s date grey; s date grey ;; -esac | sed 's/ $//'