aboutsummaryrefslogtreecommitdiffstats
path: root/.vimrc
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2026-12-05 12:08:05 -0800
committerEugene Triguba <hello@eugenetriguba.com>2026-12-05 12:08:05 -0800
commit43d20b9e16fd79e3ad8c6f9ee66d19eecb5f5d77 (patch)
treeff9469983d502cb3cd52d96f377e80870d18a2f3 /.vimrc
parentAdd vim-surround, fzf, fzf.vim plugins (diff)
downloaddotfiles-43d20b9e16fd79e3ad8c6f9ee66d19eecb5f5d77.zip
Configure backup, undo, and swap dirs for vim
Diffstat (limited to '.vimrc')
-rw-r--r--.vimrc10
1 files changed, 10 insertions, 0 deletions
diff --git a/.vimrc b/.vimrc
index fd9d43c..72f4ee8 100644
--- a/.vimrc
+++ b/.vimrc
@@ -13,6 +13,7 @@ endif
" Enable a number column with numbers relative
" to the current line the cursor is on.
+set number
set relativenumber
" 1. Enable filetype detection to apply filetype-specific
@@ -43,6 +44,15 @@ set incsearch
" Show line/column number of cursor
set ruler
+" Setup home directory locations for vim temporary files
+if empty($XDG_STATE_HOME)
+ let $XDG_STATE_HOME = $HOME.'/.local/state'
+endif
+set backupdir=$XDG_STATE_HOME/vim/backup//
+set directory=$XDG_STATE_HOME/vim/swap//
+set undodir=$XDG_STATE_HOME/vim/undo//
+set undofile
+
" Enable the :Man command that ships with vim.
runtime ftplugin/man.vim