Skip to content

Instantly share code, notes, and snippets.

@stapelberg
Created December 14, 2022 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stapelberg/d802e84321d94f946171862e0e9f2c94 to your computer and use it in GitHub Desktop.
Save stapelberg/d802e84321d94f946171862e0e9f2c94 to your computer and use it in GitHub Desktop.
(setq user-emacs-directory (format "/tmp/emacsd/%s/%s/" (file-name-base load-file-name) emacs-version))
(setq package-user-dir (concat user-emacs-directory "elpa/"))
(setq package-archives
'(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(package-initialize)
(defun install-package (pkg)
(unless (package-installed-p pkg)
(package-refresh-contents)
(package-install pkg))
(require pkg))
(install-package 'eglot)
(install-package 'go-mode)
(add-to-list 'eglot-server-programs '(go-mode . ("gopls")))
(add-hook 'go-mode-hook 'eglot-ensure)
(add-hook 'after-init-hook
(lambda ()
(find-file "nftables_test.go")))
(run-hooks 'after-init-hook)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment