Watch
1
0
Fork
You've already forked dotfiles
0

Add configuration for vim

- Add ~/.config/vim/vimrc
  + Configure basic stuff
  + Activate spell checks
  + Activate syntax highlighting and ruler
  + Show whitespace characters
  + Add various snippets for mouse handling,
    toggling line numbers, and search
  + Set `vim`-related directories inside
   ~/.config/vim and ~/.local/state/vim
- Integrate extra settings for Python files
  in ~/.config/vim/after/ftplugin/python.vim
  and ~/.config/vim/after/syntax/python.vim
- Add `vim` artifacts in ~/.config/git/ignore
This commit is contained in:
Alexander Hess 2026-08-03 02:02:37 +02:00
commit 8f7cef086b
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
12 changed files with 611 additions and 1 deletions

View file

@ -3,6 +3,22 @@
# Aliases used in all kinds of shells
# Make this file work standalone in non-interactive `bash` (e.g., ":!cmd" in `vim`)
if [ -n "${BASH_VERSION:-}" ]; then
shopt -s expand_aliases
fi
if ! command -v _command_exists >/dev/null 2>&1; then
# This utility is supposed to be defined only in ~/.profile but copied here
# to make `$BASH_ENV` work in `vim`, which sources this file only
_command_exists() {
command -v "$1" 1>/dev/null 2>&1
}
fi
# Manage the bare `git` repository in ~/ holding the dotfiles
alias dotfiles='git --git-dir=$DOTFILES_DIR --work-tree=$HOME'
@ -164,3 +180,11 @@ if _command_exists pyenv; then
alias pyvers='pyenv versions --skip-aliases'
alias pywhich='pyenv which'
fi
if _command_exists vim; then
alias v=vim
_command_exists sudoedit && alias sv=sudoedit
fi

View file

@ -26,6 +26,13 @@ export DOTFILES_DIR="$XDG_DATA_HOME/dotfiles" # also set in ~/.local/bin/dotfil
[ -t 0 ] && export GPG_TTY=$(tty)
if _command_exists vim; then
export EDITOR=vim
export SUDO_EDITOR="$EDITOR"
export VISUAL="$EDITOR"
fi
export PAGER=less
export LESS="--chop-long-lines --ignore-case --LONG-PROMPT --no-init --raw-control-chars --status-column --quit-if-one-screen"
@ -47,9 +54,11 @@ unset _bat
# Move common tools' config and cache files into XDG directories
export BAT_CONFIG_PATH="$XDG_CONFIG_HOME/bat/config"
export INPUTRC="$XDG_CONFIG_HOME/readline/inputrc"
export LESSHISTFILE="$XDG_STATE_HOME/less/history"
export PSQLRC="$XDG_CONFIG_HOME/psql/psqlrc"
export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
export PYTHONPYCACHEPREFIX="$XDG_CACHE_HOME/python"
export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/startup.py"
export PYTHON_HISTORY="$XDG_STATE_HOME/python/history"
export VIMINIT='let $MYVIMRC="'"$XDG_CONFIG_HOME"'/vim/vimrc" | source $MYVIMRC'