Files
emacs-config/lisp/init-keybindings.el
Jens Luedicke 634d0674b4 Migrate from Projectile to built-in project.el and fix Org mode
Major changes:
- Replace Projectile with built-in project.el for project management
- Add comprehensive Org mode configuration with TODO keywords and org-kanban support
- Fix multiple parsing errors and keybinding conflicts

Key improvements:
- Faster startup with built-in project.el (no external dependencies)
- Better integration with Eglot LSP client
- Proper Org TODO keyword highlighting and kanban column ordering
- Fixed unbalanced parentheses in init-completion.el and init-utils.el
- Resolved keybinding conflicts (C-c d g → C-c G d, removed C-u C-c C-r)
- Updated all file paths in init-utils.el to use lisp/ subdirectory

The configuration now loads cleanly without errors and maintains backward
compatibility with most Projectile keybindings (C-c p prefix) while also
supporting the standard project.el bindings (C-x p prefix).

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 17:33:34 +02:00

71 lines
2.3 KiB
EmacsLisp

;;; init-keybindings.el --- Global keybindings -*- lexical-binding: t -*-
;;; Commentary:
;;; Global keybinding configurations
;;; Code:
;;; Buffer management
(global-set-key (kbd "C-x k") 'kill-current-buffer-no-confirm)
;;; Configuration reload
;; Default: Non-blocking reload
(global-set-key (kbd "C-c C-r") 'reload-emacs-config)
;; Note: Use C-u C-c C-r for blocking reload (handled in the function)
;; Quick reload for current file only
(global-set-key (kbd "C-c r") 'reload-current-file)
;; Fast reload using byte-compiled files
(global-set-key (kbd "C-c R") 'reload-emacs-config-fast)
;;; Portfolio tracker
(global-set-key (kbd "C-c $") 'portfolio-tracker)
;;; Window management
;; Consider adding ace-window or windmove keybindings here
;; (global-set-key (kbd "M-o") 'ace-window)
;; (windmove-default-keybindings)
;;; Better defaults
(global-set-key (kbd "C-x C-r") 'recentf-open-files)
(global-set-key (kbd "M-/") 'hippie-expand)
;;; Text manipulation helpers
(defun duplicate-current-line-or-region (arg)
"Duplicate current line, or region if active.
With argument ARG, make ARG copies."
(interactive "p")
(let (beg end (origin (point)))
(if (and mark-active (> (point) (mark)))
(exchange-point-and-mark))
(setq beg (line-beginning-position))
(if mark-active
(exchange-point-and-mark))
(setq end (line-end-position))
(let ((region (buffer-substring-no-properties beg end)))
(dotimes (i arg)
(goto-char end)
(newline)
(insert region)
(setq end (point)))
(goto-char (+ origin (* (length region) arg) arg)))))
(global-set-key (kbd "C-c C-d") 'duplicate-current-line-or-region)
;;; Quick buffer switching
(defun switch-to-previous-buffer ()
"Switch to the most recently used buffer."
(interactive)
(switch-to-buffer (other-buffer (current-buffer) 1)))
(global-set-key (kbd "C-c b") 'switch-to-previous-buffer)
;;; Alt-Tab style buffer cycling
;; Cycle through buffers with M-Tab (Alt-Tab)
(global-set-key (kbd "M-<tab>") 'next-buffer)
(global-set-key (kbd "M-S-<tab>") 'previous-buffer)
;; Alternative: Use C-Tab if M-Tab is captured by window manager
(global-set-key (kbd "C-<tab>") 'next-buffer)
(global-set-key (kbd "C-S-<tab>") 'previous-buffer)
(provide 'init-keybindings)
;;; init-keybindings.el ends here