--- /dev/null
+# goodbye-eclipse
+a minimal yet featureful vim+tmux java workflow
+
+made to replace eclipse for writing programs in schwartz' softdev 1 class
+
+## disclaimer
+while the projinit script mimics eclipse's project structure, be sure to test
+the project in eclipse at least the first time to verify that it is in fact
+compatible. i'll be updating this to make sure that a 100% valid project is
+generated for all schwartz assignments.
+
+## guide
+make sure you have ~/.local/bin in your path
+
+run `projinit` to init a new project
+
+run `to-pdf.sh` to print the project (depends pandoc, pdflatex, eisvogel)
+
+run `compile-and-run.sh` to run the project like in eclipse
+
+because the scripts are symbolic links in each project, they barely add size to
+the submission zip
+
+to attach to the tmux session, run `tmux a -t ge`
--- /dev/null
+#/bin/sh
+
+OUT="../bin"
+
+mkdir -p "$OUT"
+
+javac -d "$OUT" *.java || { echo "Compilation failed"; exit 1; }
+
+MAIN_CLASS=$(grep -l 'public static void main' *.java | sed 's/\.java//')
+
+if [ -z "$MAIN_CLASS" ]; then
+ echo "No main class found."
+ exit 1
+fi
+
+java -cp "$OUT" "$MAIN_CLASS"
--- /dev/null
+#/bin/sh
+
+INSTALL_DIR="$HOME/.local/bin"
+BACKUP_DIR="$HOME/.config/script-backups"
+CONFIG_DIR="$HOME"
+
+mkdir -p "$INSTALL_DIR"
+mkdir -p "$BACKUP_DIR"
+
+for file in vimrc tmux.conf; do
+ if [ -f "$CONFIG_DIR/$file" ]; then
+ mv "$CONFIG_DIR/$file" "$BACKUP_DIR/${file}.bak"
+ echo "backed up $file to $BACKUP_DIR/${file}.bak"
+ fi
+ cp "$file" "$CONFIG_DIR/.$file"
+ echo "Installed new $file"
+done
+
+for script in to-pdf compile-and-run projinit; do
+ cp "$script" "$INSTALL_DIR/$script"
+ chmod +x "$INSTALL_DIR/$script"
+ echo "installed $script to $INSTALL_DIR"
+done
+
+echo "installation complete. ensure $INSTALL_DIR is in your path"
--- /dev/null
+#!/bin/sh
+
+echo "enter project name: "
+read project_name
+
+if [ -z "$project_name" ]; then
+ echo "err: project name cannot be empty"
+ exit 1
+fi
+
+mkdir -p "$project_name/src" "$project_name/bin"
+
+ln -s ~/.local/bin/to-pdf "$project_name/src/to-pdf.sh"
+ln -s ~/.local/bin/compile-and-run "$project_name/src/compile-and-run.sh"
+
+echo "initialized project $project_name"
--- /dev/null
+
+# use ctrl+a as the tmux prefix (instead of default ctrl+b)
+set -g prefix C-a
+unbind C-b
+bind C-a send-prefix
+
+# enable mouse mode
+set -g mouse on
+
+# improve colors
+set -g default-terminal "screen-256color"
+
+# create or attach to "ge" session
+if-shell "tmux has-session -t ge 2>/dev/null" \
+ "display-message 'session ge already exists'" \
+ "new-session -d -s ge -n dev 'vim -c NERDTree'"
+
+if-shell "tmux has-session -t ge 2>/dev/null" \
+ "split-window -v -t ge:dev"
+
+if-shell '[ "$TMUX" = "" ]' "attach-session -t ge"
+
+# key bindings
+bind | new-window
+bind - split-window -v
+bind _ split-window -h
+
+# resize pane shortcuts (ctrl+a then ctrl+arrow)
+bind -r C-Left resize-pane -L 2
+bind -r C-Right resize-pane -R 2
+bind -r C-Up resize-pane -U 1
+bind -r C-Down resize-pane -D 1
+
+# switch between panes using alt+arrow
+bind -n M-Left select-pane -L
+bind -n M-Right select-pane -R
+bind -n M-Up select-pane -U
+bind -n M-Down select-pane -D
+
+# switch between windows using ctrl+arrow
+bind -n C-Left previous-window
+bind -n C-Right next-window
--- /dev/null
+#!/bin/sh
+
+echo "project name: "
+read PROJECT_NAME
+echo "name: "
+read DEV_NAME
+
+OUTPUT_FILE="${PROJECT_NAME}.pdf"
+
+if ! command -v pandoc >/dev/null 2>&1; then
+ echo "err: pandoc is not installed."
+ exit 1
+fi
+
+# error checking may be nonfunctional depending on where eisvogel is installed
+#if ! pandoc --template eisvogel -o /dev/null 2>/dev/null; then
+# echo "err: eisvogel template is missing."
+# exit 1
+#fi
+
+HEADER="---
+title: \"${PROJECT_NAME}\"
+author: \"${DEV_NAME}\"
+date: \"$(date '+%Y-%m-%d %H:%M:%S')\"
+geometry: margin=1in
+fontsize: 12pt
+..."
+
+TEMP_FILE=$(mktemp)
+echo "$HEADER" > "$TEMP_FILE"
+
+echo "appending java sources..."
+for file in *.java; do
+ if [ -f "$file" ]; then
+ echo "\n\n# $file\n\n" >> "$TEMP_FILE"
+ echo '```java' >> "$TEMP_FILE"
+ cat "$file" >> "$TEMP_FILE"
+ echo '```' >> "$TEMP_FILE"
+ fi
+done
+
+if [ -f "testdata.txt" ]; then
+ echo "\n\n# testdata.txt\n\n" >> "$TEMP_FILE"
+ echo '```' >> "$TEMP_FILE"
+ cat "testdata.txt" >> "$TEMP_FILE"
+ echo '```' >> "$TEMP_FILE"
+fi
+
+pandoc "$TEMP_FILE" --template eisvogel -o "$OUTPUT_FILE" \
+ --highlight-style tango --listings
+
+rm "$TEMP_FILE"
+
+echo "pdf generated: $OUTPUT_FILE"
--- /dev/null
+" automatically install vim-plug if not present
+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
+ autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
+endif
+
+" use vim-plug to manage plugins
+call plug#begin('~/.vim/plugged')
+
+" color scheme
+Plug 'morhetz/gruvbox'
+
+" file explorer
+Plug 'preservim/nerdtree'
+
+" syntax checking
+Plug 'dense-analysis/ale'
+
+" pairing dual lexemes
+Plug 'LunarWatcher/auto-pairs'
+Plug 'tpope/vim-surround'
+
+" git wrapper
+Plug 'tpope/vim-fugitive'
+call plug#end()
+
+" basic settings
+set number
+set colorcolumn=80 " ruler at 80 characters
+set encoding=utf-8
+set t_Co=256 " 256-colour support (st)
+set background=dark
+colorscheme gruvbox
+
+" status bar
+set laststatus=2
+set showcmd
+set ruler
+
+" autoindentation and mouse
+set autoindent
+set magic
+set mouse=a
+
+" NERDTree settings
+" assume leader is \
+nnoremap <leader>n :NERDTreeToggle<CR> " toggle with n
+nnoremap <leader>f :NERDTreeFind<CR> " show current file f
+nnoremap <leader>c :NERDTreeClose<CR> " close c
+
+" syntax
+syntax on
+filetype plugin indent on
+
+" ALE configurations for c and java linting and auto-format
+let g:ale_linters = { 'c': ['gcc'], 'java': ['javac'] }
+let g:ale_fixers = { 'c': ['clang-format'], 'java': [] }
+let g:ale_c_clangformat_options = '--style={ColumnLimit: 80}'