Transient-Mark-Mode



;(transient-mark-mode 1)
(make-variable-buffer-local 'transient-mark-mode)
(put 'transient-mark-mode 'permanent-local t)
(setq-default transient-mark-mode t)

;enables C-u C-<SPC>, to return to last mark, followed by C-<SPC> to cycle through all marks set
(setq set-mark-command-repeat-pop t)

;autofill-mode
(bind-key "C-c q" 'auto-fill-mode)

Unfill-Paragraph



;unfill paragraph
(defun unfill-paragraph (&optional region)
"Takes a multi-line paragraph and makes it into a single line of text."
(interactive (progn (barf-if-buffer-read-only) '(t)))
(let ((fill-column (point-max))
	  ;; This would override `fill-column' if it's an integer.
	  (emacs-lisp-docstring-fill-column t))
  (fill-paragraph nil region)))

Expand-Region



;useful packages
(use-package expand-region
:after hydra
:config
(require 'expand-region)
(use-package change-inner
:config
(require 'change-inner));end change inner
(defun ejmr-mark-line ()
    "Mark the current line."
    (interactive)
    (end-of-line)
    (set-mark (point))
    (beginning-of-line))
);end use-package expand-region

Region Hydra



(defvar region-title (with-faicon "book" "Marking The Region"))

(pretty-hydra-define Region___ ( :title region-title :quit-key "q" :color Pink )
(   "A"
   (
    ("r" er/expand-region "Expand Region" )
    ("j" er/contract-region "Contract Region" )
    ("i" change-inner "Mark Inside Brackets/Quotes" :color blue)
    ("l" ejmr-mark-line "Mark The Line" :color blue )
    ("t" er/mark-inside-pairs "Mark Inside Pairs" :color blue )
    ("u" er/mark-url "Mark Url" :color blue)
    ("w" er/mark-word "Mark Word" :color blue)


);end theme
"B"
(
    ("p" er/mark-paragraph "Mark Paragraph" )
    (";" er/mark-comment "Mark Comment")
    ("R" rectangle-mark-mode "Mark Rectangle")
    ("k" copy-rectangle-as-kill "Copy Rectangle" )
    ("Y" yank-rectangle "Paste Rectangle" )
    ("d" delete-rectangle "Delete Rectangle" )
    ("c"  sp-change-inner "Change Enclosed" :color blue )


);end highlighting
"C"
(

    ("s" er/mark-sentence "Mark Sentence" :color blue)
    ("y" helm-show-kill-ring "Helm Kill Ring")
    ("h" hydra-helm/body "Return To Helm" :color blue )
    ("<SPC>" nil "Quit" :color blue)

);end miscellaneous
);end hydra body
);end pretty-hydra-appearance
(bind-key "<C-m> r" 'Region___/body)

emacs posiedon configuration region hydra code


Browsers



(setq browse-url-browser-function 'browse-url-default-browser)
(setq browse-url-firefox-program firefox-p)
(setq auto-window-vscroll nil)

;browse-url in this shortcut or hyrda
(bind-key "C-c C-o" 'browse-url)

Engine-Mode



(use-package engine-mode
:after hydra
:commands Browse-Web/body
:config
;(engine-mode t)
;engine mode configuration

(defengine SEARCHENGINENAME
"URL-QUERY-STRING-SEARCHENGINENAME
;:keybinding "d"
)
); end use-package engine-mode

Browser Print Functions



;custom function print buffer in browser.
(defun print-buffer-to-browser ()
  (interactive)
  (browse-url-of-buffer (htmlize-buffer)))

;custom function print region to browser

(defun print-region-to-browser ()
(interactive)
(if (use-region-p)
        (setq beg (region-beginning)
              end (region-end)))
(browse-url-of-buffer (htmlize-region beg end)))

Browser Hydra




;generate title for hydra
(defvar browser-title (with-octicon "globe" "USE BROWSER"))
:bind
("<C-m> b" . Browse-Web_/body)

:pretty-hydra
(Browse-Web_ (:color blue :quit-key "q" :title browser-title)
(
          "Search Engines"
(

("d" engine/search-SEARCHENGINENAME         "Duckduckgo")
          
);end search

          "Other"
          
);end other

          "Send Local Files To Browser"
(

           ("u" browse-url "Browse URL At Point")
           ("P" print-buffer-to-browser   "Print Buffer To Browser")
           ("p" print-region-to-browser   "Print Region To Browser")
           ("e" browse-url-of-buffer   "Render Buffer With Browser")
           ("h" hydra-helm/body "Return To Helm" :color blue )
           ("<SPC>" nil "QUIT" :color blue )

);end local
);end heads
);end browse-web hydra

);end use-package engine-mode

emacs posiedon configuration browser hydra code