 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Frame title bar format
-;; If buffer-file-name exists, show it;
-;; else if you are in dired mode, show the directory name
-;; else show only the buffer name (*scratch*, *Messages*, etc)
-;; Append the value of PRJ_NAME env var to the above.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(setq frame-title-format
-      (list '(buffer-file-name "%f"
-                               (dired-directory dired-directory "%b"))
-            " [" (getenv "PRJ_NAME") "]"))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Presentation mode
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (setq presentation-mode-enabled nil)

;; Time-stamp: <2014-07-11 17:29:40 kmodi>

;; Set up the looks of emacs


  (interactive "r")
  (ansi-color-apply-on-region beg end))

;; Show long lines
;; Source: http://stackoverflow.com/questions/6344474/how-can-i-make-emacs-highlight-lines-that-go-over-80-chars
(require 'whitespace)
(defun modi/show-long-lines()
  (interactive)
  (hi-lock-mode -1) ;; reset hi-lock mode
  (highlight-lines-matching-regexp (concat ".\\{"
                                           (number-to-string (+ 1 whitespace-line-column))
                                           "\\}") "hi-yellow"))

;; Key bindings
(global-unset-key (kbd "<C-down-mouse-1>")) ;; it is bound to `mouse-buffer-menu'
;; by default. It is inconvenient when that mouse menu pops up when I don't need
;; it to. And actually I have never used that menu :P
(bind-keys
 :map modi-mode-map
 ("<f2>"        . menu-bar-mode)
 ;; F8 key can't be used as it launches the VNC menu
 ;; It can though be used with shift/ctrl/alt keys
 ("<S-f8>"      . toggle-presentation-mode)
 ;; Make Control+mousewheel do increase/decrease font-size
 ;; Source: http://ergoemacs.org/emacs/emacs_mouse_wheel_config.html
 ("<C-mouse-1>" . font-size-reset) ;; C + left mouse click
 ("<C-mouse-4>" . font-size-incr) ;; C + wheel-up
 ("<C-mouse-5>" . font-size-decr) ;; C + wheel-down
 ("C-x C-0"     . font-size-reset)
 ("C-x +"       . font-size-incr)
 ("C-x -"       . font-size-decr)
 ("C-x t"       . toggle-truncate-lines))

(key-chord-define-global "2w" 'menu-bar-mode) ;; alternative to F2
(key-chord-define-global "8i" 'toggle-presentation-mode) ;; alternative to S-F8

(bind-to-modi-map "L" modi/show-long-lines)


(provide 'setup-visual)
