sh :: Double -> Double
sh x = undefined
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class AnyRefOption[T >: Null <: AnyRef] private(private val value: T) extends AnyVal { | |
def isEmpty = value == null | |
def isDefined: Boolean = !isEmpty | |
def get: T = value | |
def foreach[U](fn: T => U): Unit = { | |
if (isDefined) fn(value) | |
} | |
def let[U](fn: T => U) = if (isDefined) fn(value) else AnyRefOption(null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# open eshell in terminal emacsclient | |
alias tesh="te --eval '(restart-eshell)'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Enable Company in selected major modes | |
(let ((hooks '(java-mode-hook))) | |
(dolist (hook hooks) | |
(add-hook hook (lambda () | |
(company-mode 1))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Rebind 'GOTO beginning/end of buffer' to "C-M-v" | |
(defun edge-of-buffer () | |
(interactive) | |
(if (and current-prefix-arg (eq current-prefix-arg '-)) | |
(beginning-of-buffer) (end-of-buffer))) | |
(global-set-key (kbd "C-M-v") 'edge-of-buffer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html | |
(desktop-save-mode 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Display a list of existing buffers in current window | |
(global-set-key (kbd "C-x C-b") 'buffer-menu) | |
;; List buffers in other window using "C-x 4-" prefix | |
(global-set-key (kbd "C-x 4 C-x C-b") 'list-buffers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Show directories first in Dired | |
(setq dired-listing-switches "-al --group-directories-first") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun graphviz-on-buffer () | |
(interactive) | |
(shell-command-on-region (point-min) (point-max) "dot -Txlib")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Relative line numbers | |
(setq display-line-numbers-type 'relative) | |
(global-display-line-numbers-mode) | |
;; Move toward logical lines when prefix arg (numeric, negative) is presented | |
(defun next-logical-line-if-prefix (&optional arg try-vscroll) | |
(interactive "^p\np") | |
(let ((line-move-visual (if current-prefix-arg nil line-move-visual))) | |
(with-no-warnings | |
(next-line arg try-vscroll)))) |
NewerOlder