Adds changes from the org file to the init.el.
This commit is contained in:
parent
b9f6f3be53
commit
2a39995762
1 changed files with 27 additions and 8 deletions
35
init.el
35
init.el
|
|
@ -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.
|
||||||
|
|
@ -179,18 +182,19 @@ Repeated invocations toggle between the two most recently open buffers."
|
||||||
"wf" '(mariano/toggle-maximize-window :which-key "maximize window"))
|
"wf" '(mariano/toggle-maximize-window :which-key "maximize window"))
|
||||||
|
|
||||||
;; Kill all buffers except the current one.
|
;; Kill all buffers except the current one.
|
||||||
(defun kill-other-buffers ()
|
(defun kill-other-buffers ()
|
||||||
"Kill all other buffers."
|
"Kill all other buffers."
|
||||||
(interactive)
|
(interactive)
|
||||||
(mapc 'kill-buffer ;; Apply the command kill-buffer to all elements of the list.
|
(mapc 'kill-buffer ;; Apply the command kill-buffer to all elements of the list.
|
||||||
(delq (current-buffer) ;; Remove the current buffer from the list of to-be-removed.
|
(delq (current-buffer) ;; Remove the current buffer from the list of to-be-removed.
|
||||||
(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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue