Direnv
This commit is contained in:
parent
de0c02bceb
commit
c9040399a4
1 changed files with 34 additions and 0 deletions
34
config.org
34
config.org
|
|
@ -77,6 +77,7 @@
|
|||
- [[#sudo-edit][SUDO EDIT]]
|
||||
- [[#password-store][Password store]]
|
||||
- [[#cmake-projects][CMake Projects]]
|
||||
- [[#direnv][Direnv]]
|
||||
- [[#language-support][Language support]]
|
||||
- [[#nix][Nix]]
|
||||
- [[#glsl][GLSL]]
|
||||
|
|
@ -1448,6 +1449,39 @@ Vterm is a terminal emulator within Emacs. The 'shell-file-name' setting sets t
|
|||
(add-to-list 'project-find-functions 'mu-project-try-local)
|
||||
)
|
||||
#+end_src
|
||||
* Direnv
|
||||
Loading of environment for the buffers
|
||||
#+begin_src emacs-lisp
|
||||
(use-package direnv
|
||||
:ensure t
|
||||
:config
|
||||
(direnv-mode))
|
||||
#+end_src
|
||||
|
||||
Function to enable it for project
|
||||
#+begin_src emacs-lisp
|
||||
(defun kylekrein/project-enable-direnv-flake ()
|
||||
"Add `use flake` to .envrc and run `direnv allow` in the project root."
|
||||
(interactive)
|
||||
(let* ((project (project-current t))
|
||||
(root (project-root project))
|
||||
(envrc-path (expand-file-name ".envrc" root)))
|
||||
(unless (file-exists-p envrc-path)
|
||||
(with-temp-buffer
|
||||
(insert "use flake\n")
|
||||
(write-file envrc-path)))
|
||||
(unless (string-match-p "use flake" (with-temp-buffer
|
||||
(insert-file-contents envrc-path)
|
||||
(buffer-string)))
|
||||
(with-temp-buffer
|
||||
(insert-file-contents envrc-path)
|
||||
(goto-char (point-max))
|
||||
(insert "\nuse flake\n")
|
||||
(write-file envrc-path)))
|
||||
(let ((default-directory root))
|
||||
(shell-command "direnv allow"))
|
||||
(message "Added 'use flake' to .envrc and ran direnv allow in %s" root)))
|
||||
#+end_src
|
||||
* Language support
|
||||
Emacs has built-in programming language modes for Lisp, Scheme, DSSSL, Ada, ASM, AWK, C, C++, Fortran, Icon, IDL (CORBA), IDLWAVE, Java, Javascript, M4, Makefiles, Metafont, Modula2, Object Pascal, Objective-C, Octave, Pascal, Perl, Pike, PostScript, Prolog, Python, Ruby, Simula, SQL, Tcl, Verilog, and VHDL. Other languages will require you to install additional modes.
|
||||
** Nix
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue