diff --git a/.gitignore b/.gitignore index 3ac0238..7d7b878 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..2bf5767 --- /dev/null +++ b/README.md @@ -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 ` + + diff --git a/ctags b/ctags/.ctags similarity index 100% rename from ctags rename to ctags/.ctags diff --git a/gitconfig b/git/.gitconfig similarity index 100% rename from gitconfig rename to git/.gitconfig diff --git a/setup.sh b/setup.sh index fbe769b..ac19bfa 100755 --- a/setup.sh +++ b/setup.sh @@ -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' diff --git a/tmux.conf b/tmux/.tmux.conf similarity index 100% rename from tmux.conf rename to tmux/.tmux.conf diff --git a/vim/UltiSnips/javascript-jasmine.snippets b/vim/.vim/UltiSnips/javascript-jasmine.snippets similarity index 100% rename from vim/UltiSnips/javascript-jasmine.snippets rename to vim/.vim/UltiSnips/javascript-jasmine.snippets diff --git a/vim/UltiSnips/javascript-node.snippets b/vim/.vim/UltiSnips/javascript-node.snippets similarity index 100% rename from vim/UltiSnips/javascript-node.snippets rename to vim/.vim/UltiSnips/javascript-node.snippets diff --git a/vim/UltiSnips/javascript.snippets b/vim/.vim/UltiSnips/javascript.snippets similarity index 100% rename from vim/UltiSnips/javascript.snippets rename to vim/.vim/UltiSnips/javascript.snippets diff --git a/vim/autoload/plug.vim b/vim/.vim/autoload/plug.vim similarity index 100% rename from vim/autoload/plug.vim rename to vim/.vim/autoload/plug.vim diff --git a/vim/cheatsheet.md b/vim/.vim/cheatsheet.md similarity index 100% rename from vim/cheatsheet.md rename to vim/.vim/cheatsheet.md diff --git a/vimrc b/vim/.vimrc similarity index 100% rename from vimrc rename to vim/.vimrc diff --git a/vim/lightline.vim b/vim/lightline.vim deleted file mode 100644 index 576e26e..0000000 --- a/vim/lightline.vim +++ /dev/null @@ -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 diff --git a/Xresources b/x11/.Xresources similarity index 100% rename from Xresources rename to x11/.Xresources diff --git a/xinitrc b/x11/.xinitrc similarity index 100% rename from xinitrc rename to x11/.xinitrc diff --git a/aliases b/zsh/.aliases similarity index 100% rename from aliases rename to zsh/.aliases diff --git a/dircolors b/zsh/.dircolors similarity index 100% rename from dircolors rename to zsh/.dircolors diff --git a/zsh/completion/_g b/zsh/.zsh/completion/_g similarity index 100% rename from zsh/completion/_g rename to zsh/.zsh/completion/_g diff --git a/zsh/configs/color.zsh b/zsh/.zsh/configs/color.zsh similarity index 100% rename from zsh/configs/color.zsh rename to zsh/.zsh/configs/color.zsh diff --git a/zsh/configs/editor.zsh b/zsh/.zsh/configs/editor.zsh similarity index 100% rename from zsh/configs/editor.zsh rename to zsh/.zsh/configs/editor.zsh diff --git a/zsh/configs/fzf.zsh b/zsh/.zsh/configs/fzf.zsh similarity index 100% rename from zsh/configs/fzf.zsh rename to zsh/.zsh/configs/fzf.zsh diff --git a/zsh/configs/history.zsh b/zsh/.zsh/configs/history.zsh similarity index 100% rename from zsh/configs/history.zsh rename to zsh/.zsh/configs/history.zsh diff --git a/zsh/configs/keybindings.zsh b/zsh/.zsh/configs/keybindings.zsh similarity index 100% rename from zsh/configs/keybindings.zsh rename to zsh/.zsh/configs/keybindings.zsh diff --git a/zsh/configs/options.zsh b/zsh/.zsh/configs/options.zsh similarity index 100% rename from zsh/configs/options.zsh rename to zsh/.zsh/configs/options.zsh diff --git a/zsh/configs/post/completion.zsh b/zsh/.zsh/configs/post/completion.zsh similarity index 100% rename from zsh/configs/post/completion.zsh rename to zsh/.zsh/configs/post/completion.zsh diff --git a/zsh/configs/post/path.zsh b/zsh/.zsh/configs/post/path.zsh similarity index 100% rename from zsh/configs/post/path.zsh rename to zsh/.zsh/configs/post/path.zsh diff --git a/zsh/configs/prompt/functions/async b/zsh/.zsh/configs/prompt/functions/async similarity index 100% rename from zsh/configs/prompt/functions/async rename to zsh/.zsh/configs/prompt/functions/async diff --git a/zsh/configs/prompt/functions/prompt_pure_setup b/zsh/.zsh/configs/prompt/functions/prompt_pure_setup similarity index 100% rename from zsh/configs/prompt/functions/prompt_pure_setup rename to zsh/.zsh/configs/prompt/functions/prompt_pure_setup diff --git a/zsh/configs/prompt/init.zsh b/zsh/.zsh/configs/prompt/init.zsh similarity index 100% rename from zsh/configs/prompt/init.zsh rename to zsh/.zsh/configs/prompt/init.zsh diff --git a/zsh/functions/g b/zsh/.zsh/functions/g similarity index 100% rename from zsh/functions/g rename to zsh/.zsh/functions/g diff --git a/zsh/functions/mcd b/zsh/.zsh/functions/mcd similarity index 100% rename from zsh/functions/mcd rename to zsh/.zsh/functions/mcd diff --git a/zshenv b/zsh/.zshenv similarity index 100% rename from zshenv rename to zsh/.zshenv diff --git a/zshrc b/zsh/.zshrc similarity index 100% rename from zshrc rename to zsh/.zshrc