1
0
Fork 0
mirror of https://github.com/Horhik/dotfiles.git synced 2024-11-25 17:41:32 +00:00
This commit is contained in:
horhik 2021-06-09 22:13:45 +03:00
parent ec1cd5a713
commit 04f7734100
3 changed files with 425 additions and 238 deletions

View file

@ -567,3 +567,4 @@
(treemacs-load-theme 'Material) (treemacs-load-theme 'Material)
(find-file "~/.emacs.d/startup.org") (find-file "~/.emacs.d/startup.org")

View file

@ -80,7 +80,7 @@
; '(custom-safe-themes ; '(custom-safe-themes
; '("6b5c518d1c250a8ce17463b7e435e9e20faa84f3f7defba8b579d4f5925f60c1" "75b8719c741c6d7afa290e0bb394d809f0cc62045b93e1d66cd646907f8e6d43" "7661b762556018a44a29477b84757994d8386d6edee909409fabe0631952dad9" default)) ; '("6b5c518d1c250a8ce17463b7e435e9e20faa84f3f7defba8b579d4f5925f60c1" "75b8719c741c6d7afa290e0bb394d809f0cc62045b93e1d66cd646907f8e6d43" "7661b762556018a44a29477b84757994d8386d6edee909409fabe0631952dad9" default))
'(package-selected-packages '(package-selected-packages
'(org-roam-server visual-fill-column org-bullets workgroups2 neotree treemacs-persp treemacs-magit treemacs-icons-dired treemacs-projectile treemacs-evil treemacs-all-the-icons ivy-rich which-key rainbow-delimiters highlight-parentheses org-roam general use-package))) '(org-roam-server visual-fill-column org-bullets workgroups2 neotree treemacs-persp treemacs-magit treemacs-icons-dired treemacs-projectile treemacs-evil which-key rainbow-delimiters highlight-parentheses org-roam general use-package)))
#+end_src #+end_src
@ -155,116 +155,137 @@
** Treemacs ** Treemacs
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package all-the-icons) (use-package all-the-icons)
(use-package treemacs-all-the-icons) (use-package all-the-icons-ivy
(use-package treemacs :init (add-hook 'after-init-hook 'all-the-icons-ivy-setup))
:after all-the-icons (use-package ivy
:ensure t :diminish
:defer t :bind (("C-s" . swiper)
:init :map ivy-minibuffer-map
(with-eval-after-load 'winum ("TAB" . ivy-alt-done)
(define-key winum-keymap (kbd "M-0") #'treemacs-select-window)) ("C-l" . ivy-alt-done)
:config ("C-j" . ivy-next-line)
(progn ("C-k" . ivy-previous-line)
(setq treemacs-collapse-dirs (if treemacs-python-executable 3 0) :map ivy-switch-buffer-map
treemacs-deferred-git-apply-delay 0.5 ("C-k" . ivy-previous-line)
treemacs-directory-name-transformer #'identity ("C-l" . ivy-done)
treemacs-display-in-side-window t ("C-d" . ivy-switch-buffer-kill)
treemacs-eldoc-display t :map ivy-reverse-i-search-map
treemacs-file-event-delay 5000 ("C-k" . ivy-previous-line)
treemacs-file-extension-regex treemacs-last-period-regex-value ("C-d" . ivy-reverse-i-search-kill))
treemacs-file-follow-delay 0.2 :config
treemacs-file-name-transformer #'identity (ivy-mode 1)
treemacs-follow-after-init t )
treemacs-git-command-pipe ""
treemacs-goto-tag-strategy 'refetch-index
treemacs-indentation 2
treemacs-indentation-string " "
treemacs-is-never-other-window nil
treemacs-max-git-entries 5000
treemacs-missing-project-action 'ask
treemacs-move-forward-on-expand nil
treemacs-no-png-images nil
treemacs-no-delete-other-windows t
treemacs-project-follow-cleanup nil
treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory)
treemacs-position 'left
treemacs-read-string-input 'from-child-frame
treemacs-recenter-distance 0.1
treemacs-recenter-after-file-follow nil
treemacs-recenter-after-tag-follow nil
treemacs-recenter-after-project-jump 'always
treemacs-recenter-after-project-expand 'on-distance
treemacs-show-cursor nil
treemacs-show-hidden-files t
treemacs-silent-filewatch nil
treemacs-silent-refresh nil
treemacs-sorting 'alphabetic-asc
treemacs-space-between-root-nodes t
treemacs-tag-follow-cleanup t
treemacs-tag-follow-delay 1.5
treemacs-user-mode-line-format nil
treemacs-user-header-line-format nil
treemacs-width 35
treemacs-workspace-switch-cleanup nil)
;; The default width and height of the icons is 22 pixels. If you are (use-package treemacs-all-the-icons)
;; using a Hi-DPI display, uncomment this to double the icon size. (use-package treemacs
;;(treemacs-resize-icons 44) :after all-the-icons
:ensure t
:defer t
:init
(with-eval-after-load 'winum
(define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
:config
(progn
(setq treemacs-collapse-dirs (if treemacs-python-executable 3 0)
treemacs-deferred-git-apply-delay 0.5
treemacs-directory-name-transformer #'identity
treemacs-display-in-side-window t
treemacs-eldoc-display t
treemacs-file-event-delay 5000
treemacs-file-extension-regex treemacs-last-period-regex-value
treemacs-file-follow-delay 0.2
treemacs-file-name-transformer #'identity
treemacs-follow-after-init t
treemacs-git-command-pipe ""
treemacs-goto-tag-strategy 'refetch-index
treemacs-indentation 2
treemacs-indentation-string " "
treemacs-is-never-other-window nil
treemacs-max-git-entries 5000
treemacs-missing-project-action 'ask
treemacs-move-forward-on-expand nil
treemacs-no-png-images nil
treemacs-no-delete-other-windows t
treemacs-project-follow-cleanup nil
treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory)
treemacs-position 'left
treemacs-read-string-input 'from-child-frame
treemacs-recenter-distance 0.1
treemacs-recenter-after-file-follow nil
treemacs-recenter-after-tag-follow nil
treemacs-recenter-after-project-jump 'always
treemacs-recenter-after-project-expand 'on-distance
treemacs-show-cursor nil
treemacs-show-hidden-files t
treemacs-silent-filewatch nil
treemacs-silent-refresh nil
treemacs-sorting 'alphabetic-asc
treemacs-space-between-root-nodes t
treemacs-tag-follow-cleanup t
treemacs-tag-follow-delay 1.5
treemacs-user-mode-line-format nil
treemacs-user-header-line-format nil
treemacs-width 35
treemacs-workspace-switch-cleanup nil)
(treemacs-follow-mode t) ;; The default width and height of the icons is 22 pixels. If you are
(treemacs-filewatch-mode t) ;; using a Hi-DPI display, uncomment this to double the icon size.
(treemacs-load-theme 'all-the-icons) ;;(treemacs-resize-icons 44)
(treemacs-fringe-indicator-mode 'always)
(pcase (cons (not (null (executable-find "git")))
(not (null treemacs-python-executable)))
(`(t . t)
(treemacs-git-mode 'deferred))
(`(t . _)
(treemacs-git-mode 'simple))))
:bind
(:map global-map
("M-0" . treemacs-select-window)
("C-x t 1" . treemacs-delete-other-windows)
("C-x t t" . treemacs)
("C-x t B" . treemacs-bookmark)
("C-x t C-t" . treemacs-find-file)
("C-x t M-t" . treemacs-find-tag)))
(use-package treemacs-evil (treemacs-follow-mode t)
:after (treemacs evil) (treemacs-filewatch-mode t)
:ensure t) (treemacs-load-theme 'all-the-icons)
(treemacs-fringe-indicator-mode 'always)
(pcase (cons (not (null (executable-find "git")))
(not (null treemacs-python-executable)))
(`(t . t)
(treemacs-git-mode 'deferred))
(`(t . _)
(treemacs-git-mode 'simple))))
:bind
(:map global-map
("M-0" . treemacs-select-window)
("C-x t 1" . treemacs-delete-other-windows)
("C-x t t" . treemacs)
("C-x t B" . treemacs-bookmark)
("C-x t C-t" . treemacs-find-file)
("C-x t M-t" . treemacs-find-tag)))
(use-package treemacs-projectile (use-package treemacs-evil
:after (treemacs projectile) :after (treemacs evil)
:ensure t) :ensure t)
(use-package treemacs-icons-dired (use-package treemacs-projectile
:after (treemacs dired) :after (treemacs projectile)
:ensure t :ensure t)
:config (treemacs-icons-dired-mode))
(use-package treemacs-magit (use-package treemacs-icons-dired
:after (treemacs magit) :after (treemacs dired)
:ensure t) :ensure t
:config (treemacs-icons-dired-mode))
(use-package treemacs-persp ;;treemacs-perspective if you use perspective.el vs. persp-mode (use-package treemacs-magit
:after (treemacs persp-mode) ;;or perspective vs. persp-mode :after (treemacs magit)
:ensure t :ensure t)
:config (treemacs-set-scope-type 'Perspectives))
(use-package neotree (use-package treemacs-persp ;;treemacs-perspective if you use perspective.el vs. persp-mode
:ensure t :after (treemacs persp-mode) ;;or perspective vs. persp-mode
:init :ensure t
(setq neo-theme (if (display-graphic-p) 'icons 'arrow))) :config (treemacs-set-scope-type 'Perspectives))
(org-babel-do-load-languages (use-package neotree
'org-babel-load-languages :ensure t
'((python . t))) :init
(setq neo-theme (if (display-graphic-p) 'icons 'arrow)))
(org-babel-do-load-languages
'org-babel-load-languages
'((python . t)))
(use-package magit) (use-package magit)
(use-package workgroups2) (use-package workgroups2)
#+end_src #+end_src
@ -343,34 +364,37 @@
* Evil Mode * Evil Mode
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package undo-tree) (use-package undo-tree
(use-package evil
:init :init
(setq evil-want-keybinding nil)
(setq evil-want-integration t)
(setq evil-want-C-u-scroll t)
(setq evil-want-C-i-jump nil)
(global-undo-tree-mode) (global-undo-tree-mode)
:config )
(evil-set-undo-system 'undo-tree) (use-package evil
(evil-mode 1) :init
(define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state) (setq evil-want-keybinding nil)
(define-key evil-insert-state-map (kbd "C-h") 'evil-delete-backward-char-and-join) (setq evil-want-integration t)
(setq evil-want-C-u-scroll t)
(setq evil-want-C-i-jump nil)
(global-undo-tree-mode)
:config
(evil-set-undo-system 'undo-tree)
(evil-mode 1)
(define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state)
(define-key evil-insert-state-map (kbd "C-h") 'evil-delete-backward-char-and-join)
;; Use visual line motions even outside of visual-line-mode buffers ;; Use visual line motions even outside of visual-line-mode buffers
(evil-global-set-key 'motion "j" 'evil-next-visual-line) (evil-global-set-key 'motion "j" 'evil-next-visual-line)
(evil-global-set-key 'motion "k" 'evil-previous-visual-line) (evil-global-set-key 'motion "k" 'evil-previous-visual-line)
(evil-set-initial-state 'messages-buffer-mode 'normal) (evil-set-initial-state 'messages-buffer-mode 'normal)
(evil-set-initial-state 'dashboard-mode 'normal)) (evil-set-initial-state 'dashboard-mode 'normal))
(use-package evil-collection (use-package evil-collection
:after evil :after evil
:init :init
:config :config
(evil-collection-init)) (evil-collection-init))
#+end_src #+end_src
@ -381,70 +405,76 @@
* Keybindings * Keybindings
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package counsel)
(use-package ivy (use-package ivy
:diminish :diminish
:bind ( :bind (
("M-x" . counsel-M-x) ("M-x" . counsel-M-x)
("C-s" . swiper) ("C-s" . swiper)
:map ivy-minibuffer-map :map ivy-minibuffer-map
("TAB" . ivy-alt-done) ("TAB" . ivy-alt-done)
("C-f" . ivy-alt-done) ("C-f" . ivy-alt-done)
("C-l" . ivy-alt-done) ("C-l" . ivy-alt-done)
("C-j" . ivy-next-line) ("C-j" . ivy-next-line)
("C-k" . ivy-previous-line) ("C-k" . ivy-previous-line)
:map ivy-switch-buffer-map :map ivy-switch-buffer-map
("C-k" . ivy-previous-line) ("C-k" . ivy-previous-line)
("C-l" . ivy-done) ("C-l" . ivy-done)
("C-d" . ivy-switch-buffer-kill) ("C-d" . ivy-switch-buffer-kill)
:map ivy-reverse-i-search-map :map ivy-reverse-i-search-map
("C-k" . ivy-previous-line) ("C-k" . ivy-previous-line)
("C-d" . ivy-reverse-i-search-kill)) ("C-d" . ivy-reverse-i-search-kill))
:init :init
(ivy-mode 1)) (ivy-mode 1))
(use-package counsel-projectile (use-package counsel
:config (counsel-projectile-mode)) :bind (("C-M-j" . 'counsel-switch-buffer)
:map minibuffer-local-map
("C-r" . 'counsel-minibuffer-history))
:config
(counsel-mode 1))
(use-package counsel-projectile
:config (counsel-projectile-mode))
;; Keybindings ;; Keybindings
(defun add-to-map(keys func) (defun add-to-map(keys func)
"Add a keybinding in evil mode from keys to func." "Add a keybinding in evil mode from keys to func."
(define-key evil-normal-state-map (kbd keys) func) (define-key evil-normal-state-map (kbd keys) func)
(define-key evil-motion-state-map (kbd keys) func)) (define-key evil-motion-state-map (kbd keys) func))
;;(add-to-map "<SPC>" nil) ;;(add-to-map "<SPC>" nil)
;;(add-to-map "<SPC> <SPC>" 'counsel-M-x) ;;(add-to-map "<SPC> <SPC>" 'counsel-M-x)
;; (add-to-map "<SPC> f" 'lusty-file-explorer) ;; (add-to-map "<SPC> f" 'lusty-file-explorer)
;; (add-to-map "<SPC> b" 'lusty-buffer-explorer) ;; (add-to-map "<SPC> b" 'lusty-buffer-explorer)
;;(add-to-map "<SPC> o" 'treemacs) ;;(add-to-map "<SPC> o" 'treemacs)
;;(add-to-map "<SPC> s" 'save-buffer) ;;(add-to-map "<SPC> s" 'save-buffer)
(add-to-map "TAB" 'company-indent-or-complete-common)
(defun open-file (file) (defun open-file (file)
"just more shortest function for opening the file" "just more shortest function for opening the file"
(interactive) (interactive)
((lambda (file) (interactive) ((lambda (file) (interactive)
(find-file (expand-file-name (format "%s" file)))) file ) ) (find-file (expand-file-name (format "%s" file)))) file ) )
(use-package general) (use-package general)
(general-evil-setup) (general-evil-setup)
(general-nmap (general-nmap
:prefix "SPC" :prefix "SPC"
;; dotfiles editing config ;; dotfiles editing config
"SPC" '(counsel-M-x :which-key "M-x") "SPC" '(counsel-M-x :which-key "M-x")
"o" '(treemacs :which-key "treemacs") "o" '(treemacs :which-key "treemacs")
"f f" '(counsel-find-file :which-key "find-file") "f f" '(counsel-find-file :which-key "find-file")
"f r" '(counsel-buffer-or-recentf :which-key "recent files") "f r" '(counsel-buffer-or-recentf :which-key "recent files")
"b b" '(counsel-switch-buffer :which-key "switch buff") "b b" '(counsel-switch-buffer :which-key "switch buff")
"f e" '(lambda() (interactive) (find-file "~/.emacs.d/config.org") :which-key "config.org") "f e" '(lambda() (interactive) (find-file "~/.emacs.d/config.org") :which-key "config.org")
"f v" '(lambda() (interactive) (find-file "~/.config/nvim/init.vim" :which-key "neovim config" )) "f v" '(lambda() (interactive) (find-file "~/.config/nvim/init.vim" :which-key "neovim config" ))
"f d" '(lambda() (interactive) (find-file "~/dotfiles/home" :which-key "dotfiles dired" )) "f d" '(lambda() (interactive) (find-file "~/dotfiles/home" :which-key "dotfiles dired" ))
"f a" '(lambda() (interactive) (find-file "~/.config/alacritty/alacritty.yml" :which-key "alacritty")) "f a" '(lambda() (interactive) (find-file "~/.config/alacritty/alacritty.yml" :which-key "alacritty"))
"f b" '(lambda() (interactive) (find-file "~/Brain") :which-key "my brain") "f b" '(lambda() (interactive) (find-file "~/Notes") :which-key "my brain")
) )
@ -467,6 +497,22 @@
#+end_src #+end_src
** Company-mode
#+begin_src emacs-lisp
(use-package company
:after lsp-mode
:hook (lsp-mode . company-mode)
:bind (:map company-active-map
("<tab>" . company-complete-selection))
(:map lsp-mode-map
("<tab>" . company-indent-or-complete-common))
:custom
(company-minimum-prefix-length 1)
(company-idle-delay 0.0))
(use-package company-box
:hook (company-mode . company-box-mode))
#+end_src
#+RESULTS: #+RESULTS:
* Org * Org
@ -526,7 +572,7 @@
:hook ((org-mode . my/org-mode-setup) :hook ((org-mode . my/org-mode-setup)
(org-mode . variable-pitch-mode) (org-mode . variable-pitch-mode)
) )
:config (setq org-agenda-files `("~/Brain" "~/Brain/Tasks/Tasks.org")) :config (setq org-agenda-files `("~/Notes" "~/Notes/Tasks/Tasks.org"))
(org-bullets-mode t) (org-bullets-mode t)
(org-indent-mode t) (org-indent-mode t)
(setq org-ellipsis " ▸" org-hide-emphasis-markers t org-src-fontify-natively t (setq org-ellipsis " ▸" org-hide-emphasis-markers t org-src-fontify-natively t
@ -683,7 +729,7 @@
"b h" '(org-roam-buffer-deactivate :which-key "roam buffer hide ") "b h" '(org-roam-buffer-deactivate :which-key "roam buffer hide ")
"s" '(org-roam-server-mode :which-key "roam server ")) "s" '(org-roam-server-mode :which-key "roam server "))
:custom :custom
(org-roam-directory "~/Brain") (org-roam-directory "~/Notes")
:config :config
(setq (setq
org-roam-server-host "127.0.0.1" org-roam-server-host "127.0.0.1"
@ -712,3 +758,61 @@
#+RESULTS: #+RESULTS:
: org-roam-protocol : org-roam-protocol
* Languages
** Flycheck
#+begin_src emacs-lisp
(use-package flycheck
:init
(flycheck-set-checker-executable "c/c++-clang" "~/code/competitive/clang++")
)
(use-package flycheck-irony
:after flycheck
(add-hook 'flycheck-mode-hook #'flycheck-irony-setup)
)
#+end_src
** LSP
#+begin_src emacs-lisp
(use-package lsp-mode
:hook ((prog-mode). lsp)
:init
(setq lsp-keymap-prefix "C-SPC c")
(setq lsp-client-packages nil
:config
(lsp-mode . lsp-enable-which-key-integration)
:commands (lsp lsp-deferred)
)
(use-package lsp-treemacs
:after lsp-mode
)
(use-package lsp-ivy)
#+end_src
** C/CPP
#+begin_src emacs-lisp
(use-package irony
:init
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'objc-mode-hook 'irony-mode)
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
)
#+end_src
** Markdown
#+begin_src emacs-lisp
(use-package markdown-mode)
#+end_src
** Ocaml
#+begin_src emacs-lisp
(use-package tuareg)
#+end_src
** Nix
#+begin_src emacs-lisp
(use-package direnv
:config
(direnv-mode))
(add-hook 'lsp-mode-hook #'direnv-update-environment)
#+end_src

View file

@ -47,7 +47,7 @@
; '(custom-safe-themes ; '(custom-safe-themes
; '("6b5c518d1c250a8ce17463b7e435e9e20faa84f3f7defba8b579d4f5925f60c1" "75b8719c741c6d7afa290e0bb394d809f0cc62045b93e1d66cd646907f8e6d43" "7661b762556018a44a29477b84757994d8386d6edee909409fabe0631952dad9" default)) ; '("6b5c518d1c250a8ce17463b7e435e9e20faa84f3f7defba8b579d4f5925f60c1" "75b8719c741c6d7afa290e0bb394d809f0cc62045b93e1d66cd646907f8e6d43" "7661b762556018a44a29477b84757994d8386d6edee909409fabe0631952dad9" default))
'(package-selected-packages '(package-selected-packages
'(org-roam-server visual-fill-column org-bullets workgroups2 neotree treemacs-persp treemacs-magit treemacs-icons-dired treemacs-projectile treemacs-evil treemacs-all-the-icons ivy-rich which-key rainbow-delimiters highlight-parentheses org-roam general use-package))) '(org-roam-server visual-fill-column org-bullets workgroups2 neotree treemacs-persp treemacs-magit treemacs-icons-dired treemacs-projectile treemacs-evil which-key rainbow-delimiters highlight-parentheses org-roam general use-package)))
(use-package doom-modeline (use-package doom-modeline
:init :init
@ -88,6 +88,27 @@
:hook (prog-mode . rainbow-delimiters-mode)) :hook (prog-mode . rainbow-delimiters-mode))
(use-package all-the-icons) (use-package all-the-icons)
(use-package all-the-icons-ivy
:init (add-hook 'after-init-hook 'all-the-icons-ivy-setup))
(use-package ivy
:diminish
:bind (("C-s" . swiper)
:map ivy-minibuffer-map
("TAB" . ivy-alt-done)
("C-l" . ivy-alt-done)
("C-j" . ivy-next-line)
("C-k" . ivy-previous-line)
:map ivy-switch-buffer-map
("C-k" . ivy-previous-line)
("C-l" . ivy-done)
("C-d" . ivy-switch-buffer-kill)
:map ivy-reverse-i-search-map
("C-k" . ivy-previous-line)
("C-d" . ivy-reverse-i-search-kill))
:config
(ivy-mode 1)
)
(use-package treemacs-all-the-icons) (use-package treemacs-all-the-icons)
(use-package treemacs (use-package treemacs
:after all-the-icons :after all-the-icons
@ -262,7 +283,10 @@
(treemacs-load-theme 'Material) (treemacs-load-theme 'Material)
(use-package undo-tree) (use-package undo-tree
:init
(global-undo-tree-mode)
)
(use-package evil (use-package evil
:init :init
(setq evil-want-keybinding nil) (setq evil-want-keybinding nil)
@ -291,70 +315,75 @@
:config :config
(evil-collection-init)) (evil-collection-init))
(use-package counsel)
(use-package ivy (use-package ivy
:diminish :diminish
:bind ( :bind (
("M-x" . counsel-M-x) ("M-x" . counsel-M-x)
("C-s" . swiper) ("C-s" . swiper)
:map ivy-minibuffer-map :map ivy-minibuffer-map
("TAB" . ivy-alt-done) ("TAB" . ivy-alt-done)
("C-f" . ivy-alt-done) ("C-f" . ivy-alt-done)
("C-l" . ivy-alt-done) ("C-l" . ivy-alt-done)
("C-j" . ivy-next-line) ("C-j" . ivy-next-line)
("C-k" . ivy-previous-line) ("C-k" . ivy-previous-line)
:map ivy-switch-buffer-map :map ivy-switch-buffer-map
("C-k" . ivy-previous-line) ("C-k" . ivy-previous-line)
("C-l" . ivy-done) ("C-l" . ivy-done)
("C-d" . ivy-switch-buffer-kill) ("C-d" . ivy-switch-buffer-kill)
:map ivy-reverse-i-search-map :map ivy-reverse-i-search-map
("C-k" . ivy-previous-line) ("C-k" . ivy-previous-line)
("C-d" . ivy-reverse-i-search-kill)) ("C-d" . ivy-reverse-i-search-kill))
:init :init
(ivy-mode 1)) (ivy-mode 1))
(use-package counsel-projectile (use-package counsel
:config (counsel-projectile-mode)) :bind (("C-M-j" . 'counsel-switch-buffer)
:map minibuffer-local-map
("C-r" . 'counsel-minibuffer-history))
:config
(counsel-mode 1))
(use-package counsel-projectile
:config (counsel-projectile-mode))
;; Keybindings ;; Keybindings
(defun add-to-map(keys func) (defun add-to-map(keys func)
"Add a keybinding in evil mode from keys to func." "Add a keybinding in evil mode from keys to func."
(define-key evil-normal-state-map (kbd keys) func) (define-key evil-normal-state-map (kbd keys) func)
(define-key evil-motion-state-map (kbd keys) func)) (define-key evil-motion-state-map (kbd keys) func))
;;(add-to-map "<SPC>" nil) ;;(add-to-map "<SPC>" nil)
;;(add-to-map "<SPC> <SPC>" 'counsel-M-x) ;;(add-to-map "<SPC> <SPC>" 'counsel-M-x)
;; (add-to-map "<SPC> f" 'lusty-file-explorer) ;; (add-to-map "<SPC> f" 'lusty-file-explorer)
;; (add-to-map "<SPC> b" 'lusty-buffer-explorer) ;; (add-to-map "<SPC> b" 'lusty-buffer-explorer)
;;(add-to-map "<SPC> o" 'treemacs) ;;(add-to-map "<SPC> o" 'treemacs)
;;(add-to-map "<SPC> s" 'save-buffer) ;;(add-to-map "<SPC> s" 'save-buffer)
(add-to-map "TAB" 'company-indent-or-complete-common)
(defun open-file (file) (defun open-file (file)
"just more shortest function for opening the file" "just more shortest function for opening the file"
(interactive) (interactive)
((lambda (file) (interactive) ((lambda (file) (interactive)
(find-file (expand-file-name (format "%s" file)))) file ) ) (find-file (expand-file-name (format "%s" file)))) file ) )
(use-package general) (use-package general)
(general-evil-setup) (general-evil-setup)
(general-nmap (general-nmap
:prefix "SPC" :prefix "SPC"
;; dotfiles editing config ;; dotfiles editing config
"SPC" '(counsel-M-x :which-key "M-x") "SPC" '(counsel-M-x :which-key "M-x")
"o" '(treemacs :which-key "treemacs") "o" '(treemacs :which-key "treemacs")
"f f" '(counsel-find-file :which-key "find-file") "f f" '(counsel-find-file :which-key "find-file")
"f r" '(counsel-buffer-or-recentf :which-key "recent files") "f r" '(counsel-buffer-or-recentf :which-key "recent files")
"b b" '(counsel-switch-buffer :which-key "switch buff") "b b" '(counsel-switch-buffer :which-key "switch buff")
"f e" '(lambda() (interactive) (find-file "~/.emacs.d/config.org") :which-key "config.org") "f e" '(lambda() (interactive) (find-file "~/.emacs.d/config.org") :which-key "config.org")
"f v" '(lambda() (interactive) (find-file "~/.config/nvim/init.vim" :which-key "neovim config" )) "f v" '(lambda() (interactive) (find-file "~/.config/nvim/init.vim" :which-key "neovim config" ))
"f d" '(lambda() (interactive) (find-file "~/dotfiles/home" :which-key "dotfiles dired" )) "f d" '(lambda() (interactive) (find-file "~/dotfiles/home" :which-key "dotfiles dired" ))
"f a" '(lambda() (interactive) (find-file "~/.config/alacritty/alacritty.yml" :which-key "alacritty")) "f a" '(lambda() (interactive) (find-file "~/.config/alacritty/alacritty.yml" :which-key "alacritty"))
"f b" '(lambda() (interactive) (find-file "~/Brain") :which-key "my brain") "f b" '(lambda() (interactive) (find-file "~/Notes") :which-key "my brain")
) )
(use-package which-key (use-package which-key
:init (which-key-mode) :init (which-key-mode)
@ -366,6 +395,20 @@
:init :init
(ivy-rich-mode 1)) (ivy-rich-mode 1))
(use-package company
:after lsp-mode
:hook (lsp-mode . company-mode)
:bind (:map company-active-map
("<tab>" . company-complete-selection))
(:map lsp-mode-map
("<tab>" . company-indent-or-complete-common))
:custom
(company-minimum-prefix-length 1)
(company-idle-delay 0.0))
(use-package company-box
:hook (company-mode . company-box-mode))
(set-face-attribute 'variable-pitch nil (set-face-attribute 'variable-pitch nil
;; :font "Cantarell" ;; :font "Cantarell"
:font "Hack" :font "Hack"
@ -410,7 +453,7 @@
:hook ((org-mode . my/org-mode-setup) :hook ((org-mode . my/org-mode-setup)
(org-mode . variable-pitch-mode) (org-mode . variable-pitch-mode)
) )
:config (setq org-agenda-files `("~/Brain" "~/Brain/Tasks/Tasks.org")) :config (setq org-agenda-files `("~/Notes" "~/Notes/Tasks/Tasks.org"))
(org-bullets-mode t) (org-bullets-mode t)
(org-indent-mode t) (org-indent-mode t)
(setq org-ellipsis "" org-hide-emphasis-markers t org-src-fontify-natively t (setq org-ellipsis "" org-hide-emphasis-markers t org-src-fontify-natively t
@ -551,7 +594,7 @@
"b h" '(org-roam-buffer-deactivate :which-key "roam buffer hide ") "b h" '(org-roam-buffer-deactivate :which-key "roam buffer hide ")
"s" '(org-roam-server-mode :which-key "roam server ")) "s" '(org-roam-server-mode :which-key "roam server "))
:custom :custom
(org-roam-directory "~/Brain") (org-roam-directory "~/Notes")
:config :config
(setq (setq
org-roam-server-host "127.0.0.1" org-roam-server-host "127.0.0.1"
@ -575,3 +618,42 @@
(require 'org-roam-protocol) (require 'org-roam-protocol)
(use-package flycheck
:init
(flycheck-set-checker-executable "c/c++-clang" "~/code/competitive/clang++")
)
(use-package flycheck-irony
:after flycheck
(add-hook 'flycheck-mode-hook #'flycheck-irony-setup)
)
(use-package lsp-mode
:init
(setq lsp-keymap-prefix "C-SPC c")
:config
(lsp-mode . lsp-enable-which-key-integration)
:commands (lsp lsp-deferred)
)
(use-package lsp-treemacs
:after lsp-mode
)
(use-package lsp-ivy)
(use-package irony
:init
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'objc-mode-hook 'irony-mode)
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
)
(use-package markdown-mode)
(use-package tuareg)
(use-package direnv
:config
(direnv-mode))
(add-hook 'lsp-mode-hook #'direnv-update-environment)