vim: convert config to xdg
parent
43a71f4b8e
commit
077979bbc8
|
@ -1 +1,2 @@
|
|||
*.swp
|
||||
vim/bundle
|
||||
|
|
41
vim/vimrc
41
vim/vimrc
|
@ -1,12 +1,29 @@
|
|||
set nocompatible
|
||||
|
||||
" XDG
|
||||
set undodir=$XDG_CACHE_HOME/vim/undo
|
||||
set directory=$XDG_CACHE_HOME/vim/swap
|
||||
set backupdir=$XDG_CACHE_HOME/vim/backup
|
||||
set viminfo+='1000,n$XDG_CACHE_HOME/vim/viminfo
|
||||
set runtimepath=$XDG_CONFIG_HOME/vim,$VIMRUNTIME,$XDG_CONFIG_HOME/vim/after
|
||||
|
||||
let g:session_directory=$XDG_CACHE_HOME."/vim/sessions"
|
||||
|
||||
for directory in [&undodir, &directory, &backupdir, g:session_directory]
|
||||
if !filewritable(expand(directory))
|
||||
call mkdir(expand(directory), "p")
|
||||
endif
|
||||
endfor
|
||||
|
||||
" VUNDLE
|
||||
" {
|
||||
if filereadable(expand("$HOME/.vim/bundle/vundle/README.md"))
|
||||
let bundledir=$XDG_CONFIG_HOME."/vim/bundle/"
|
||||
|
||||
if filereadable(expand(bundledir."vundle/README.md"))
|
||||
filetype off " required!
|
||||
|
||||
set rtp+=~/.vim/bundle/vundle/
|
||||
call vundle#rc()
|
||||
let &rtp=&rtp.",".bundledir."vundle/"
|
||||
call vundle#begin(bundledir)
|
||||
|
||||
" let Vundle manage Vundle
|
||||
" required!
|
||||
|
@ -38,6 +55,8 @@ if filereadable(expand("$HOME/.vim/bundle/vundle/README.md"))
|
|||
Plugin 'scrooloose/nerdcommenter'
|
||||
|
||||
Plugin 'VisIncr'
|
||||
|
||||
call vundle#end()
|
||||
endif
|
||||
" }
|
||||
|
||||
|
@ -102,19 +121,8 @@ set undolevels=150
|
|||
set ttimeoutlen=100
|
||||
|
||||
set undofile
|
||||
|
||||
if !filewritable(expand("~/.vim/tmp/undo"))
|
||||
call mkdir(expand("~/.vim/tmp/undo"), "p")
|
||||
endif
|
||||
set undodir=~/.vim/tmp/undo
|
||||
|
||||
set backup
|
||||
|
||||
if !filewritable(expand("~/.vim/tmp/backup"))
|
||||
call mkdir(expand("~/.vim/tmp/backup"), "p")
|
||||
endif
|
||||
set backupdir=~/.vim/tmp/backup
|
||||
|
||||
let mapleader = ","
|
||||
|
||||
let g:bufferhint_MaxWidth = 200
|
||||
|
@ -170,11 +178,6 @@ let g:UltiSnipsJumpForwardTrigger="<tab>"
|
|||
let g:session_autoload = 'no'
|
||||
let g:session_autosave = 'no'
|
||||
|
||||
let g:session_directory=$HOME."/.vim/tmp/sessions"
|
||||
if !filewritable(expand(g:session_directory))
|
||||
call mkdir(expand(g:session_directory), "p")
|
||||
endif
|
||||
|
||||
autocmd FileType ruby let b:switch_custom_definitions =
|
||||
\ [
|
||||
\ {
|
||||
|
|
|
@ -23,4 +23,5 @@ export KEYTIMEOUT=1
|
|||
export EDITOR=vim
|
||||
export PAGER=less
|
||||
|
||||
export VIMINIT=":source $XDG_CONFIG_HOME/vim/vimrc"
|
||||
export ZDOTDIR=${XDG_CONFIG_HOME}/zsh
|
||||
|
|
Loading…
Reference in New Issue