diff --git a/macOS/.config/macOS/Brewfile b/macOS/.config/macOS/Brewfile index a056bbd..ab331e7 100644 --- a/macOS/.config/macOS/Brewfile +++ b/macOS/.config/macOS/Brewfile @@ -21,6 +21,7 @@ brew "ripgrep" brew "stow" # for dotfile linking / placement. brew "swift-format" # for formatting swift files brew "tmux" # terminal multi-plexer +brew "vim" brew "zsh" brew "zsh-completions" diff --git a/vim/.vim/plugins/sets.vim b/vim/.vim/plugins/sets.vim deleted file mode 100644 index e3277c7..0000000 --- a/vim/.vim/plugins/sets.vim +++ /dev/null @@ -1,43 +0,0 @@ - -" Settings: -set tabstop=4 softtabstop=4 -set shiftwidth=4 -set expandtab -set smartindent -set exrc -set relativenumber -set nohlsearch -set hidden -set nu -set nowrap -set noswapfile -set nobackup -set undodir=~/.vim/undodir -set undofile -set incsearch -set termguicolors -set scrolloff=8 -set noshowmode -set signcolumn=yes -set colorcolumn=80 -set noerrorbells -set number -syntax enable -set background=dark - -let mapleader = " " - - -fun! TrimWhiteSpace() - let l:save = winsaveview() - keeppatterns %s/\s\+$//e - call winrestview(l:save) -endfun - -augroup MICHAEL - autocmd! - autocmd BufWritePre * :call TrimWhiteSpace() - autocmd Filetype yaml setlocal ts=2 sts=2 sw=2 expandtab -augroup END - - diff --git a/vim/.vim/vimrc b/vim/.vim/vimrc new file mode 100644 index 0000000..39b0013 --- /dev/null +++ b/vim/.vim/vimrc @@ -0,0 +1,87 @@ + +" ----------------------- settings ---------------------------------- +set autoindent +set autowrite " automatically write files when changing +set background=dark +set ruler " turns on col and row in lower right +" used with `set ruler` +set ruf=%30(%=%#LineNr#%.50F\ [%{strlen(&ft)?&ft:'none'}]\ %l:%c\ %p%%%) +set showmode " show command and insert mode +set tabstop=2 +set softtabstop=2 +set shiftwidth=2 +set expandtab " replace tabs with spaces automatically +set textwidth=72 +set smartindent +set smarttab +set nofixendofline +set foldmethod=manual +set exrc +set relativenumber +set nohlsearch +set hidden +set nocompatible +set nu +set nowrap +set noswapfile +set nobackup +set undodir=~/.vim/undodir +set undofile +set icon +set incsearch +set termguicolors +set scrolloff=8 +set signcolumn=yes +set colorcolumn=80 +set noerrorbells +set number +set wildmenu +set ttyfast " faster scrolling +set viminfo='20,<1000,s1000 " prevents truncated yanks, deletes, etc. +set hidden +set history=100 " command history +syntax enable +filetype plugin on " sense the filesystem +let mapleader = " " + +" ----------------------- plugins ---------------------------------- + +" Install vim-plug if not found +if empty(glob('~/.vim/autoload/plug.vim')) + silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim +endif + +" Run PlugInstall if there are missing plugins +autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) + \| PlugInstall --sync | source $MYVIMRC +\| endif + +call plug#begin('~/.vim/plugged') + Plug 'junegunn/fzf' + Plug 'vim-pandoc/vim-pandoc' + Plug 'rwxrob/vim-pandoc-syntax-simple' + Plug 'morhetz/gruvbox' +call plug#end() + +colorscheme gruvbox +" highlight Normal guibg=none + +" ----------------------- utilities ---------------------------------- +" Edit/Reload vimr configuration file +nnoremap confe :e $HOME/.vimrc +nnoremap confr :source $HOME/.vimrc + +fun! TrimWhiteSpace() + let l:save = winsaveview() + keeppatterns %s/\s\+$//e + call winrestview(l:save) +endfun + +augroup MICHAEL + autocmd! + autocmd BufWritePre * :call TrimWhiteSpace() + autocmd Filetype yaml setlocal ts=2 sts=2 sw=2 expandtab +augroup END + + diff --git a/vim/.vimrc b/vim/.vimrc deleted file mode 100644 index b26ffab..0000000 --- a/vim/.vimrc +++ /dev/null @@ -1,61 +0,0 @@ - -" Settings: -set tabstop=2 -set softtabstop=2 -set shiftwidth=2 -set expandtab -set smartindent -set exrc -set relativenumber -set nohlsearch -set hidden -set nu -set nowrap -set noswapfile -set nobackup -set undodir=~/.vim/undodir -set undofile -set incsearch -set termguicolors -set scrolloff=8 -set noshowmode -set signcolumn=yes -set colorcolumn=80 -set noerrorbells -set number -syntax enable -set background=dark - -let mapleader = " " - -" Install vim-plug if not found -if empty(glob('~/.vim/autoload/plug.vim')) - silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs - \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -endif - -" Run PlugInstall if there are missing plugins -autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) - \| PlugInstall --sync | source $MYVIMRC -\| endif - -call plug#begin('~/.vim/plugged') -" Plug 'morhetz/gruvbox' -call plug#end() - - -highlight Normal guibg=none - -fun! TrimWhiteSpace() - let l:save = winsaveview() - keeppatterns %s/\s\+$//e - call winrestview(l:save) -endfun - -augroup MICHAEL - autocmd! - autocmd BufWritePre * :call TrimWhiteSpace() - autocmd Filetype yaml setlocal ts=2 sts=2 sw=2 expandtab -augroup END - - diff --git a/vim/setup b/vim/setup new file mode 100755 index 0000000..f57d101 --- /dev/null +++ b/vim/setup @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e + +if test -z "$(type vim)"; then + echo "Does not look like you have vim installed." + exit 1 +fi + +mkdir "${HOME}/.vim" |true +ln -sfv "${PWD}/.vim/vimrc" "${HOME}/.vim/vimrc" + + + + diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 3d90cda..9a347b8 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -36,6 +36,8 @@ export EDITOR=vi export VISUAL=vi export EDITOR_PREFIX=vi export GIT_DISCOVERY_ACROSS_FILESYSTEM=1 +export VIMINIT='source $MYVIMRC' +export MYVIMRC="$HOME/.vim/vimrc" autoload -U up-line-or-beginning-search autoload -U down-line-or-beginning-search @@ -127,9 +129,6 @@ setopt aliases # Enable vi mode bindkey -v -#zsh_add_file "zsh-exports" -#zsh_add_file "zsh-aliases" - # Plugins zsh_add_plugin "zsh-users/zsh-autosuggestions" zsh_add_plugin "zsh-users/zsh-syntax-highlighting" @@ -146,12 +145,28 @@ autoload -Uz compinit; compinit # zstyle(s) should be added before this. zmodload zsh/complist _comp_options+=(globdots) # Include hidden files. +#------------------------------ prompt ------------------------------ # Prompt / managed by brew. (`brew install pure`) autoload -Uz promptinit; promptinit prompt pure +#------------------------------ aliases ------------------------------ + +alias bk='cd "${OLDPWD}"' +alias cdots='cd "${DOTFILES}"' +alias cl='printf "\e[H\e[2J"' +alias clear='printf "\e[H\e[2J"' +alias g='git' +alias ga='git add' +alias gcb='git checkout -b' +alias gco='git checkout' +#alias gma() { git add . && git commit -m "$1" } +#alias gp() { git push } +alias gs='git status' #------------------------------ local configs ------------------------------ _source_if "$ZDOTDIR/.zshrc-local" + +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh