105 Commits

Author SHA1 Message Date
4e666d5c6b Warn about key rebinds 2016-11-18 10:27:12 +01:00
4ea052b970 Move loading my own functions earlier 2016-11-18 09:47:57 +01:00
5a8be149cb Install anaconda-mode and company-anaconda packages 2016-11-17 23:31:35 +01:00
6829120d10 Create capture template for GT2 notes 2016-11-17 22:37:15 +01:00
a80b9348cc Reconfigure ace-window
* Make it possible to scroll (up/down) and bury window buffers
* Map window selectors back to the defaults (numbers)
* Make dispatcher run always, even for only two windows
2016-11-17 16:07:27 +01:00
822260dad0 Reformat org-todo-keywords
Just for readability’s sake.
2016-11-17 13:36:32 +01:00
954881e661 Move window manipulating functions to window-manip.el 2016-11-17 13:35:33 +01:00
6ee76de7db Enable the erase-buffer command 2016-11-17 08:26:01 +01:00
a83ff1f572 Add my new movement commands to mc-lists 2016-11-17 08:26:01 +01:00
2403128ced Rebind ace-window to C-x o
It is a real pain to keep track of what `other-window` means. It was
also inconvenient to press M-P on Dvorak. This new solution will be a
short-term pain until I get used to it with more than two windows, but
after that, life will be easier.
2016-11-17 08:26:01 +01:00
d45149db80 Remove easy-kill in favour of expand-region
* easy-kill is not that easy
* I actually used for the purpose of expand-region
2016-11-16 23:01:56 +01:00
5e6aae007d Implement move-to-beginning/end-of line for Org-mode 2016-11-15 22:09:01 +01:00
b48f918bdd Update auto-virtualenv config
It now activates automatically when switching to `python-mode`
2016-11-15 22:09:00 +01:00
ab56d6f449 Add two new functions to move to beginning/end of a line
They consider visual lines and indentation.  However, they don’t work in
Org-mode yet.

Inspired by @bbatsov:
http://emacsredux.com/blog/2013/05/22/smarter-navigation-to-the-beginning-of-a-line/
2016-11-15 09:36:10 +01:00
33e05c054a Add key binding for transpose-windows 2016-11-15 09:36:09 +01:00
ef42a03d3a Add key binding to visit init file and index.org
Inspired by http://emacsredux.com/blog/2013/05/18/instant-access-to-init-dot-el/
2016-11-15 00:50:49 +01:00
e0e2fd262e Install the highlight-indent-guides package 2016-11-15 00:07:11 +01:00
e8db11375f Fix electric-case config 2016-11-14 23:59:40 +01:00
a24bf7d6ef Install the eshell-prompt-extras package 2016-11-14 20:29:44 +01:00
1dfb6091a0 Install the eshell-fringe-status package 2016-11-14 20:20:32 +01:00
717c1acc34 Woot! 2016-11-14 20:13:03 +01:00
4a114c7fc3 Install the glasses package 2016-11-14 19:44:55 +01:00
441513584a Auto-enable electric-spacing-mode in C-derived modes 2016-11-14 08:39:16 +01:00
d536a23ee2 Install the hl-todo package 2016-11-11 23:29:00 +01:00
9fb5a2c3a1 Install the helm-pydoc package 2016-11-11 23:28:59 +01:00
99645d8634 Woot! 2016-11-11 23:28:44 +01:00
3ef1fa40d2 Woot! 2016-11-11 12:34:51 +01:00
ac28c27f0f Install the helm-hunks package 2016-11-11 11:27:50 +01:00
0ee44cc580 Install the helm-c-yasnippet package 2016-11-11 09:52:02 +01:00
30ec3aad97 Finish minari-today-string 2016-11-11 09:52:02 +01:00
2dd0f9edf2 Woot! 2016-11-10 21:57:16 +01:00
696904aa8e Install the easy-kill package 2016-11-10 17:08:46 +01:00
7309e9e740 Shrink ace-window’s key preview 2016-11-10 17:08:18 +01:00
7b059751b5 Expand sml/replacer-regexp-list
* Add “~/Projektek/” that I use on my home machine
* Add my blog‘s directory
2016-11-10 11:48:31 +01:00
d76643ae93 Change the title of a frame to the current file name 2016-11-10 11:48:24 +01:00
fa68c7ce00 Move autosave and backup files to /tmp 2016-11-10 11:32:35 +01:00
ccdc042a89 Create function open-this-file-as-other-user
It opens the current file as the specified user or root.
2016-11-10 11:31:50 +01:00
50d518a906 Install the gitlab package
It’s needed for my future magitlab stuff.
2016-11-10 09:49:26 +01:00
7b47c9b24b Update mc command list 2016-11-10 09:48:14 +01:00
a332592a17 Woot! 2016-11-10 09:47:54 +01:00
540eccc8a5 Fix zone-nyan config
It sometimes loaded before `zone`, when `zone-programs` is not defined yet.
2016-11-09 10:38:40 +01:00
2c21f86070 Woot! 2016-11-09 10:35:46 +01:00
c720e948f7 Set Hack as the default font 2016-11-09 10:14:29 +01:00
6b170ac52f Bind org-toggle-link-display to C-c l 2016-11-09 10:14:19 +01:00
4b582382fd Install the ace-mc package 2016-11-09 10:13:56 +01:00
613d2c63ea Attempt to use git-gutter-fringe only in graphics mode 2016-11-09 10:13:43 +01:00
50bfccd7a8 Fix message in gpolonkai/zone-enable 2016-11-09 10:12:53 +01:00
a7ce541859 Woot! 2016-11-09 10:12:30 +01:00
b71866dfd6 Make zone-nyan load only for graphics mode 2016-11-09 09:12:58 +01:00
bfbf069997 Fix sml config
* Make it load after org, so org-directory is added correctly to
  `sml/replacer-regexp-list`
