Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 107 lines (87 sloc) 3.225 kb
7244f77 @tavisrudd diminish some stuff in the modeline
authored
1 (require 'diminish)
95e0793 @tavisrudd (setq-default filladapt-mode t)
authored
2 (require 'filladapt)
4c7bb99 @tavisrudd flymake and hilit-chg tweaks
authored
3 (require 'flymake)
4 (setq flymake-log-level 0)
5
95e0793 @tavisrudd (setq-default filladapt-mode t)
authored
6 (setq-default filladapt-mode t)
7244f77 @tavisrudd diminish some stuff in the modeline
authored
7 (diminish 'filladapt-mode "")
8 (diminish 'abbrev-mode "Ab.")
9
50e1283 @tavisrudd undo-tree
authored
10 (setq visible-bell nil)
43b578b @tavisrudd misc cleanup and refactoring
authored
11 (defun dss/set-undo-boundary ()
12 (interactive)
13 (undo-boundary))
14
0646a46 @tavisrudd initial commit
authored
15 (defun dss/cap-sentence ()
16 (interactive)
17 (save-excursion
18 (backward-sentence)
19 (capitalize-word 1)))
20
21 (defun dss/quote-region (start end &optional c)
22 (interactive "r")
23 (let ((c (or c "\"")))
7244f77 @tavisrudd diminish some stuff in the modeline
authored
24 (save-excursion
25 (goto-char start)
26 (insert c)
27 (goto-char (+ 1 end))
28 (insert c))))
0646a46 @tavisrudd initial commit
authored
29
30 (defun dss/single-quote-region (start end)
31 (interactive "r")
32 (dss/quote-region start end "'"))
33
cba7c69 @tavisrudd dss/yank-and-indent
authored
34 (defun dss/yank-and-indent ()
35 (interactive)
36 (yank)
37 (call-interactively 'indent-region))
38
dad46f5 @tavisrudd add slick-edit defadvice from alex payne
authored
39
252bd61 @tavisrudd visible-mark, goto-last-change and highlight-changes
authored
40 (require 'misc) ; forward-to-word & backward-to-word
41
42 (require 'visible-mark)
43 (global-visible-mark-mode t)
44
50e1283 @tavisrudd undo-tree
authored
45 (require 'undo-tree)
46 (global-undo-tree-mode)
7244f77 @tavisrudd diminish some stuff in the modeline
authored
47 (diminish 'undo-tree-mode "")
50e1283 @tavisrudd undo-tree
authored
48
d4e25be @tavisrudd dss/clone-line
authored
49 (defun dss/clone-line ()
50 (interactive)
51 (beginning-of-line)
52 (k2-copy-whole-line)
53 (open-next-line)
54 (forward-line)
55 (yank)
56 (back-to-indentation))
57
9fffa79 @tavisrudd dss/goto-line
authored
58 (defun dss/goto-line (line)
59 "A simplified, single buffer version of the standard command
60 that work even if the buffer is narrowed"
61 (interactive "nLine:")
62 ;; Leave mark at previous position
63 (or (region-active-p) (push-mark))
64 ;; Move to the specified line number in that buffer.
65 (save-restriction
66 (goto-char (point-min))
67 (if (eq selective-display t)
68 (re-search-forward "[\n\C-m]" nil 'end (1- line))
69 (forward-line (1- line)))))
70
252bd61 @tavisrudd visible-mark, goto-last-change and highlight-changes
authored
71 (require 'goto-last-change) ;there is another version of this library called goto-chg.el
72
73 ;; see
74 ;; http://nicolas-lara.blogspot.com/2009/11/emacs-mark-stack.html
75 ;; http://www.bloomington.in.us/~brutt/marker-visit.el
76
77 ;;; http://emacs-fu.blogspot.com/2009/05/tracking-changes.html
4c7bb99 @tavisrudd flymake and hilit-chg tweaks
authored
78 ;; (require 'hilit-chg)
252bd61 @tavisrudd visible-mark, goto-last-change and highlight-changes
authored
79 (setq highlight-changes-visibility-initial-state nil)
4c7bb99 @tavisrudd flymake and hilit-chg tweaks
authored
80 (global-highlight-changes-mode -1)
252bd61 @tavisrudd visible-mark, goto-last-change and highlight-changes
authored
81 ;; (global-set-key (kbd "<f6>") 'highlight-changes-visible-mode) ;; changes
82 ;; ;; remove the change-highlight in region
83 ;; (global-set-key (kbd "S-<f6>") 'highlight-changes-remove-highlight)
84 ;; (global-set-key (kbd "<M-prior>") 'highlight-changes-next-change)
85 ;; (global-set-key (kbd "<M-next>") 'highlight-changes-previous-change)
86
87
dad46f5 @tavisrudd add slick-edit defadvice from alex payne
authored
88 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
89 ;;; https://github.com/al3x/emacs/blob/master/utilities/slick-copy.el
90 (defadvice kill-ring-save (before slick-copy activate compile)
91 "When called interactively with no active region, copy a single line instead."
92 (interactive
93 (if mark-active (list (region-beginning) (region-end))
94 (message "Copied line")
95 (list (line-beginning-position)
96 (line-beginning-position 2)))))
97
98 (defadvice kill-region (before slick-cut activate compile)
99 "When called interactively with no active region, kill a single line instead."
100 (interactive
101 (if mark-active (list (region-beginning) (region-end))
102 (list (line-beginning-position)
103 (line-beginning-position 2)))))
104 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
252bd61 @tavisrudd visible-mark, goto-last-change and highlight-changes
authored
105
0646a46 @tavisrudd initial commit
authored
106 (provide 'dss-basic-editing)
Something went wrong with that request. Please try again.