From 472ba71fd7e646ea82a332e0ecbe6a836512f28d Mon Sep 17 00:00:00 2001 From: Matt Singleton Date: Tue, 9 Feb 2021 17:29:48 -0600 Subject: better file organization --- deploy.sh | 13 ++-- gitconfig-local | 1 - home/vimrc | 171 ++++++++++++++++++++++++++++++++++++++++++++++++++ home/zshenv | 1 + local.zsh | 23 ------- local/gitconfig-local | 1 + local/local.zsh | 23 +++++++ vimrc | 171 -------------------------------------------------- zshenv | 1 - 9 files changed, 204 insertions(+), 201 deletions(-) delete mode 100644 gitconfig-local create mode 100644 home/vimrc create mode 100644 home/zshenv delete mode 100644 local.zsh create mode 100644 local/gitconfig-local create mode 100644 local/local.zsh delete mode 100644 vimrc delete mode 100644 zshenv diff --git a/deploy.sh b/deploy.sh index ba805a0..7908e5b 100755 --- a/deploy.sh +++ b/deploy.sh @@ -10,7 +10,7 @@ xcache="${XDG_CACHE_HOME:-${HOME}/.cache}" xdata="${XDG_DATA_HOME:-${HOME}/.local/share}" xconfig="${XDG_CONFIG_HOME:-${HOME}/.config}" -# deploy +# deploy to XDG dirs mkdir -p "${xcache}/zsh" mkdir -p "${xdata}/zsh" cd config @@ -24,13 +24,16 @@ do done cd .. -for f in vimrc zshenv +# deploy to home +cd home +for f in * do if [ -e ~/.${f} ]; then - mv ~/.${f} dotfiles-backup/${f} + mv ~/.${f} ../dotfiles-backup/${f} fi ln -sf "$(pwd)/${f}" ~/.${f} done +cd .. if [ ! -d ~/.vim/bundle/vundle ]; then git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle @@ -42,8 +45,8 @@ vim +BundleInstall +qall vim +BundleClean +qall if [ ! -e config/zsh/local.zsh ]; then - cp local.zsh config/zsh/local.zsh + cp local/local.zsh config/zsh/local.zsh fi if [ ! -e config/git/config-local ]; then - cp gitconfig-local config/git/config-local + cp local/gitconfig-local config/git/config-local fi diff --git a/gitconfig-local b/gitconfig-local deleted file mode 100644 index 8076467..0000000 --- a/gitconfig-local +++ /dev/null @@ -1 +0,0 @@ -# Local (not source-controlled) overrides go here diff --git a/home/vimrc b/home/vimrc new file mode 100644 index 0000000..101caf0 --- /dev/null +++ b/home/vimrc @@ -0,0 +1,171 @@ +" +" vundle +" + +set nocompatible +filetype off + +set rtp+=~/.vim/bundle/vundle/ +call vundle#rc() + +Bundle 'gmarik/vundle' + +Bundle 'scrooloose/nerdtree' +Bundle 'altercation/vim-colors-solarized' +Bundle 'vim-scripts/bufexplorer.zip' +Bundle 'ctrlpvim/ctrlp.vim' +Bundle 'pangloss/vim-javascript' +Bundle 'jnwhiteh/vim-golang' +Bundle 'chase/vim-ansible-yaml' +Bundle 'airblade/vim-gitgutter' +Plugin 'vim-airline/vim-airline' +Plugin 'vim-airline/vim-airline-themes' +Plugin 'tpope/vim-eunuch' +Plugin 'dense-analysis/ale' + +" +" behavior +" + +set nocompatible " use vim, not vi settings +set wildmenu " command line tab completion menu +set wildignore=*.pyc,.git " ignore from autocomplete +set ruler " show the cursor position all the time +set showcmd " display incomplete commands +set incsearch " do incremental searching +set ignorecase " ignore case in search +set smartcase " respect case in search if uppercase is used +set nowrap " do not wrap lines +set backspace=indent,eol,start " backspace over all stuff +set vb t_vb= " no beeping +set laststatus=2 " always show the status line + +" +" formatting +" + +set autoindent +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set expandtab +set smarttab +set shiftround +set listchars=tab:»·,trail:· +set list + +" +" filetype-specific +" + +if has("autocmd") + filetype plugin indent on + + au! + au FileType text setlocal tw=80 ts=2 sw=2 sts=2 + au FileType markdown setlocal tw=80 ts=2 sw=2 sts=2 + au FileType html setlocal ts=2 sw=2 sts=2 + au FileType xhtml setlocal ts=2 sw=2 sts=2 + au FileType ruby setlocal ts=2 sw=2 sts=2 + au FileType eruby setlocal ts=2 sw=2 sts=2 + au FileType htmldjango setlocal ts=2 sw=2 sts=2 + au FileType coffee setlocal ts=2 sw=2 sts=2 + au FileType php setlocal ts=2 sw=2 sts=2 + + " text files + au BufRead,BufNewFile *.txt setlocal filetype=text + + " markdown + au BufRead,BufNewFile *.md setlocal filetype=markdown + + " html templates + au BufRead,BufNewFile *.mako setlocal filetype=html + au BufRead,BufNewFile *.ftl setlocal filetype=html + au BufRead,BufNewFile *.handlebars setlocal filetype=html ts=4 sts=4 sw=4 + + " css templates + au BufRead,BufNewFile *.less setlocal filetype=css + + " zsh configs and scripts + au BufRead,BufNewFile *.zsh-overrides setlocal filetype=zsh + au BufRead,BufNewFile *.zsh setlocal filetype=zsh + + " ruby files + au BufRead,BufNewFile *.cap setlocal filetype=ruby + + " 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 + au BufReadPost * + \ if line("'\"") > 0 && line("'\"") <= line("$") | + \ exe "normal g`\"" | + \ endif +endif + +" +" bindings +" + +let mapleader = "," + +" convenience +nnoremap x :source ~/.vimrc +nnoremap +nnoremap j +nnoremap k +nnoremap h +nnoremap l +"nnoremap 10 10j +"nnoremap 10 10k + +" NERDTree +nnoremap e :NERDTreeToggle +let NERDTreeMapActivateNode='' + +" bufexplore +nnoremap fe :BufExplorer +nnoremap fs :BufExplorerHorizontalSplit +nnoremap fv :BufExplorerVerticalSplit + +" ctrlp +let g:ctrlp_map ='a' + +" solarized +nnoremap vl :let g:solarized_visibility="low" | colo solarized +nnoremap vh :let g:solarized_visibility="high" | colo solarized + + +" +" visual +" + +let g:solarized_visibility="high" "trailing characters very visible +let g:solarized_menu=0 "don't show the gui menu +set synmaxcol=500 +syntax on +set background=light +silent! colo solarized "silent so it doesn't harf before it's installed +set hlsearch + +" don't mess up gutter highlight with gitgutter +highlight clear SignColumn +hi! link SignColumn Background + +" Highlight non-ascii characters +" Run this late to override solarized +if has("autocmd") + highlight nonascii guibg=Red ctermbg=1 term=standout + au BufReadPost * syntax match nonascii /[^\d0-\d127]/ +endif + +let g:airline_left_sep='' +let g:airline_left_alt_sep='|' +let g:airline_right_sep='' +let g:airline_right_alt_sep='|' + +" +" local additions +" + +if filereadable($HOME."/.vimrc-local") + source ~/.vimrc-local +endif diff --git a/home/zshenv b/home/zshenv new file mode 100644 index 0000000..a573065 --- /dev/null +++ b/home/zshenv @@ -0,0 +1 @@ +export ZDOTDIR="${XDG_CONFIG_HOME:-${HOME}/.config}/zsh" diff --git a/local.zsh b/local.zsh deleted file mode 100644 index 8b012e4..0000000 --- a/local.zsh +++ /dev/null @@ -1,23 +0,0 @@ -# get sbin on the path -#export PATH="/usr/sbin:/sbin:$PATH" - -# move homebrew stuff to the beginning of the search path -#export PATH="/usr/local/bin:/usr/local/sbin:$PATH" -#export MANPATH="/usr/local/man:$MANPATH" -#export PATH="/usr/local/opt/python/libexec/bin:$PATH" -#export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" -#export MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH" -#export PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH" -#export MANPATH="/usr/local/opt/findutils/libexec/gnuman:$MANPATH" -#export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH" -#export MANPATH="/usr/local/opt/grep/libexec/gnuman:$MANPATH" - -# Java -#export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)" - -# start the ssh agent on login and stop on logout -#eval `ssh-agent -s` -#trap 'eval `ssh-agent -k`' 0 - -# prompt hostname is highlighted in red for non-local envs -#export ZSH_LOCAL_ENV=true diff --git a/local/gitconfig-local b/local/gitconfig-local new file mode 100644 index 0000000..8076467 --- /dev/null +++ b/local/gitconfig-local @@ -0,0 +1 @@ +# Local (not source-controlled) overrides go here diff --git a/local/local.zsh b/local/local.zsh new file mode 100644 index 0000000..8b012e4 --- /dev/null +++ b/local/local.zsh @@ -0,0 +1,23 @@ +# get sbin on the path +#export PATH="/usr/sbin:/sbin:$PATH" + +# move homebrew stuff to the beginning of the search path +#export PATH="/usr/local/bin:/usr/local/sbin:$PATH" +#export MANPATH="/usr/local/man:$MANPATH" +#export PATH="/usr/local/opt/python/libexec/bin:$PATH" +#export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" +#export MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH" +#export PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH" +#export MANPATH="/usr/local/opt/findutils/libexec/gnuman:$MANPATH" +#export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH" +#export MANPATH="/usr/local/opt/grep/libexec/gnuman:$MANPATH" + +# Java +#export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)" + +# start the ssh agent on login and stop on logout +#eval `ssh-agent -s` +#trap 'eval `ssh-agent -k`' 0 + +# prompt hostname is highlighted in red for non-local envs +#export ZSH_LOCAL_ENV=true diff --git a/vimrc b/vimrc deleted file mode 100644 index 101caf0..0000000 --- a/vimrc +++ /dev/null @@ -1,171 +0,0 @@ -" -" vundle -" - -set nocompatible -filetype off - -set rtp+=~/.vim/bundle/vundle/ -call vundle#rc() - -Bundle 'gmarik/vundle' - -Bundle 'scrooloose/nerdtree' -Bundle 'altercation/vim-colors-solarized' -Bundle 'vim-scripts/bufexplorer.zip' -Bundle 'ctrlpvim/ctrlp.vim' -Bundle 'pangloss/vim-javascript' -Bundle 'jnwhiteh/vim-golang' -Bundle 'chase/vim-ansible-yaml' -Bundle 'airblade/vim-gitgutter' -Plugin 'vim-airline/vim-airline' -Plugin 'vim-airline/vim-airline-themes' -Plugin 'tpope/vim-eunuch' -Plugin 'dense-analysis/ale' - -" -" behavior -" - -set nocompatible " use vim, not vi settings -set wildmenu " command line tab completion menu -set wildignore=*.pyc,.git " ignore from autocomplete -set ruler " show the cursor position all the time -set showcmd " display incomplete commands -set incsearch " do incremental searching -set ignorecase " ignore case in search -set smartcase " respect case in search if uppercase is used -set nowrap " do not wrap lines -set backspace=indent,eol,start " backspace over all stuff -set vb t_vb= " no beeping -set laststatus=2 " always show the status line - -" -" formatting -" - -set autoindent -set tabstop=4 -set softtabstop=4 -set shiftwidth=4 -set expandtab -set smarttab -set shiftround -set listchars=tab:»·,trail:· -set list - -" -" filetype-specific -" - -if has("autocmd") - filetype plugin indent on - - au! - au FileType text setlocal tw=80 ts=2 sw=2 sts=2 - au FileType markdown setlocal tw=80 ts=2 sw=2 sts=2 - au FileType html setlocal ts=2 sw=2 sts=2 - au FileType xhtml setlocal ts=2 sw=2 sts=2 - au FileType ruby setlocal ts=2 sw=2 sts=2 - au FileType eruby setlocal ts=2 sw=2 sts=2 - au FileType htmldjango setlocal ts=2 sw=2 sts=2 - au FileType coffee setlocal ts=2 sw=2 sts=2 - au FileType php setlocal ts=2 sw=2 sts=2 - - " text files - au BufRead,BufNewFile *.txt setlocal filetype=text - - " markdown - au BufRead,BufNewFile *.md setlocal filetype=markdown - - " html templates - au BufRead,BufNewFile *.mako setlocal filetype=html - au BufRead,BufNewFile *.ftl setlocal filetype=html - au BufRead,BufNewFile *.handlebars setlocal filetype=html ts=4 sts=4 sw=4 - - " css templates - au BufRead,BufNewFile *.less setlocal filetype=css - - " zsh configs and scripts - au BufRead,BufNewFile *.zsh-overrides setlocal filetype=zsh - au BufRead,BufNewFile *.zsh setlocal filetype=zsh - - " ruby files - au BufRead,BufNewFile *.cap setlocal filetype=ruby - - " 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 - au BufReadPost * - \ if line("'\"") > 0 && line("'\"") <= line("$") | - \ exe "normal g`\"" | - \ endif -endif - -" -" bindings -" - -let mapleader = "," - -" convenience -nnoremap x :source ~/.vimrc -nnoremap -nnoremap j -nnoremap k -nnoremap h -nnoremap l -"nnoremap 10 10j -"nnoremap 10 10k - -" NERDTree -nnoremap e :NERDTreeToggle -let NERDTreeMapActivateNode='' - -" bufexplore -nnoremap fe :BufExplorer -nnoremap fs :BufExplorerHorizontalSplit -nnoremap fv :BufExplorerVerticalSplit - -" ctrlp -let g:ctrlp_map ='a' - -" solarized -nnoremap vl :let g:solarized_visibility="low" | colo solarized -nnoremap vh :let g:solarized_visibility="high" | colo solarized - - -" -" visual -" - -let g:solarized_visibility="high" "trailing characters very visible -let g:solarized_menu=0 "don't show the gui menu -set synmaxcol=500 -syntax on -set background=light -silent! colo solarized "silent so it doesn't harf before it's installed -set hlsearch - -" don't mess up gutter highlight with gitgutter -highlight clear SignColumn -hi! link SignColumn Background - -" Highlight non-ascii characters -" Run this late to override solarized -if has("autocmd") - highlight nonascii guibg=Red ctermbg=1 term=standout - au BufReadPost * syntax match nonascii /[^\d0-\d127]/ -endif - -let g:airline_left_sep='' -let g:airline_left_alt_sep='|' -let g:airline_right_sep='' -let g:airline_right_alt_sep='|' - -" -" local additions -" - -if filereadable($HOME."/.vimrc-local") - source ~/.vimrc-local -endif diff --git a/zshenv b/zshenv deleted file mode 100644 index a573065..0000000 --- a/zshenv +++ /dev/null @@ -1 +0,0 @@ -export ZDOTDIR="${XDG_CONFIG_HOME:-${HOME}/.config}/zsh" -- cgit v1.2.3