Compare commits
105 Commits
gerrit-pac
...
warn-key-r
Author | SHA1 | Date | |
---|---|---|---|
4e666d5c6b | |||
4ea052b970 | |||
5a8be149cb | |||
6829120d10 | |||
a80b9348cc | |||
822260dad0 | |||
954881e661 | |||
6ee76de7db | |||
a83ff1f572 | |||
2403128ced | |||
d45149db80 | |||
5e6aae007d | |||
b48f918bdd | |||
ab56d6f449 | |||
33e05c054a | |||
ef42a03d3a | |||
e0e2fd262e | |||
e8db11375f | |||
a24bf7d6ef | |||
1dfb6091a0 | |||
717c1acc34 | |||
4a114c7fc3 | |||
441513584a | |||
d536a23ee2 | |||
9fb5a2c3a1 | |||
99645d8634 | |||
3ef1fa40d2 | |||
ac28c27f0f | |||
0ee44cc580 | |||
30ec3aad97 | |||
2dd0f9edf2 | |||
696904aa8e | |||
7309e9e740 | |||
7b059751b5 | |||
d76643ae93 | |||
fa68c7ce00 | |||
ccdc042a89 | |||
50d518a906 | |||
7b47c9b24b | |||
a332592a17 | |||
540eccc8a5 | |||
2c21f86070 | |||
c720e948f7 | |||
6b170ac52f | |||
4b582382fd | |||
613d2c63ea | |||
50bfccd7a8 | |||
a7ce541859 | |||
b71866dfd6 | |||
bfbf069997 | |||
fdfac65961 | |||
a40477411d | |||
ae47b2b574 | |||
031e5fe6c0 | |||
92eadd3fe2 | |||
c927f77126 | |||
1e02b702c8 | |||
79c8dc6072 | |||
555c27b4cc | |||
dcc9a63cb0 | |||
cbb8555ac5 | |||
bfe6318062 | |||
2427e2818a | |||
699fd49140 | |||
6d9c415f40 | |||
3becd42968 | |||
8705d8d985 | |||
5c45f8e199 | |||
702c873d51 | |||
7840503da6 | |||
c902a22bcf | |||
ceb06977a4 | |||
111a4b01d8 | |||
2ad00f4e4d | |||
41c49b79ca | |||
|
20389b6617 | ||
|
bf639efa20 | ||
|
2af3dade16 | ||
5d76b50e89 | |||
4c677c3679 | |||
|
0cee2a7afd | ||
|
fff167d497 | ||
406266c670 | |||
6cdddf1e48 | |||
|
adc1ddc852 | ||
110f573820 | |||
57b63b0612 | |||
3cc7226461 | |||
a717e9ace1 | |||
405a1be44a | |||
3d02b61550 | |||
217f16cf9d | |||
|
deecd0eb5b | ||
|
3364cdd580 | ||
|
245e01ebad | ||
|
16efffafef | ||
|
c90582bb3b | ||
|
197f79c822 | ||
|
753e165d88 | ||
|
df2edfb7c8 | ||
|
cd2dd7b629 | ||
e8113bf04b | |||
1e8ef17788 | |||
b15cda6dc8 | |||
|
15d81e221b |
2
.achievements
Normal file
2
.achievements
Normal file
File diff suppressed because one or more lines are too long
2
.gitignore
vendored
2
.gitignore
vendored
@@ -15,6 +15,8 @@
|
||||
/url/
|
||||
/hgs-cache
|
||||
/smex-items
|
||||
/var/
|
||||
/anaconda-mode/
|
||||
# All hail use-package!
|
||||
/elpa/
|
||||
|
||||
|
11
.mc-lists.el
11
.mc-lists.el
@@ -3,17 +3,23 @@
|
||||
|
||||
(setq mc/cmds-to-run-for-all
|
||||
'(
|
||||
avy-goto-char
|
||||
c-electric-brace
|
||||
c-electric-semi&comma
|
||||
c-indent-line-or-region
|
||||
electric-newline-and-maybe-indent
|
||||
gpolonkai/move-to-beginning-of-line
|
||||
gpolonkai/move-to-end-of-line
|
||||
hungry-delete-backward
|
||||
hungry-delete-forward
|
||||
indent-for-tab-command
|
||||
kill-region
|
||||
org-cycle
|
||||
org-end-of-line
|
||||
org-kill-line
|
||||
org-return
|
||||
org-self-insert-command
|
||||
org-space-key
|
||||
sp-backward-delete-char
|
||||
sp-backward-kill-word
|
||||
sp-delete-char
|
||||
@@ -21,6 +27,11 @@
|
||||
|
||||
(setq mc/cmds-to-run-once
|
||||
'(
|
||||
ace-jump-move
|
||||
ace-mc-add-char
|
||||
ace-mc-add-multiple-cursors
|
||||
ace-mc-add-single-cursor
|
||||
ace-mc-do-keyboard-reset
|
||||
drag-stuff-right
|
||||
end-of-buffer
|
||||
helm-M-x
|
||||
|
155
customizations.el
Normal file
155
customizations.el
Normal file
@@ -0,0 +1,155 @@
|
||||
(custom-set-variables
|
||||
;; custom-set-variables was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(background-color "#7f7f7f")
|
||||
'(background-mode dark)
|
||||
'(blink-cursor-mode t)
|
||||
'(column-number-mode t)
|
||||
'(cursor-color "#5c5cff")
|
||||
'(cursor-type (quote bar))
|
||||
'(custom-enabled-themes (quote (tango-dark)))
|
||||
'(custom-file (concat user-emacs-directory "customizations.el"))
|
||||
'(custom-safe-themes
|
||||
(quote
|
||||
("3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa" "a27c00821ccfd5a78b01e4f35dc056706dd9ede09a8b90c6955ae6a390eb1c1e" default)))
|
||||
'(echo-keystrokes 0.1)
|
||||
'(fill-column 76)
|
||||
'(foreground-color "#5c5cff")
|
||||
'(indent-tabs-mode nil)
|
||||
'(indicate-empty-lines t)
|
||||
'(inhibit-startup-echo-area-message (user-login-name))
|
||||
'(inhibit-startup-screen t)
|
||||
'(initial-scratch-message nil)
|
||||
'(package-selected-packages
|
||||
(quote
|
||||
(ace-mc
|
||||
ace-popup-menu
|
||||
ace-window
|
||||
achievements
|
||||
ag
|
||||
alert
|
||||
anaconda-mode
|
||||
anzu
|
||||
auto-highlight-symbol
|
||||
auto-package-update
|
||||
auto-virtualenv
|
||||
avy
|
||||
beacon
|
||||
bind-key
|
||||
cheatsheet
|
||||
coffee-mode
|
||||
command-log-mode
|
||||
company
|
||||
company-anaconda
|
||||
company-c-headers
|
||||
company-emoji
|
||||
company-restclient
|
||||
company-shell
|
||||
diminish
|
||||
dired-k
|
||||
drag-stuff
|
||||
electric-case
|
||||
electric-spacing
|
||||
emamux
|
||||
eshell-fringe-status
|
||||
eshell-prompt-extras
|
||||
expand-region
|
||||
fill-column-indicator
|
||||
flycheck
|
||||
flycheck-pkg-config
|
||||
flymake-python-pyflakes
|
||||
focus
|
||||
form-feed
|
||||
ggtags
|
||||
git-gutter-fringe
|
||||
git-messenger
|
||||
git-timemachine
|
||||
gitconfig-mode
|
||||
gitignore-mode
|
||||
gitlab
|
||||
gnugo
|
||||
gobgen
|
||||
google
|
||||
goto-last-change
|
||||
helm
|
||||
helm-ag
|
||||
helm-c-yasnippet
|
||||
helm-chrome
|
||||
helm-company
|
||||
helm-descbinds
|
||||
helm-describe-modes
|
||||
helm-flycheck
|
||||
helm-flyspell
|
||||
helm-github-stars
|
||||
helm-google
|
||||
helm-gtags
|
||||
helm-hunks
|
||||
helm-projectile
|
||||
helm-pydoc
|
||||
helm-smex
|
||||
helm-swoop
|
||||
helm-unicode
|
||||
highlight-indent-guides
|
||||
hl-todo
|
||||
hungarian-holidays
|
||||
hungry-delete
|
||||
hyde
|
||||
id-manager
|
||||
identica-mode
|
||||
jinja2-mode
|
||||
js2-mode
|
||||
json-mode
|
||||
kanban
|
||||
magit
|
||||
magit-gerrit
|
||||
magithub
|
||||
markdown-mode
|
||||
mc-extras
|
||||
multiple-cursors
|
||||
ng2-mode
|
||||
nyan-mode
|
||||
nyan-prompt
|
||||
org
|
||||
org-bullets
|
||||
org-jekyll
|
||||
org-projectile
|
||||
org-random-todo
|
||||
org-rtm
|
||||
origami
|
||||
plantuml-mode
|
||||
projectile
|
||||
rainbow-delimiters
|
||||
rainbow-mode
|
||||
restclient
|
||||
restclient-helm
|
||||
sass-mode
|
||||
smart-mode-line
|
||||
smart-mode-line-powerline-theme
|
||||
smartparens
|
||||
spinner
|
||||
sx
|
||||
typescript-mode
|
||||
use-package
|
||||
vala-mode
|
||||
vala-snippets
|
||||
wakatime-mode
|
||||
xlicense
|
||||
yaml-mode
|
||||
yasnippet
|
||||
zone-nyan
|
||||
zygospore)))
|
||||
'(sgml-basic-offset 4)
|
||||
'(show-trailing-whitespace t)
|
||||
'(tab-width 4))
|
||||
(custom-set-faces
|
||||
;; custom-set-faces was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(default ((t (:family "Hack" :foundry "simp" :slant normal :weight normal :height 98 :width normal))))
|
||||
'(aw-leading-char-face ((t (:inherit ace-jump-face-foreground :height 2.0))))
|
||||
'(hl-line ((t (:inherit nil :background "gray25"))))
|
||||
'(trailing-whitespace ((t (:inherit nil :background "red1"))))
|
||||
'(whitespace-line ((t (:inherit nil :background "orange4")))))
|
2668
fortune-cookies.txt
Normal file
2668
fortune-cookies.txt
Normal file
File diff suppressed because it is too large
Load Diff
564
init.el
564
init.el
@@ -1,12 +1,17 @@
|
||||
(setq custom-file (concat user-emacs-directory "customizations.el"))
|
||||
(load custom-file)
|
||||
|
||||
;; Initialize the package system and use-package
|
||||
(setq load-prefer-newer t)
|
||||
(require 'package)
|
||||
(add-to-list 'package-archives
|
||||
'("gnu" . "http://elpa.gnu.org/packages/"))
|
||||
(add-to-list 'package-archives
|
||||
'("melpa" . "https://melpa.org/packages/"))
|
||||
'("melpa-stable" . "https://stable.melpa.org/packages/") t)
|
||||
(add-to-list 'package-archives
|
||||
'("marmalade" . "http://marmalade-repo.org/packages/"))
|
||||
'("melpa" . "https://melpa.org/packages/") t)
|
||||
(add-to-list 'package-archives
|
||||
'("marmalade" . "http://marmalade-repo.org/packages/") t)
|
||||
(package-initialize)
|
||||
|
||||
(unless (package-installed-p 'use-package)
|
||||
@@ -15,6 +20,8 @@
|
||||
|
||||
;; Set up my personal keymap early so I can use it in use-package
|
||||
;; calls
|
||||
(defvar gpolonkai/pers-map (make-sparse-keymap)
|
||||
"My own, personal, keymap!")
|
||||
(define-prefix-command 'gpolonkai/pers-map)
|
||||
(define-key ctl-x-map "t" 'gpolonkai/pers-map)
|
||||
|
||||
@@ -23,142 +30,23 @@
|
||||
user-emacs-directory
|
||||
(convert-standard-filename "lisp/")))
|
||||
|
||||
;; Custom stuff
|
||||
(custom-set-variables
|
||||
;; custom-set-variables was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(background-color "#7f7f7f")
|
||||
'(background-mode dark)
|
||||
'(blink-cursor-mode t)
|
||||
'(column-number-mode t)
|
||||
'(cursor-color "#5c5cff")
|
||||
'(cursor-type (quote bar))
|
||||
'(custom-enabled-themes (quote (tango-dark)))
|
||||
'(custom-safe-themes
|
||||
(quote
|
||||
("84d2f9eeb3f82d619ca4bfffe5f157282f4779732f48a5ac1484d94d5ff5b279"
|
||||
"c74e83f8aa4c78a121b52146eadb792c9facc5b1f02c917e3dbb454fca931223"
|
||||
"3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa"
|
||||
"a27c00821ccfd5a78b01e4f35dc056706dd9ede09a8b90c6955ae6a390eb1c1e"
|
||||
"1e7e097ec8cb1f8c3a912d7e1e0331caeed49fef6cff220be63bd2a6ba4cc365"
|
||||
"fc5fcb6f1f1c1bc01305694c59a1a861b008c534cae8d0e48e4d5e81ad718bc6"
|
||||
default)))
|
||||
'(echo-keystrokes 0.1)
|
||||
'(foreground-color "#5c5cff")
|
||||
'(indent-tabs-mode nil)
|
||||
'(indicate-empty-lines t)
|
||||
'(inhibit-startup-echo-area-message (user-login-name))
|
||||
'(inhibit-startup-screen t)
|
||||
'(initial-scratch-message nil)
|
||||
'(package-selected-packages
|
||||
(quote
|
||||
(ace-window
|
||||
ag
|
||||
alert
|
||||
avy
|
||||
beacon
|
||||
cheatsheet
|
||||
coffee-mode
|
||||
command-log-mode
|
||||
company
|
||||
company-c-headers
|
||||
company-emoji
|
||||
company-restclient
|
||||
company-shell
|
||||
diminish
|
||||
drag-stuff
|
||||
electric-case
|
||||
electric-spacing
|
||||
emamux
|
||||
flycheck
|
||||
flycheck-pkg-config
|
||||
focus
|
||||
ggtags
|
||||
git-gutter
|
||||
git-messenger
|
||||
git-timemachine
|
||||
gitconfig-mode
|
||||
gitignore-mode
|
||||
gnugo
|
||||
gobgen
|
||||
google
|
||||
goto-last-change
|
||||
helm
|
||||
helm-ag
|
||||
helm-chrome
|
||||
helm-company
|
||||
helm-descbinds
|
||||
helm-describe-modes
|
||||
helm-flycheck
|
||||
helm-flyspell
|
||||
helm-github-stars
|
||||
helm-google
|
||||
helm-gtags
|
||||
helm-projectile
|
||||
helm-smex
|
||||
helm-swoop
|
||||
helm-unicode
|
||||
hungarian-holidays
|
||||
hungry-delete
|
||||
hyde
|
||||
id-manager
|
||||
identica-mode
|
||||
jinja2-mode
|
||||
js2-mode
|
||||
json-mode
|
||||
magit
|
||||
magit-gerrit
|
||||
magithub
|
||||
markdown-mode
|
||||
mc-extras
|
||||
multiple-cursors
|
||||
ng2-mode
|
||||
nyan-mode
|
||||
nyan-prompt
|
||||
org
|
||||
org-bullets
|
||||
org-jekyll
|
||||
org-projectile
|
||||
org-random-todo
|
||||
org-rtm
|
||||
origami
|
||||
plantuml-mode
|
||||
projectile
|
||||
rainbow-delimiters
|
||||
rainbow-mode
|
||||
restclient
|
||||
restclient-helm
|
||||
sass-mode
|
||||
smart-mode-line
|
||||
smart-mode-line-powerline-theme
|
||||
smartparens
|
||||
spinner
|
||||
sx
|
||||
typescript-mode
|
||||
use-package
|
||||
vala-mode
|
||||
vala-snippets
|
||||
wakatime-mode
|
||||
xlicense
|
||||
yaml-mode
|
||||
yasnippet
|
||||
zone-nyan)))
|
||||
'(sgml-basic-offset 4)
|
||||
'(show-trailing-whitespace t)
|
||||
'(tab-width 4))
|
||||
;; Load my own functions
|
||||
(load "gnu-c-header")
|
||||
(load "round-number-to-decimals")
|
||||
(load "zim")
|
||||
(load "enclose-string")
|
||||
(load "buf-manipulation")
|
||||
(load "text-manip")
|
||||
(load "frame-manip")
|
||||
(load "file-manip")
|
||||
(load "window-manip")
|
||||
(load "gpolonkai-misc")
|
||||
|
||||
(advice-add 'define-key :before #'warn-key-rebind)
|
||||
|
||||
;; Define aliases
|
||||
(defalias 'yes-or-no-p 'y-or-n-p)
|
||||
|
||||
;; Custom face settings
|
||||
(custom-set-faces
|
||||
;; custom-set-faces was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(aw-leading-char-face ((t (:inherit ace-jump-face-foreground :height 3.0))))
|
||||
'(hl-line ((t (:inherit nil :background "gray25"))))
|
||||
'(trailing-whitespace ((t (:inherit nil :background "red1"))))
|
||||
'(whitespace-line ((t (:inherit nil :background "orange")))))
|
||||
(set-face-attribute 'default t :font "Hack-10")
|
||||
(set-frame-font "Hack-10" nil t)
|
||||
|
||||
@@ -168,6 +56,8 @@
|
||||
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
|
||||
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
|
||||
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
|
||||
;; Maximize the frame
|
||||
(set-frame-parameter nil 'fullscreen 'maximized)
|
||||
|
||||
;; Some personal stuff
|
||||
(setq user-mail-address "gergely@polonkai.eu")
|
||||
@@ -186,8 +76,9 @@
|
||||
(helm-mode t)
|
||||
:bind
|
||||
(("M-x" . helm-M-x)
|
||||
("C-x C-f" . helm-find-files)
|
||||
("C-x b" . helm-mini)))
|
||||
:map ctl-x-map
|
||||
("C-f" . helm-find-files)
|
||||
("b" . helm-mini)))
|
||||
|
||||
(use-package helm-swoop
|
||||
:ensure t
|
||||
@@ -281,15 +172,28 @@
|
||||
(add-hook 'eshell-load-hook 'nyan-prompt-enable)))
|
||||
|
||||
;; Zone!
|
||||
(use-package zone-nyan
|
||||
:ensure t
|
||||
:init
|
||||
(setq zone-programs [zone-nyan])
|
||||
(setq-default zone-nyan-hide-progress t))
|
||||
(when (display-graphic-p)
|
||||
(use-package zone-nyan
|
||||
:ensure t
|
||||
:after
|
||||
zone
|
||||
:config
|
||||
(setq-default zone-nyan-hide-progress t)
|
||||
(setq zone-programs (vconcat zone-programs [zone-nyan]))))
|
||||
|
||||
(defun gpolonkai/zone-enable ()
|
||||
(interactive)
|
||||
(zone-when-idle 60)
|
||||
(message "I will zone out after idling for 60 seconds."))
|
||||
|
||||
(use-package zone
|
||||
:demand
|
||||
:config
|
||||
(zone-when-idle 60))
|
||||
(zone-when-idle 60)
|
||||
:bind
|
||||
(:map gpolonkai/pers-map
|
||||
("zi" . gpolonkai/zone-enable)
|
||||
("zq" . zone-leave-me-alone)))
|
||||
|
||||
;; Magit and friends
|
||||
(use-package magit
|
||||
@@ -298,7 +202,8 @@
|
||||
(setq magit-auto-revert-mode nil)
|
||||
(setq magit-last-seen-setup-instructions "1.4.0")
|
||||
:bind
|
||||
(("C-x g" . magit-status)))
|
||||
(:map ctl-x-map
|
||||
("g" . magit-status)))
|
||||
|
||||
(use-package magithub
|
||||
:ensure t)
|
||||
@@ -313,7 +218,7 @@
|
||||
:demand
|
||||
:config
|
||||
(define-prefix-command 'origami-mode-map)
|
||||
(global-set-key (kbd "C-x C-z") 'origami-mode-map)
|
||||
(define-key ctl-x-map (kbd "C-z") 'origami-mode-map)
|
||||
(global-origami-mode)
|
||||
:bind
|
||||
(:map origami-mode-map
|
||||
@@ -333,7 +238,8 @@
|
||||
(use-package helm-ag
|
||||
:ensure t
|
||||
:bind
|
||||
(("C-x M-a" . helm-do-ag)))
|
||||
(:map gpolonkai/pers-map
|
||||
("s" . helm-do-ag)))
|
||||
|
||||
(use-package smartparens
|
||||
:ensure t
|
||||
@@ -349,7 +255,22 @@
|
||||
|
||||
(use-package smart-mode-line
|
||||
:ensure t
|
||||
:after
|
||||
org
|
||||
:config
|
||||
(add-to-list 'sml/replacer-regexp-list
|
||||
'("^~/Projects/" ":Proj:")
|
||||
t)
|
||||
(add-to-list 'sml/replacer-regexp-list
|
||||
'("^~/Projektek/" ":Proj:")
|
||||
t)
|
||||
(add-to-list 'sml/replacer-regexp-list
|
||||
(list (concat "^" (regexp-quote user-documents-directory))
|
||||
":Doc:")
|
||||
t)
|
||||
(add-to-list 'sml/replacer-regexp-list
|
||||
'("^:Proj:jekyll/gergelypolonkai.github.io/" ":Blog:")
|
||||
t)
|
||||
(sml/setup))
|
||||
|
||||
(use-package company
|
||||
@@ -386,10 +307,19 @@
|
||||
(drag-stuff-global-mode t))
|
||||
|
||||
;; Git gutter
|
||||
(use-package git-gutter
|
||||
:ensure t
|
||||
:config
|
||||
(global-git-gutter-mode t))
|
||||
;; If we are in text-only mode, there is no fringe.
|
||||
(let ((gitgutter-package
|
||||
(if (display-graphic-p)
|
||||
"git-gutter-fringe"
|
||||
"git-gutter")))
|
||||
(eval `(use-package ,gitgutter-package
|
||||
:ensure t
|
||||
:demand
|
||||
:config
|
||||
(global-git-gutter-mode t)
|
||||
:bind
|
||||
(:map gpolonkai/pers-map
|
||||
("gg" . git-gutter:update-all-windows)))))
|
||||
|
||||
;; Org mode
|
||||
(use-package org
|
||||
@@ -423,12 +353,28 @@
|
||||
'("p" "Blog post"
|
||||
entry (file+datetree (concat org-directory "blog.org"))
|
||||
"* %^{Title} :blog:\n :PROPERTIES:\n :on: %T\n :END:\n %i%?"))
|
||||
(add-to-list 'org-capture-templates
|
||||
'("g" "GT2 note"
|
||||
entry (file+headline (concat org-directory "gt2-notes.org")
|
||||
"Captures")
|
||||
"** %^{Title}\n :PROPERTIES:\n :on: %T\n :END:\n %i%?"))
|
||||
(setq org-time-stamp-formats '("<%Y-%m-%d>" . "<%Y-%m-%d %H:%M>"))
|
||||
(setq org-todo-keywords
|
||||
'((sequence "TODO(t)"
|
||||
"DOING(w@/!)"
|
||||
"BLOCKED(b@/!)"
|
||||
"|"
|
||||
"REVIEW(r@/!)"
|
||||
"DONE(d@/!)")))
|
||||
:bind
|
||||
(:map gpolonkai/pers-map
|
||||
("a" . org-agenda-list)
|
||||
("c" . org-capture)
|
||||
:map org-mode-map
|
||||
("SPC" . org-space-key)))
|
||||
("SPC" . org-space-key)
|
||||
("C-c l" . org-toggle-link-display)
|
||||
("C-a" . gpolonkai/move-to-beginning-of-line)
|
||||
("C-e" . gpolonkai/move-to-end-of-line)))
|
||||
|
||||
(use-package org-bullets
|
||||
:ensure t
|
||||
@@ -441,17 +387,27 @@
|
||||
(use-package wakatime-mode
|
||||
:ensure t
|
||||
:init
|
||||
(setq-default wakatime-cli-path "/usr/local/bin/wakatime")
|
||||
(setq-default wakatime-cli-path "/usr/bin/wakatime")
|
||||
:config
|
||||
(global-wakatime-mode t))
|
||||
|
||||
(use-package ace-window
|
||||
:ensure t
|
||||
:init
|
||||
(setq aw-keys '(?a ?o ?e ?u ?i ?d ?h ?t ?n)
|
||||
aw-background nil)
|
||||
:config
|
||||
(setq aw-background nil
|
||||
aw-dispatch-always t)
|
||||
(add-to-list 'aw-dispatch-alist
|
||||
'(?s gpolonkai/scroll-window-up " Scroll window up")
|
||||
t)
|
||||
(add-to-list 'aw-dispatch-alist
|
||||
'(?S gpolonkai/scroll-window-down " Scroll window down")
|
||||
t)
|
||||
(add-to-list 'aw-dispatch-alist
|
||||
'(?q gpolonkai/bury-window " Bury (quit) window")
|
||||
t)
|
||||
:bind
|
||||
(("M-P" . ace-window)))
|
||||
(:map ctl-x-map
|
||||
("o" . ace-window)))
|
||||
|
||||
(use-package avy
|
||||
:ensure t
|
||||
@@ -459,7 +415,7 @@
|
||||
:config
|
||||
(avy-setup-default)
|
||||
:bind
|
||||
(("C-:" . avy-goto-char)
|
||||
(("M-g c" . avy-goto-char)
|
||||
("C-'" . avy-goto-char-2)
|
||||
("M-g f" . avy-goto-line)
|
||||
("M-g w" . avy-goto-word-1)
|
||||
@@ -489,12 +445,12 @@
|
||||
(use-package electric-case
|
||||
:ensure t
|
||||
:config
|
||||
(add-hook 'c-mode-hook ''electric-case-c-init))
|
||||
(add-hook 'c-mode-hook 'electric-case-c-init))
|
||||
|
||||
(use-package electric-spacing
|
||||
:ensure t
|
||||
:bind
|
||||
(([f7] . electric-spacing-mode)))
|
||||
:config
|
||||
(add-hook 'c-mode-common-hook 'electric-spacing-mode))
|
||||
|
||||
(use-package emamux
|
||||
:ensure t)
|
||||
@@ -506,7 +462,10 @@
|
||||
:ensure t)
|
||||
|
||||
(use-package git-messenger
|
||||
:ensure t)
|
||||
:ensure t
|
||||
:bind
|
||||
(:map gpolonkai/pers-map
|
||||
("gm" . git-messenger:popup-message)))
|
||||
|
||||
(use-package git-timemachine
|
||||
:ensure t
|
||||
@@ -570,7 +529,10 @@
|
||||
:ensure t)
|
||||
|
||||
(use-package markdown-mode
|
||||
:ensure t)
|
||||
:ensure t
|
||||
:config
|
||||
(push '("\\.markdown\\'" . markdown-mode) auto-mode-alist)
|
||||
(push '("\\.md\\'" . markdown-mode) auto-mode-alist))
|
||||
|
||||
(use-package mc-extras
|
||||
:ensure t)
|
||||
@@ -619,7 +581,7 @@
|
||||
(use-package helm-smex
|
||||
:ensure t
|
||||
:bind
|
||||
(("M-X" . helm-smex)))
|
||||
(("M-S-x" . helm-smex)))
|
||||
|
||||
(use-package ediff
|
||||
:ensure t
|
||||
@@ -648,9 +610,13 @@
|
||||
|
||||
(use-package org-random-todo
|
||||
:ensure t
|
||||
:demand
|
||||
:config
|
||||
;; Don’t bug me too often…
|
||||
(setq org-random-todo-how-often 3600))
|
||||
(setq org-random-todo-how-often 3600)
|
||||
:bind
|
||||
(:map gpolonkai/pers-map
|
||||
("r" . org-random-todo)))
|
||||
|
||||
(use-package calendar
|
||||
:init
|
||||
@@ -774,7 +740,7 @@
|
||||
(use-package cheatsheet
|
||||
:ensure t)
|
||||
|
||||
(use-package nxml
|
||||
(use-package nxml-mode
|
||||
:config
|
||||
(setq nxml-attribute-indent 4
|
||||
nxml-child-indent 2
|
||||
@@ -810,26 +776,165 @@
|
||||
(add-hook 'after-make-frame-functions
|
||||
'--set-emoji-font))
|
||||
|
||||
;; Load my own functions
|
||||
(load "gnu-c-header.el")
|
||||
(load "toggle-window-split.el")
|
||||
(load "round-number-to-decimals.el")
|
||||
(load "transpose-windows.el")
|
||||
(load "zim.el")
|
||||
(load "clearcase.el")
|
||||
(load "enclose-string.el")
|
||||
(load "buf-manipulation.el")
|
||||
(load "package-manip")
|
||||
(load "text-manip")
|
||||
(load "frame-manip")
|
||||
(use-package zygospore
|
||||
:ensure t
|
||||
:bind
|
||||
(:map ctl-x-map
|
||||
("1" . zygospore-toggle-delete-other-windows)))
|
||||
|
||||
;; Define aliases
|
||||
(defalias 'yes-or-no-p 'y-or-n-p)
|
||||
(use-package webjump
|
||||
:bind
|
||||
(:map gpolonkai/pers-map
|
||||
("j" . webjump)))
|
||||
|
||||
(use-package which-func
|
||||
:config
|
||||
(add-hook 'prog-mode-hook
|
||||
(lambda ()
|
||||
(which-func-mode)))
|
||||
(setq which-func-unknown "∅"))
|
||||
|
||||
(use-package ace-popup-menu
|
||||
:ensure t
|
||||
:config
|
||||
(ace-popup-menu-mode 1))
|
||||
|
||||
(use-package bind-key
|
||||
:ensure t)
|
||||
|
||||
(use-package kanban
|
||||
:ensure t)
|
||||
|
||||
(use-package achievements
|
||||
:ensure t
|
||||
:config
|
||||
(achievements-mode 1))
|
||||
|
||||
(use-package auto-highlight-symbol
|
||||
:ensure t
|
||||
:config
|
||||
(global-auto-highlight-symbol-mode t))
|
||||
|
||||
(use-package auto-package-update
|
||||
:ensure t
|
||||
:config
|
||||
(setq auto-package-update-interval 7
|
||||
auto-package-update-delete-old-versions t))
|
||||
|
||||
(use-package cookie1
|
||||
:demand t
|
||||
:config
|
||||
(setq cookie-file (concat user-emacs-directory "fortune-cookies.txt"))
|
||||
:bind
|
||||
(:map gpolonkai/pers-map
|
||||
("k" . cookie)))
|
||||
|
||||
(use-package ace-mc
|
||||
:ensure t)
|
||||
|
||||
(use-package dired-k
|
||||
:ensure t
|
||||
:bind
|
||||
(:map dired-mode-map
|
||||
("K" . dired-k)))
|
||||
|
||||
(use-package fill-column-indicator
|
||||
:ensure t
|
||||
:config
|
||||
(add-hook 'prog-mode-hook 'fci-mode))
|
||||
|
||||
(use-package form-feed
|
||||
:ensure t
|
||||
:config
|
||||
(add-hook 'emacs-lisp-mode-hook 'form-feed-mode))
|
||||
|
||||
(use-package anzu
|
||||
:ensure t
|
||||
:config
|
||||
(global-anzu-mode 1))
|
||||
|
||||
(use-package auto-virtualenv
|
||||
:ensure t
|
||||
:config
|
||||
(add-hook 'python-mode-hook 'auto-virtualenv-set-virtualenv)
|
||||
(add-hook 'projectile-after-switch-project-hook
|
||||
'auto-virtualenv-set-virtualenv))
|
||||
|
||||
(use-package flymake-python-pyflakes
|
||||
:ensure t)
|
||||
|
||||
(use-package gitlab
|
||||
:ensure t)
|
||||
|
||||
(use-package files
|
||||
:config
|
||||
(setq backup-directory-alist
|
||||
`((".*" . ,temporary-file-directory)))
|
||||
(setq auto-save-file-name-transforms
|
||||
`((".*" ,temporary-file-directory t))))
|
||||
|
||||
(use-package helm-c-yasnippet
|
||||
:ensure t
|
||||
:demand t
|
||||
:config
|
||||
(setq helm-yas-space-match-any-greedy t)
|
||||
:bind
|
||||
(("C-c y" . helm-yas-complete)))
|
||||
|
||||
(use-package helm-hunks
|
||||
:ensure t)
|
||||
|
||||
(use-package helm-pydoc
|
||||
:ensure t)
|
||||
|
||||
(use-package hl-todo
|
||||
:ensure t)
|
||||
|
||||
(use-package glasses
|
||||
:ensure t
|
||||
:config
|
||||
(add-hook 'prog-mode-hook 'glasses-mode))
|
||||
|
||||
(when (display-graphic-p)
|
||||
(use-package eshell-fringe-status
|
||||
:ensure t
|
||||
:config
|
||||
(add-hook 'eshell-mode-hook 'eshell-fringe-status-mode)))
|
||||
|
||||
(use-package eshell-prompt-extras
|
||||
:ensure t
|
||||
:config
|
||||
(with-eval-after-load "esh-opt"
|
||||
(autoload 'epe-theme-lambda "eshell-prompt-extras")
|
||||
(setq eshell-highlight-prompt nil
|
||||
eshell-prompt-function 'epe-theme-lambda)))
|
||||
|
||||
(use-package highlight-indent-guides
|
||||
:ensure t
|
||||
:config
|
||||
(add-hook 'prog-mode-hook 'highlight-indent-guides-mode)
|
||||
(setq highlight-indent-guides-method 'character))
|
||||
|
||||
(use-package expand-region
|
||||
:ensure t
|
||||
:bind
|
||||
(:map ctl-x-map
|
||||
("*" . er/expand-region)))
|
||||
|
||||
(use-package anaconda-mode
|
||||
:ensure t
|
||||
:config
|
||||
(add-hook 'python-mode-hook 'anaconda-mode)
|
||||
(add-hook 'python-mode-hook 'anaconda-eldoc-mode))
|
||||
|
||||
(use-package company-anaconda
|
||||
:ensure t
|
||||
:after
|
||||
company
|
||||
:config
|
||||
(add-to-list 'company-backends 'company-anaconda))
|
||||
|
||||
;; `c-mode' settings
|
||||
(add-hook 'c-mode-hook
|
||||
(lambda ()
|
||||
(which-func-mode)))
|
||||
(add-hook 'c-mode-common-hook
|
||||
(lambda ()
|
||||
(local-set-key (kbd "C-c o") 'ff-find-other-file)
|
||||
@@ -868,17 +973,37 @@
|
||||
(setq c-offset-alist '((member-init-intro . ++)))
|
||||
|
||||
;; Custom key bindings
|
||||
(global-set-key (kbd "C-x _") 'maximize-window)
|
||||
(global-set-key (kbd "C-c C-y") 'duplicate-line)
|
||||
(global-set-key (kbd "M-(") 'æ-enclose-region)
|
||||
(global-set-key (kbd "C-x w") 'webjump)
|
||||
(global-set-key (kbd "<C-return>") 'open-line-below)
|
||||
(global-set-key (kbd "<C-S-return>") 'open-line-above)
|
||||
(global-set-key (kbd "C-x C-r") 'rename-current-buffer-file)
|
||||
(global-set-key (kbd "C-x C-d") 'delete-current-buffer-file)
|
||||
(global-set-key (kbd "C-x ~") 'toggle-char-case)
|
||||
(define-key isearch-mode-map (kbd "<C-return>") #'isearch-exit-other-end)
|
||||
(define-key gpolonkai/pers-map (kbd "m") 'hidden-mode-line-mode)
|
||||
(bind-keys
|
||||
:map global-map
|
||||
("M-(" . æ-enclose-region)
|
||||
("<C-return>" . open-line-below)
|
||||
("<C-S-return>" . open-line-above)
|
||||
("M-t" . nil) ;; Remove the old keybinding
|
||||
("M-t c" . transpose-chars)
|
||||
("M-t w" . transpose-words)
|
||||
("M-t l" . transpose-lines)
|
||||
("M-t e" . transpose-sexps)
|
||||
("M-t s" . transpose-sentences)
|
||||
("M-t p" . transpose-paragraphs)
|
||||
("M-t W" . transpose-windows)
|
||||
("C-a" . gpolonkai/move-to-beginning-of-line)
|
||||
("C-e" . gpolonkai/move-to-end-of-line)
|
||||
:map ctl-x-map
|
||||
("C-y" . duplicate-line)
|
||||
("_" . maximize-window)
|
||||
("C-r" . rename-current-buffer-file)
|
||||
("C-d" . delete-current-buffer-file)
|
||||
("~" . toggle-char-case)
|
||||
("|" . toggle-window-split)
|
||||
:map isearch-mode-map
|
||||
("<C-return>" . isearch-exit-other-end)
|
||||
:map gpolonkai/pers-map
|
||||
("m" . hidden-mode-line-mode)
|
||||
("C-i e" . "gergely@polonkai.eu")
|
||||
("C-i w" . "http://gergely.polonkai.eu/")
|
||||
("C-p" . package-list-packages)
|
||||
("o i" . gpolonkai/visit-init-file)
|
||||
("o o" . gpolonkai/visit-org-index))
|
||||
|
||||
;; Kudos goes to
|
||||
;; http://endlessparentheses.com/leave-the-cursor-at-start-of-match-after-isearch.html
|
||||
@@ -895,6 +1020,7 @@
|
||||
;; Enable some functions
|
||||
(put 'downcase-region 'disabled nil)
|
||||
(put 'upcase-region 'disabled nil)
|
||||
(put 'erase-buffer 'disabled nil)
|
||||
|
||||
;; text-mode settings
|
||||
(add-hook 'text-mode-hook (lambda () (visual-line-mode t)))
|
||||
@@ -904,26 +1030,30 @@
|
||||
'(("lambda" . 955) ; λ
|
||||
("->" . 8594) ; →
|
||||
("=>" . 8658) ; ⇒
|
||||
("map" . 8614))) ; ↦
|
||||
;; …and some pairs to complete
|
||||
;; TODO: maybe add-to-list is a better way to do it
|
||||
(setq insert-pair-alist
|
||||
'(
|
||||
(40 41) ; ()
|
||||
(91 93) ; []
|
||||
(123 125) ; {}
|
||||
(60 62) ; <>
|
||||
(34 34) ; ""
|
||||
(39 39) ; ''
|
||||
(96 39) ; `'
|
||||
(8220 8221) ; “”
|
||||
(8222 8221) ; „”
|
||||
(8216 8217) ; ‘’
|
||||
(8249 8250) ; ‹›
|
||||
(8250 8249) ; ›‹
|
||||
(171 187) ; «»
|
||||
(187 171) ; »«
|
||||
))
|
||||
("map" . 8614)) ; ↦
|
||||
|
||||
;; Check for package upgrades every Monday so I don’t forget.
|
||||
(check-for-package-upgrades-on-day 1)
|
||||
;; …and some pairs to complete
|
||||
;; TODO: maybe add-to-list is a better way to do it
|
||||
insert-pair-alist '(
|
||||
(40 41) ; ()
|
||||
(91 93) ; []
|
||||
(123 125) ; {}
|
||||
(60 62) ; <>
|
||||
(34 34) ; ""
|
||||
(39 39) ; ''
|
||||
(96 39) ; `'
|
||||
(8220 8221) ; “”
|
||||
(8222 8221) ; „”
|
||||
(8216 8217) ; ‘’
|
||||
(8249 8250) ; ‹›
|
||||
(8250 8249) ; ›‹
|
||||
(171 187) ; «»
|
||||
(187 171)) ; »«
|
||||
|
||||
;; Set the frame title to the current file name
|
||||
frame-title-format '((:eval (concat system-name
|
||||
": "
|
||||
(if (buffer-file-name)
|
||||
(abbreviate-file-name
|
||||
(buffer-file-name))
|
||||
"%b")))))
|
||||
|
@@ -127,3 +127,40 @@ copied to the kill-ring."
|
||||
(let ((beginning (progn (beginning-of-line) (point)))
|
||||
(end (progn (end-of-line) (point))))
|
||||
(copy-region-as-kill beginning end))))
|
||||
|
||||
(defun gpolonkai/move-to-beginning-of-line ()
|
||||
"Move to different beginnings of the line; in order: beginning
|
||||
of the visual line if `visual-line-mode' is active, the first
|
||||
non-whitespace (indentation), the actual beginning of the line.
|
||||
This function will jump between the first character and the
|
||||
indentation if used multiple times.
|
||||
|
||||
Inspired by Bozhidar Batsov's solution:
|
||||
http://emacsredux.com/blog/2013/05/22/smarter-navigation-to-the-beginning-of-a-line/"
|
||||
(interactive)
|
||||
(let ((last-pos (point)))
|
||||
(when visual-line-mode
|
||||
(beginning-of-visual-line))
|
||||
(when (= (point) last-pos)
|
||||
(back-to-indentation))
|
||||
(when (= (point) last-pos)
|
||||
(beginning-of-line))
|
||||
(when (and (eq major-mode 'org-mode)
|
||||
(= (point) last-pos))
|
||||
(org-beginning-of-line))
|
||||
(when (= (point) last-pos)
|
||||
(back-to-indentation))))
|
||||
|
||||
(defun gpolonkai/move-to-end-of-line ()
|
||||
"Move to the end of the line. If `visual-line-mode' is active,
|
||||
jump to the end of the visual line first. The jump to the
|
||||
actual end of the line."
|
||||
(interactive)
|
||||
(let ((last-pos (point)))
|
||||
(when visual-line-mode
|
||||
(end-of-visual-line))
|
||||
(when (= (point) last-pos)
|
||||
(end-of-line))
|
||||
(when (and (eq major-mode 'org-mode)
|
||||
(= (point) last-pos))
|
||||
(org-end-of-line))))
|
||||
|
7968
lisp/clearcase.el
7968
lisp/clearcase.el
File diff suppressed because it is too large
Load Diff
24
lisp/file-manip.el
Normal file
24
lisp/file-manip.el
Normal file
@@ -0,0 +1,24 @@
|
||||
(defun open-this-file-as-other-user (user)
|
||||
"Edit current file as USER, using `tramp' and `sudo'. If the current
|
||||
buffer is not visiting a file, prompt for a file name."
|
||||
(interactive "sEdit as user (default: root): ")
|
||||
(when (string= "" user)
|
||||
(setq user "root"))
|
||||
(let* ((filename (or buffer-file-name
|
||||
(read-file-name (format "Find file (as %s): "
|
||||
user))))
|
||||
(tramp-path (concat (format "/sudo:%s@localhost:" user) filename)))
|
||||
(if buffer-file-name
|
||||
(find-alternate-file tramp-path)
|
||||
(find-file tramp-path))))
|
||||
|
||||
(defun gpolonkai/visit-init-file ()
|
||||
"Open the init file."
|
||||
(interactive)
|
||||
(find-file-other-window user-init-file))
|
||||
|
||||
(defun gpolonkai/visit-org-index ()
|
||||
"Visit the root of Org-mode notes."
|
||||
(interactive)
|
||||
(find-file-other-window (concat (file-name-as-directory org-directory)
|
||||
"index.org")))
|
27
lisp/gpolonkai-misc.el
Normal file
27
lisp/gpolonkai-misc.el
Normal file
@@ -0,0 +1,27 @@
|
||||
(defun warn-key-rebind (keymap key new-def)
|
||||
"Warn if a key is being rebound."
|
||||
(let ((global-def (global-key-binding key))
|
||||
(local-def (local-key-binding key))
|
||||
(minor-defs (minor-mode-key-binding key))
|
||||
(key-desc (key-description key)))
|
||||
(when (and global-def
|
||||
(not (numberp global-def))
|
||||
(not (equal global-def new-def)))
|
||||
(warn "'%s' from the global keymap is being rebound from '%s' to '%s'"
|
||||
key-desc
|
||||
global-def
|
||||
new-def))
|
||||
(when (and local-def
|
||||
(not (numberp local-def))
|
||||
(not (equal local-def new-def)))
|
||||
(warn "'%s' from the local keymap is being rebound from '%s' to '%s'"
|
||||
key-desc
|
||||
local-def
|
||||
new-def))
|
||||
(when minor-defs
|
||||
(dolist (binding minor-defs)
|
||||
(warn "'%s' from '%s' keymap is being rebound from '%s' to '%s'"
|
||||
key-desc
|
||||
(car binding)
|
||||
(cdr binding)
|
||||
new-def)))))
|
70
lisp/minari.el
Normal file
70
lisp/minari.el
Normal file
@@ -0,0 +1,70 @@
|
||||
;;; minari.el --- Calculate Minari dates
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defconst minari-special-day-names
|
||||
'("Hëður" "Rideyy" "Morkh" "Morkh+" "Khmerd" "Chamog")
|
||||
"Names of the special (monthless) days of the year.")
|
||||
|
||||
(defconst minari-weekday-names
|
||||
'("Ro’unn" "Mïrdu" "Hëmi" "Drak" "Þodon" "Charm")
|
||||
"Names of weekdays.")
|
||||
|
||||
(defconst minari-month-names
|
||||
'("Mëbel" "Dirann" "Ma’uþ"
|
||||
"Gerub" "Þrei" "Dimoc"
|
||||
"Xentor" "Mëðïr" "Draþ"
|
||||
"Quaden" "Ridïmel" "Rodom")
|
||||
"Names of months.")
|
||||
|
||||
(defun minari-today-string ()
|
||||
"Calculate today's date according to the Minari Calendar."
|
||||
(let ((today (decode-time (current-time))))
|
||||
;; FIXME: I’m not sure about this one… If I increment by 11, I get a
|
||||
;; wrong date according to my GNOME Shell extension. If I increment by
|
||||
;; 10, the date is OK, but by calculating it in my head, it’s bad.
|
||||
(incf (nth 3 today) 10)
|
||||
(let* ((minari-leap (date-leap-year-p (nth 5 today)))
|
||||
(doy (time-to-day-in-year (apply 'encode-time today)))
|
||||
(minari-year (- (nth 5 today) 1873))
|
||||
(minari-month 0)
|
||||
(minari-doy 0)
|
||||
(minari-day 0)
|
||||
(minari-weekday 0)
|
||||
(minari-special-day -1))
|
||||
(cond
|
||||
((eq doy 0) (setq minari-special-day 0))
|
||||
((eq doy 91) (setq minari-special-day 1))
|
||||
((eq doy 182) (setq minari-special-day 2))
|
||||
((and (eq doy 183) minari-leap) (setq minari-special-day 3))
|
||||
((and (eq doy 273) (not minari-leap)) (setq minari-special-day 4))
|
||||
((and (eq doy 274) minari-leap) (setq minari-special-day 4))
|
||||
((and (eq doy 364) (not minari-leap)) (setq minari-special-day 5))
|
||||
((and (eq doy 365) minari-leap) (setq minari-special-day 5))
|
||||
(t (let ((decr 0)
|
||||
(minari-doy doy))
|
||||
(when (> minari-doy 0) (incf decr))
|
||||
(when (> minari-doy 91) (incf decr))
|
||||
(when (> minari-doy 182) (incf decr))
|
||||
(when (and (> minari-doy 183) minari-leap) (incf decr))
|
||||
(when (and (> minari-doy 273) (not minari-leap)) (incf decr))
|
||||
(when (and (> minari-doy 274) minari-leap) (incf decr))
|
||||
(setq minari-doy (- minari-doy (- decr 1))
|
||||
minari-month (round (fceiling (/ minari-doy 30.0)))
|
||||
minari-day (% minari-doy 30))
|
||||
(when (eq minari-day 0) (setq minari-day 30))
|
||||
(setq minari-weekday (% minari-day 6)))))
|
||||
(if (eq -1 minari-special-day)
|
||||
(format "%d %s %s (%s)"
|
||||
minari-year
|
||||
(nth (- minari-month 1) minari-month-names)
|
||||
minari-day
|
||||
(nth minari-weekday minari-weekday-names))
|
||||
(nth (- minari-special-day 1) minari-special-day-names)))))
|
||||
|
||||
(provide 'minari)
|
||||
|
||||
;;; minari.el ends here
|
@@ -1,11 +0,0 @@
|
||||
(defun transpose-windows (arg)
|
||||
"Transpose the buffers shown in two windows."
|
||||
(interactive "p")
|
||||
(let ((selector (if (>= arg 0) 'next-window 'previous-window)))
|
||||
(while (/= arg 0)
|
||||
(let ((this-win (window-buffer))
|
||||
(next-win (window-buffer (funcall selector))))
|
||||
(set-window-buffer (selected-window) next-win)
|
||||
(set-window-buffer (funcall selector) this-win)
|
||||
(select-window (funcall selector)))
|
||||
(setq arg (if (plusp arg) (1- arg) (1+ arg))))))
|
@@ -1,3 +1,15 @@
|
||||
(defun transpose-windows (arg)
|
||||
"Transpose the buffers shown in two windows."
|
||||
(interactive "p")
|
||||
(let ((selector (if (>= arg 0) 'next-window 'previous-window)))
|
||||
(while (/= arg 0)
|
||||
(let ((this-win (window-buffer))
|
||||
(next-win (window-buffer (funcall selector))))
|
||||
(set-window-buffer (selected-window) next-win)
|
||||
(set-window-buffer (funcall selector) this-win)
|
||||
(select-window (funcall selector)))
|
||||
(setq arg (if (plusp arg) (1- arg) (1+ arg))))))
|
||||
|
||||
(defun toggle-window-split ()
|
||||
(interactive)
|
||||
(if (= (count-windows) 2)
|
||||
@@ -24,4 +36,21 @@
|
||||
(if this-win-2nd (other-window 1))))
|
||||
(error "This works only for two windows!")))
|
||||
|
||||
(global-set-key (kbd "C-x |") 'toggle-window-split)
|
||||
(defun gpolonkai/scroll-window-up (window)
|
||||
"Scroll WINDOW up as `scroll-up-command' would."
|
||||
(interactive)
|
||||
(save-selected-window
|
||||
(select-window window)
|
||||
(scroll-up)))
|
||||
|
||||
(defun gpolonkai/scroll-window-down (window)
|
||||
"Scroll WINDOW down as `scroll-down-command' would."
|
||||
(interactive)
|
||||
(save-selected-window
|
||||
(select-window window)
|
||||
(scroll-down)))
|
||||
|
||||
(defun gpolonkai/bury-window (window)
|
||||
"Quit WINDOW without killing it."
|
||||
(interactive)
|
||||
(quit-window nil window))
|
Reference in New Issue
Block a user