From ccedf83ac9f6826bc346d4f568a021bacfffbc66 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sun, 10 Nov 2019 10:40:34 +0100 Subject: [PATCH] Switched to LSP backend, added packages to install and configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Emacs, I switched to the LSP backend for C/C++, CSS, Dart, HTML, Go, Javascript and Python. I also removed a redundant line for web-beautify, and I removed the plantuml layer since I don’t use it. This lead to the installation of multiple packages, some of which were already required but not explicitly installed by the bootstrap. I added the packages existing in the Arch repos and the AUR, and some packages will get installed by pip or by go’s package manager. I also set up the configuration of Chicken, and more precisely, of its documentation. --- .spacemacs | 47 +++++++++++++++++--------- .yadm/bootstrap | 57 +++++++++++++++++++++++--------- README.org | 87 ++++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 145 insertions(+), 46 deletions(-) diff --git a/.spacemacs b/.spacemacs index 690c36f..e6d7cd9 100644 --- a/.spacemacs +++ b/.spacemacs @@ -51,14 +51,20 @@ This function should only modify configuration layer settings." (c-c++ :variables c-c++-default-mode-for-headers 'c-mode c-c++-adopt-subprojects t - c-c++-enable-clang-support t c-c++-enable-google-style t - c-c++-enable-c++11 t) + c-c++-enable-c++11 t + c-c++-backend 'lsp-ccls + c-c++-lsp-executable "/usr/bin/ccls" + c-c++-lsp-sem-highlight-method 'overlay + c-c++-lsp-sem-highlight-rainbow t + c-c++-adopt-subprojects t + c++-enable-organize-includes-on-save t) (cmake :variables cmake-enable-cmake-ide-support t) conlanging csv colors + dart dired-phundrak django docker @@ -69,21 +75,29 @@ This function should only modify configuration layer settings." github graphviz (go :variables - go-use-gometalinter t - go-tab-width 2) + go-backend 'lsp + go-tab-width 2 + go-use-golangci-lint t) gnus gpu (helm :variables helm-no-header t helm-use-fuzzy 'source) (html :variables - web-fmt-tool 'web-beautify) + web-fmt-tool 'web-beautify + css-enable-lsp t + less-enable-lsp t + scss-enable-lsp t + html-enable-lsp t) (ibuffer :variables ibuffer-group-buffers-by 'projects) imenu-list (javascript :variables - javascript-backend 'tern - javascript-fmt-tool 'web-beautify) + javascript-backend 'lsp + javascript-lsp-linter nil + javascript-fmt-tool 'web-beautify + javascript-repl 'skewer + node-add-modules-path t) (json :variables json-fmt-tool 'web-beautify) (latex :variables @@ -91,6 +105,7 @@ This function should only modify configuration layer settings." latex-enable-auto-fill t latex-enable-folding t latex-enable-magic t) + lsp (markdown :variables markdown-live-preview-engine 'vmd markdown-mmm-auto-modes '("c" @@ -110,25 +125,25 @@ This function should only modify configuration layer settings." org-return-follows-link t) pass pdf - (plantuml :variables - plantuml-jar-path "/opt/plantuml/plantuml.jar" - org-plantuml-jar-path "/opt/plantuml/plantuml.jar") prettier prolog (python :variables - python-backend 'anaconda + python-backend 'lsp python-sort-imports-on-save t python-fill-column 80 - python-enable-yapf-format-on-save t) + python-test-runner '(pytest nose) + python-formatter 'lsp) (restclient :variables restclient-use-org t) - rust - scheme + (rust :variables rust-backend 'lsp) + (scheme :variables + geiser-chicken-binary "chicken-csi") semantic (shell :variables shell-default-height 40 shell-default-position 'right - shell-default-shell 'eshell) + shell-default-shell 'eshell + shell-default-full-span nil) shell-scripts selectric semantic @@ -148,7 +163,6 @@ This function should only modify configuration layer settings." twitter unicode-fonts w3m - web-beautify xkcd web-beautify yaml) @@ -164,6 +178,7 @@ This function should only modify configuration layer settings." edit-indirect elcord eshell-git-prompt + flycheck-golangci-lint kaolin-themes magit-gitflow meson-mode diff --git a/.yadm/bootstrap b/.yadm/bootstrap index 61bd1d2..cbbbd49 100755 --- a/.yadm/bootstrap +++ b/.yadm/bootstrap @@ -102,30 +102,34 @@ end set PACKAGES \ acpilight asar ascii aspell-en aspell-fr assimp awesome-terminal-fonts \ base-devel bat biber bleachbit bluez-firmware bluez-utils bookworm boost bzip2 \ -chromium clisp compton cppcheck cppreference cppreference-devhelp cpupower \ -cronie cryptsetup device-mapper diffutils discord-canary discount ditaa dmenu \ -dmenu-lpass docker docker-compose doxygen dunst dwarffortress emacs \ -exfat-utils farbfel ffmpegthumbnailer findutils firefox flake8 \ +chiken chromium clisp compton cppcheck cppreference cppreference-devhelp \ +cpupower cronie cryptsetup device-mapper diffutils discord-canary discount \ +ditaa dmenu dmenu-lpass docker docker-compose doxygen dunst dwarffortress \ +emacs exfat-utils farbfel ffmpegthumbnailer findutils firefox flake8 \ font-mathematica fontforge freeglut fzf gcc-libs gdb gimp glibc \ gnome-disk-utility gnome-epub-thumbnailer gnu-free-fonts gnuplot go-tools \ -graphviz htop i3-gaps i3lock-blur i3status igdm-bin inetutils j4-dmenu-desktop \ -jfsutils jmtpfs lastpass-cli less linux-headers lldb logrotate lvm2 ly-git \ -meson minted mpc mpd mpd-rich-presence-discord-git mpv mupdf-tools nano ncdu \ -ncmpcpp nemo-fileroller nemo-preview neofetch neovim netctl networkmanager \ -networkmanager-openvpn nm-connection-editor nnn nomacs noto-fonts-emoji npm \ -ntfs-3g numlockx openssh p7zip pacman-contrib pandoc-bin pavucontrol pciutils \ -pcurses pdfpc polybar pulseaudio-bluetooth python-envtpl-git python-pip \ +golangci-lint-bin graphviz htop i3-gaps i3lock-blur i3status igdm-bin \ +inetutils j4-dmenu-desktop javascript-typescript-langserver jfsutils jmtpfs \ +lastpass-cli less linux-headers lldb logrotate lvm2 ly-git meson minted mpc \ +mpd mpd-rich-presence-discord-git mpv mupdf-tools nano ncdu ncmpcpp \ +nemo-fileroller nemo-preview neofetch neovim netctl networkmanager \ +networkmanager-openvpn nm-connection-editor nnn nodejs-vmd nomacs \ +noto-fonts-emoji npm ntfs-3g numlockx openssh p7zip pacman-contrib pandoc-bin \ +pavucontrol pciutils pcurses pdfpc polybar prettier pulseaudio-bluetooth \ +python-autoflake python-envtpl-git python-epc python-importmagic \ +python-language-server python-nose python-pip python-ptvsd python-pytest \ python-pywal qemu r raw-thumbnailer reflector rofi rofi-wifi-menu-git rsync \ -rtv rustup s-nail samba scrot sent shadow siji-git simplescreenrecorder \ +-rtv rustup s-nail samba scrot sent shadow siji-git simplescreenrecorder \ speedcrunch sshfs st-luke-git swi-prolog texlive-most texlive-bin \ texlive-langchinese texlive-langcyrillic texlive-langgreek \ texlive-langjapanese texlive-langkorean texlive-latexextra \ texlive-localmanager-git tmux tree ttf-arphic-uming ttf-baekmuk \ ttf-bitstream-vera ttf-dejavu ttf-google-fonts-opinionated-git ttf-joypixels \ ttf-liberation ttf-material-design-icons-git ttf-ms-fonts ttf-symbola \ -ttf-tibetan-machine ttf-twemoji-color ttf-unifont unicode unicode-emoji unrar \ -usbutils valgrind w3m wget x11-ssh-askpass xclip xdg-user-dirs-gtk \ -xdotool xorg-drivers xorg-apps xfsprogs xorg-server xorg-xinit xss-lock yapf +ttf-tibetan-machine ttf-twemoji-color ttf-unifont typescript unicode \ +unicode-emoji unrar usbutils valgrind w3m wget x11-ssh-askpass xclip \ +xdg-user-dirs-gtk xorg-drivers xorg-apps xfsprogs xorg-server xorg-xinit \ +xss-lock xvkbd yapf printf "\n# Installing needed packages ##################################################\n\n" yay -S --needed $PACKAGES @@ -200,5 +204,28 @@ cargo install rustfmt racer rustup component add src rustup component add rls +pip install --user pyls-isort pyls-mypy + +go get -v golang.org/x/tools/gopls@latest +go get -u -v golang.org/x/tools/cmd/godoc +go get -u -v golang.org/x/tools/cmd/goimports +go get -u -v golang.org/x/tools/cmd/gorename +go get -u -v golang.org/x/tools/cmd/guru +go get -u -v github.com/cweill/gotests/... +go get -u -v github.com/davidrjenni/reftools/cmd/fillstruct +go get -u -v github.com/fatih/gomodifytags +go get -u -v github.com/godoctor/godoctor +go get -u -v github.com/golangci/golangci-lint/cmd/golangci-lint +go get -u -v github.com/haya14busa/gopkgs/cmd/gopkgs +go get -u -v github.com/josharian/impl +go get -u -v github.com/mdempsky/gocode +go get -u -v github.com/rogpeppe/godef +go get -u -v github.com/zmb3/gogetdoc + +chicken-install -s apropos chicken-doc + +cd (chicken-csi -b -e "(import (chicken platform))" -p "(chicken-home)") +curl https://3e8.org/pub/chicken-doc/chicken-doc-repo.tgz | sudo tar zx + printf "\n# Clean the pacman and yay cache ##############################################\n\n" yay -Sc --noconfirm diff --git a/README.org b/README.org index 65f18c9..2de03dd 100644 --- a/README.org +++ b/README.org @@ -91,6 +91,9 @@ - [[#install-rust][Install Rust]] - [[#install-the-toolchains][Install the toolchains]] - [[#install-some-utilities][Install some utilities]] + - [[#install-some-python-packages][Install some python packages]] + - [[#install-go-packages][Install go packages]] + - [[#set-up-chicken-scheme-interpretercompiler][Set up Chicken (Scheme interpreter/compiler)]] - [[#clean-the-pacman-and-yay-cache][Clean the =pacman= and =yay= cache]] - [[#licence][Licence]] @@ -792,30 +795,34 @@ set PACKAGES \ acpilight asar ascii aspell-en aspell-fr assimp awesome-terminal-fonts \ base-devel bat biber bleachbit bluez-firmware bluez-utils bookworm boost bzip2 \ - chromium clisp compton cppcheck cppreference cppreference-devhelp cpupower \ - cronie cryptsetup device-mapper diffutils discord-canary discount ditaa dmenu \ - dmenu-lpass docker docker-compose doxygen dunst dwarffortress emacs \ - exfat-utils farbfel ffmpegthumbnailer findutils firefox flake8 \ + chiken chromium clisp compton cppcheck cppreference cppreference-devhelp \ + cpupower cronie cryptsetup device-mapper diffutils discord-canary discount \ + ditaa dmenu dmenu-lpass docker docker-compose doxygen dunst dwarffortress \ + emacs exfat-utils farbfel ffmpegthumbnailer findutils firefox flake8 \ font-mathematica fontforge freeglut fzf gcc-libs gdb gimp glibc \ gnome-disk-utility gnome-epub-thumbnailer gnu-free-fonts gnuplot go-tools \ - graphviz htop i3-gaps i3lock-blur i3status igdm-bin inetutils j4-dmenu-desktop \ - jfsutils jmtpfs lastpass-cli less linux-headers lldb logrotate lvm2 ly-git \ - meson minted mpc mpd mpd-rich-presence-discord-git mpv mupdf-tools nano ncdu \ - ncmpcpp nemo-fileroller nemo-preview neofetch neovim netctl networkmanager \ - networkmanager-openvpn nm-connection-editor nnn nomacs noto-fonts-emoji npm \ - ntfs-3g numlockx openssh p7zip pacman-contrib pandoc-bin pavucontrol pciutils \ - pcurses pdfpc polybar pulseaudio-bluetooth python-envtpl-git python-pip \ + golangci-lint-bin graphviz htop i3-gaps i3lock-blur i3status igdm-bin \ + inetutils j4-dmenu-desktop javascript-typescript-langserver jfsutils jmtpfs \ + lastpass-cli less linux-headers lldb logrotate lvm2 ly-git meson minted mpc \ + mpd mpd-rich-presence-discord-git mpv mupdf-tools nano ncdu ncmpcpp \ + nemo-fileroller nemo-preview neofetch neovim netctl networkmanager \ + networkmanager-openvpn nm-connection-editor nnn nodejs-vmd nomacs \ + noto-fonts-emoji npm ntfs-3g numlockx openssh p7zip pacman-contrib pandoc-bin \ + pavucontrol pciutils pcurses pdfpc polybar prettier pulseaudio-bluetooth \ + python-autoflake python-envtpl-git python-epc python-importmagic \ + python-language-server python-nose python-pip python-ptvsd python-pytest \ python-pywal qemu r raw-thumbnailer reflector rofi rofi-wifi-menu-git rsync \ - rtv rustup s-nail samba scrot sent shadow siji-git simplescreenrecorder \ + -rtv rustup s-nail samba scrot sent shadow siji-git simplescreenrecorder \ speedcrunch sshfs st-luke-git swi-prolog texlive-most texlive-bin \ texlive-langchinese texlive-langcyrillic texlive-langgreek \ texlive-langjapanese texlive-langkorean texlive-latexextra \ texlive-localmanager-git tmux tree ttf-arphic-uming ttf-baekmuk \ ttf-bitstream-vera ttf-dejavu ttf-google-fonts-opinionated-git ttf-joypixels \ ttf-liberation ttf-material-design-icons-git ttf-ms-fonts ttf-symbola \ - ttf-tibetan-machine ttf-twemoji-color ttf-unifont unicode unicode-emoji unrar \ - usbutils valgrind w3m wget x11-ssh-askpass xclip xdg-user-dirs-gtk \ - xdotool xorg-drivers xorg-apps xfsprogs xorg-server xorg-xinit xss-lock yapf + ttf-tibetan-machine ttf-twemoji-color ttf-unifont typescript unicode \ + unicode-emoji unrar usbutils valgrind w3m wget x11-ssh-askpass xclip \ + xdg-user-dirs-gtk xorg-drivers xorg-apps xfsprogs xorg-server xorg-xinit \ + xss-lock xvkbd yapf #+END_SRC These are the minimum I would have in my own installation. You can edit it however you want. Let’s install those. @@ -1043,6 +1050,56 @@ rustup component add rls #+END_SRC +*** Install some python packages + :PROPERTIES: + :CUSTOM_ID: h-8155ae1a-0be1-489f-be13-9222f7686fb2 + :END: + Some packages will be needed from pip in order to get our Emacs setup + correctly working. Let’s install them locally for our user: + #+BEGIN_SRC fish + pip install --user pyls-isort pyls-mypy + #+END_SRC + +*** Install go packages + :PROPERTIES: + :CUSTOM_ID: h-8c6e2311-eb84-4bf4-8e0b-948f89bc9664 + :END: + For go development from Emacs, the Spacemacs go layer requires some packages + to be installed. + #+BEGIN_SRC fish + go get -v golang.org/x/tools/gopls@latest + go get -u -v golang.org/x/tools/cmd/godoc + go get -u -v golang.org/x/tools/cmd/goimports + go get -u -v golang.org/x/tools/cmd/gorename + go get -u -v golang.org/x/tools/cmd/guru + go get -u -v github.com/cweill/gotests/... + go get -u -v github.com/davidrjenni/reftools/cmd/fillstruct + go get -u -v github.com/fatih/gomodifytags + go get -u -v github.com/godoctor/godoctor + go get -u -v github.com/golangci/golangci-lint/cmd/golangci-lint + go get -u -v github.com/haya14busa/gopkgs/cmd/gopkgs + go get -u -v github.com/josharian/impl + go get -u -v github.com/mdempsky/gocode + go get -u -v github.com/rogpeppe/godef + go get -u -v github.com/zmb3/gogetdoc + #+END_SRC + +*** Set up Chicken (Scheme interpreter/compiler) + :PROPERTIES: + :CUSTOM_ID: h-10ffb0c0-8028-4e9c-842e-9e7d2c165c5b + :END: + Chicken needs to be set up before being used. First, we need to install its + documentation. + #+BEGIN_SRC fish + chicken-install -s apropos chicken-doc + #+END_SRC + + Then, we’ll complete the documentation like so: + #+BEGIN_SRC fish + cd (chicken-csi -b -e "(import (chicken platform))" -p "(chicken-home)") + curl https://3e8.org/pub/chicken-doc/chicken-doc-repo.tgz | sudo tar zx + #+END_SRC + *** Clean the =pacman= and =yay= cache :PROPERTIES: :CUSTOM_ID: h-fa5307ec-065b-4d06-9d47-05ccde0da8ac