This commit is contained in:
+35
-1
@@ -3,6 +3,11 @@
|
|||||||
(define TAB-LENGTH 4)
|
(define TAB-LENGTH 4)
|
||||||
(define QUIT-TIMES 1)
|
(define QUIT-TIMES 1)
|
||||||
|
|
||||||
|
;; PACKAGES
|
||||||
|
|
||||||
|
;; First git clone it
|
||||||
|
;; (add-package "smart_delimiters")
|
||||||
|
|
||||||
;; FUNCTIONS
|
;; FUNCTIONS
|
||||||
|
|
||||||
(define editor-delete-next-char (lambda () (
|
(define editor-delete-next-char (lambda () (
|
||||||
@@ -12,6 +17,35 @@
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(define (char-between ch lo hi)
|
||||||
|
(if (char>=? ch lo)
|
||||||
|
(char<=? ch hi)
|
||||||
|
#f))
|
||||||
|
|
||||||
|
(define (alphanumericp ch)
|
||||||
|
(if ch
|
||||||
|
(if (char-between ch #\a #\z)
|
||||||
|
#t
|
||||||
|
(if (char-between ch #\A #\Z)
|
||||||
|
#t
|
||||||
|
(if (char-between ch #\0 #\9)
|
||||||
|
#t
|
||||||
|
#f)))
|
||||||
|
#f))
|
||||||
|
|
||||||
|
(define (word-char-p ch)
|
||||||
|
(if (alphanumericp ch)
|
||||||
|
#t
|
||||||
|
(char= ch #\_)))
|
||||||
|
|
||||||
|
|
||||||
|
(define editor-move-to-end-of-word (lambda () (
|
||||||
|
(if (word-char-p (editor-read-char))
|
||||||
|
((move-cursor "right")
|
||||||
|
(editor-move-to-end-of-word))
|
||||||
|
))
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
;; KEY MAPPING
|
;; KEY MAPPING
|
||||||
|
|
||||||
@@ -31,4 +65,4 @@
|
|||||||
(map-key "CTRL-o" editor-open-file)
|
(map-key "CTRL-o" editor-open-file)
|
||||||
(map-key "CTRL-k" editor-del-row)
|
(map-key "CTRL-k" editor-del-row)
|
||||||
(map-key "CTRL-s" editor-find)
|
(map-key "CTRL-s" editor-find)
|
||||||
|
(map-key "CTRL-r" editor-move-to-end-of-word)
|
||||||
|
|||||||
Reference in New Issue
Block a user