This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+spacemacs/spacemacs-editing-visual/funcs.el
syl20bnr 0fa3658cd8 reorganize spacemacs-base distribution into +spacemacs/spacemacs-xxx
This idea is to have the spacemacs-base distribution only configure defaults for
built-in packages. Those buit-in packages are now configured in the new layer
spacemacs-defaults.
Additionally some other packages of spacemacs-base have been dispatched to
better suiting spacemacs layers.

Projectile has been moved to the new layer spacemacs-project

- Move the following packages to bootsrap distributio layer:
  - exec-path-from-shell
  - evil-evilified-state
  - holy-mode
  - hybrid-mode
  - spacemacs-theme
- ace-window has been moved to spacemacs-navigation
- centered-buffer-mode has been moved to spacemacs-editing-visual
- pcre2el has been moved to spacemacs-editing
- evil-escape and evil-visualstar have been moved to spacemacs-evil
2018-03-04 20:54:54 -05:00

41 lines
1.4 KiB
EmacsLisp

;;; funcs.el --- Spacemacs Editing Visual Layer functions File
;;
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defun spacemacs/toggle-centered-buffer-mode ()
"Toggle `spacemacs-centered-buffer-mode'."
(interactive)
(when (require 'centered-buffer-mode nil t)
(call-interactively 'spacemacs-centered-buffer-mode)))
(defun spacemacs/toggle-centered-buffer-mode-frame ()
"Open current buffer in the new frame centered and without mode-line."
(interactive)
(when (require 'centered-buffer-mode nil t)
(switch-to-buffer-other-frame (current-buffer) t)
(toggle-frame-fullscreen)
(run-with-idle-timer
;; FIXME: We need this delay to make sure that the
;; `toggle-frame-fullscreen' fully "finished"
;; it will be better to use something more reliable
;; instead :)
1
nil
(lambda ()
(call-interactively 'spacemacs-centered-buffer-mode)
(setq mode-line-format nil)))))
(defun spacemacs/centered-buffer-mode-full-width ()
"Center buffer in the frame."
;; FIXME Needs new key-binding.
(interactive)
(when (require 'centered-buffer-mode nil t)
(spacemacs/maximize-horizontally)
(call-interactively 'spacemacs-centered-buffer-mode)))