fix circular link creation in installer

master
Jordan Orelli 7 years ago
parent e5701abd63
commit 16d31db208

@ -18,6 +18,7 @@ call vundle#begin()
Plugin 'fatih/vim-go' Plugin 'fatih/vim-go'
Plugin 'nanotech/jellybeans.vim' Plugin 'nanotech/jellybeans.vim'
Plugin 'ervandew/supertab' Plugin 'ervandew/supertab'
Plugin 'scrooloose/nerdcommenter'
Plugin 'scrooloose/nerdtree' Plugin 'scrooloose/nerdtree'
Plugin 'Align' Plugin 'Align'
Plugin 'tomtom/tlib_vim' " dependency of flashdevelop Plugin 'tomtom/tlib_vim' " dependency of flashdevelop
@ -64,7 +65,7 @@ set linebreak " soft text wrapping
set nobackup " disable temporary files. set nobackup " disable temporary files.
set nowritebackup set nowritebackup
set noswapfile set noswapfile
set updatetime=750 " wait 750ms after typing for updates. default is 4000 set updatetime=750 " wait 750ms after typing for updates
" set hidden " hide buffers instead of closing them " set hidden " hide buffers instead of closing them
set visualbell " don't beep set visualbell " don't beep
@ -109,11 +110,15 @@ if has("autocmd")
" Put these in an autocmd group, so that we can delete them easily. " Put these in an autocmd group, so that we can delete them easily.
augroup vimrcEx augroup vimrcEx
" delete existing definitions for this group
au! au!
" For all text files set 'textwidth' to 78 characters. " For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78 autocmd FileType text setlocal textwidth=78
" on some machines md files are thought to be modula2
autocmd BufNewFile,BufRead *.md set filetype=markdown
" When editing a file, always jump to the last known cursor position. " When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler " Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim). " (happens when dropping a file on gvim).
@ -124,24 +129,27 @@ if has("autocmd")
\ exe "normal! g`\"" | \ exe "normal! g`\"" |
\ endif \ endif
augroup END autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags " causes VIM to enter the directory of the file being edited to simplify
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS " finding related files.
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags autocmd BufEnter * silent! lcd %:p:h
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
" causes VIM to enter the directory of the file being edited to simplify autocmd FileType go :iabbrev iff if {<cr>}<up><right>
" finding related files. autocmd FileType javascript :iabbrev iff if
autocmd BufEnter * silent! lcd %:p:h autocmd FileType javascript :iabbrev fun function
" add proper coloring for my .localrc file " add proper coloring for my .localrc file
au BufNewFile,BufRead .localrc call SetFileTypeSH("bash") au BufNewFile,BufRead .localrc call SetFileTypeSH("bash")
" add Coloring for ChucK source " add Coloring for ChucK source
au! BufNewFile,BufRead *.ck setf ck au! BufNewFile,BufRead *.ck setf ck
augroup END
else else
endif " has("autocmd") endif " has("autocmd")
@ -155,9 +163,9 @@ endif
" Shortcut to show invisible characters " Shortcut to show invisible characters
nnoremap <leader>l :set list!<CR> nnoremap <leader>l :set list!<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" tab navigation helpers " tab navigation helpers
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" ctrl-k to go to the next tab " ctrl-k to go to the next tab
noremap <C-k> :tabn<CR> noremap <C-k> :tabn<CR>
" ctrl-j to go to the previous tab " ctrl-j to go to the previous tab
@ -186,7 +194,10 @@ noremap <buffer> <silent> $ g$
let g:ctrlp_map = '<c-p>' let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP' let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard'] let g:ctrlp_user_command = [
\'.git',
\'cd %s && git ls-files -co --exclude-standard'
\]
" open up directories with a single click instead of needing to double-click " open up directories with a single click instead of needing to double-click
let g:NERDTreeMouseMode = 2 let g:NERDTreeMouseMode = 2
@ -215,3 +226,20 @@ nnoremap <leader>ev :vsplit $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr> nnoremap <leader>sv :source $MYVIMRC<cr>
iabbrev @@ @jordanorelli iabbrev @@ @jordanorelli
noremap <Leader>ci NERDComInvertComment
let g:NERDDefaultAlign='left'
let g:NERDSpaceDelims=1
" new text object: "next paren". means the next open paren on the current
" line.
onoremap in( :<c-u>normal! f(ci(<cr>
" new text object: "last paren". means the previous open paren on the current
" line. (using p would shadow the paragraph object)
onoremap il( :<c-u>normal! F)vi(<cr>
" command mode abbreviation :vhelp to open help text in a vertical split
" instead of a horizontal split.
cabbrev vhelp vertical help

@ -12,6 +12,7 @@ include=(
.tmux.conf .tmux.conf
.vim/ftplugin/javascript.vim .vim/ftplugin/javascript.vim
.vim/ftplugin/ruby.vim .vim/ftplugin/ruby.vim
.vim/ftplugin/vim.vim
.vimrc .vimrc
) )
@ -31,33 +32,34 @@ for filename in ${include[@]}; do
echo "dest path: $dest_path" echo "dest path: $dest_path"
echo "backup path: $backup_path" echo "backup path: $backup_path"
# if a file doesn't actually exist in the repo, do nothing. # if a file doesn't actually exist in the repo, do nothing.
if [[ ! -a "$source_path" ]]; then if [[ ! -a "$source_path" ]]; then
echo "no file found at source path $source_path, skipping" echo "no file found at source path $source_path, skipping"
continue continue
fi fi
# back up existing dotfiles, just for safety # back up existing dotfiles, just for safety
if [[ -a "$dest_path" ]]; then if [[ -a "$dest_path" ]]; then
if [[ -h "$dest_path" ]]; then if [[ -h "$dest_path" ]]; then
# existing file is a symlink. delete it. # existing file is a symlink. delete it.
echo "removing old link at $dest_path" echo "removing old link at $dest_path"
rm "$dest_path" rm "$dest_path"
else else
# existing file is an original preferences file. archive it. # existing file is an original preferences file. archive it.
echo "archiving existing preferences file at $dest_path"
if [[ ! -d $(dirname "$backup_path") ]]; then if [[ ! -d $(dirname "$backup_path") ]]; then
mkdir -pv $(dirname "$backup_path") mkdir -pv $(dirname "$backup_path")
fi fi
echo "archiving old preferences file at $dest_path"
mv -v "$dest_path" "$backup_path" mv -v "$dest_path" "$backup_path"
echo "ok we archived it"
fi fi
fi fi
# symlink in the versioned dotfiles. if [[ ! -d $(dirname "$dest_path") ]]; then
echo "linking preferences file" mkdir -p $(dirname "$dest_path")
ln -sv "$source_path" "$dest_path" fi
echo "ok we linked it"
# symlink in the versioned dotfiles.
ln -sv "$source_path" "$dest_path"
echo "--------------------------------------------------------------------------------" echo "--------------------------------------------------------------------------------"
done done

Loading…
Cancel
Save