65 lines
1.8 KiB
EmacsLisp
65 lines
1.8 KiB
EmacsLisp
(defun copy-whole-line ()
|
|
(interactive)
|
|
(save-excursion
|
|
(kill-new
|
|
(buffer-substring
|
|
(point-at-bol)
|
|
(point-at-eol)))))
|
|
(global-set-key (kbd "C-c w l") 'copy-whole-line)
|
|
|
|
(defun kill-all-buffers ()
|
|
(interactive)
|
|
(mapc 'kill-buffer (buffer-list)))
|
|
(global-set-key (kbd "C-c k k") 'kill-all-buffers)
|
|
|
|
(defun split-and-follow-horizontally ()
|
|
(interactive)
|
|
(split-window-below)
|
|
(balance-windows)
|
|
(other-window 1))
|
|
(global-set-key (kbd "C-x 2") 'split-and-follow-horizontally)
|
|
|
|
(defun split-and-follow-vertically ()
|
|
(interactive)
|
|
(split-window-right)
|
|
(balance-windows)
|
|
(other-window 1))
|
|
(global-set-key (kbd "C-x 3") 'split-and-follow-vertically)
|
|
|
|
(defun switch-to-previous-buffer ()
|
|
(interactive)
|
|
(switch-to-buffer (other-buffer (current-buffer) 1)))
|
|
(global-set-key (kbd "C-x b") 'switch-to-previous-buffer)
|
|
(global-set-key (kbd "C-c b") 'switch-to-buffer)
|
|
|
|
;; compilation
|
|
(setq compile-command "make ")
|
|
(global-set-key (kbd "C-x C-m") 'compile)
|
|
|
|
(defun mark-line ()
|
|
(interactive)
|
|
(move-beginning-of-line nil)
|
|
(set-mark (point))
|
|
(move-end-of-line nil))
|
|
|
|
(global-set-key (kbd "C-x C-z") 'mark-line)
|
|
(global-unset-key (kbd "C-z")) ; disable suspend frame
|
|
(global-unset-key (kbd "C-x C-z")) ; disable suspend frame
|
|
(global-set-key (kbd "C-x C-x") 'other-window)
|
|
(global-set-key (kbd "C-x C-b") '(lambda () (interactive)
|
|
(bs-show nil)
|
|
(swiper)))
|
|
|
|
(defun toggle-indent ()
|
|
(interactive)
|
|
(setq-default indent-tabs-mode (not indent-tabs-mode)))
|
|
|
|
(global-set-key [f5] (lambda ()
|
|
(interactive)
|
|
(disable-theme 'basic)
|
|
(load-theme 'magik)))
|
|
(global-set-key [f6] (lambda ()
|
|
(interactive)
|
|
(disable-theme 'magik)
|
|
(load-theme 'basic)))
|