Commits

Anonymous committed 006e5e5

* Added some calc routines
* Swapped f/b sentence movement

  • Participants
  • Parent commits 34bdf4f

Comments (0)

Files changed (6)

 eshell/lastdir
 files/sunrise-x-w32-addons.vbs
 tramp
+calc.el
   (exchange-point-and-mark)
   (deactivate-mark nil))
 
+;; usefull mini calculator
+(defun my-mini-calc (expr &optional arg)
+  "Calculate expression
+
+If ARG is given, then insert the result to current-buffer"
+  (interactive
+   (list (read-from-minibuffer "Enter expression: ")
+     current-prefix-arg))
+
+  (let ((result (calc-eval expr)))
+    (if arg
+    (insert result)
+      (message (format "Result: [%s] = %s" expr result)))))
+
 (defun fix-basic ()
   (interactive)
   (beginning-of-buffer)

files/key-chord.el

 
 (key-chord-define-global "df" 'iy-go-to-char)
 
-;; (defun add-tex-key-chords ()
-;;   (key-chord-define tex-mode-map "$$" "$$\C-b"))
-;; (add-hook 'tex-mode-hook 'add-tex-key-chords)
+(defun add-tex-key-chords ()
+  (key-chord-define tex-mode-map "wq" "$"))
+(add-hook 'tex-mode-hook 'add-tex-key-chords)
 
 (defun add-programming-chords ()
   (key-chord-define-local ";;" "\C-e;")
 (global-set-key (kbd "C-n") 'next-line)
 (global-set-key (kbd "C-p") 'previous-line)
 ;; sentence
-(global-set-key (kbd "M-a") 'forward-sentence)
-(global-set-key (kbd "M-e") 'backward-sentence)
+(global-set-key (kbd "M-e") 'forward-sentence)
+(global-set-key (kbd "M-a") 'backward-sentence)
 ;; paragraph
 (global-unset-key (kbd "M-{")) ;; was backward-paragraph
 (global-unset-key (kbd "M-}")) ;; was forward-paragraph
 (global-set-key (kbd "M-{") 'backward-paragraph-select)
 (global-set-key (kbd "M-}") 'forward-paragraph-select)
 ;; screen
-(global-set-key (kbd "C-v") 'scroll-down-command)
-(global-set-key (kbd "M-v") 'scroll-up-command)
+(global-set-key (kbd "C-v") 'scroll-up-command)
+(global-set-key (kbd "M-v") 'scroll-down-command)
 ;; sexp
 (global-set-key (kbd "C-M-f") 'forward-sexp)
 (global-set-key (kbd "C-M-b") 'backward-sexp)
 ;; swap C-a and M-m, back-to-indentation is much more common
 (global-unset-key (kbd "M-m"))
 (global-unset-key (kbd "C-a"))
-(global-set-key (kbd "M-m") 'beginning-of-line)
+(global-set-key (kbd "M-m") 'move-beginning-of-line)
 (global-set-key (kbd "C-a") 'back-to-indentation)
-(global-set-key (kbd "C-e") 'end-of-line)
+(global-set-key (kbd "C-e") 'move-end-of-line)
 ;; buffer
 (global-unset-key [(home)]) ;; was C-a
 (global-unset-key [(end)]) ;; was C-e
 (global-set-key (kbd "C-`") 'push-mark-no-activate)
 (global-set-key (kbd "M-`") 'jump-to-mark)
 (define-key global-map [remap exchange-point-and-mark] 'exchange-point-and-mark-no-activate)
+
+;; calc settings
+(global-set-key (kbd "<pause>") 'calc-dispatch)
+(global-set-key (kbd "<home>") 'calc-same-interface)
+(global-set-key (kbd "C-c c") 'my-mini-calc)
 ;; [i] Text of the footnote...
 ;; It will search for the first [i] in the text body and place \footnote{...} there
 (fset 'fninsert
-   [C-right C-right C-left ?\C-  ?\C-e ?\M-w ?\M-a ?\C-s ?\C-w ?\C-w right ?\M-< ?\C-s ?\C-s ?\C-  ?\C-\M-a delete ?\M-x ?f ?n ?o return])
+   [?\C-\M-f ?\C-f ?\C-  ?\M-e ?\M-w ?\M-a ?\C-s ?\C-w ?\C-w ?\C-s ?\C-s ?\C-m ?\C-  ?\C-\M-b delete ?\M-x ?f ?n ?o ?t ?e return])
 
 (defun fnote ()
   (interactive)

files/textmate.el

-;;This package gives some of the functionality provided by TextMate to
-;;Emacs. In particular, the automatic insertion of braces and string
-;;delimiters. It is heavily based on work by Orestis Markou
-;;(http://code.google.com/p/emacs-textmate/).
-
-(tm/initialize)
-(add-to-list 'tm/ignore-modes-list 'sr-mode)
-(add-to-list 'tm/ignore-modes-list 'minibuffer-inactive-mode)
-(add-to-list 'tm/ignore-modes-list 'ibuffer-mode)
-
-(setq tm/use-open-next-line nil)
-(setq skeleton-autowrap nil)
+;;This package gives some of the functionality provided by TextMate to
+;;Emacs. In particular, the automatic insertion of braces and string
+;;delimiters. It is heavily based on work by Orestis Markou
+;;(http://code.google.com/p/emacs-textmate/).
+
+(tm/initialize)
+(add-to-list 'tm/ignore-modes-list 'sr-mode)
+(add-to-list 'tm/ignore-modes-list 'minibuffer-inactive-mode)
+(add-to-list 'tm/ignore-modes-list 'ibuffer-mode)
+(add-to-list 'tm/ignore-modes-list 'calc-mode)
+
+(setq tm/use-open-next-line nil)
+(setq skeleton-autowrap nil)