mirror of
https://github.com/tpope/vim-sensible.git
synced 2025-11-12 21:13:48 -05:00
Provide a home for transient files
This commit is contained in:
@@ -31,6 +31,9 @@ mostly `:set` calls.) Here's a taste:
|
|||||||
* `'incsearch'`: Start searching before pressing enter.
|
* `'incsearch'`: Start searching before pressing enter.
|
||||||
* `'listchars'`: Show trailing whitespace.
|
* `'listchars'`: Show trailing whitespace.
|
||||||
* `'scrolloff'`: Always show at least one line above/below the cursor.
|
* `'scrolloff'`: Always show at least one line above/below the cursor.
|
||||||
|
* `'directory'`: Dump swap files under `~/.cache/vim/swap` (only if that
|
||||||
|
directory already exists). Also `'backupdir'` and `'undodir'`. Try
|
||||||
|
`mkdir -p ~/.cache/vim/{swap,backup,undo}`.
|
||||||
* `nmap Y y$`: Make `Y` behaves like `C` and `D`.
|
* `nmap Y y$`: Make `Y` behaves like `C` and `D`.
|
||||||
* `runtime! macros/matchit.vim`: Load the version of matchit.vim that ships
|
* `runtime! macros/matchit.vim`: Load the version of matchit.vim that ships
|
||||||
with Vim.
|
with Vim.
|
||||||
|
|||||||
@@ -47,6 +47,17 @@ set fileformats=unix,dos,mac
|
|||||||
|
|
||||||
set viminfo+=!
|
set viminfo+=!
|
||||||
|
|
||||||
|
if isdirectory(expand('~/.cache/vim'))
|
||||||
|
if &directory =~# '^\.,'
|
||||||
|
set directory^=~/.cache/vim/swap//
|
||||||
|
endif
|
||||||
|
if &backupdir =~# '^\.,'
|
||||||
|
set backupdir^=~/.cache/vim/backup//
|
||||||
|
endif
|
||||||
|
if exists('+undodir') && &undodir =~# '^\.,'
|
||||||
|
set undodir^=~/.cache/vim/undo//
|
||||||
|
endif
|
||||||
|
endif
|
||||||
if exists('+undofile')
|
if exists('+undofile')
|
||||||
set undofile
|
set undofile
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user