# Ensure that at least `curl` and `git` are installed
# `vim` is recommended
curl https://raw.githubusercontent.com/LuzianHahn/dotfiles/debian/.local/installer/dotfile_installer.sh | bash
# on work machines for alternative git authorship use
curl https://raw.githubusercontent.com/LuzianHahn/dotfiles/debian/.local/installer/dotfile_installer.sh | AUTHOR=work bash
# e.g. on alpine systems, `bash` is not included. Use `sh` in this case.
# curl https://raw.githubusercontent.com/LuzianHahn/dotfiles/debian/.local/installer/dotfile_installer.sh | sh
# Quick-Setup for neat Extras like LSP-Servers and programming language setups
# -i is necessary, as this scripts sources the ~/.bashrc file, which only works in interactive shells.
# For extra-installations, `cc` is needed. (On Debian - build-essential)
# Respective packages can also get obtained elsewise instead.
bash -i $HOME/.local/installer/extra_installer.shFor a comprehensive script, see also
installer/extra_installer.sh
Right now the vim setup here works with different Servers, which implement the LSP (Language Server Protocol).
In order to receive features in vim like OpenDocumentation or GoToDefinition,
one needs to install the respective servers.
I listed how to do this for the languages I typically use:
This is ordinary achieved via rust-analyzer. One can find a detailed documentation here.
In theory it should be enough to call rustup component add rust-src
I am currently using jedi-language-server for this, which is a python package, which comes with an own entrypoint.
As I don't want to install this package for every python project I have, I am using my global uv-virtualenv for this.
It is intended for user specific python packages.
Therefore it is necessary to have uv set up before installing jedi-language-server.
See here for this.
Afterwards one needs to create the global uv-virtualenv. The easiest way is to call . $HOME/.bashrc.
Now one needs to install jedi-language-server via uv pip install jedi-language-server.
Finally to circumvent the problem of the global uv-virtualenv's binaries colliding,
one needs to create a link to the respective jedi-language-server-binary via:
ln -sf $HOME/.local/lib/uv_base/bin/jedi-language-server $HOME/.local/bin/.
-
If you encounter the following error after opening a
*.py-buffer:Error: jedi-vim failed to initialize Python: jedi-vim requires Vim with support for Python 3.Your current version of vim does not come with python support. (You can check this with
:versionand looking for+python3. If onlypython3-is present, your vim version lacks support)- On debian you can install instead
vim-noxviaapt, which should provided+python3support. - On MacOS you need to install
vimviabrew install vim. It might be necessary to override$PATHhere sincevimis already present per default, butbrewlocates its installed version different from the base version ofvim
- On debian you can install instead
-
I want to read
:help-entries invim, but the system claimsE149: Sorry, no help for <entryX>. Apparently one needs to generate the helptags once on the respective system. See also https://stackoverflow.com/a/22355979. So just callvim -c "helptags <Path-to-doc-folder-in-extension> -
After syncronizing a device with this repository, I receive errors, when opening vim like:
Fehler beim Ausführen von "/home/XXX/.vimrc": Zeile 63: E31: Kein Mapping gefunden Zeile 64: E31: Kein Mapping gefunden Betätigen Sie die EINGABETASTE oder geben Sie einen Befehl einThis means that the respective plugins in vim have not been installed properly yet. One can do so by calling:
cfg submodule update --init --recursive --depth 1 -
If your installed vim version is
<9you cannot usecoc-nvim. Sometimes it can be a hustle to obtain such a version e.g. on debian < 12 or ubuntu LTS < 24. A potential solution here lies in two options:-
Using an appimage version of
vimfrom here. Just download the appimage into$HOME/.local/lib/vim-appimage/(after creating this directory) and link it via:ln -s $HOME/.local/lib/vim-appimage/gvim.appimage $HOME/.local/bin/vimUnfortunately this version suffers from a small start-up delay, which might be annoying. Worse than this, on systems, where you don't have and cannot provide a fusermount utility (e.g. when this error occurs:
Error: No suitable fusermount binary found on the $PATH), this solution is not an option. -
Compile vim from scratch:
cd $HOME/.local/lib/ git clone https://github.com/vim/vim.git --depth 1 cd vim/src/ # In case there is no `python3-config` (e.g. on a slurm cluster), consider activating a python3 module there. # Otherwise install a python3 version via your package manager. ./configure --with-features=huge \ --enable-multibyte \ --enable-python3interp=yes \ --with-python3-config-dir=$(python3-config --configdir) \ --enable-perlinterp=yes \ --enable-gui=gtk2 \ --enable-cscope \ --prefix=$HOME/.local/ make && make install
-
-
After an initial setup including
coc.nvim, opening the first.py-file results into something like:[coc.nvim] jedi: Error: Command failed: python3 -m venv --clear $HOME/.config/coc/extensions/node_modules/coc-jedi/.venv && $HOME/.config/coc/extensions/node_modules/coc-jedi/.venv/bin/pip install -U pip jedi-language-server==0.41.1This mostly happens, when
venvis not available in your globalpython3-setup. (e.g. on hardware maintained by somebody else). It is difficult to makecoc.nvimuse here the defaultuv_base-venv. An alternative solution is this:rm -rf $HOME/.config/coc/extensions/node_modules/coc-jedi/.venv ( uv venv --no-project $HOME/.config/coc/extensions/node_modules/coc-jedi/.venv deactivate source $HOME/.config/coc/extensions/node_modules/coc-jedi/.venv/bin/activate uv pip install pip jedi-language-server==0.41.1 )
- running
bash -i $HOME/.local/installer/extra_installer.shends with"cc is missing and is needed to compile packages via cargo locally.". You can either installccfor your OS and rerun theextra_installer.sh-script or obtain the respective utilities e.g. viaapton Debian or viabrewon MacOS. - Updating shallow submodules with
cfg submodule update --init --recursive --depth 1fails with something likeSyncing the submodules again should help via:Schwerwiegend: Übertragungsart 'file' nicht erlaubt. Schwerwiegend: "fetch" in Submodul-Pfad '...' ausgeführt, aber enthielt nicht <commitXYZ>. Direktes Anfordern dieses Commits ist fehlgeschlagen.bash -i $HOME/.local/installer/install_latest_submodules.sh # Remember to push your changes afterwards manually AFTER verifying them!
- I don't get ALE in combination with jedi-language-server properly to work. Most of the times it seems to work, but then seem situations don't work at all:
- e.g.
from pkg import-statements are not autocompleted. It is not even possible to autocompletefrom pkg. - when running e.g.
import pkg.-completions, this works only if I don't enter a first letter here (e.g.import pathlib.PforPath) click-completions are not working at all-
Seems like this is a general issue of completing modules. It is possible to use GoTo into these modules, when the venv is activated.
- e.g.
trying to use coc-nvim as completion library. seems to work much better than ALE.
- my venv has to be active to recognized respective third-party modules
- need to learn more about all the different commands