rice

personal dot files and scripts for linux and macOS
Log | Files | Refs | README | LICENSE

core-ui.el (2501B)


      1 ;;; core-ui.el --- ui configuration for my emacs
      2 
      3 ;; Author: Mark Feller <mark.feller@member.fsf.org>
      4 
      5 ;; This file is not part of GNU Emacs.
      6 
      7 ;; This file is free software; you can redistribute it and/or modify
      8 ;; it under the terms of the GNU General Public License as published by
      9 ;; the Free Software Foundation; either version 3, or (at your option)
     10 ;; any later version.
     11 
     12 ;; This file is distributed in the hope that it will be useful,
     13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 ;; GNU General Public License for more details.
     16 
     17 ;; You should have received a copy of the GNU General Public License
     18 ;; along with this file.  If not, see <http://www.gnu.org/licenses/>.
     19 
     20 ;;; Commentary:
     21 
     22 ;;; Code:
     23 
     24 (when (fboundp 'tool-bar-mode)
     25   (tool-bar-mode -1))
     26 
     27 (menu-bar-mode -1)
     28 
     29 (when (fboundp 'scroll-bar-mode)
     30   (scroll-bar-mode -1))
     31 
     32 (blink-cursor-mode -1)            ; the blinking cursor is nothing, but an annoyance
     33 (setq ring-bell-function 'ignore) ; disable the annoying bell ring
     34 (setq inhibit-startup-screen t)   ; disable startup screen
     35 (fset 'yes-or-no-p 'y-or-n-p)     ; enable y/n answers
     36 
     37 ;; nice scrolling
     38 (setq scroll-margin 0
     39       scroll-conservatively 100000
     40       scroll-preserve-screen-position 1)
     41 
     42 ;; mode line numbers
     43 (line-number-mode 0)
     44 (column-number-mode t)
     45 
     46 (delete-selection-mode t) ; Delete Marked regions
     47 (show-paren-mode t)       ; Show matching parenthesis
     48 
     49 (setq-default indent-tabs-mode nil)
     50 (setq-default tab-width 8)
     51 (setq-default indicate-empty-lines nil)
     52 
     53 (set-terminal-coding-system 'utf-8)
     54 (set-keyboard-coding-system 'utf-8)
     55 (prefer-coding-system 'utf-8)
     56 
     57 (setq-default fill-column 72)
     58 
     59 (add-hook 'before-save-hook 'delete-tailing-whitespace)
     60 
     61 (setq echo-keystrokes 0.1)
     62 
     63 (setq frame-resize-pixelwise t)
     64 
     65 (defun on-after-init ()
     66   (unless (display-graphic-p (selected-frame))
     67     (set-face-background 'default "unspecified-bg" (selected-frame))))
     68 
     69 (add-hook 'window-setup-hook 'on-after-init)
     70 
     71 ;; line numbers
     72 (setq-default display-line-numbers-width 3)
     73 (setq display-line-numbers-type 'relative
     74       display-line-numbers-current-absolute t
     75       display-line-numbers-widen nil) ; don't count narrowed regions
     76 
     77 (setq-default line-spacing 5)
     78 
     79 ;; add some padding around the entire frame and fringes
     80 (if (eq system-type 'darwin)
     81     (set-fringe-mode 0)
     82   (set-fringe-mode 25))
     83 (set-frame-parameter nil 'internal-border-width 0)
     84 
     85 (provide 'core-ui)
     86 
     87 ;;; core-ui.el ends here