Bubble up avy

master
Jacopo De Simoi 9 years ago
parent c82ab38b1e
commit f6276e37fd
  1. 232
      global.org

@ -349,6 +349,13 @@
(global-set-key (kbd "<H-f14>") 'mc/mark-pop) (global-set-key (kbd "<H-f14>") 'mc/mark-pop)
(global-set-key (kbd "H-#") 'mc/insert-numbers) (global-set-key (kbd "H-#") 'mc/insert-numbers)
#+END_SRC #+END_SRC
** avy
#+BEGIN_SRC emacs-lisp
(global-set-key (kbd "C-c SPC") 'avy-goto-word-or-subword-1)
(global-set-key (kbd "M-s") 'avy-goto-word-or-subword-1)
(global-set-key (kbd "M-g M-g") 'avy-goto-line)
(global-set-key (kbd "M-g g") 'avy-goto-line)
#+END_SRC
** Atomic chrome ** Atomic chrome
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
;;(require 'atomic-chrome) ;;(require 'atomic-chrome)
@ -379,120 +386,115 @@
#+END_SRC #+END_SRC
** Leftovers ** Leftovers
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
;;(setq kde-full-name "Jacopo De Simoi") ;;(setq kde-full-name "Jacopo De Simoi")
;;(setq kde-email "wilderkde@gmail.com") ;;(setq kde-email "wilderkde@gmail.com")
;; (require 'sourcepair) ;; (require 'sourcepair)
;; (global-set-key (kbd "<f6>") 'sourcepair-load) ;; (global-set-key (kbd "<f6>") 'sourcepair-load)
(setq default-fill-column 110) (setq default-fill-column 110)
;; (require 'pomodoro) ;; (require 'pomodoro)
;; * smart-tab-mode ;; * smart-tab-mode
(require 'smart-tab) (require 'smart-tab)
(global-smart-tab-mode 1) (global-smart-tab-mode 1)
(global-set-key (kbd "C-j") 'smart-tab) ;; try this; I never use C-j for goto-line (global-set-key (kbd "C-j") 'smart-tab) ;; try this; I never use C-j for goto-line
(global-set-key (kbd "C-c SPC") 'avy-goto-word-or-subword-1) ;; * redefine line-beginning to handle indentation properly
(global-set-key (kbd "M-s") 'avy-goto-word-or-subword-1) (defun smart-line-beginning ()
(global-set-key (kbd "M-g M-g") 'avy-goto-line) "Move point to the beginning of text on the current line; if that is already
(global-set-key (kbd "M-g g") 'avy-goto-line) the current position of point, then move it to the beginning of the line."
(interactive)
;; * redefine line-beginning to handle indentation properly (let ((pt (point)))
(defun smart-line-beginning () (beginning-of-line-text)
"Move point to the beginning of text on the current line; if that is already (when (eq pt (point))
the current position of point, then move it to the beginning of the line." (beginning-of-line))))
(interactive) (global-set-key (kbd "C-a") 'smart-line-beginning)
(let ((pt (point)))
(beginning-of-line-text) ;; * load expand-region
(when (eq pt (point))
(beginning-of-line)))) (require 'expand-region)
(global-set-key (kbd "C-a") 'smart-line-beginning) (global-set-key (kbd "C-=") 'er/expand-region)
;; * load expand-region ;; * construct emacs-session so with session-id
(defun emacs-session-filename (session-id)
(require 'expand-region) "Construct a filename to save the session in based on SESSION-ID.
(global-set-key (kbd "C-=") 'er/expand-region) If the directory ~/.emacs.d exists, we make a filename in there, otherwise
a file in the home directory."
;; * construct emacs-session so with session-id (let ((basename (concat "sessions/session." session-id))
(defun emacs-session-filename (session-id) (emacs-dir user-emacs-directory))
"Construct a filename to save the session in based on SESSION-ID. (expand-file-name (if (file-directory-p emacs-dir)
If the directory ~/.emacs.d exists, we make a filename in there, otherwise (concat emacs-dir basename)
a file in the home directory." (concat "~/.emacs-" basename)))))
(let ((basename (concat "sessions/session." session-id))
(emacs-dir user-emacs-directory)) ;; * Wordnik - this has bitrotten :fixme:
(expand-file-name (if (file-directory-p emacs-dir) ;(require 'wordnik-synonym)
(concat emacs-dir basename) ;(global-set-key (kbd "H-=") 'wn/synonym-at-point)
(concat "~/.emacs-" basename)))))
;; * Time stamps
;; * Wordnik - this has bitrotten :fixme: ;; write
;(require 'wordnik-synonym) ;; Time-stamp: <>
;(global-set-key (kbd "H-=") 'wn/synonym-at-point) ;; in your file and save it to see time stamps at work.
;; Other time stamp format: "%a %b %e, %Y %l:%M %p"
;; * Time stamps (add-hook 'write-file-hooks 'time-stamp)
;; write (setq time-stamp-active t)
;; Time-stamp: <> (setq time-stamp-format "%:a %02d %:b %:y, %02H:%02M:%02S, %u")
;; in your file and save it to see time stamps at work. (setq european-calendar-style 't)
;; Other time stamp format: "%a %b %e, %Y %l:%M %p" ;; first day of the week is monday instead of sunday:
(add-hook 'write-file-hooks 'time-stamp) (setq calendar--week--start--day 1)
(setq time-stamp-active t)
(setq time-stamp-format "%:a %02d %:b %:y, %02H:%02M:%02S, %u") ;; * toorg
(setq european-calendar-style 't) (require 'highlight-sexps)
;; first day of the week is monday instead of sunday:
(setq calendar--week--start--day 1) (require 'package)
(add-to-list 'package-archives
;; * toorg '("melpa-stable" . "http://stable.melpa.org/packages/") t)
(require 'highlight-sexps)
;; (eval-after-load 'tramp '(setenv "SHELL" "/bin/bash"))
(require 'package)
(add-to-list 'package-archives ;; Use system proxy
'("melpa-stable" . "http://stable.melpa.org/packages/") t) (setq url-proxy-services '(("http" . "127.0.0.1:8118")))
;; (eval-after-load 'tramp '(setenv "SHELL" "/bin/bash")) (defun flash-hline ()
(let ((fg (face-foreground 'default))
;; Use system proxy (bg (face-background 'hl-line)))
(setq url-proxy-services '(("http" . "127.0.0.1:8118"))) (set-face-background 'hl-line fg)
(run-with-timer
(defun flash-hline () 0.1 nil (lambda ()
(let ((fg (face-foreground 'default)) (set-face-background 'hl-line "#303030") ))))
(bg (face-background 'hl-line)))
(set-face-background 'hl-line fg) (global-set-key (kbd "<f15>") 'flash-hline)
(run-with-timer
0.1 nil (lambda ()
(set-face-background 'hl-line "#303030") )))) ;;; Stefan Monnier <foo at acm.org>. It is the opposite of fill-paragraph
(defun unfill-paragraph (&optional region)
(global-set-key (kbd "<f15>") 'flash-hline) "Takes a multi-line paragraph and makes it into a single line of text."
(interactive (progn (barf-if-buffer-read-only) '(t)))
(let ((fill-column (point-max))
;;; Stefan Monnier <foo at acm.org>. It is the opposite of fill-paragraph ;; This would override `fill-column' if it's an integer.
(defun unfill-paragraph (&optional region) (emacs-lisp-docstring-fill-column t))
"Takes a multi-line paragraph and makes it into a single line of text." (fill-paragraph nil region)))
(interactive (progn (barf-if-buffer-read-only) '(t)))
(let ((fill-column (point-max)) (defun select-frame-on-current-activity ()
;; This would override `fill-column' if it's an integer. (select-frame-on-activity (kde-current-activity))
(emacs-lisp-docstring-fill-column t)) )
(fill-paragraph nil region)))
;; * start server named after kde activity name
(defun select-frame-on-current-activity () (setq server-name (kde-current-activity-name))
(select-frame-on-activity (kde-current-activity)) ;; mmh
) ;; (set-face-font 'default "-xos4-hackminus-medium-r-normal--20-200-72-72-c-100-ISO10646-1") ;
;; Why is the above needed down here?
;; * start server named after kde activity name ;;
(setq server-name (kde-current-activity-name)) ;; Because it sets the face for packages that have loaded in the meantime;
;; mmh ;; it does not wark perfectly as some packages are still to be loaded
;; (set-face-font 'default "-xos4-hackminus-medium-r-normal--20-200-72-72-c-100-ISO10646-1") ; ;; (most notably magit)
;; Why is the above needed down here?
;; (mapc
;; Because it sets the face for packages that have loaded in the meantime; (lambda (face)
;; it does not wark perfectly as some packages are still to be loaded (set-face-attribute face nil :weight 'normal)
;; (most notably magit) (set-face-attribute face nil :slant 'normal))
(face-list))
(mapc (server-start)
(lambda (face)
(set-face-attribute face nil :weight 'normal)
(set-face-attribute face nil :slant 'normal))
(face-list))
(server-start)
#+END_SRC #+END_SRC

Loading…
Cancel
Save