 (if (package-installed-p 'smex)
     (ng/set-keys "M-x" smex))
 
-(when (package-installed-p 'projectile)  
+(when (package-installed-p 'projectile)
   (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
   (ng/set-keys "C-," projectile-find-file))
   

    (global-set-key (eval `(kbd ,key)) function)))

(ng/set-keys
 "C-a"       ng/home
 "M-m"       ng/home
 "<home>"    ng/home
 "C-e"       ng/end
 "<end>"     ng/end
 "C-m"       newline-and-indent
 "C-k"       ng/C-k
 "C-w"       ng/C-w
 "C-x C-b"   ibuffer
 "M-n"       cua-scroll-up
 "M-p"       cua-scroll-down
 "C-x C-k"   ng/kill-other-buffer-and-window
 "C-x k"     ng/kill-this-buffer-and-window
 "<C-tab>"   next-buffer
 "<C-S-tab>" previous-buffer
 "C-;"       comment-line
 "C-c C-c"   ng/done
 )

(if (package-installed-p 'expand-region)
    (ng/set-keys

    (save-excursion
      (back-to-indentation)
      (= old-column (current-column)))))

(defun ng/rectangle-mark-down (&optional arg)
  (interactive "p")          
  (unless cua--rectangle (cua-set-rectangle-mark))
  (cua-resize-rectangle-down arg))
                             
(defun ng/rectangle-mark-up (&optional arg)
  (interactive "p")          
  (unless rectangle (cua-set-rectangle-mark))
  (cua-resize-rectangle-up arg))

(defun ng/rectangle-mark-left (&optional arg)
  (interactive "p")
  (unless cua--rectangle (cua-set-rectangle-mark))
  (cua-resize-rectangle-left arg))

(defun ng/rectangle-mark-right (&optional arg)
  (interactive "p")
  (unless cua--rectangle (cua-set-rectangle-mark))
  (cua-resize-rectangle-right arg))

(defun ng/C-w (&optional arg)
  "If there is an active region, kill it. Otherwise, kill the
