 ;; acceptable line length
 (setq-default fill-column 80)
 
+;; don't permanently delete files
+(setq delete-by-moving-to-trash t)
+
 ;; set macOS modifier keys
-;; command is switched with control
 (when (eq system-type 'darwin)
+  ;; command is switched with control
   (setq mac-right-option-modifier 'meta
 	mac-right-command-modifier 'control
 	mac-command-modifier 'control
-	mac-control-modifier 'super))
+	mac-control-modifier 'super)
+  ;; prevent accidental press
+  (global-unset-key (kbd "s-g")))
+
+;; point dired to correct ls binary on macOS
+(when (eq system-type 'darwin)
+  (setq dired-use-ls-dired t
+        insert-directory-program "/usr/local/bin/gls"
+        dired-listing-switches "-aBhl --group-directories-first"))
 
 ;; neuter annoying escape key
 (define-key key-translation-map (kbd "ESC") (kbd "C-g"))
 
 ;; replaces unnecessary suspend command
 (global-set-key (kbd "C-z") #'zap-up-to-char)
+
 ;; ibuffer for listing buffers
 (global-set-key (kbd "C-x C-b") #'ibuffer)
+
 ;; Edit emacs directory
 (defun t/edit-emacs-dir ()
   "Edit file from Emacs configuration directory."
   (interactive)
   (counsel-find-file user-emacs-directory))
 (global-set-key (kbd "C-c f p") #'t/edit-emacs-dir)
+
 ;; Open scratch buffer
 (defun t/open-scratch ()
   (interactive)
   (pop-to-buffer "*scratch*"))
 (global-set-key (kbd "C-c x") #'t/open-scratch)
+
 ;; Toggles
 (global-set-key (kbd "C-c t l") #'display-line-numbers-mode)
 (global-set-key (kbd "C-c t f") #'toggle-frame-fullscreen)

  ;; prefer right side, then bottom for popup
  (which-key-setup-side-window-right-bottom))

;; replace annoying splits with popups
(use-package popwin
  :straight t
  :config
  (popwin-mode 1)
  (push '(helpful-mode :height 20 :stick t)
	popwin:special-display-config)
  (push '(vterm-mode :height 20
		     :stick t
		     :dedicated t)
	popwin:special-display-config))


;; Completion

;; enhanced C-h help system
(use-package helpful
  :straight t
  :bind ("C-h k" . #'helpful-key)
  :init
  (setq counsel-describe-function-function #'helpful-callable
	counsel-describe-variable-function #'helpful-variable))


;; Navigation/Editing
