use GNU stow for setup

This commit is contained in:
Thomas Ruoff
2018-05-09 00:08:38 +02:00
parent 5d78e5848d
commit f9c702ed55
33 changed files with 24 additions and 149 deletions

12
.gitignore vendored
View File

@@ -1,7 +1,5 @@
irssi
vim/plugged/*
vim/undos/*
vim/backup/
vim/spell
.netrwhist
Xresources.compiled
vim/.vim/plugged/*
vim/.vim/undos/*
vim/.vim/backup/*
vim/.vim/spell/*
x11/.Xresources.compiled

17
README.md Normal file
View File

@@ -0,0 +1,17 @@
# My dotfiles
## Requirements
* [GNU stow](https://www.gnu.org/software/stow/).
## Install
### All applications
* Run `./setup.sh`
### One application
* Run `stow <application>`

View File

View File

@@ -1,28 +1,8 @@
INSTALL_DIR=~/.dotfiles
TARGET_DIR=$HOME
for ITEM in `ls $INSTALL_DIR` ; do
if [ "$ITEM" = "setup.sh" ]
then
continue;
fi
TARGET_NAME="$TARGET_DIR/.$ITEM";
# backup needed
if [ -f $TARGET_NAME ] || [ -h $TARGET_NAME ] || [ -d $TARGET_NAME ]
then
echo "Found $TARGET_NAME. Backing up to ${TARGET_NAME}.pre_dotfiles";
mv $TARGET_NAME ${TARGET_NAME}.pre_dotfiles || exit 1
fi
ln -s $INSTALL_DIR/$ITEM $TARGET_NAME;
echo "Genereated symbolic link from $TARGET_NAME to $INSTALL_DIR/$ITEM";
echo ""
done
cd $INSTALL_DIR
stow $(ls -d */ | xargs basename --multiple)
echo 'dotfiles are installed'

View File

View File

@@ -1,120 +0,0 @@
"" lightline
let g:lightline = {
\ 'colorscheme': 'default',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ], ['ctrlpmark'] ],
\ 'right': [ [ 'ale', 'lineinfo' ], ['percent'], [ 'fileformat', 'fileencoding', 'filetype' ] ]
\ },
\ 'component_function': {
\ 'fugitive': 'LightLineFugitive',
\ 'filename': 'LightLineFilename',
\ 'fileformat': 'LightLineFileformat',
\ 'filetype': 'LightLineFiletype',
\ 'fileencoding': 'LightLineFileencoding',
\ 'mode': 'LightLineMode',
\ 'ctrlpmark': 'CtrlPMark',
\ },
\ 'component_expand': {
\ 'ale': 'ale#statusline#Status',
\ },
\ 'component_type': {
\ 'ale': 'error',
\ },
\ 'subseparator': { 'left': '|', 'right': '|' }
\ }
function! LightLineModified()
return &ft =~ 'help' ? '' : &modified ? '+' : &modifiable ? '' : '-'
endfunction
function! LightLineReadonly()
return &ft !~? 'help' && &readonly ? 'RO' : ''
endfunction
function! LightLineFilename()
let fname = expand('%:t')
return fname == 'ControlP' ? g:lightline.ctrlp_item :
\ fname == '__Tagbar__' ? g:lightline.fname :
\ fname =~ '__Gundo\|NERD_tree' ? '' :
\ &ft == 'vimfiler' ? vimfiler#get_status_string() :
\ &ft == 'unite' ? unite#get_status_string() :
\ &ft == 'vimshell' ? vimshell#get_status_string() :
\ ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
\ ('' != fname ? fname : '[No Name]') .
\ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
endfunction
function! LightLineFugitive()
try
if expand('%:t') !~? 'Tagbar\|Gundo\|NERD' && &ft !~? 'vimfiler' && exists('*fugitive#head')
let mark = '' " edit here for cool mark
let _ = fugitive#head()
return strlen(_) ? mark._ : ''
endif
catch
endtry
return ''
endfunction
function! LightLineFileformat()
return winwidth(0) > 70 ? &fileformat : ''
endfunction
function! LightLineFiletype()
return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : ''
endfunction
function! LightLineFileencoding()
return winwidth(0) > 70 ? (strlen(&fenc) ? &fenc : &enc) : ''
endfunction
function! LightLineMode()
let fname = expand('%:t')
return fname == '__Tagbar__' ? 'Tagbar' :
\ fname == 'ControlP' ? 'CtrlP' :
\ fname == '__Gundo__' ? 'Gundo' :
\ fname == '__Gundo_Preview__' ? 'Gundo Preview' :
\ fname =~ 'NERD_tree' ? 'NERDTree' :
\ &ft == 'unite' ? 'Unite' :
\ &ft == 'vimfiler' ? 'VimFiler' :
\ &ft == 'vimshell' ? 'VimShell' :
\ winwidth(0) > 60 ? lightline#mode() : ''
endfunction
function! CtrlPMark()
if expand('%:t') =~ 'ControlP'
call lightline#link('iR'[g:lightline.ctrlp_regex])
return lightline#concatenate([g:lightline.ctrlp_prev, g:lightline.ctrlp_item
\ , g:lightline.ctrlp_next], 0)
else
return ''
endif
endfunction
let g:ctrlp_status_func = {
\ 'main': 'CtrlPStatusFunc_1',
\ 'prog': 'CtrlPStatusFunc_2',
\ }
function! CtrlPStatusFunc_1(focus, byfname, regex, prev, item, next, marked)
let g:lightline.ctrlp_regex = a:regex
let g:lightline.ctrlp_prev = a:prev
let g:lightline.ctrlp_item = a:item
let g:lightline.ctrlp_next = a:next
return lightline#statusline(0)
endfunction
function! CtrlPStatusFunc_2(str)
return lightline#statusline(0)
endfunction
let g:tagbar_status_func = 'TagbarStatusFunc'
function! TagbarStatusFunc(current, sort, fname, ...) abort
let g:lightline.fname = a:fname
return lightline#statusline(0)
endfunction
let g:unite_force_overwrite_statusline = 0
let g:vimfiler_force_overwrite_statusline = 0
let g:vimshell_force_overwrite_statusline = 0

View File

View File