Skip to content

Instantly share code, notes, and snippets.

@enisozgen
Created February 3, 2020 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enisozgen/bd279c4d608ab089112fe99dbdce6503 to your computer and use it in GitHub Desktop.
Save enisozgen/bd279c4d608ab089112fe99dbdce6503 to your computer and use it in GitHub Desktop.
move text or region
;; 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