dotfiles

Settings and scripts
git clone git://git.konyahin.xyz/dotfiles
Log | Files | Refs

commit 3931799b115c5657018272eee889909c67d830ae
parent 59dc34d10a006bd17024eb6d387e116391c57b85
Author: Anton Konyahin <me@konyahin.xyz>
Date:   Mon,  3 Apr 2023 21:31:14 +0300

emacs: a lot of fixes

Diffstat:
Aemacs/.emacs.d/abbrev_defs | 6++++++
Aemacs/.emacs.d/init.el | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Demacs/dot-emacs | 52----------------------------------------------------
3 files changed, 77 insertions(+), 52 deletions(-)

diff --git a/emacs/.emacs.d/abbrev_defs b/emacs/.emacs.d/abbrev_defs @@ -0,0 +1,6 @@ +;;-*-coding: utf-8;-*- +(define-abbrev-table 'global-abbrev-table + '( + ("hrt" "♥" nil :count 1) + )) + diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el @@ -0,0 +1,71 @@ +;; base settings +(tool-bar-mode 0) +(scroll-bar-mode 0) + +(setq make-backup-files nil) +(setq auto-save-default nil) + +;; abbrev mode +(setq-default abbrev-mode t) +(setq save-abbrevs 'silently) + +;; dired settings +(setq dired-listing-switches "-lap") + +(defun knh-dired-find-file-other-frame () + "Open file in dired and move it in another emacs frame" + (interactive) + (dired-find-file) + (display-buffer-use-least-recent-window + (current-buffer) nil) + (previous-buffer)) + +(add-hook 'dired-mode-hook + (lambda () + "Dired settings" + (dired-hide-details-mode) + (define-key dired-mode-map (kbd "M-o") 'knh-dired-find-file-other-frame))) + +;; settings for packages +(require 'package) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) + +(require 'markdown-mode) +(add-hook 'markdown-mode-hook 'auto-fill-mode) +(add-hook 'markdown-mode-hook 'flyspell-mode) +(define-key markdown-mode-map (kbd "M-<up>") 'markdown-previous-visible-heading) +(define-key markdown-mode-map (kbd "M-<down>") 'markdown-next-visible-heading) + +(require 'howm) +(setq howm-file-name-format "%Y-%m-%d-%H%M%S.md") +(setq howm-template "# %title%cursor\n\n%file\n\n") +(setq howm-keyword-file (expand-file-name ".howm-keys" howm-directory)) +(setq howm-history-file (expand-file-name ".howm-history" howm-directory)) +(define-key howm-menu-mode-map "\C-h" nil) +(define-key riffle-summary-mode-map "\C-h" nil) +(define-key howm-view-contents-mode-map "\C-h" nil) + +(require 'restclient) +(require 'misc) + +;; custom functions and key bindings +(global-set-key (kbd "M-f") 'forward-to-word) +(defun knh-new-line-below () + "Insert new line below, without breaking current line" + (interactive) + (end-of-line) + (newline-and-indent)) +(global-set-key (kbd "C-c RET") 'knh-new-line-below) + +(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. + '(package-selected-packages '(restclient howm markdown-mode))) +(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. + ) diff --git a/emacs/dot-emacs b/emacs/dot-emacs @@ -1,52 +0,0 @@ -; base settings -(tool-bar-mode 0) -(scroll-bar-mode 0) - -(setq make-backup-files nil) -(setq auto-save-default nil) - -; dired settings -(add-hook 'dired-mode-hook #'dired-hide-details-mode) -(setq dired-listing-switches "-lp") - -; settings for packages -(require 'package) -(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) - -(require 'markdown-mode) -(add-hook 'markdown-mode-hook 'auto-fill-mode) -(add-hook 'markdown-mode-hook 'flyspell-mode) -(define-key markdown-mode-map (kbd "M-<up>") 'markdown-previous-visible-heading) -(define-key markdown-mode-map (kbd "M-<down>") 'markdown-next-visible-heading) - -(require 'restclient) - -(require 'howm) -(setq howm-file-name-format "%Y-%m-%d-%H%M%S.md") -(setq howm-template "# %title%cursor\n\n%file\n\n") -(setq howm-keyword-file (expand-file-name ".howm-keys" howm-directory)) -(setq howm-history-file (expand-file-name ".howm-history" howm-directory)) -(define-key howm-menu-mode-map "\C-h" nil) -(define-key riffle-summary-mode-map "\C-h" nil) -(define-key howm-view-contents-mode-map "\C-h" nil) - -; custom functions and key bindings -(defun knh-new-line-below () - "Insert new line below, without breaking current line" - (interactive) - (end-of-line) - (newline-and-indent)) -(global-set-key (kbd "M-RET") 'knh-new-line-below) - -(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. - '(package-selected-packages '(restclient howm markdown-mode))) -(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. - )