summaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ravi-init-navigation.el36
1 files changed, 3 insertions, 33 deletions
diff --git a/lisp/ravi-init-navigation.el b/lisp/ravi-init-navigation.el
index 493381c..5a8c05b 100644
--- a/lisp/ravi-init-navigation.el
+++ b/lisp/ravi-init-navigation.el
@@ -175,40 +175,10 @@
;; C-: duplicates line, C-u C-: comments first line
(bind-key "C-:" 'ravi/kyle-sherman-duplicate-line)
-(use-package key-combo
- :config
- (progn
- (global-key-combo-mode 1)
- (key-combo-define-global (kbd "C-a")
- `(back-to-indentation move-beginning-of-line
- key-combo-return))))
-
-(defun ravi/Fuco-point-in-comment ()
- "Determine if the point is inside a comment"
- (interactive)
- (let ((syn (syntax-ppss)))
- (and (nth 8 syn)
- (not (nth 3 syn)))))
-
-(defun ravi/Fuco-end-of-code-or-line+ (arg)
- "Move to the end of line. If already there, move to the end of code.
+(use-package mwim
+ :bind (("C-a" . mwim-beginning)
+ ("C-e" . mwim-end)))
- Comments are recognized in any mode that sets syntax-ppss properly."
- (interactive "P")
- (let ((eoc (save-excursion
- (move-end-of-line arg)
- (while (ravi/Fuco-point-in-comment)
- (backward-char))
- (skip-chars-backward " \t")
- (point))))
- (cond ((eolp)
- (move-end-of-line arg)
- (while (ravi/Fuco-point-in-comment)
- (backward-char))
- (skip-chars-backward " \t"))
- (t
- (move-end-of-line arg)))))
-(bind-key "C-e" 'ravi/Fuco-end-of-code-or-line+)
;; Use current line for region-based commands if no region selected
(use-package whole-line-or-region