102 lines
2.9 KiB
EmacsLisp
102 lines
2.9 KiB
EmacsLisp
;;; basic-settings.el --- provide basic configuration
|
|
;;; Commentary:
|
|
;; Configure basic parameters like linum and filesize
|
|
;;; Code:
|
|
|
|
;; ibuffer settings
|
|
|
|
;; Buffers selectin and ibuffer settings
|
|
(defun configure-ibuffer ()
|
|
"Make awesome menu and bind it to F2;
|
|
Integrate projectile with ibuffer."
|
|
(use-package bs)
|
|
(use-package ibuffer
|
|
:bind (("<f2>" . ibuffer)
|
|
("<f5>" . buffer-menu)))
|
|
|
|
;; (defalias 'list-buffers 'ibuffer-list-buffers)
|
|
(use-package ibuffer-projectile
|
|
:config
|
|
(add-hook 'ibuffer-hook
|
|
(lambda ()
|
|
(ibuffer-projectile-set-filter-groups)
|
|
(unless (eq ibuffer-sorting-mode 'alphabetic)
|
|
(ibuffer-do-sort-by-alphabetic))))))
|
|
|
|
;; Linum plugin
|
|
(defun configure-linum (&optional enabled)
|
|
"Make linum ENABLED."
|
|
(use-package linum
|
|
:config
|
|
(if enabled
|
|
(and (line-number-mode t)
|
|
(global-linum-mode t))
|
|
(and (line-number-mode nil)
|
|
(global-linum-mode nil)))
|
|
(column-number-mode t)
|
|
(setq linum-format " %d ")))
|
|
|
|
;; Comment block
|
|
(defun comment-dwim-line (&optional arg)
|
|
"Replacement for 'comment-dwim' ARG."
|
|
(interactive "*P")
|
|
(comment-normalize-vars)
|
|
(if (and (not (region-active-p)) (not (looking-at "[ \t]*$")))
|
|
(comment-or-uncomment-region (line-beginning-position) (line-end-position))
|
|
(comment-dwim arg)))
|
|
|
|
(defun configure-base (&optional indent)
|
|
"Set base configuration, configure INDENT."
|
|
(configure-ibuffer)
|
|
(configure-linum nil)
|
|
|
|
;; Exec path from shell
|
|
(use-package exec-path-from-shell)
|
|
|
|
(global-set-key "\M-;" 'comment-dwim-line)
|
|
|
|
(setenv "PATH" (concat (getenv "PATH") ":~/.local/bin"))
|
|
|
|
;; Scrolling
|
|
(setq scroll-step 1)
|
|
(setq scroll-margin 10)
|
|
(setq scroll-conservatively 10000)
|
|
|
|
;; Fringe settings
|
|
(fringe-mode '(4 . 0))
|
|
(setq-default indicate-empty-lines t)
|
|
(setq-default indicate-buffer-boundaries 'left)
|
|
;; (global-fringe-mode t)
|
|
|
|
;; Display file size in mode-line
|
|
(setq display-time-24hr-format t)
|
|
(display-time-mode t)
|
|
(size-indication-mode t)
|
|
|
|
;; Indent settings
|
|
(setq-default indent-tabs-mode nil)
|
|
(setq-default tab-width indent)
|
|
(setq-default c-basic-offset indent)
|
|
(setq-default standart-indent indent)
|
|
(setq-default lisp-body-indent indent)
|
|
(global-set-key (kbd "RET") 'newline-and-indent)
|
|
|
|
;; Clipboard settings
|
|
(setq x-select-enable-clipboard t)
|
|
|
|
;; EOF newlines
|
|
(setq require-final-newline t)
|
|
(setq next-line-add-newlines nil)
|
|
|
|
;; Highlight search results
|
|
(setq search-highlight t)
|
|
(setq query-replace-highlight t)
|
|
|
|
;; Undo & Redo
|
|
(global-unset-key "\C-z")
|
|
(global-set-key "\C-z" 'advertised-undo))
|
|
|
|
(provide 'basic-settings)
|
|
|
|
;;; basic-settings.el ends here
|