new tweaks, add fez/lookup-key and fez/ttm-upload, disable autosaves

This commit is contained in:
opfez 2021-06-03 11:34:57 +02:00
parent c3d492f731
commit c72ae4a83e
3 changed files with 66 additions and 3 deletions

View File

@ -71,6 +71,22 @@
(dolist (l (reverse kill-ring))
(insert l)))
(defun fez/lookup-key ()
"Search for KEY in all known keymaps (outputs to *Messages*)"
(interactive)
(let ((key (read-key-sequence-vector "Key sequence: ")))
(mapatoms (lambda (ob) (when (and (boundp ob) (keymapp (symbol-value ob)))
(when (functionp (lookup-key (symbol-value ob) key))
(message (symbol-name ob)))))
obarray)))
(defun fez/ttm-upload ()
"Upload file in selected buffer to ttm.sh and output the link in the echo area (and in *Messages*)"
(interactive)
(message "%s" (shell-command-to-string (concat "curl -Ffile=@"
(buffer-file-name)
" https://ttm.sh"))))
;; Eshell convinience commands.
(defalias 'open 'find-file-other-window)
(defalias 'clean 'eshell/clear-scrollback)

View File

@ -44,7 +44,23 @@
(add-hook 'sly-mode-hook
(lambda ()
(defun sly-flash-region (start end)
(fez/flash-region))))
(fez/flash-region))
(defun sly-mrepl-default-prompt (_package
nickname
error-level
entry-idx
_condition)
"SLY REPL prompt."
(concat
(when (cl-plusp error-level)
(concat (sly-make-action-button
(format "[%d]" error-level)
#'sly-db-pop-to-debugger-maybe)
" "))
(propertize
(concat (number-to-string entry-idx) ":" nickname "> ")
'face 'sly-mrepl-prompt-face
'font-lock-face 'sly-mrepl-prompt-face)))))
(use-package sly-quicklisp
:ensure t))
@ -71,7 +87,7 @@
:ensure t
:config
(setq dashboard-banner-logo-title "")
(setq dashboard-startup-banner 'logo) ; add own image?
(setq dashboard-startup-banner 3) ; add own image?
(setq dashboard-center-content t)
(setq dashboard-set-footer nil)
(dashboard-setup-startup-hook))
@ -150,4 +166,16 @@
"* %?\nEntered on %U\n %i\n %a")))
(global-set-key (kbd "C-c o") 'org-capture))
;; Notes
(use-package org-roam
:ensure t
:config
(setq org-roam-directory "~/Documents/org-roam"))
;; better shell-command
(use-package shell-command+
:ensure t
:config
(global-set-key (kbd "M-!") 'shell-command+))
(provide 'packages)

View File

@ -6,7 +6,8 @@
;; Remove useless stuff.
(menu-bar-mode 0)
(tool-bar-mode 0)
(scroll-bar-mode 0)
(when (display-graphic-p)
(scroll-bar-mode 0))
(defun my/disable-scroll-bars (frame)
(modify-frame-parameters frame
'((vertical-scroll-bars . nil)
@ -33,6 +34,7 @@
;; Move backup files to another folder.
(setq backup-directory-alist '(("." . "~/.emacs.d/backups/")))
(setq auto-save-default nil)
;; don't create .#<filename> files.
(setq create-lockfiles nil)
@ -73,3 +75,20 @@
;; Start replacing text if it is marked
(delete-selection-mode 1)
;; Auto-indent pasted code.
(dolist (command '(yank yank-pop))
(eval
`(defadvice ,command (after indent-region activate)
(and (not current-prefix-arg)
(member major-mode
'(emacs-lisp-mode
lisp-mode
clojure-mode scheme-mode
haskell-mode ruby-mode
rspec-mode python-mode
c-mode c++-mode
objc-mode latex-mode
plain-tex-mode elisp-mode))
(let ((mark-even-if-inactive transient-mark-mode))
(indent-region (region-beginning) (region-end) nil))))))