Skip to content

Commit

Permalink
Setup direnv integration
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyklay committed Nov 24, 2024
1 parent 1ee3575 commit 1ddac2b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ and I have no insight into how it behaves on older versions.

I have built this configuration with the following tools in mind:

- [[https://direnv.net/][direnv (=direnv=)]]
- [[https://github.com/BurntSushi/ripgrep][ripgrep (=rg=)]]
- [[https://git-scm.com][Git (=git=)]]
- [[https://www.gnupg.org][GnuPG (=gpg=)]]
Expand Down
7 changes: 7 additions & 0 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ advice for `require-package', to which ARGS are passed."
csv-mode ; CSV file editing mode
embark ; Contextual actions in buffers
embark-consult ; Embark integration with Consult
envrc ; Environment variable manager for shell
erc-hl-nicks ; Nick highlighting in ERC (IRC client)
flyspell-correct ; Correct spelling with popup menus
git-modes ; Modes for Git-related files
Expand Down Expand Up @@ -2366,6 +2367,12 @@ This function serves multiple purposes:
;; Pressing "M-s e" will open Eshell in the current buffer.
(global-set-key (kbd "M-s e") 'eshell)

;; Setup buffer-local direnv integration for Emacs.
(when (executable-find "direnv")
;; `envrc-global-mode' should be enabled after other global minor modes,
;; since each prepends itself to various hooks.
(add-hook 'after-init-hook #'envrc-global-mode))


;;;; News, Feeds and Mail

Expand Down
16 changes: 16 additions & 0 deletions share/doc/python/USAGE.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
* Setup python project

Go to project root and run the following commands:

#+begin_src shell
# Set it up for direnv
echo "export VIRTUAL_ENV=.venv" > .envrc
echo "layout python3" > .envrc

direnv allow

# Set up language server
python -m pip install python-lsp-server pylsp-mypy
#+end_src

Next, open project in Emacs and run ~M-x lsp~.

0 comments on commit 1ddac2b

Please sign in to comment.