Skip to content

Commit

Permalink
Allow to choose the number of columns for pokemacs-restore-session
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiasdrp committed Nov 5, 2024
1 parent 8d3bd7e commit 79aa6ee
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions custom.el
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
'(magit-diff-refine-hunk 'all)
'(org-export-backends '(ascii html icalendar latex md odt pandoc))
'(package-selected-packages nil)
'(pokemacs-columns 3)
'(pokemacs-dict "en-GB")
'(pokemacs-mono-font "Fira Code" t)
'(pokemacs-repeat-timeout 0.5)
Expand Down
11 changes: 11 additions & 0 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,17 @@
:group 'pokemacs
:tag "Appearance")

(defcustom pokemacs-columns 3
"Number of columns for pokemacs-restore-session
The n-1 first columns are unlocked vertical columns
The last one is split in three locked horizontal windows:
- magit
- compilation
- lsp"
:group 'pokemacs-appearance
:type 'int
:tag " Layout")

(defcustom pokemacs-mono-font "Fira Code"
"Mono font."
:group 'pokemacs-appearance
Expand Down
11 changes: 11 additions & 0 deletions init.org
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,17 @@ This is a list of custom variables that allow to enable/disable features. If you
:group 'pokemacs
:tag "Appearance")

(defcustom pokemacs-columns 3
"Number of columns for pokemacs-restore-session
The n-1 first columns are unlocked vertical columns
The last one is split in three locked horizontal windows:
- magit
- compilation
- lsp"
:group 'pokemacs-appearance
:type 'int
:tag " Layout")

(defcustom pokemacs-mono-font "Fira Code"
"Mono font."
:group 'pokemacs-appearance
Expand Down
4 changes: 4 additions & 0 deletions lisp/pokemacs-functions.el
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ DOCSTRING and BODY are as in `defun'.
(interactive)
(visual-fill-column-mode -1)
(setq middle-window (split-window-right))
(dotimes (_ (- pokemacs-columns 3))
(select-window middle-window)
(setq middle-window (split-window-right))
(balance-windows))
(select-window middle-window)
;; Third window, start with magit
(setq magit-window (split-window-right))
Expand Down

0 comments on commit 79aa6ee

Please sign in to comment.