diff --git a/.emacs.d.tsoding/init.el b/.emacs.d.tsoding/init.el deleted file mode 100644 index 91d213b..0000000 --- a/.emacs.d.tsoding/init.el +++ /dev/null @@ -1,101 +0,0 @@ -;; Added by Package.el. This must come before configurations of -;; installed packages. Don't delete this line. If you don't want it, -;; just comment it out by adding a semicolon to the start of the line. -;; You may delete these explanatory comments. -(package-initialize) - -(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") - ("melpa" . "https://melpa.org/packages/"))) - -;; Funzioni di servizio -(defvar rc/package-contents-refreshed nil) -(defvar rc/required-packages nil) - -(defun rc/package-refresh-contents-once () - (when (not rc/package-contents-refreshed) - (setq rc/package-contents-refreshed t) - (package-refresh-contents))) - -(defun rc/require-one-package (package) - (push package rc/required-packages) - (when (not (package-installed-p package)) - (rc/package-refresh-contents-once) - (package-install package))) - -(defun rc/require (&rest packages) - (dolist (package packages) - (rc/require-one-package package))) - -(defun rc/require-theme (theme) - (let ((theme-package (->> theme - (symbol-name) - (funcall (-flip #'concat) "-theme") - (intern)))) - (rc/require theme-package) - (load-theme theme t))) - -(rc/require 'dash) -(require 'dash) - -(rc/require 'dash-functional) -(require 'dash-functional) - -(defun rc/package-reqs (package) - (let ((package-desc - (->> package-alist - (alist-get package) - (car)))) - (when package-desc - (package-desc-reqs package-desc)))) - -(defun rc/package-dependencies (package) - (->> package - (rc/package-reqs) - (-map #'car) - (cons package))) - -(defun rc/package-expand-dependencies (packages) - (->> packages - (-map #'rc/package-dependencies) - (-flatten) - (remove-duplicates))) - -(defun rc/unused-packages () - (let ((all-package (rc/package-expand-dependencies rc/required-packages))) - (->> package-alist - (-map #'car) - (-filter (-lambda (package) - (not (-contains? all-package package))))))) - -(defun rc/remove-unused-packages () - (interactive) - (message "Unused packages: %s" (rc/unused-packages))) - -;; Carica il file con delle configurazioni, -;; la configurazione è un file scritto con org-mode. -(require 'org) -(org-babel-load-file - (expand-file-name "settings.org" - user-emacs-directory)) - -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(org-agenda-dim-blocked-tasks nil) - '(org-agenda-exporter-settings (quote ((org-agenda-tag-filter-preset (list "+personal"))))) - '(org-enforce-todo-dependencies nil) - '(org-modules - (quote - (org-bbdb org-bibtex org-docview org-gnus org-habit org-info org-irc org-mhe org-rmail org-w3m))) - '(org-refile-use-outline-path (quote file)) - '(package-selected-packages - (quote - (exec-path-from-shell yasnippet rainbow-mode org-cliplink openwith nasm-mode multiple-cursors move-text ido-completing-read+ smex editorconfig company atom-one-dark-theme paredit material-theme magit lsp-mode)))) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - ) diff --git a/.emacs.d.tsoding/settings.org b/.emacs.d.tsoding/settings.org deleted file mode 100644 index 9c3cd0a..0000000 --- a/.emacs.d.tsoding/settings.org +++ /dev/null @@ -1,710 +0,0 @@ - -#+BEGIN_SRC emacs-lisp -(when (executable-find "agda-mode") - (load-file (let ((coding-system-for-read 'utf-8)) - (shell-command-to-string "agda-mode locate")))) -#+END_SRC - -#+BEGIN_SRC emacs-lisp -;;; Fonts -(defun rc/get-default-font () - (cond - ((eq system-type 'windows-nt) "Consolas-13") - ((eq system-type 'gnu/linux) "Fira Code-12") - ((eq system-type 'darwin) "Monaco-14"))) - -(add-to-list 'default-frame-alist `(font . ,(rc/get-default-font))) - -(when (display-graphic-p) - (set-face-attribute 'fixed-pitch nil :family (rc/get-default-font))) - -;;; GUI -(tool-bar-mode 0) -(menu-bar-mode 0) -(scroll-bar-mode 0) -(column-number-mode 1) -(show-paren-mode 1) -(setq frame-title-format "Emacs") -(set-default 'cursor-type 'hbar) -(global-hl-line-mode) -(winner-mode t) -(add-to-list 'default-frame-alist '(fullscreen . maximized)) -(windmove-default-keybindings) - -;;; Themes -(rc/require-theme 'atom-one-dark) -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -;;; TODO(c3bdae31-4329-4217-98a0-743b9dcbb6d2): extract autocommit into a separate package -;;; -;;; Once e266bfaa-2a01-4881-9e7f-ce2c592f7cdd is done, I think we can do that. - -(defvar rc/autocommit-local-locks - (make-hash-table :test 'equal)) - -(defun rc/file-truename-nilable (filename) - (when filename - (file-truename filename))) - -(defun rc/autocommit--id () - (let ((id (-> default-directory - (locate-dominating-file ".git") - (rc/file-truename-nilable)))) - (when (not id) - (error "%s is not inside of a git repository" default-directory)) - (unless (gethash id rc/autocommit-local-locks) - (puthash id nil rc/autocommit-local-locks)) - id)) - -(defun rc/autocommit--get-lock (lock) - (-> (rc/autocommit--id) - (gethash rc/autocommit-local-locks) - (plist-get lock))) - -(defun rc/autocommit--set-lock (lock value) - (puthash (rc/autocommit--id) - (-> (rc/autocommit--id) - (gethash rc/autocommit-local-locks) - (plist-put lock value)) - rc/autocommit-local-locks)) - -(defun rc/autocommit--toggle-lock (lock) - (-> lock - (rc/autocommit--get-lock) - (not) - (rc/autocommit--set-lock))) - -(defun rc/autocommit--create-dir-locals (file-name) - (write-region "((nil . ((eval . (rc/autocommit-dir-locals)))))" - nil file-name)) - -(defun rc/y-or-n-if (predicate question action) - (when (or (not (funcall predicate)) - (y-or-n-p question)) - (funcall action))) - -;;; TODO(4229cf9a-4768-4f5e-aca1-865256c64a23): rc/autocommit-init-dir should modify dir locals file on AST level -;;; -;;; Right know it just overrides .dir-locals file on text level. I -;;; want it to -;;; - read .dir-locals, -;;; - parse the assoc list, -;;; - check if there is already autocommit stuff -;;; - add autocommit stuff to the assoc list if needed -;;; - and write it back to the file -;;; -;;; That will enable us with modifying dir locals that contains custom -;;; stuff unrelated to autocommit -(defun rc/autocommit-init-dir (&optional dir) - "Initialize autocommit folder." - (interactive "DAutocommit directory: ") - (let* ((autocommit-dir (if dir dir default-directory)) - (file-name (concat autocommit-dir - dir-locals-file))) - (rc/y-or-n-if (-partial #'file-exists-p file-name) - (format "%s already exists. Replace it?" file-name) - (-partial #'rc/autocommit--create-dir-locals file-name)))) - -(defun rc/autocommit-dir-locals () - "The function that has to be put into the .dir-locals.el file -of the autocommit folder as evaluated for any mode." - (interactive) - (auto-revert-mode 1) - (rc/autopull-changes) - (add-hook 'after-save-hook - 'rc/autocommit-changes - nil 'make-it-local)) - -;;; TODO: rc/toggle-autocommit-offline doesn't work correctly -;;; -;;; It should toggle offline for all of the folders at once -(defun rc/toggle-autocommit-offline () - "Toggle between OFFLINE and ONLINE modes. - -Autocommit can be in two modes: OFFLINE and ONLINE. When ONLINE -rc/autocommit-changes does `git commit && git push'. When OFFLINE -rc/autocommit does only `git commit'." - (interactive) - (rc/autocommit--toggle-lock 'autocommit-offline) - (if (rc/autocommit--get-lock 'autocommit-offline) - (message "[OFFLINE] Autocommit Mode") - (message "[ONLINE] Autocommit Mode"))) - -(defun rc/autopull-changes () - "Pull the recent changes. - -Should be invoked once before working with the content under -autocommit. Usually put into the dir locals file." - (interactive) - (when (not (rc/autocommit--get-lock 'autopull-lock)) - (rc/autocommit--set-lock 'autopull-lock t) - (if (rc/autocommit--get-lock 'autocommit-offline) - (message "[OFFLINE] NOT Syncing the Agenda") - (if (y-or-n-p (format "Sync the Agenda? [%s]" (rc/autocommit--id))) - (progn - (message (format "Syncing the Agenda [%s]" (rc/autocommit--id))) - (shell-command "git pull")) - (progn - (rc/autocommit--set-lock 'autocommit-offline t) - (message (format "[OFFLINE] NOT Syncing the Agenda [%s]" - (rc/autocommit--id)))))))) - -(defun rc/autocommit-changes () - "Commit all of the changes under the autocommit folder. - -Should be invoked each time a change is made. Usually put into -dir locals file." - (interactive) - (if (rc/autocommit--get-lock 'autocommit-lock) - (rc/autocommit--set-lock 'autocommit-changed t) - (rc/autocommit--set-lock 'autocommit-lock t) - (rc/autocommit--set-lock 'autocommit-changed nil) - (set-process-sentinel (rc/run-commit-process (rc/autocommit--id)) - (-partial 'rc/autocommit-beat (rc/autocommit--id))))) - -(defun rc/run-commit-process (autocommit-directory) - (let ((default-directory autocommit-directory)) - (let ((autocommit-message (format-time-string "Autocommit %s"))) - (start-process-shell-command - (format "Autocommit-%s" autocommit-directory) - (format "*Autocommit-%s*" autocommit-directory) - (format (if (rc/autocommit--get-lock 'autocommit-offline) - "git add -A && git commit -m \"%s\"" - "git add -A && git commit -m \"%s\" && git push origin master") - autocommit-message))))) - -(defun rc/autocommit-beat (autocommit-directory process event) - (let ((default-directory autocommit-directory)) - (message (if (rc/autocommit--get-lock 'autocommit-offline) - "[OFFLINE] Autocommit: %s" - "Autocommit: %s") - event) - (if (not (rc/autocommit--get-lock 'autocommit-changed)) - (rc/autocommit--set-lock 'autocommit-lock nil) - (rc/autocommit--set-lock 'autocommit-changed nil) - (set-process-sentinel (rc/run-commit-process autocommit-directory) - (-partial 'rc/autocommit-beat autocommit-directory))))) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(setq-default c-basic-offset 4 - c-default-style '((java-mode . "java") - (awk-mode . "awk") - (other . "bsd"))) - -(add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode)) - -(add-hook 'c-mode-hook (lambda () - (interactive) - (c-toggle-comment-style -1))) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(rc/require 'company) -(require 'company) - -(global-company-mode) - -(add-hook 'tuareg-mode-hook - (lambda () - (interactive) - (company-mode 0))) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(require 'dired-x) -(setq dired-omit-files - (concat dired-omit-files "\\|^\\..+$")) -(setq-default dired-dwim-target t) -(setq dired-listing-switches "-alh") - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(rc/require 'editorconfig) -(editorconfig-mode 1) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(defun rc/turn-on-eldoc-mode () - (interactive) - (eldoc-mode 1)) - -(add-hook 'emacs-lisp-mode-hook 'rc/turn-on-eldoc-mode) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(add-hook 'emacs-lisp-mode-hook - '(lambda () - (local-set-key (kbd "C-c C-j") - (quote eval-print-last-sexp)))) -(add-to-list 'auto-mode-alist '("Cask" . emacs-lisp-mode)) - -;; Automatically load paredit when editing a lisp file -;; More at http://www.emacswiki.org/emacs/ParEdit -(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t) -(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) -(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode) -(add-hook 'ielm-mode-hook #'enable-paredit-mode) -(add-hook 'lisp-mode-hook #'enable-paredit-mode) -(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode) -(add-hook 'scheme-mode-hook #'enable-paredit-mode) - -;; eldoc-mode shows documentation in the minibuffer when writing code -;; http://www.emacswiki.org/emacs/ElDoc -(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode) -(add-hook 'lisp-interaction-mode-hook 'turn-on-eldoc-mode) -(add-hook 'ielm-mode-hook 'turn-on-eldoc-mode) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(rc/require 'smex 'ido-completing-read+) - -(require 'ido-completing-read+) - -(ido-mode 1) -(ido-everywhere 1) -(ido-ubiquitous-mode 1) - -(global-set-key (kbd "M-x") 'smex) -(global-set-key (kbd "C-c C-c M-x") 'execute-extended-command) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -;; magit requres this lib, but it is not installed automatically on -;; Windows. -(rc/require 'cl-lib) -(rc/require 'magit) - -(setq magit-auto-revert-mode nil) - -(global-set-key (kbd "C-c m s") 'magit-status) -(global-set-key (kbd "C-c m l") 'magit-log) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(require 'ansi-color) - -(global-set-key (kbd "C-c p") 'find-file-at-point) -(global-set-key (kbd "C-c i m") 'imenu) - -(setq-default inhibit-splash-screen t - make-backup-files nil - tab-width 4 - indent-tabs-mode nil - compilation-scroll-output t -;; default-input-method "russian-computer" - visible-bell (equal system-type 'windows-nt)) - -(defun rc/colorize-compilation-buffer () - (read-only-mode) - (ansi-color-apply-on-region compilation-filter-start (point)) - (read-only-mode)) -(add-hook 'compilation-filter-hook 'rc/colorize-compilation-buffer) - -(defun rc/buffer-file-name () - (if (equal major-mode 'dired-mode) - default-directory - (buffer-file-name))) - -(defun rc/parent-directory (path) - (file-name-directory (directory-file-name path))) - -(defun rc/root-anchor (path anchor) - (cond - ((string= anchor "") nil) - ((file-exists-p (concat (file-name-as-directory path) anchor)) path) - ((string-equal path "/") nil) - (t (rc/root-anchor (rc/parent-directory path) anchor)))) - -(defun rc/clipboard-org-mode-file-link (anchor) - (interactive "sRoot anchor: ") - (let* ((root-dir (rc/root-anchor default-directory anchor)) - (org-mode-file-link (format "file:%s::%d" - (if root-dir - (file-relative-name (rc/buffer-file-name) root-dir) - (rc/buffer-file-name)) - (line-number-at-pos)))) - (kill-new org-mode-file-link) - (message org-mode-file-link))) - -;;; Taken from here: -;;; http://stackoverflow.com/questions/2416655/file-path-to-clipboard-in-emacs -(defun rc/put-file-name-on-clipboard () - "Put the current file name on the clipboard" - (interactive) - (let ((filename (rc/buffer-file-name))) - (when filename - (kill-new filename) - (message filename)))) - -(defun rc/put-buffer-name-on-clipboard () - "Put the current buffer name on the clipboard" - (interactive) - (kill-new (buffer-name)) - (message (buffer-name))) - -(defun rc/kill-autoloads-buffers () - (interactive) - (dolist (buffer (buffer-list)) - (let ((name (buffer-name buffer))) - (when (string-match-p "-autoloads.el" name) - (kill-buffer buffer) - (message "Killed autoloads buffer %s" name))))) - -(defun rc/start-python-simple-http-server () - (interactive) - (shell-command "python -m SimpleHTTPServer 3001 &" - "*Simple Python HTTP Server*")) - -(global-set-key (kbd "C-x p s") 'rc/start-python-simple-http-server) - -;;; Taken from here: -;;; http://blog.bookworm.at/2007/03/pretty-print-xml-with-emacs.html -(defun bf-pretty-print-xml-region (begin end) - "Pretty format XML markup in region. You need to have nxml-mode -http://www.emacswiki.org/cgi-bin/wiki/NxmlMode installed to do -this. The function inserts linebreaks to separate tags that have -nothing but whitespace between them. It then indents the markup -by using nxml's indentation rules." - (interactive "r") - (save-excursion - (nxml-mode) - (goto-char begin) - (while (search-forward-regexp "\>[ \\t]*\<" nil t) - (backward-char) (insert "\n")) - (indent-region begin end)) - (message "Ah, much better!")) - -;;; Stolen from http://ergoemacs.org/emacs/emacs_unfill-paragraph.html -(defun rc/unfill-paragraph () - "Replace newline chars in current paragraph by single spaces. -This command does the inverse of `fill-paragraph'." - (interactive) - (let ((fill-column 90002000)) ; 90002000 is just random. you can use `most-positive-fixnum' - (fill-paragraph nil))) - -(global-set-key (kbd "C-c M-q") 'rc/unfill-paragraph) - -(defun rc/load-path-here () - (interactive) - (add-to-list 'load-path default-directory)) - -(defconst rc/frame-transparency 85) - -(defun rc/toggle-transparency () - (interactive) - (let ((frame-alpha (frame-parameter nil 'alpha))) - (if (or (not frame-alpha) - (= (cadr frame-alpha) 100)) - (set-frame-parameter nil 'alpha - `(,rc/frame-transparency - ,rc/frame-transparency)) - (set-frame-parameter nil 'alpha '(100 100))))) - -(defun rc/duplicate-line () - "Duplicate current line" - (interactive) - (move-beginning-of-line 1) - (kill-line) - (yank) - (newline) - (yank)) - -(global-set-key (kbd "C-,") 'rc/duplicate-line) - -;;; A little hack which fixes a problem with meta key in fluxbox under VNC. -(setq x-alt-keysym 'meta) - -(setq confirm-kill-emacs 'y-or-n-p) -;; Changes all yes/no questions to y/n type -(fset 'yes-or-no-p 'y-or-n-p) - -;; shell scripts -(setq-default sh-basic-offset 2) -(setq-default sh-indentation 2) - -;; No need for ~ files when editing -(setq create-lockfiles nil) - -;; Go straight to scratch buffer on startup -(setq inhibit-startup-message t) - -(add-hook 'emacs-startup-hook - (lambda () - (message "Emacs ready in %s with %d garbage collections." - (format "%.2f seconds" - (float-time (time-subtract after-init-time before-init-time))) - gcs-done))) - - -(server-start) - - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(rc/require 'move-text) -(global-set-key (kbd "M-p") 'move-text-up) -(global-set-key (kbd "M-n") 'move-text-down) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(rc/require 'multiple-cursors) - -(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) -(global-set-key (kbd "C->") 'mc/mark-next-like-this) -(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) -(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this) -(global-set-key (kbd "C-\"") 'mc/skip-to-next-like-this) -(global-set-key (kbd "C-:") 'mc/skip-to-previous-like-this) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(rc/require 'nasm-mode) -(add-to-list 'auto-mode-alist '("\\.asm\\'" . nasm-mode)) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(add-to-list 'auto-mode-alist '("\\.html\\'" . nxml-mode)) -(add-to-list 'auto-mode-alist '("\\.xsd\\'" . nxml-mode)) -(add-to-list 'auto-mode-alist '("\\.ant\\'" . nxml-mode)) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(rc/require 'openwith) - -(openwith-mode 1) - - -(setq openwith-associations - (append - (when (eq system-type 'gnu/linux) - '(("\\.pdf\\'" "evince" (file)) - ("\\.djvu\\'" "evince" (file)))) - '(("\\.docx\\'" "libreoffice" (file)) - ("\\.xlsx\\'" "libreoffice" (file)) - ("\\.doc\\'" "libreoffice" (file)) - ("\\.rtf\\'" "libreoffice" (file)) - ("\\.ods\\'" "libreoffice" (file)) - ("\\.mp3\\'" "vlc" (file))))) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(require 'ob-python) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(setq org-capture-templates - '(("p" "Capture task" entry (file "~/Documents/Agenda/Tasks.org") - "* TODO %?\n SCHEDULED: %t\n") - ("K" "Cliplink capture task" entry (file "~/Documents/Agenda/Tasks.org") - "* TODO %(org-cliplink-capture) \n SCHEDULED: %t\n" :empty-lines 1))) -(define-key global-map "\C-cc" 'org-capture) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(rc/require 'org-cliplink) - -(when (eq system-type 'gnu/linux) - (custom-set-variables - '(org-cliplink-transport-implementation (quote url-el)))) - -(global-set-key (kbd "C-x p i") 'org-cliplink) - -(defun rc/cliplink-task () - (interactive) - (org-cliplink-retrieve-title - (substring-no-properties (current-kill 0)) - '(lambda (url title) - (insert (if title - (concat "* TODO " title - "\n [[" url "][" title "]]") - (concat "* TODO " url - "\n [[" url "]]")))))) -(global-set-key (kbd "C-x p t") 'rc/cliplink-task) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(global-set-key (kbd "C-x a") 'org-agenda) -(global-set-key (kbd "C-c C-x j") #'org-clock-jump-to-current-clock) - -(setq org-agenda-files (list "~/Documents/Agenda/")) - -(setq org-export-backends '(md)) - -(custom-set-variables - '(org-modules - (quote - (org-bbdb - org-bibtex - org-docview - org-gnus - org-habit - org-info - org-irc - org-mhe - org-rmail - org-w3m))) - '(org-enforce-todo-dependencies nil) - '(org-agenda-dim-blocked-tasks nil) - '(org-agenda-exporter-settings - (quote ((org-agenda-tag-filter-preset (list "+personal"))))) - '(org-refile-use-outline-path (quote file))) - -(defun rc/org-increment-move-counter () - (interactive) - - (defun default (x d) - (if x x d)) - - (let* ((point (point)) - (move-counter-name "MOVE_COUNTER") - (move-counter-value (-> (org-entry-get point move-counter-name) - (default "0") - (string-to-number) - (1+)))) - (org-entry-put point move-counter-name - (number-to-string move-counter-value))) - nil) - -(defun rc/org-get-heading-name () - (nth 4 (org-heading-components))) - -(defun rc/org-kill-heading-name-save () - (interactive) - (let ((heading-name (rc/org-get-heading-name))) - (kill-new heading-name) - (message "Kill \"%s\"" heading-name))) - -(global-set-key (kbd "C-x p w") 'rc/org-kill-heading-name-save) - -(setq org-agenda-custom-commands - '(("u" "Unscheduled" tags "+personal-SCHEDULED={.+}-DEADLINE={.+}/!+TODO" - ((org-agenda-sorting-strategy '(priority-down)))) - ("p" "Personal" ((agenda "" ((org-agenda-tag-filter-preset (list "+personal")))))) - ("w" "Work" ((agenda "" ((org-agenda-tag-filter-preset (list "+work")))))) - )) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(rc/require 'paredit) - -(defun rc/turn-on-paredit () - (interactive) - (paredit-mode 1)) - -(add-hook 'emacs-lisp-mode-hook 'rc/turn-on-paredit) -(add-hook 'clojure-mode-hook 'rc/turn-on-paredit) -(add-hook 'lisp-mode-hook 'rc/turn-on-paredit) -(add-hook 'common-lisp-mode-hook 'rc/turn-on-paredit) -(add-hook 'scheme-mode-hook 'rc/turn-on-paredit) -(add-hook 'racket-mode-hook 'rc/turn-on-paredit) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(rc/require 'rainbow-mode) - -(defun rc/turn-on-rainbow-mode () - (interactive) - (rainbow-mode 1)) - -(add-hook 'html-mode-hook 'rc/turn-on-rainbow-mode) -(add-hook 'css-mode-hook 'rc/turn-on-rainbow-mode) -(add-hook 'js-mode-hook 'rc/turn-on-rainbow-mode) -(add-hook 'nxml-mode-hook 'rc/turn-on-rainbow-mode) -(add-hook 'conf-xdefaults-mode-hook 'rc/turn-on-rainbow-mode) -(add-hook 'typescript-mode-hook 'rc/turn-on-rainbow-mode) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(require 'recentf) -(recentf-mode 1) -(setq recentf-max-menu-items 25) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -;; Sets up exec-path-from shell -;; https://github.com/purcell/exec-path-from- -(require 'exec-path-from-shell) -(when (memq window-system '(mac ns)) - (exec-path-from-shell-initialize) - (exec-path-from-shell-copy-envs - '("PATH"))) - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -;;; http://stackoverflow.com/questions/13794433/how-to-disable-autosave-for-tramp-buffers-in-emacs -(setq tramp-auto-save-directory "/tmp") - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(defun rc/enable-word-wrap () - (interactive) - (toggle-word-wrap 1)) - -(add-hook 'markdown-mode-hook 'rc/enable-word-wrap) - - -#+END_SRC - -#+BEGIN_SRC emacs-lisp - -(rc/require 'yasnippet) - -(require 'yasnippet) - -(setq yas/triggers-in-field nil) -(setq yas-snippet-dirs '("~/.emacs.snippets/")) - -(yas-global-mode 1) - -#+END_SRC diff --git a/bat/bat/config b/bat/bat/config deleted file mode 100644 index daf1b60..0000000 --- a/bat/bat/config +++ /dev/null @@ -1,25 +0,0 @@ -# This is `bat`s configuration file. Each line either contains a comment or -# a command-line option that you want to pass to `bat` by default. You can -# run `bat --help` to get a list of all possible configuration options. - -# Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes` -# for a list of all available themes ---theme="1337" - -# Enable this to use italic text on the terminal. This is not supported on all -# terminal emulators (like tmux, by default): -#--italic-text=always - -# Uncomment the following line to disable automatic paging: -#--paging=never - -# Uncomment the following line if you are using less version >= 551 and want to -# enable mouse scrolling support in `bat` when running inside tmux. This might -# disable text selection, unless you press shift. -#--pager="less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse" - -# Syntax mappings: map a certain filename pattern to a language. -# Example 1: use the C++ syntax for Arduino .ino files -# Example 2: Use ".gitignore"-style highlighting for ".ignore" files -#--map-syntax "*.ino:C++" -#--map-syntax ".ignore:Git Ignore" diff --git a/bat/config b/bat/config index f548173..daf1b60 100644 --- a/bat/config +++ b/bat/config @@ -4,7 +4,7 @@ # Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes` # for a list of all available themes ---theme="Dracula" +--theme="1337" # Enable this to use italic text on the terminal. This is not supported on all # terminal emulators (like tmux, by default): diff --git a/fastfetch/config.jsonc b/fastfetch/config.jsonc index 8dbe3d8..9cf2590 100644 --- a/fastfetch/config.jsonc +++ b/fastfetch/config.jsonc @@ -59,7 +59,7 @@ "keyColor": "blue" }, { - "type": "wmtheme", + "type": "theme", "key": "│ ├󰉼", "keyColor": "blue" }, @@ -114,11 +114,11 @@ "key": "│ ├󰅐", "keyColor": "green" }, - { - "type": "display", - "key": "│ └󰍹", - "keyColor": "green" - }, + // { + // "type": "disk", + // "key": "│ └󰍹", + // "keyColor": "green" + // }, { "type": "sound", "key": " AUDIO", diff --git a/fastfetch/fastfetch/config-compact.jsonc b/fastfetch/fastfetch/config-compact.jsonc deleted file mode 100644 index f8b1e12..0000000 --- a/fastfetch/fastfetch/config-compact.jsonc +++ /dev/null @@ -1,72 +0,0 @@ -{ - "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", - "logo": { - "padding": { - "top": 2 - }, - "type": "small" - }, - "display": { - "separator": " -> " - }, - "modules": [ - "break", - { - "type": "title", - "keyWidth": 10, - "format": " {6}{7}{8}" - }, - { - "type": "custom", - "format": " ╭───────────────────────╮" - }, - { - "type": "kernel", - "key": " ", - "keyColor": "yellow" - }, - { - "type": "wm", - "key": " ", - "keyColor": "blue" - }, - { - "type": "shell", - "key": " ", - "keyColor": "yellow" - }, - { - "type": "terminal", - "key": " ", - "keyColor": "blue" - }, - /* - { - "type": "packages", - "key": "󰏖 ", - "keyColor": "yellow" - }, - */ - { - "type": "memory", - "key": "󰍛 ", - "keyColor": "magenta", - // format: used / total - "format": "{1} / {2}" - }, - { - "type": "uptime", - "key": "󰔛 ", - "keyColor": "green" - }, - { - "type": "custom", - "format": " ╰───────────────────────╯" - }, - { - "type": "custom", - "format": " \u001b[31m \u001b[32m \u001b[33m \u001b[34m \u001b[35m \u001b[36m \u001b[37m \u001b[90m " - }, - "break", - ] -} diff --git a/fastfetch/fastfetch/config.jsonc b/fastfetch/fastfetch/config.jsonc deleted file mode 100644 index 9cf2590..0000000 --- a/fastfetch/fastfetch/config.jsonc +++ /dev/null @@ -1,137 +0,0 @@ -// Load with --load-config examples/2.jsonc -// Note that you must replace the image path to an existing image to display it. - -{ - "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", - "logo": { - "padding": { - "top": 2 - } - }, - "display": { - "separator": " 󰑃 " - }, - "modules": [ - { - "type": "custom", - "format": "\u001b[90m┌────────────────────────────────────────────────────────────┐" - }, - { - "type": "title", - "keyWidth": 10, - "format": " {6}{7}{8}" - }, - { - "type": "custom", - "format": "\u001b[90m└────────────────────────────────────────────────────────────┘" - }, - { - "type": "custom", - "format": "\u001b[90m \u001b[31m \u001b[32m \u001b[33m \u001b[34m \u001b[35m \u001b[36m \u001b[37m \u001b[38m \u001b[39m  \u001b[38m \u001b[37m \u001b[36m \u001b[35m \u001b[34m \u001b[33m \u001b[32m \u001b[31m \u001b[90m " - }, - { - "type": "custom", - "format": "\u001b[90m┌────────────────────────────────────────────────────────────┐" - }, - { - "type": "os", - "key": " DISTRO", - "keyColor": "yellow" - }, - { - "type": "kernel", - "key": "│ ├", - "keyColor": "yellow" - }, - { - "type": "packages", - "key": "│ ├󰏖", - "keyColor": "yellow" - }, - { - "type": "shell", - "key": "│ └", - "keyColor": "yellow" - }, - { - "type": "wm", - "key": " DE/WM", - "keyColor": "blue" - }, - { - "type": "theme", - "key": "│ ├󰉼", - "keyColor": "blue" - }, - { - "type": "icons", - "key": "│ ├󰀻", - "keyColor": "blue" - }, - { - "type": "terminal", - "key": "│ ├", - "keyColor": "blue" - }, - { - "type": "wallpaper", - "key": "│ └󰸉", - "keyColor": "blue" - }, - { - "type": "host", - "key": "󰌢 SYSTEM", - "keyColor": "green" - }, - { - "type": "cpu", - "key": "│ ├󰻠", - "keyColor": "green" - }, - { - "type": "gpu", - "key": "│ ├󰻑", - "keyColor": "green" - }, - { - "type": "display", - "key": "│ ├󰍹", - "keyColor": "green", - "compactType": "original-with-refresh-rate" - }, - { - "type": "memory", - "key": "│ ├󰾆", - "keyColor": "green" - }, - { - "type": "swap", - "key": "│ ├󰓡", - "keyColor": "green" - }, - { - "type": "uptime", - "key": "│ ├󰅐", - "keyColor": "green" - }, - // { - // "type": "disk", - // "key": "│ └󰍹", - // "keyColor": "green" - // }, - { - "type": "sound", - "key": " AUDIO", - "keyColor": "cyan" - }, - { - "type": "custom", - "format": "\u001b[90m└────────────────────────────────────────────────────────────┘" - }, - { - "type": "custom", - "format": "\u001b[90m \u001b[31m \u001b[32m \u001b[33m \u001b[34m \u001b[35m \u001b[36m \u001b[37m \u001b[38m \u001b[39m  \u001b[38m \u001b[37m \u001b[36m \u001b[35m \u001b[34m \u001b[33m \u001b[32m \u001b[31m \u001b[90m " - }, - "break", - ] -} diff --git a/fish/fish/completions/asdf.fish b/fish/completions/asdf.fish similarity index 100% rename from fish/fish/completions/asdf.fish rename to fish/completions/asdf.fish diff --git a/fish/completions/fisher.fish b/fish/completions/fisher.fish old mode 100755 new mode 100644 diff --git a/fish/completions/fzf_configure_bindings.fish b/fish/completions/fzf_configure_bindings.fish old mode 100755 new mode 100644 diff --git a/fish/completions/sdk.fish b/fish/completions/sdk.fish old mode 100755 new mode 100644 diff --git a/fish/fish/conf.d/asdf.fish b/fish/conf.d/asdf.fish similarity index 100% rename from fish/fish/conf.d/asdf.fish rename to fish/conf.d/asdf.fish diff --git a/fish/conf.d/fzf.fish b/fish/conf.d/fzf.fish old mode 100755 new mode 100644 diff --git a/fish/conf.d/rustup.fish b/fish/conf.d/rustup.fish index e45daf6..e4cb363 100755 --- a/fish/conf.d/rustup.fish +++ b/fish/conf.d/rustup.fish @@ -1 +1 @@ -#source "$HOME/.cargo/env.fish" +source "$HOME/.cargo/env.fish" diff --git a/fish/conf.d/sdk.fish b/fish/conf.d/sdk.fish old mode 100755 new mode 100644 diff --git a/fish/config.fish b/fish/config.fish index fd03e81..9514417 100755 --- a/fish/config.fish +++ b/fish/config.fish @@ -4,6 +4,7 @@ set fish_greeting set VIRTUAL_ENV_DISABLE_PROMPT "1" set -xU MANPAGER "sh -c 'col -bx | bat -l man -p'" set -xU MANROFFOPT "-c" +set -xU EDITOR /usr/bin/nvim set -x SHELL /usr/bin/fish ## Export variable need for qt-theme @@ -31,7 +32,8 @@ end ## Starship prompt if status --is-interactive - source ("/usr/bin/starship" init fish --print-full-init | psub) + set -l starship_path (which starship) + source ("$starship_path" init fish --print-full-init | psub) end ## Advanced command-not-found hook @@ -97,8 +99,8 @@ function copy end function fish_greeting - echo -e "\n" - fastfetch + # echo -e "\n" + # fastfetch end ## Useful aliases @@ -113,13 +115,15 @@ alias l. 'eza -ald --color=always --group-directories-first --icons .*' # show o # Replace some more things with better alternatives alias cat 'bat --style header --style snip --style changes --style header' +# Replace df command tool +alias df='duf' + # Common use alias .. 'cd ..' alias ... 'cd ../..' alias .... 'cd ../../..' alias ..... 'cd ../../../..' alias ...... 'cd ../../../../..' -alias big 'expac -H M "%m\t%n" | sort -h | nl' # Sort installed packages according to size in MB (expac must be installed) alias dir 'dir --color=auto' alias grep 'ugrep --color=auto' alias egrep 'ugrep -E --color=auto' @@ -133,10 +137,15 @@ alias tarnow 'tar -acf ' alias untar 'tar -zxvf ' alias vdir 'vdir --color=auto' alias wget 'wget -c ' +alias rost 'rpm-ostree' alias vi 'nvim' # Get the error messages from journalctl alias jctl 'journalctl -p 3 -xb' -# Recent installed packages -alias rip 'expac --timefmt="%Y-%m-%d %T" "%l\t%n %v" | sort | tail -200 | nl' +# Aliases run commands inner Archlinux Toolbox container +alias exercism 'toolbox run -c arch-toolbox-latest exercism' +alias k9s 'toolbox run -c arch-toolbox-latest k9s' +alias kubectl 'toolbox run -c arch-toolbox-latest kubectl' +alias lazydocker 'toolbox run -c arch-toolbox-latest lazydocker' +alias lazygit 'toolbox run -c arch-toolbox-latest lazygit' diff --git a/fish/fish/completions/exercism.fish b/fish/fish/completions/exercism.fish deleted file mode 100755 index dc20fdc..0000000 --- a/fish/fish/completions/exercism.fish +++ /dev/null @@ -1,54 +0,0 @@ -# Configure -complete -f -c exercism -n "__fish_use_subcommand" -a "configure" -d "Writes config values to a JSON file." -complete -f -c exercism -n "__fish_seen_subcommand_from configure" -s t -l token -d "Set token" -complete -f -c exercism -n "__fish_seen_subcommand_from configure" -s w -l workspace -d "Set workspace" -complete -f -c exercism -n "__fish_seen_subcommand_from configure" -s a -l api -d "set API base url" -complete -f -c exercism -n "__fish_seen_subcommand_from configure" -s s -l show -d "show settings" - -# Download -complete -f -c exercism -n "__fish_use_subcommand" -a "download" -d "Downloads and saves a specified submission into the local system" -complete -f -c exercism -n "__fish_seen_subcommand_from download" -s e -l exercise -d "the exercise slug" -complete -f -c exercism -n "__fish_seen_subcommand_from download" -s h -l help -d "help for download" -complete -f -c exercism -n "__fish_seen_subcommand_from download" -s T -l team -d "the team slug" -complete -f -c exercism -n "__fish_seen_subcommand_from download" -s t -l track -d "the track ID" -complete -f -c exercism -n "__fish_seen_subcommand_from download" -s u -l uuid -d "the solution UUID" - -# Help -complete -f -c exercism -n "__fish_use_subcommand" -a "help" -d "Shows a list of commands or help for one command" -complete -f -c exercism -n "__fish_seen_subcommand_from help" -a "configure download help open submit troubleshoot upgrade version workspace" - -# Open -complete -f -c exercism -n "__fish_use_subcommand" -a "open" -d "Opens a browser to exercism.io for the specified submission." -complete -f -c exercism -n "__fish_seen_subcommand_from open" -s h -l help -d "help for open" - -# Submit -complete -f -c exercism -n "__fish_use_subcommand" -a "submit" -d "Submits a new iteration to a problem on exercism.io." -complete -f -c exercism -n "__fish_seen_subcommand_from submit" -s h -l help -d "help for submit" - -# Troubleshoot -complete -f -c exercism -n "__fish_use_subcommand" -a "troubleshoot" -d "Outputs useful debug information." -complete -f -c exercism -n "__fish_seen_subcommand_from troubleshoot" -s f -l full-api-key -d "display full API key (censored by default)" -complete -f -c exercism -n "__fish_seen_subcommand_from troubleshoot" -s h -l help -d "help for troubleshoot" - -# Upgrade -complete -f -c exercism -n "__fish_use_subcommand" -a "upgrade" -d "Upgrades to the latest available version." -complete -f -c exercism -n "__fish_seen_subcommand_from help" -s h -l help -d "help for help" - -# Version -complete -f -c exercism -n "__fish_use_subcommand" -a "version" -d "Outputs version information." -complete -f -c exercism -n "__fish_seen_subcommand_from version" -s l -l latest -d "check latest available version" -complete -f -c exercism -n "__fish_seen_subcommand_from version" -s h -l help -d "help for version" - -# Workspace -complete -f -c exercism -n "__fish_use_subcommand" -a "workspace" -d "Outputs the root directory for Exercism exercises." -complete -f -c exercism -n "__fish_seen_subcommand_from workspace" -s h -l help -d "help for workspace" - -# Options -complete -f -c exercism -s h -l help -d "show help" -complete -f -c exercism -l timeout -a "10" -d "10 seconds" -complete -f -c exercism -l timeout -a "30" -d "30 seconds" -complete -f -c exercism -l timeout -a "60" -d "1 minute" -complete -f -c exercism -l timeout -a "300" -d "5 minutes" -complete -f -c exercism -l timeout -a "600" -d "10 minutes" -complete -f -c exercism -l timeout -a "" -d "override default HTTP timeout" -complete -f -c exercism -s v -l verbose -d "turn on verbose logging" diff --git a/fish/fish/completions/fisher.fish b/fish/fish/completions/fisher.fish deleted file mode 100644 index 6d23ce4..0000000 --- a/fish/fish/completions/fisher.fish +++ /dev/null @@ -1,7 +0,0 @@ -complete --command fisher --exclusive --long help --description "Print help" -complete --command fisher --exclusive --long version --description "Print version" -complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins" -complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins" -complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins" -complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex" -complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)" diff --git a/fish/fish/completions/fzf_configure_bindings.fish b/fish/fish/completions/fzf_configure_bindings.fish deleted file mode 100644 index b38ef92..0000000 --- a/fish/fish/completions/fzf_configure_bindings.fish +++ /dev/null @@ -1,8 +0,0 @@ -complete fzf_configure_bindings --no-files -complete fzf_configure_bindings --long help --short h --description "Print help" --condition "not __fish_seen_argument --help -h" -complete fzf_configure_bindings --long directory --description "Change the key binding for Search Directory" --condition "not __fish_seen_argument --directory" -complete fzf_configure_bindings --long git_log --description "Change the key binding for Search Git Log" --condition "not __fish_seen_argument --git_log" -complete fzf_configure_bindings --long git_status --description "Change the key binding for Search Git Status" --condition "not __fish_seen_argument --git_status" -complete fzf_configure_bindings --long history --description "Change the key binding for Search History" --condition "not __fish_seen_argument --history" -complete fzf_configure_bindings --long processes --description "Change the key binding for Search Processes" --condition "not __fish_seen_argument --processes" -complete fzf_configure_bindings --long variables --description "Change the key binding for Search Variables" --condition "not __fish_seen_argument --variables" diff --git a/fish/fish/completions/sdk.fish b/fish/fish/completions/sdk.fish deleted file mode 100644 index 54693df..0000000 --- a/fish/fish/completions/sdk.fish +++ /dev/null @@ -1,243 +0,0 @@ -# Defines autocompletion for SDKMAN! - -# Copyright (c) 2018-2023 Raphael Reitzig -# MIT License (MIT) -# https://github.com/reitzig/sdkman-for-fish - -# Guard: SDKMAN! needs to be installed -if not test -f "$SDKMAN_DIR/bin/sdkman-init.sh" - exit 0 -end - -# # # # # # -# Completion trigger predicates -# # # # # # - -# Test if there is no command -function __fish_sdkman_no_command - set cmd (commandline -opc) - - if [ (count $cmd) -eq 1 ] - return 0 - end - return 1 -end - -# Test if the main command matches one of the parameters -function __fish_sdkman_using_command - set cmd (commandline -opc) - - if [ (count $cmd) -eq 2 ] - if contains $cmd[2] $argv - return 0 - end - end - return 1 -end - -function __fish_sdkman_specifying_candidate - set cmd (commandline -opc) - - if [ (count $cmd) -eq 3 ] # currently, sdk does not support multiple versions - if contains $cmd[2] $argv - return 0 - end - end - return 1 -end - -function __fish_sdkman_command_has_enough_parameters - set cmd (commandline -opc) - - if [ (count $cmd) -ge (math $argv[1] + 2) ]; and contains $cmd[2] $argv[2..-1] - return 0 - end - return 1 -end - -# # # # # # -# Data collectors -# # # # # # - -function __fish_sdkman_candidates - cat "$SDKMAN_DIR"/var/candidates | string replace -a -r ',' '\n' -end - -function __fish_sdkman_candidates_with_versions - set regexpHome (string replace -a '/' '\\/' "$HOME/") - - find "$SDKMAN_DIR"/candidates/ -mindepth 2 -maxdepth 2 -name '*current' \ - | awk -F '/' '{ print $(NF-1) }' \ - | sort -u -end - -function __fish_sdkman_installed_versions - set cmd (commandline -opc) - if [ -d "$SDKMAN_DIR"/candidates/$cmd[3]/current ] - ls -v1 "$SDKMAN_DIR"/candidates/$cmd[3] | grep -v current - end -end - -# # # # # # -# Completion specification -# # # # # # - -# install -complete -c sdk -f -n '__fish_sdkman_no_command' \ - -a 'i install' \ - -d 'Install new version' -complete -c sdk -f -n '__fish_sdkman_using_command i install' \ - -a "(__fish_sdkman_candidates)" -# TODO complete available versions --> issue #4 -complete -c sdk -f -n '__fish_sdkman_specifying_candidate i install' \ - -a 'a.b.c' \ - -d "version list unavailable" -complete -c sdk -f -n '__fish_sdkman_specifying_candidate i install' \ - -a 'x.y.z' \ - -d "Specify path to install custom version." -# Implicit: complete files as fourth parameter -complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 3 i install' - # block - -# uninstall -complete -c sdk -f -n '__fish_sdkman_no_command' \ - -a 'rm uninstall' -d 'Uninstall version' -complete -c sdk -f -n '__fish_sdkman_using_command rm uninstall' \ - -a "(__fish_sdkman_candidates_with_versions)" -complete -c sdk -f -n '__fish_sdkman_specifying_candidate rm uninstall' \ - -a "(__fish_sdkman_installed_versions)" -complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 rm uninstall' - # block - -# list -complete -c sdk -f -n '__fish_sdkman_no_command' \ - -a 'ls list' \ - -d 'List versions' -complete -c sdk -f -n '__fish_sdkman_using_command ls list' \ - -a "(__fish_sdkman_candidates)" -complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 ls list' - # block - -# use -complete -c sdk -f -n '__fish_sdkman_no_command' \ - -a 'u use' \ - -d 'Use specific version' -complete -c sdk -f -n '__fish_sdkman_using_command u use' \ - -a "(__fish_sdkman_candidates_with_versions)" -complete -c sdk -f -n '__fish_sdkman_specifying_candidate u use' \ - -a "(__fish_sdkman_installed_versions)" -complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 u use' - # block - -# default -complete -c sdk -f -n '__fish_sdkman_no_command' \ - -a 'd default' \ - -d 'Set default version' -complete -c sdk -f -n '__fish_sdkman_using_command d default' \ - -a "(__fish_sdkman_candidates_with_versions)" -complete -c sdk -f -n '__fish_sdkman_specifying_candidate d default' \ - -a "(__fish_sdkman_installed_versions)" -complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 d default' - # block - -# current -complete -c sdk -f -n '__fish_sdkman_no_command' \ - -a 'c current' \ - -d 'Display current version' -complete -c sdk -f -n '__fish_sdkman_using_command c current' \ - -a "(__fish_sdkman_candidates)" -complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 c current' - # block - -# upgrade -complete -c sdk -f -n '__fish_sdkman_no_command' \ - -a 'ug upgrade' \ - -d 'Display what is outdated' -complete -c sdk -f -n '__fish_sdkman_using_command ug upgrade' \ - -a "(__fish_sdkman_candidates_with_versions)" -complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 ug upgrade' - # block - -# version -complete -c sdk -f -n '__fish_sdkman_no_command' \ - -a 'v version' \ - -d 'Display version' -complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 v version' - # block - -# help -complete -c sdk -f -n '__fish_sdkman_no_command' \ - -a 'help' \ - -d 'Display help message' -complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 h help' - # block - -# offline -complete -c sdk -f -n '__fish_sdkman_no_command' \ - -a 'offline' \ - -d 'Set offline status' -complete -c sdk -f -n '__fish_sdkman_using_command offline' \ - -a 'enable' \ - -d 'Make sdk work while offline' -complete -c sdk -f -n '__fish_sdkman_using_command offline' \ - -a 'disable' \ - -d 'Turn on all features' -complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 offline' - # block - -# selfupdate -complete -c sdk -f -n '__fish_sdkman_no_command' \ - -a 'selfupdate' \ - -d 'Update sdk' -complete -c sdk -f -n '__fish_sdkman_using_command selfupdate' \ - -a 'force' \ - -d 'Force re-install of current version' -complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 selfupdate' - # block - -# update -complete -c sdk -f -n '__fish_sdkman_no_command' \ - -a 'update' \ - -d 'Reload the candidate list' -complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 update' - # block - -# flush -complete -c sdk -f -n '__fish_sdkman_no_command' \ - -a 'flush' \ - -d 'Clear out archives and temporary storage folders' -complete -c sdk -f -n '__fish_sdkman_using_command flush' \ - -a 'temp' \ - -d 'Clear out staging work folder' -complete -c sdk -f -n '__fish_sdkman_using_command flush' \ - -a 'version' \ - -d 'Flush version file' -complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 flush' - # block - -# env -complete -c sdk -f -n '__fish_sdkman_no_command' \ - -a 'e env' \ - -d 'Load environment from .sdkmanrc file' -complete -c sdk -f -n '__fish_sdkman_using_command e env' \ - -a 'init' \ - -d 'Initialize .sdkmanrc file' -complete -c sdk -f -n '__fish_sdkman_using_command e env' \ - -a 'install' \ - -d 'Install all candidate versions listed in .sdkmanrc' -complete -c sdk -f -n '__fish_sdkman_using_command e env' \ - -a 'clear' \ - -d 'Unload currently loaded environment' -complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 e env' - # block - -# home -complete -c sdk -f -n '__fish_sdkman_no_command' \ - -a 'h home' \ - -d 'Show installation folder of given candidate' -complete -c sdk -f -n '__fish_sdkman_using_command h home' \ - -a "(__fish_sdkman_candidates_with_versions)" -complete -c sdk -f -n '__fish_sdkman_specifying_candidate h home' \ - -a "(__fish_sdkman_installed_versions)" -complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 h home' - # block diff --git a/fish/fish/conf.d/done.fish b/fish/fish/conf.d/done.fish deleted file mode 100755 index 6ff631c..0000000 --- a/fish/fish/conf.d/done.fish +++ /dev/null @@ -1,335 +0,0 @@ -# MIT License - -# Copyright (c) 2016 Francisco Lourenço & Daniel Wehner - -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -if not status is-interactive - exit -end - -set -g __done_version 1.19.2 - -function __done_run_powershell_script - set -l powershell_exe (command --search "powershell.exe") - - if test $status -ne 0 - and command --search wslvar - - set -l powershell_exe (wslpath (wslvar windir)/System32/WindowsPowerShell/v1.0/powershell.exe) - end - - if string length --quiet "$powershell_exe" - and test -x "$powershell_exe" - - set cmd (string escape $argv) - - eval "$powershell_exe -Command $cmd" - end -end - -function __done_windows_notification -a title -a message - if test "$__done_notify_sound" -eq 1 - set soundopt "