* Add Projects to `sml/replacer-regexp-list`
* Add Documents to `sml/replacer-regexp-list` in a way that agrees with
  XDG
2016-11-09 08:42:52 +01:00
fdfac65961 Install the flymake-python-pyflakes package 2016-11-09 08:42:52 +01:00
a40477411d Install the auto-virtualenv package 2016-11-09 08:42:51 +01:00
ae47b2b574 Install the anzu package 2016-11-07 23:58:05 +01:00
031e5fe6c0 Finish cleaning up custom-safe-themes 2016-11-07 17:45:12 +01:00
92eadd3fe2 Woot! 2016-11-07 16:33:56 +01:00
c927f77126 Move from git-gutter to git-gutter-fringe
I’m not sure (yet) if this is a good idea, though. Let’s see what this
can do in text mode…
2016-11-07 16:23:52 +01:00
1e02b702c8 Install the form-feed package 2016-11-07 16:17:30 +01:00
79c8dc6072 Install the fill-column-indicator package 2016-11-07 16:06:41 +01:00
555c27b4cc Install the dired-k package 2016-11-07 16:04:50 +01:00
dcc9a63cb0 Clean up custom-safe-themes 2016-11-07 16:04:10 +01:00
cbb8555ac5 Fix MELPA stable configuration 2016-11-07 14:46:53 +01:00
bfe6318062 Change long line background to a darker one
It is much more readable (not perfect, though…)
2016-11-07 14:46:21 +01:00
2427e2818a Update package archive list
I have reordered it a bit, and added MELPA stable.
2016-11-07 14:00:06 +01:00
699fd49140 Woot! 2016-11-07 13:28:03 +01:00
6d9c415f40 Update mc-lists 2016-11-07 13:28:03 +01:00
3becd42968 Change default wakatime CLI path
I use Fedora primarily, and Fedora pip installs under `/usr/bin` instead
of `/usr/local/bin` (I wonder, though, how good that idea is…)
2016-11-07 13:28:03 +01:00
8705d8d985 Maximize frame on startup 2016-11-07 13:28:03 +01:00
5c45f8e199 Add short(?) bindings to my blog and e-mail
Maybe a global dabbrev or snippet is a better idea, though.
2016-11-07 13:24:41 +01:00
702c873d51 Bind transpose-* to an M-t keymap 2016-11-07 13:24:41 +01:00
7840503da6 Rebind duplicate-line to a saner key 2016-11-07 13:24:40 +01:00
c902a22bcf Rebind avy-goto-char to a more sane key 2016-11-07 13:24:40 +01:00
ceb06977a4 Add keys to insert my web and email address 2016-11-03 19:33:09 +01:00
111a4b01d8 Move zygospore binding to C-x 1
I should have started with it.
2016-11-03 19:33:08 +01:00
2ad00f4e4d Fix nxml config
Although the package name is `nxml`, the feature to `require` is
`nxml-mode`.
2016-11-03 18:31:39 +01:00
41c49b79ca Woot! 2016-11-03 18:31:39 +01:00
Gergely Polonkai
20389b6617 Initial version of minari.el
It has some bugs (or maybe my JS version has one). Yet, it’s
feature-complete.
2016-11-03 16:09:40 +01:00
Gergely Polonkai
bf639efa20 Woot! 2016-11-03 13:26:09 +01:00
Gergely Polonkai
2af3dade16 Add key binding to org-capture 2016-11-03 12:42:32 +01:00
5d76b50e89 Woot! 2016-11-02 22:26:04 +01:00
4c677c3679 Configured the cookie1 package
Now it uses the ancient tagline database.
2016-11-02 22:26:04 +01:00
Gergely Polonkai
0cee2a7afd Woot! 2016-11-02 14:42:27 +01:00
Gergely Polonkai
fff167d497 Add .emacs.d/var to .gitignore 2016-11-02 14:42:27 +01:00
406266c670 Woot! 2016-11-02 13:24:05 +01:00
6cdddf1e48 Remove clearcase.el
Finally I don’t have to use it any more!
2016-11-02 13:24:05 +01:00
Gergely Polonkai
adc1ddc852 Woot! 2016-11-02 10:21:47 +01:00
110f573820 Woot! 2016-11-02 10:03:07 +01:00
57b63b0612 Install auto-package-update
It partially obsoletes my own package-manip stuff.  I don’t load this
latter any more, but I may send its crontab-like functionality later.
2016-11-02 10:03:07 +01:00
3cc7226461 Install the auto-highlight-symbol package
All good IDEs (like Notepad++. LoL) have it.
2016-11-02 10:03:06 +01:00
a717e9ace1 Move customize stuff to a separate file 2016-11-01 17:07:41 +01:00
405a1be44a Kanbanize
* Install the kanban package
* Set up Org TODO states
2016-11-01 14:03:10 +01:00
3d02b61550 Extend mc command list 2016-11-01 14:03:09 +01:00
217f16cf9d In-tall the achievements package 2016-11-01 14:03:09 +01:00
Gergely Polonkai
deecd0eb5b Move custom global key bindings to bind-keys
This requires the bind-key package to be pinned (it was installed anyway
as a dependency to use-package).
2016-10-28 07:35:41 +02:00
Gergely Polonkai
3364cdd580 Update configuration of the markdown-mode package 2016-10-28 07:34:52 +02:00
Gergely Polonkai
245e01ebad Install the ace-popup-menu package 2016-10-28 07:34:51 +02:00
Gergely Polonkai
16efffafef Add a docstring to my keymap 2016-10-27 16:50:03 +02:00
Gergely Polonkai
c90582bb3b Move which-func configuration to use-package 2016-10-27 16:50:02 +02:00
Gergely Polonkai
197f79c822 Issue a message when starting idle-zoning timer
It didn’t have any visual feedback, which is a bit annoying in this
case.
2016-10-27 16:49:32 +02:00
Gergely Polonkai
753e165d88 Move webjump configuration to use-package 2016-10-27 16:49:30 +02:00
Gergely Polonkai
df2edfb7c8 Fix key binding definitions 2016-10-27 16:48:46 +02:00
Gergely Polonkai
cd2dd7b629 Add key binding for git-gutter:update-all-windows 2016-10-27 16:48:46 +02:00
e8113bf04b Bind org-random-todo to a key 2016-10-27 09:58:56 +02:00
1e8ef17788 Add key binding for git-messenger 2016-10-26 23:26:05 +02:00
b15cda6dc8 Install the zygospore package
Bound to `C-x t w`
2016-10-26 23:26:04 +02:00
Gergely Polonkai
15d81e221b Add key bindings for zone 2016-10-25 19:06:37 +02:00
13 changed files with 3373 additions and 8197 deletions

2
.achievements Normal file

File diff suppressed because one or more lines are too long

2
.gitignore vendored
View File

@@ -15,6 +15,8 @@
/url/
/hgs-cache
/smex-items
/var/
/anaconda-mode/
# All hail use-package!
/elpa/

View File

@@ -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
View 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

File diff suppressed because it is too large Load Diff

564
init.el
View File

@@ -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
;; Dont 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 dont 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")))))

View File

@@ -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))))

File diff suppressed because it is too large Load Diff

24
lisp/file-manip.el Normal file
View 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
View 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
View 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
'("Rounn" "Mïrdu" "Hëmi" "Drak" "Þodon" "Charm")
"Names of weekdays.")
(defconst minari-month-names
'("Mëbel" "Dirann" "Ma"
"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: Im 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, its 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

View File

@@ -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))))))

View File

@@ -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))