Created
February 3, 2020 22:48
-
-
Save enisozgen/bd279c4d608ab089112fe99dbdce6503 to your computer and use it in GitHub Desktop.
move text or region
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; https://github.com/hbin/smart-shift | |
;; Another text moving package which works well. | |
;; Easily you can shift region or current line. | |
;; Usage 1: Go to line call the function move it with h,j,k,l | |
;; Usage 2: Select the region than move them via h,j,k,l | |
;; Known bug If you select via V command it behaves so weird. | |
(defhydra smart-shift-hydra ( | |
;; Overide predefined function in package | |
;; It was offering arrow keys | |
;; PS: I know it's not good place to define function but it works. | |
:pre (defun smart-shift-override-local-map ()) | |
;; Deactivates mark if it is active | |
;; PS: It can be better function! so what? | |
:post evil-magit-maybe-deactivate-mark | |
;; Pretty shortcut | |
global-map "C-x TAB" | |
:exit nil) | |
("h" smart-shift-left) | |
("j" smart-shift-down) | |
("k" smart-shift-up) | |
("l" smart-shift-right) | |
;; Exit | |
("RET" nil :exit t) | |
("q" nil :exit t)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment