Commit 5a82b8ec authored by marc0s's avatar marc0s

refactor: remove old crap

parent 83065b3d
......@@ -133,25 +133,6 @@ work here..."
:init
(add-hook 'coffee-mode-hook 'marc0s/coffee-mode-hook))
(defvar company-clang-executable)
(defvar company-dabbrev-downcase)
(use-package company
:ensure t
:diminish "Co"
:config
(setq company-clang-executable "/usr/bin/clang-5.0")
(global-company-mode 1)
(setq
company-echo-delay 0
company-idle-delay 0.1
company-minimum-prefix-length 1
company-tooltip-align-annotations t
;; company-tooltip-limit 10
company-tooltip-flip-when-above t
company-dabbrev-downcase nil
company-require-match nil
company-begin-commands '(self-insert-command)))
(use-package editorconfig
:ensure t
:init
......@@ -170,17 +151,6 @@ work here..."
:ensure t
:bind ("C-=" . er/expand-region))
;; (use-package fill-column-indicator
;; :init
;; (add-hook 'prog-mode-hook #'turn-on-fci-mode))
;; (defun on-off-fci-before-company(command)
;; (when (string= "show" command)
;; (turn-off-fci-mode))
;; (when (string= "hide" command)
;; (turn-on-fci-mode)))
;; (advice-add 'company-call-frontends :before #'on-off-fci-before-company)
(use-package eslintd-fix
:ensure t
:init
......@@ -200,17 +170,6 @@ work here..."
(window-height . 0.2)))
(defun my/use-eslintd ()
(setq-local flycheck-javascript-eslint-executable (concat (getenv "NVM_BIN") "/eslint_d")))
;; Look up nearest node_modules/eslint installation and use it
;; (defun my/use-eslint-from-node-modules ()
;; (let* ((root (locate-dominating-file
;; (or (buffer-file-name) default-directory)
;; "node_modules"))
;; (eslint (and root
;; (expand-file-name "node_modules/eslint/bin/eslint.js"
;; root))))
;; (when (and eslint (file-executable-p eslint))
;; (setq-local flycheck-javascript-eslint-executable eslint))))
;; (add-hook 'flycheck-mode-hook #'my/use-eslint-from-node-modules)
(add-hook 'flycheck-mode-hook #'my/use-eslintd)
:config
(use-package flycheck-pos-tip
......@@ -220,12 +179,6 @@ work here..."
(use-package flycheck-plantuml
:ensure t
:init (flycheck-plantuml-setup))
;; ;; disable json-jsonlist checking for json files
;; (setq-default flycheck-disabled-checkers
;; (append flycheck-disabled-checkers
;; '(json-jsonlist)))
;; (flycheck-add-mode 'javascript-eslint 'js2-mode)
(add-hook 'after-init-hook #'global-flycheck-mode))
(use-package helm
......@@ -255,77 +208,6 @@ work here..."
:config
(add-hook 'prog-mode-hook 'idle-highlight-mode))
(use-package irony
:ensure t
:config
;; (use-package cpputils-cmake
;; :ensure t
;; :config
;; (add-hook 'c-mode-common-hook
;; (lambda ()
;; (if (derived-mode-p 'c-mode 'c++-mode)
;; (cppcm-reload-all)
;; ))))
(use-package irony-eldoc
:ensure t
:config
(add-hook 'irony-mode-hook #'irony-eldoc))
(use-package company-irony
:ensure t
:after company
:config
(add-to-list 'company-backends 'company-irony))
;; replace the `completion-at-point' and `complete-symbol' bindings in
;; irony-mode's buffers by irony-mode's function
(use-package flycheck-clangcheck
:ensure t
:config
(defun marc0s/flycheck-clang-setup ()
;; disable gcc-check
;;(add-to-list 'flycheck-disabled-checkers 'c/c++-gcc)
;;(flycheck-select-checker 'c/c++-clangcheck)
(setq flycheck-clangcheck-build-path "/home/marcos/Projects/Quobis/sippo-cpp/build/amd")))
(defun marc0s/irony-mode-hook ()
(define-key irony-mode-map [remap completion-at-point]
'irony-completion-at-point-async)
(define-key irony-mode-map [remap complete-symbol]
'irony-completion-at-point-async)
(eval-after-load 'flycheck
'(add-hook 'flycheck-mode-hook #'marc0s/flycheck-clang-setup)))
;; If irony server was never installed, install it.
(unless (irony--find-server-executable) (call-interactively #'irony-install-server))
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'objc-mode-hook 'irony-mode)
(setq irony-additional-clang-options '("-std=c++11"))
;; Use compilation database first, clang_complete as fallback.
(setq-default irony-cdb-compilation-databases '(irony-cdb-libclang
irony-cdb-clang-complete))
(add-hook 'irony-mode-hook 'marc0s/irony-mode-hook)
(use-package flycheck-clang-analyzer
:ensure t
:after flycheck
:config (flycheck-clang-analyzer-setup))
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))
(use-package clang-format
:ensure t
:config
(defun marc0s/clang-format-buffer-smart ()
"Reformat buffer if .clang-format exists in the projectile root."
(when (file-exists-p (expand-file-name ".clang-format" (projectile-project-root)))
(clang-format-buffer)))
(add-hook 'c++-mode-hook (lambda ()
(add-hook 'before-save-hook 'marc0s/clang-format-buffer-smart nil t))))
;; (use-package flycheck-irony
;; :ensure t
;; :init
;; (eval-after-load 'flycheck
;; '(add-hook 'flycheck-mode-hook #'flycheck-irony-setup)))
(use-package js2-refactor
:ensure t
:config
......@@ -337,19 +219,13 @@ work here..."
:config
(add-hook 'js2-mode #'discover-js2-refactor))
;; (use-package tern
;; :ensure t
;; :diminish "T")
;; ;; :config
;; ;; (setq tern-command '("/home/marcos/.nvm/v6.10.3/bin/node" "/home/marcos/.nvm/v6.10.3/bin/tern" "--no-port-file")))
(use-package js2-mode
:ensure t
:mode ("\\.js\\'" . js2-mode)
:preface
(defun marc0s/fix-js2-indent ()
"Set `tab-width' when loading js2-mode."
;; (setq tab-width 4)
(setq tab-width 4)
;; (setq-local js-indent-level 4)
(setq fill-column 100))
(defun marc0s/js2-flycheck ()
......@@ -375,19 +251,12 @@ work here..."
(setq-default js2-strict-inconsistent-return-warning nil)
(setq-default js-switch-indent-offset 4)
(setq-default js2-global-externs '("module" "require" "assert" "setTimeout" "clearTimeout" "setInterval" "clearInterval" "location" "__dirname" "console" "JSON"))
(add-hook 'js2-mode-hook #'add-node-modules-path)
(add-hook 'js2-mode-hook #'marc0s/fix-js2-indent)
(add-hook 'js2-mode-hook #'marc0s/js2-flycheck)
(add-hook 'js2-mode-hook #'marc0s/js2-lsp)
;; (add-hook 'js2-mode-hook #'setup-tide-mode)
;; (add-hook 'js2-mode-hook #'tern-mode)
;; open up the documentation from symbol at point
;; (define-key js-mode-map (kbd "<C-f1>") #'tide-documentation-at-point)
(define-key js-mode-map (kbd "C-c m") #'marc0s/mdn-search))
;; (use-package company-tern
;; :ensure t
;; :config (add-to-list 'company-backends '(company-tern :with company-yasnippet)))
(use-package company
:ensure t)
(use-package company-quickhelp
:ensure t
:init (company-quickhelp-mode 1))
......@@ -594,25 +463,6 @@ work here..."
(add-hook 'prog-mode-hook '(lambda ()
(local-set-key (kbd "RET") 'newline-and-indent)))
;; configure javascript-tide checker to run after your default javascript checker
;; (flycheck-add-next-checker 'javascript-eslint 'javascript-tide 'append)
;; (defun setup-tide-mode ()
;; "Set up tide configuration."
;; (interactive)
;; (tide-setup)
;; (flycheck-mode +1)
;; (setq flycheck-check-syntax-automatically '(save mode-enabled))
;; (eldoc-mode +1)
;; (tide-hl-identifier-mode +1)
;; (company-mode +1)
;; (defvar tide-sort-completions-by-kind)
;; (defvar tide-hl-identifier-idle-time)
;; (defvar tide-always-show-documentation)
;; (setq tide-sort-completions-by-kind t)
;; (setq tide-hl-identifier-idle-time 0.1)
;; (setq tide-always-show-documentation t))
;; aligns annotation to the right hand side
(setq company-tooltip-align-annotations t)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment