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

23
init.el
View file

@ -10,6 +10,9 @@
;; Avoid asking confirmation when killing a buffer with a process.
(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)
;; Specify repositories.
@ -187,9 +190,10 @@ Repeated invocations toggle between the two most recently open buffers."
(cl-remove-if-not 'buffer-file-name (buffer-list))))) ;; Only remove file buffers.
(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)
(if (> (count-windows) 1)
(if (and (> (count-windows) 1)
(window-left (selected-window)))
(kill-buffer-and-window)
(kill-buffer)))
@ -463,6 +467,7 @@ Repeated invocations toggle between the two most recently open buffers."
"lg" '(:ignore t :which-key "goto")
"lgd" '(lsp-find-definition :which-key "go to definition")
"lgi" '(lsp-find-implementation :which-key "find implementation")
"lgr" '(lsp-find-references :which-key "find references")
"lr" '(:ignore t :which-key "refactor")
"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
(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 ()
"Selects the appropriate candidate in the company mode list and completes it."
(interactive)