;;;;;;;;;;;; ;; PAKETI ;; ;;;;;;;;;;;; ;; Set up package.el to work with MELPA (require 'package) ;; Sekvence n'shiat (require 'seq) ;; Loudamo melpa paketice (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) ;; Kaj vse naj bo namesceno? (setq paketi '(;; Evil mode evil evil-collection evil-org ;; Global undo tree undo-tree ;; Gruvbox tema gruvbox-theme ;; Hemisu tema hemisu-theme ;; Doom themes doom-themes ;; Oblikovanje teksta editorconfig ;; Projekti projectile ;; Completion company ;; Completion2 ivy ;; Iskanje swiper ;; Izboljsani default ukazi bolj prijazni counsel ;; Iskanje po fajlih rg ;; Modeline - status bar spodaj (+ ikonice) doom-modeline all-the-icons ;; Pomoch helpful ;; Prikazi nedavne ukaze visje smex ;; Programiranje js2-mode rjsx-mode vue-mode clojure-mode geiser geiser-guile paredit rainbow-delimiters gdscript-mode php-mode fennel-mode arduino-mode markdown-mode yaml-mode ;; Checker za syntax? flycheck ;; Lepšanje fajlov na webu web-beautify ;; Tab alignment smart-tabs-mode ;; Dreva fajlov treemacs treemacs-projectile treemacs-evil ;; Pomoc za keybinde which-key ;; Git paket magit ;; dr00pal moud drupal-mode )) (setq nema (seq-filter (lambda (p) (not (package-installed-p p))) paketi)) (when nema (package-initialize) (package-refresh-contents) (dolist (p nema) (package-install p))) ;;;;;;;;;; ;; EVIL ;; ;;;;;;;;;; (setq evil-want-integration t) ;; This is optional since it's already set to t by default. (setq evil-want-keybinding nil) (require 'evil) ;; Dodatni keybindi (dired, drugje) (evil-collection-init) (defvar my-leader-map (make-sparse-keymap) "Mapiranje za evil bliznjice (leader trigger)") ;; Dodatki za orgmode / agenda podporo (require 'evil-org) (add-hook 'org-mode-hook 'evil-org-mode) (evil-org-set-key-theme '(navigation insert textobjects additional calendar)) (require 'evil-org-agenda) (evil-org-agenda-set-keys) (setq org-agenda-files (list "~/rs/org" "~/Dokumenti")) ;; WINDOW ukazi (define-prefix-command 'evil-window-map) (define-key evil-window-map "j" 'windmove-down) (define-key evil-window-map "k" 'windmove-up) (define-key evil-window-map "h" 'windmove-left) (define-key evil-window-map "l" 'windmove-right) (define-key evil-window-map "s" 'split-window-below) (define-key evil-window-map "v" 'split-window-right) ;; BUFFER ukazi (define-prefix-command 'evil-buffer-map) (define-key evil-buffer-map "b" 'ivy-switch-buffer) (define-key evil-buffer-map "p" 'previous-buffer) (define-key evil-buffer-map "n" 'next-buffer) (define-key evil-buffer-map "e" 'eval-buffer) (defun switch-to-scratch () (interactive) (switch-to-buffer "*scratch*")) (define-key evil-buffer-map "s" 'switch-to-scratch) ;; FILE ukazi (define-prefix-command 'evil-file-map) (define-key evil-file-map "f" 'counsel-find-file) (defun load-config () (interactive) (find-file "~/.emacs.d/init.el")) (define-key evil-file-map "c" 'load-config) ;; Mapiranje ukazov (evil-global-set-key 'motion (kbd "SPC") my-leader-map) ;(evil-local-set-key 'motion (kbd "SPC") my-leader-map) ;(define-key evil-normal-state-map (kbd "SPC") my-leader-map) (define-key my-leader-map "w" 'evil-window-map) (define-key my-leader-map "b" 'evil-buffer-map) (define-key my-leader-map "f" 'evil-file-map) (define-key my-leader-map "[" 'previous-buffer) (define-key my-leader-map "]" 'next-buffer) (define-key my-leader-map "r" 'counsel-bookmark) (define-key my-leader-map "p" 'projectile-command-map) (define-key my-leader-map "/" 'counsel-rg) ;; Odpri drevo fajlov (define-key my-leader-map "t" 'treemacs) ;;;;;;;;;;;;;;;;;;; ;; Custom (tema) ;; ;;;;;;;;;;;;;;;;;;; (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. '(custom-safe-themes '("7661b762556018a44a29477b84757994d8386d6edee909409fabe0631952dad9" default)) '(iswitchb-mode t) '(package-selected-packages '(yaml-mode drupal-mode magit markdown-mode flycheck arduino-mode rjsx-mode gdscript-mode rainbow-delimiters which-key paredit geiser-guile geiser web-beautify vue-mode treemacs-evil treemacs-projectile treemacs smart-tabs-mode smart-tabs js2-mode smex clojure-mode helpful doom-themes counsel swiper all-the-icons doom-modeline evil-collection fennel-mode rg ivy company projectile evil)) '(tool-bar-mode nil) '(which-key-mode t)) (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. '(default ((t (:family "Iosevka SS05" :foundry "BE5N" :slant normal :weight semi-bold :height 120 :width normal))))) ;;;;;;;;;;;;;;;; ;; UI cleanup ;; ;;;;;;;;;;;;;;;; ;; Menu bar off (menu-bar-mode -1) (tool-bar-mode -1) ;; No dialog box plx (setq use-dialog-box nil) ;; Brez ikon zgoraj (setq ns-use-proxy-icon nil) (setq frame-title-format nil) ;; Undo tree (global-undo-tree-mode) (evil-set-undo-system 'undo-tree) ;; Theme ; Skrij scrollbar (scroll-bar-mode -1) (setq window-divider-default-bottom-width 3) (window-divider-mode t) ;(load-theme 'gruvbox-dark-medium t) ;(load-theme 'hemisu-light t) (require 'doom-themes) (setq doom-themes-enable-bold t ; if nil, bold is universally disabled doom-themes-enable-italic t) ; if nil, italics is universally disabled (load-theme 'doom-gruvbox t) (doom-themes-org-config) ;;;;;;;;;; ;; Text ;; ;;;;;;;;;; ;; Sirina taba ter spejsi kot distancniki (setq-default tab-width 2) (setq-default indent-tabs-mode nil) ;; Editorconfig formatiranje fajlov (editorconfig-mode 1) ;; Text wrap na sirino oken (global-visual-line-mode) ;; Stevilke vrstic (global-display-line-numbers-mode) ;; Brez stevilk vrstic v file drevesu! (add-hook 'treemacs-mode-hook (lambda () (display-line-numbers-mode -1))) ;; Evil mode toggle <3 (evil-mode) ;; PhP ko je treba (add-to-list 'auto-mode-alist '("\\.php$" . php-mode)) ;; Org tudi kdaj (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) ;; Vue nacin (add-to-list 'auto-mode-alist '("\\.vue$" . vue-mode)) ;; Guile scheme (setq scheme-program-name "guile") ;; Rainbowz (add-hook 'prog-mode-hook #'rainbow-delimiters-mode) ;; Boljse urejanje lispy jezikov (autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t) (add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) (add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode) (add-hook 'ielm-mode-hook #'enable-paredit-mode) (add-hook 'lisp-mode-hook #'enable-paredit-mode) (add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode) (add-hook 'scheme-mode-hook #'enable-paredit-mode) ;; Stanja taskov (setq org-todo-keywords '((sequence "TODO" "V DELU" "TESTIRANJE" "DOKUMENTIRANJE" "KONČANO"))) ;; DOT diagrami (org-babel-do-load-languages 'org-babel-load-languages '((dot . t))) ;; enable ditaa (org-babel-do-load-languages 'org-babel-load-languages '((ditaa . t))) ;; js2 za javascript (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) (setq js2-strict-missing-semi-warning nil) (setq js2-missing-semi-one-line-override nil) (setq js2-basic-offset 2) (setq js-indent-level 2) ;; Pametni tabi za js2-mode (smart-tabs-advice js2-indent-line js2-basic-offset) ;; css indent (setq css-indent-level 2) (setq css-indent-offset 2) ;; Kompletiranje ukazov (company-mode) ;; IVY (ivy-mode) (setq ivy-use-virtual-buffers t) (setq enable-recursive-minibuffers t) ;; Swiper search, counsel bliznjice (global-set-key "\C-s" 'swiper) (define-key evil-normal-state-map (kbd "RET") 'org-open-at-point) (global-set-key (kbd "C-c C-r") 'ivy-resume) (global-set-key (kbd "") 'ivy-resume) (global-set-key (kbd "M-x") 'counsel-M-x) (global-set-key (kbd "C-x C-f") 'counsel-find-file) (global-set-key (kbd " f") 'counsel-describe-function) (global-set-key (kbd " v") 'counsel-describe-variable) (global-set-key (kbd " o") 'counsel-describe-symbol) (global-set-key (kbd " l") 'counsel-find-library) (global-set-key (kbd " i") 'counsel-info-lookup-symbol) (global-set-key (kbd " u") 'counsel-unicode-char) (global-set-key (kbd "C-c g") 'counsel-git) (global-set-key (kbd "C-c j") 'counsel-git-grep) (global-set-key (kbd "C-c k") 'counsel-ag) (global-set-key (kbd "C-x l") 'counsel-locate) (global-set-key (kbd "C-S-o") 'counsel-rhythmbox) (define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history) ;; Iskanje po fajlih (fulltext) (rg-enable-default-bindings) ;; Modeline / statusbar (require 'all-the-icons) ;; Pognat je treba (1x) all-the-icons-install-fonts ;(require 'doom-modeline) (doom-modeline-init) ;;;;;;;;;;; ;; Razno ;; ;;;;;;;;;;; ;; Vedno sledi symlinkom v git (setq vc-follow-symlinks t) ;; Projektni mgmt (projectile-mode t) ;; Pomoc ;(require 'helpful) ;; Allow C-h to trigger which-key before it is done automatically (setq which-key-show-early-on-C-h t) ;; make sure which-key doesn't show normally but refreshes quickly after it is ;; triggered. (setq which-key-idle-delay 0.4) (setq which-key-idle-secondary-delay 0.05) (which-key-mode) ;; Prikazi startup time (add-to-list 'after-init-hook (lambda () (message (concat "emacs (" (number-to-string (emacs-pid)) ") started in " (emacs-init-time))))) ;; Backup fajli emacsa (setq backup-by-copying t ; don't clobber symlinks backup-directory-alist `((".*" . "~/.saves/")) ; don't litter my fs tree delete-old-versions t kept-new-versions 6 kept-old-versions 2 version-control t) ; use versioned backups