Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.93 KB | None | 0 0
  1. (defvar-local hl-line-after-cursor nil
  2. "Overlay used by Global-Hl-Line mode to highlight the current line.")
  3.  
  4.  
  5. (defun my-hl-line-after-current-line()
  6. (if (eq (line-end-position) (point-max))
  7. (progn
  8. (setq hl-line-after-cursor (make-overlay (line-end-position) (line-end-position)))
  9. (overlay-put hl-line-after-cursor 'after-string
  10. (propertize (make-string (- (- (window-text-width) (- (line-end-position) (line-beginning-position))) 2) (string-to-char " "))
  11. 'face hl-line-face 'cursor 1))
  12. (move-overlay hl-line-after-cursor (line-end-position) (line-end-position))
  13. )))
  14.  
  15.  
  16.  
  17. (defun my-hl-line-after-unhighlight ()
  18. "Deactivate the Hl-Line overlay on the current line."
  19. (when hl-line-after-cursor
  20. (delete-overlay hl-line-after-cursor)))
  21.  
  22. (add-hook 'pre-command-hook #'my-hl-line-after-unhighlight nil t)
  23. (add-hook 'post-command-hook #'my-hl-line-after-current-line nil t)
  24.  
  25. (debug)
  26. (setq user-full-name "YOUR NAME")
  27. (setq user-mail-address "YOUR EMAIL ADDRESS")
  28.  
  29. ;;
  30. ;; Basic Setup
  31. ;;
  32. (prefer-coding-system 'utf-8)
  33. ;; Shorten yes-or-no prompts
  34. (fset 'yes-or-no-p 'y-or-n-p)
  35. ;; This code stashes backups in ~/.emacs.d/backups
  36. (setq backup-directory-alist '(("." . "~/.emacs.d/backups")))
  37. ;; This code removes the ugly tool bar
  38. (tool-bar-mode -1)
  39. ;; Matching parenthesis highlight
  40. (show-paren-mode 1)
  41. ;; Show line numbers
  42. (global-linum-mode 1)
  43. ;; Set window title to full file name
  44. (setq frame-title-format '("Emacs @ " system-name ": %b %+%+ %f"))
  45. ;; Set up smooth scrolling
  46. (setq redisplay-dont-pause t
  47. scroll-margin 1
  48. scroll-step 1
  49. scroll-conservatively 10000
  50. scroll-preserve-screen-position 1)
  51. ;; get rid of the scroll bar boxes
  52. (scroll-bar-mode -1)
  53. ;; Set the tab width to 2 by default
  54. (setq-default tab-width 2)
  55. ;; No dinging during exceptions
  56. (setq visible-bell 1)
  57. ;; Enable keybinding to Caps Lock key
  58. (setq w32-enable-caps-lock nil)
  59. ;; Highlight current line
  60. (global-hl-line-mode +1)
  61.  
  62. (require 'package)
  63. (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
  64. ("marmalade" . "http://marmalade-repo.org/packages/")
  65. ("melpa" . "http://melpa.org/packages/")))
  66. (package-initialize)
  67.  
  68. (add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
  69. (load-theme 'solarized t)
  70.  
  71. (custom-set-variables
  72. ;; custom-set-variables was added by Custom.
  73. ;; If you edit it by hand, you could mess it up, so be careful.
  74. ;; Your init file should contain only one such instance.
  75. ;; If there is more than one, they won't work right.
  76. '(custom-safe-themes
  77. (quote
  78. ("a8245b7cc985a0610d71f9852e9f2767ad1b852c2bdea6f4aadc12cce9c4d6d0" default))))
  79. (custom-set-faces
  80. ;; custom-set-faces was added by Custom.
  81. ;; If you edit it by hand, you could mess it up, so be careful.
  82. ;; Your init file should contain only one such instance.
  83. ;; If there is more than one, they won't work right.
  84. )
  85.  
  86. ;; The default "C-x c" is quite close to "C-x C-c", which quits Emacs.
  87. ;; Changed to "C-c h". Note: We must set "C-c h" globally, because we
  88. ;; cannot change `helm-command-prefix-key' once `helm-config' is loaded.
  89. (global-set-key (kbd "C-c h") 'helm-command-prefix)
  90. (global-unset-key (kbd "C-x c"))
  91. (global-set-key (kbd "M-x") 'helm-M-x)
  92.  
  93.  
  94. ; (add-to-list 'load-path "~/site-lisp/wolfram-mode-master/")
  95. ; (require wolfram-mode)
  96. ; (autoload 'wolfram-mode "wolfram-mode" nil t)
  97. ; (autoload 'run-wolfram "wolfram-mode" nil t)
  98. ; (setq wolfram-program "C:ProgramDataMicrosoftWindowsStart MenuProgramsWolfram Mathematica")
  99. ; (add-to-list 'auto-mode-alist '("\.m$" . wolfram-mode))
  100. ; (setq wolfram-path "C:Program FilesWolfram ResearchMathematica10.4") ;; e.g. on Linux "~/.Mathematica/Applications"
  101.  
  102.  
  103. ;(overlay-put (make-overlay (line-end-position) (point-max)) 'after-string (propertize " " 'face '(:background "gray50" :foreground "black")))
  104. (defvar-local hl-line-after-cursor nil
  105. "Overlay used by Global-Hl-Line mode to highlight the current line.")
  106.  
  107.  
  108. (defun my-hl-line-after-current-line()
  109. (if (eq (line-end-position) (point-max))
  110. (progn
  111. (setq hl-line-after-cursor (make-overlay (line-end-position) (line-end-position)))
  112. (overlay-put hl-line-after-cursor 'after-string
  113. (propertize (make-string (- (- (window-text-width) (- (line-end-position) (line-beginning-position))) 2) (string-to-char " "))
  114. 'face hl-line-face 'cursor 1))
  115. (move-overlay hl-line-after-cursor (line-end-position) (line-end-position))
  116. ;(overlay-put hl-line-after-cursor 'priority -50)
  117. )))
  118.  
  119.  
  120.  
  121. (defun my-hl-line-after-unhighlight ()
  122. "Deactivate the Hl-Line overlay on the current line."
  123. (when hl-line-after-cursor
  124. (delete-overlay hl-line-after-cursor)))
  125.  
  126. (add-hook 'pre-command-hook #'my-hl-line-after-unhighlight nil t)
  127. (add-hook 'post-command-hook #'my-hl-line-after-current-line nil t)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement