Adds changes from the org file to the init.el.

This commit is contained in:
Mariano Uvalle 2021-05-28 19:32:04 -05:00
parent b9f6f3be53
commit 2a39995762

25
init.el
View file

@ -10,6 +10,9 @@
;; Avoid asking confirmation when killing a buffer with a process. ;; Avoid asking confirmation when killing a buffer with a process.
(setq kill-buffer-query-functions nil) (setq kill-buffer-query-functions nil)
;; Don't show warnings when doing async native com.
(setq native-comp-async-report-warnings-errors nil)
(require 'package) (require 'package)
;; Specify repositories. ;; Specify repositories.
@ -187,10 +190,11 @@ Repeated invocations toggle between the two most recently open buffers."
(cl-remove-if-not 'buffer-file-name (buffer-list))))) ;; Only remove file buffers. (cl-remove-if-not 'buffer-file-name (buffer-list))))) ;; Only remove file buffers.
(defun mariano/kill-buffer-and-window () (defun mariano/kill-buffer-and-window ()
"Kills the current buffer. If there's more than one active window it also closes the current one" "Kills the current buffer. If there's more than one window and it is not the leftmost window, it also kills it."
(interactive) (interactive)
(if (> (count-windows) 1) (if (and (> (count-windows) 1)
(kill-buffer-and-window) (window-left (selected-window)))
(kill-buffer-and-window)
(kill-buffer))) (kill-buffer)))
@ -463,6 +467,7 @@ Repeated invocations toggle between the two most recently open buffers."
"lg" '(:ignore t :which-key "goto") "lg" '(:ignore t :which-key "goto")
"lgd" '(lsp-find-definition :which-key "go to definition") "lgd" '(lsp-find-definition :which-key "go to definition")
"lgi" '(lsp-find-implementation :which-key "find implementation") "lgi" '(lsp-find-implementation :which-key "find implementation")
"lgr" '(lsp-find-references :which-key "find references")
"lr" '(:ignore t :which-key "refactor") "lr" '(:ignore t :which-key "refactor")
"lrr" '(lsp-rename :which-key "rename") "lrr" '(lsp-rename :which-key "rename")
) )
@ -540,6 +545,20 @@ Repeated invocations toggle between the two most recently open buffers."
(setq lsp-language-id-configuration (setq lsp-language-id-configuration
(cons '("\\.prisma$" . "prisma") lsp-language-id-configuration)) (cons '("\\.prisma$" . "prisma") lsp-language-id-configuration))
(use-package elixir-mode
:hook (elixir-mode . lsp-deferred)
:init
(add-to-list 'exec-path "/Users/marianouvalle/.config/nvim/lang-srvrs/elixir-ls"))
(add-hook 'elixir-mode-hook
(lambda () (add-hook 'before-save-hook 'lsp-format-buffer nil 'local)))
(add-hook 'c-mode-hook
(lambda () (lsp t)))
(add-hook 'c++-mode-hook
(lambda () (lsp t)))
(defun mariano/company-select-first-and-complete () (defun mariano/company-select-first-and-complete ()
"Selects the appropriate candidate in the company mode list and completes it." "Selects the appropriate candidate in the company mode list and completes it."
(interactive) (interactive)