~andrewzah/dotfiles

03421900f9f90200ecb5b3c48a036b003ede7c36 — Andrew Zah 2 years ago d1f48a0
Update
20 files changed, 180 insertions(+), 2959 deletions(-)

D .config/.kitty/kitty.conf
D .config/.mpd/mpd.conf
D .config/.termite/config
M .gemrc
M .khdrc
A .msmtprc
D .muttrc
D .nvimrc
A .offlineimaprc
D .xinitrc
A config/neomutt/neomuttrc
D config/nvim/after/syntax/clojure.vim
D config/nvim/indent/README
D config/nvim/indent/scala.vim
D config/nvim/indent/testfile.scala
M config/nvim/init.vim
D config/nvim/syntax/scala.vim
D config/nvim/syntax/testfile.scala
D gruvbox_palette.sh
A scripts/offline-imap.sh
D .config/.kitty/kitty.conf => .config/.kitty/kitty.conf +0 -442
@@ 1,442 0,0 @@
# vim:fileencoding=utf-8:ft=conf

# Fonts {{{
# Font family. You can also specify different fonts for the
# bold/italic/bold-italic variants. By default they are derived automatically,
# by the OSes font system. Setting them manually is useful for font families
# that have many weight variants like Book, Medium, Thick, etc. For example:
# font_family Operator Mono Book
# bold_font Operator Mono Medium
# italic_font Operator Mono Book Italic
# bold_italic_font Operator Mono Medium Italic
#
# You can get a list of full family names available on your computer by running
# kitty list-fonts
# The default values shown below rely on your OS to choose an appropriate monospace font family.
font_family      Fira Code

# Font size (in pts)
font_size        10.0

# The amount the font size is changed by (in pts) when increasing/decreasing
# the font size in a running terminal.
font_size_delta 2


# Adjust the cell dimensions.
# You can use either numbers, which are interpreted as pixels or percentages
# (number followed by %), which are interpreted as percentages of the
# unmodified values. You can use negative pixels or percentages less than
# 100% to reduce sizes (but this might cause rendering artifacts).
adjust_line_height 0
adjust_column_width 0

# Symbol mapping (special font for specified unicode code points). Map the
# specified unicode codepoints to a particular font. Useful if you need special
# rendering for some symbols, such as for Powerline. Avoids the need for
# patched fonts. Each unicode code point is specified in the form U+<code point
# in hexadecimal>. You can specify multiple code points, separated by commas
# and ranges separated by hyphens. symbol_map itself can be specified multiple times.
# Syntax is:
#
# symbol_map codepoints Font Family Name
#
# For example:
#
# symbol_map U+E0A0-U+E0A2,U+E0B0-U+E0B3 PowerlineSymbols

# Change the sizes of the lines used for the box drawing unicode characters
# These values are in pts. They will be scaled by the monitor DPI to arrive at
# a pixel value. There must be four values corresponding to thin, normal, thick,
# and very thick lines;
box_drawing_scale 0.001, 1, 1.5, 2
# }}}


# Cursor customization {{{
# The cursor color
cursor           #cccccc

# The cursor shape can be one of (block, beam, underline)
cursor_shape     block

# The interval (in seconds) at which to blink the cursor. Set to zero to
# disable blinking. Note that numbers smaller than repaint_delay will be
# limited to repaint_delay.
cursor_blink_interval     0.5

# Stop blinking cursor after the specified number of seconds of keyboard inactivity. Set to
# zero to never stop blinking.
cursor_stop_blinking_after 15.0
# }}}


# Scrollback {{{
# Number of lines of history to keep in memory for scrolling back
scrollback_lines 2000

# Program with which to view scrollback in a new window. The scrollback buffer is passed as
# STDIN to this program. If you change it, make sure the program you use can
# handle ANSI escape sequences for colors and text formatting.
scrollback_pager less +G -R

# Wheel scroll multiplier (modify the amount scrolled by the mouse wheel). Use negative
# numbers to change scroll direction.
wheel_scroll_multiplier 5.0
# }}}


# Mouse {{{
# The color and style for highlighting URLs on mouse-over. url_style can be one of:
# none, single, double, curly
url_color #0087BD
url_style curly

# The modifier keys to press when clicking with the mouse on URLs to open the URL
open_url_modifiers ctrl+shift

# The program with which to open URLs that are clicked on. The special value "default" means to
# use the operating system's default URL handler.
open_url_with default

# Copy to clipboard on select. With this enabled, simply selecting text with
# the mouse will cause the text to be copied to clipboard. Useful on platforms
# such as macOS/Wayland that do not have the concept of primary selections. Note
# that this is a security risk, as all programs, including websites open in your
# browser can read the contents of the clipboard.
copy_on_select no

# The modifiers to use rectangular selection (i.e. to select text in a
# rectangular block with the mouse)
rectangle_select_modifiers ctrl+alt

# Characters considered part of a word when double clicking. In addition to these characters
# any character that is marked as an alpha-numeric character in the unicode
# database will be matched.
select_by_word_characters :@-./_~?&=%+#

# The interval between successive clicks to detect double/triple clicks (in seconds)
click_interval 0.5

# Hide mouse cursor after the specified number of seconds of the mouse not being used. Set to
# zero to disable mouse cursor hiding.
mouse_hide_wait 3.0

# Set the active window to the window under the mouse when moving the mouse around
focus_follows_mouse no
# }}}


# Performance tuning {{{
# Delay (in milliseconds) between screen updates. Decreasing it, increases
# frames-per-second (FPS) at the cost of more CPU usage. The default value
# yields ~100 FPS which is more than sufficient for most uses. Note that to
# actually achieve 100FPS you have to either set sync_to_monitor to no or use a
# monitor with a high refresh rate.
repaint_delay    10

# Delay (in milliseconds) before input from the program running in the terminal
# is processed. Note that decreasing it will increase responsiveness, but also
# increase CPU usage and might cause flicker in full screen programs that
# redraw the entire screen on each loop, because kitty is so fast that partial
# screen updates will be drawn.
input_delay 3

# Sync screen updates to the refresh rate of the monitor. This prevents
# tearing (https://en.wikipedia.org/wiki/Screen_tearing) when scrolling. However,
# it limits the rendering speed to the refresh rate of your monitor. With a
# very high speed mouse/high keyboard repeat rate, you may notice some slight input latency.
# If so, set this to no.
sync_to_monitor yes
# }}}


# Audio/visual bell {{{
# Visual bell duration. Flash the screen when a bell occurs for the specified number of
# seconds. Set to zero to disable.
visual_bell_duration 0.0

# Enable/disable the audio bell. Useful in environments that require silence.
enable_audio_bell yes
# }}}


# Window layout {{{
# If enabled, the window size will be remembered so that new instances of kitty will have the same
# size as the previous instance. If disabled, the window will initially have size configured
# by initial_window_width/height, in pixels.
remember_window_size   yes
initial_window_width   640
initial_window_height  400

# The enabled window layouts. A comma separated list of layout names. The special value * means
# all layouts. The first listed layout will be used as the startup layout.
# For a list of available layouts, see the README.
enabled_layouts *

# The width (in pts) of window borders. Will be rounded to the nearest number of pixels based on screen resolution.
# Note that borders are displayed only when more than one window is visible. They are meant to separate multiple windows.
window_border_width 1

# The window margin (in pts) (blank area outside the border)
window_margin_width 0

# The window padding (in pts) (blank area between the text and the window border)
window_padding_width 1

# The color for the border of the active window
active_border_color #00ff00

# The color for the border of inactive windows
inactive_border_color #cccccc

# Fade the text in inactive windows by the specified amount (a number between
# zero and one, with 0 being fully faded).
inactive_text_alpha 1.0
# }}}


# Tab bar {{{
# Which edge to show the tab bar on, top or bottom
tab_bar_edge bottom

# The separator between tabs in the tab bar
tab_separator " ┇"

# Tab bar colors and styles
active_tab_foreground #000
active_tab_background #eee
active_tab_font_style bold-italic
inactive_tab_foreground #444
inactive_tab_background #999
inactive_tab_font_style normal
# }}}


# Color scheme {{{
# The foreground color
foreground       #dddddd

# The opacity of the background. A number between 0 and 1, where 1 is opaque and 0 is fully transparent.
# This will only work if supported by the OS (for instance, when using a compositor under X11). Note
# that it only sets the default background color's opacity. This is so that
# things like the status bar in vim, powerline prompts, etc. still look good.
# But it means that if you use a color theme with a background color in your
# editor, it will not be rendered as transparent.  Instead you should change the
# default background color in your kitty config and not use a background color
# in the editor color scheme. Or use the escape codes to set the terminals
# default colors in a shell script to launch your editor.
# Be aware that using a value less than 1.0 is a (possibly significant) performance hit.

# The foreground for selections
selection_foreground #000000

# The background for selections
selection_background #FFFACD

background #282828
background_opacity 1.0

color0 #282c34
color1 #cc6666
color2 #87bd68
color3 #dfaf8f
color4 #81a2be
color5 #dc8cc3
color6 #72a0a8
color7 #dcdccc
color8 #709080
color9 #dca3a3
color10 #c3bf9f
color11 #f0dfaf
color12 #94bff3

# Advanced {{{

# The shell program to execute. The default value of . means
# to use whatever shell is set as the default shell for the current user.
# Note that on macOS if you change this, you might need to add --login to
# ensure that the shell starts in interactive mode and reads its startup rc files.
shell .

# Close the window when the child process (shell) exits. If no (the default),
# the terminal will remain open when the child exits as long as there are still
# processes outputting to the terminal (for example disowned or backgrounded
# processes). If yes, the window will close as soon as the child process exits.
# Note that setting it to yes means that any background processes still using
# the terminal can fail silently because their stdout/stderr/stdin no longer
# work.
close_on_child_death no

# Allow other programs to control kitty. If you turn this on other programs can
# control all aspects of kitty, including sending text to kitty windows,
# opening new windows, closing windows, reading the content of windows, etc.
# Note that this even works over ssh connections.
allow_remote_control no

# The value of the TERM environment variable to set. Changing this can break
# many terminal programs, only change it if you know what you are doing, not
# because you read some advice on Stack Overflow to change it.
term xterm-kitty


# }}}


# Keyboard shortcuts {{{
# For a list of key names, see: http://www.glfw.org/docs/latest/group__keys.html
# For a list of modifier names, see: http://www.glfw.org/docs/latest/group__mods.html
#
# You can use the special action no_op to unmap a keyboard shortcut that is
# assigned in the default configuration.
#
# You can combine multiple actions to be triggered by a single shortcut, using the
# syntax below:
# map key combine <separator> action1 <separator> action2 <separator> action3 ...
# For example:
# map ctrl+shift+e combine : new_window : next_layout
# this will create a new window and switch to the next available layout

# Clipboard {{{
map ctrl+shift+v        paste_from_clipboard
map ctrl+shift+s        paste_from_selection
map ctrl+shift+c        copy_to_clipboard
map shift+insert        paste_from_selection
# You can also pass the contents of the current selection to any program using
# pass_selection_to_program. By default, the system's open program is used, but
# you can specify your own, for example:
# map ctrl+shift+o      pass_selection_to_program firefox
map ctrl+shift+o        pass_selection_to_program
# }}}

# Scrolling {{{
map ctrl+shift+up        scroll_line_up
map ctrl+shift+down      scroll_line_down
map ctrl+shift+k         scroll_line_up
map ctrl+shift+j         scroll_line_down
map ctrl+shift+page_up   scroll_page_up
map ctrl+shift+page_down scroll_page_down
map ctrl+shift+home      scroll_home
map ctrl+shift+end       scroll_end
# }}}

# Window management {{{
map ctrl+shift+enter    new_window
map ctrl+shift+n        new_os_window
map ctrl+shift+w        close_window
map ctrl+shift+]        next_window
map ctrl+shift+[        previous_window
map ctrl+shift+f        move_window_forward
map ctrl+shift+b        move_window_backward
map ctrl+shift+`        move_window_to_top
map ctrl+shift+1        first_window
map ctrl+shift+2        second_window
map ctrl+shift+3        third_window
map ctrl+shift+4        fourth_window
map ctrl+shift+5        fifth_window
map ctrl+shift+6        sixth_window
map ctrl+shift+7        seventh_window
map ctrl+shift+8        eighth_window
map ctrl+shift+9        ninth_window
map ctrl+shift+0        tenth_window
# You can open a new window running an arbitrary program, for example:
# map ctrl+shift+y      new_window mutt
#
# You can pass the current selection to the new program by using the @selection placeholder
# map ctrl+shift+y      new_window less @selection
#
# You can even send the contents of the current screen + history buffer as stdin using
# the placeholders @text (which is the plain text) and @ansi (which includes text styling escape codes).
# For only the current screen, use @screen or @ansi_screen.
# For example, the following command opens the scrollback buffer in less in a new window.
# map ctrl+shift+y      new_window @ansi less +G -R
#
# You can open a new window with the current working directory set to the
# working directory of the current window using
# map ctrl+alt+enter    new_window_with_cwd
# }}}

# Tab management {{{
map ctrl+shift+right    next_tab
map ctrl+shift+left     previous_tab
map ctrl+shift+t        new_tab
map ctrl+shift+q        close_tab
map ctrl+shift+l        next_layout
map ctrl+shift+.        move_tab_forward
map ctrl+shift+,        move_tab_backward
# You can also create shortcuts to go to specific tabs, with 1 being the first tab
# map ctrl+alt+1          goto_tab 1
# map ctrl+alt+2          goto_tab 2

# Just as with new_window above, you can also pass the name of arbitrary
# commands to run when using new_tab and use new_tab_with_cwd.
# }}}

# Layout management {{{
# You can create shortcuts to switch to specific layouts
# map ctrl+alt+1          goto_layout tall
# map ctrl+alt+2          goto_layout stack
# }}}

# Font sizes {{{
map ctrl+shift+equal    increase_font_size
map ctrl+shift+minus    decrease_font_size
map ctrl+shift+backspace restore_font_size
# To setup shortcuts for specific font sizes, follow the example below:
# map ctrl+shift+f6     set_font_size 10.0
# map ctrl+shift+f7     set_font_size 20.5
# }}}

# Miscellaneous {{{
map ctrl+shift+f11      toggle_fullscreen
map ctrl+shift+u        input_unicode_character
map ctrl+shift+f2       edit_config_file
# Open a currently visible URL using the keyboard. The program used to open the URL is specified in open_url_with.
# You can customize how the URLs are detected and opened by specifying command line options to
# url_hints. For example:
# map ctrl+shift+e        run_simple_kitten text url_hints --program firefox --regex "http://[^ ]+"
map ctrl+shift+e        run_simple_kitten text url_hints

# Sending arbitrary text on shortcut key presses
# You can tell kitty to send arbitrary (UTF-8) encoded text to
# the client program when pressing specified shortcut keys. For example:
# map ctrl+alt+a send_text all Special text
# This will send "Special text" when you press the Ctrl+Alt+a key combination.
# The text to be sent is a python string literal so you can use escapes like
# \x1b to send control codes or \u21fb to send unicode characters (or you can
# just input the unicode characters directly as UTF-8 text). The first argument
# to send_text is the keyboard modes in which to activate the shortcut. The possible
# values are normal or application or kitty or a comma separated combination of them.
# The special keyword all means all modes. The modes normal and application refer to
# the DECCKM cursor key mode for terminals, and kitty refers to the special kitty
# extended keyboard protocol. Another example, that outputs a word and then moves the cursor
# to the start of the line (same as pressing the Home key):
# map ctrl+alt+a send_text normal Word\x1b[H
# map ctrl+alt+a send_text application Word\x1bOH
# }}}

# }}}


# OS specific tweaks {{{

# Change the color of the kitty window's titlebar on macOS. A value of "system"
# means to use the default system color, a value of "background" means to use
# the default background color and finally you can use an arbitrary color, such
# as #12af59 or "red".
macos_titlebar_color system

# Hide the kitty window's title bar on macOS.
macos_hide_titlebar no

# Use the option key as an alt key. With this set to no, kitty will use
# the macOS native Option+Key = unicode character behavior. This will
# break any Alt+key keyboard shortcuts in your terminal programs, but you
# can use the macOS unicode input technique.
macos_option_as_alt yes

# The number is a percentage of maximum volume.
# See man XBell for details.
x11_bell_volume 80
# }}}


D .config/.mpd/mpd.conf => .config/.mpd/mpd.conf +0 -407
@@ 1,407 0,0 @@
# An example configuration file for MPD.
# Read the user manual for documentation: http://www.musicpd.org/doc/user/

bind_to_address "~/.config/mpd/socket"

# Files and directories #######################################################
#
# This setting controls the top directory which MPD will search to discover the
# available audio files and add them to the daemon's online database. This 
# setting defaults to the XDG directory, otherwise the music directory will be
# be disabled and audio files will only be accepted over ipc socket (using
# file:// protocol) or streaming files over an accepted protocol.
#
music_directory		"/mnt/falcon/Music"
#
# This setting sets the MPD internal playlist directory. The purpose of this
# directory is storage for playlists created by MPD. The server will use 
# playlist files not created by the server but only if they are in the MPD
# format. This setting defaults to playlist saving being disabled.
#
playlist_directory		"~/.config/mpd/playlists"
#
# This setting sets the location of the MPD database. This file is used to
# load the database at server start up and store the database while the 
# server is not up. This setting defaults to disabled which will allow
# MPD to accept files over ipc socket (using file:// protocol) or streaming
# files over an accepted protocol.
#
db_file			"~/.config/mpd/database"
# 
# These settings are the locations for the daemon log files for the daemon.
# These logs are great for troubleshooting, depending on your log_level
# settings.
#
# The special value "syslog" makes MPD use the local syslog daemon. This
# setting defaults to logging to syslog, otherwise logging is disabled.
#
log_file			"~/.config/mpd/log"
#
# This setting sets the location of the file which stores the process ID
# for use of mpd --kill and some init scripts. This setting is disabled by
# default and the pid file will not be stored.
#
pid_file			"~/.config/mpd/pid"
#
# This setting sets the location of the file which contains information about
# most variables to get MPD back into the same general shape it was in before
# it was brought down. This setting is disabled by default and the server 
# state will be reset on server start up.
#
state_file			"~/.config/mpd/state"
#
# The location of the sticker database.  This is a database which
# manages dynamic information attached to songs.
#
sticker_file			"~/.config/mpd/sticker.sql"
#
###############################################################################

audio_output {
  type  "pulse"
  name  "DAC"
}

audio_output {
  type  "fifo"
  name  "my_fifo"
  path  "/tmp/mpd.fifo"
  format "44100:16:2"
}


# General music daemon options ################################################
#
# This setting specifies the user that MPD will run as. MPD should never run as
# root and you may use this setting to make MPD change its user ID after
# initialization. This setting is disabled by default and MPD is run as the
# current user.
#
user				"andrei"
#
# This setting specifies the group that MPD will run as. If not specified
# primary group of user specified with "user" setting will be used (if set).
# This is useful if MPD needs to be a member of group such as "audio" to
# have permission to use sound card.
#
#group				"nogroup"
#
# This setting sets the address for the daemon to listen on. Careful attention
# should be paid if this is assigned to anything other then the default, any.
# This setting can deny access to control of the daemon. Not effective if
# systemd socket activiation is in use.
#
# For network
#bind_to_address		"any"
#
# And for Unix Socket
#bind_to_address		"~/.mpd/socket"
#
# This setting is the TCP port that is desired for the daemon to get assigned
# to.
#
#port				"6600"
#
# This setting controls the type of information which is logged. Available 
# setting arguments are "default", "secure" or "verbose". The "verbose" setting
# argument is recommended for troubleshooting, though can quickly stretch
# available resources on limited hardware storage.
#
log_level			"default"
#
# If you have a problem with your MP3s ending abruptly it is recommended that 
# you set this argument to "no" to attempt to fix the problem. If this solves
# the problem, it is highly recommended to fix the MP3 files with vbrfix
# (available from <http://www.willwap.co.uk/Programs/vbrfix.php>), at which
# point gapless MP3 playback can be enabled.
#
#gapless_mp3_playback			"yes"
#
# Setting "restore_paused" to "yes" puts MPD into pause mode instead
# of starting playback after startup.
#
#restore_paused "no"
#
# This setting enables MPD to create playlists in a format usable by other
# music players.
#
#save_absolute_paths_in_playlists	"no"
#
# This setting defines a list of tag types that will be extracted during the
# audio file discovery process. The complete list of possible values can be
# found in the user manual.
#metadata_to_use	"artist,album,title,track,name,genre,date,composer,performer,disc"
#
# This setting enables automatic update of MPD's database when files in 
# music_directory are changed.
#
#auto_update	"yes"
#
# Limit the depth of the directories being watched, 0 means only watch
# the music directory itself.  There is no limit by default.
#
#auto_update_depth "3"
#
###############################################################################


# Symbolic link behavior ######################################################
#
# If this setting is set to "yes", MPD will discover audio files by following 
# symbolic links outside of the configured music_directory.
#
#follow_outside_symlinks	"yes"
#
# If this setting is set to "yes", MPD will discover audio files by following
# symbolic links inside of the configured music_directory.
#
#follow_inside_symlinks		"yes"
#
###############################################################################


# Zeroconf / Avahi Service Discovery ##########################################
#
# If this setting is set to "yes", service information will be published with
# Zeroconf / Avahi.
#
#zeroconf_enabled		"yes"
#
# The argument to this setting will be the Zeroconf / Avahi unique name for
# this MPD server on the network.
#
#zeroconf_name			"Music Player"
#
###############################################################################


# Permissions #################################################################
#
# If this setting is set, MPD will require password authorization. The password
# setting can be specified multiple times for different password profiles.
#
#password                        "password@read,add,control,admin"
#
# This setting specifies the permissions a user has who has not yet logged in. 
#
#default_permissions             "read,add,control,admin"
#
###############################################################################


# Database #######################################################################
#

#database {
#       plugin "proxy"
#       host "other.mpd.host"
#       port "6600"
#}

# Input #######################################################################
#

input {
        plugin "curl"
#       proxy "proxy.isp.com:8080"
#       proxy_user "user"
#       proxy_password "password"
}

#
###############################################################################

# Audio Output ################################################################
#
# MPD supports various audio output types, as well as playing through multiple 
# audio outputs at the same time, through multiple audio_output settings 
# blocks. Setting this block is optional, though the server will only attempt
# autodetection for one sound card.
#
# An example of an ALSA output:
#
#audio_output {
#	type		"alsa"
#	name		"My ALSA Device"
##	device		"hw:0,0"	# optional
##	mixer_type      "hardware"	# optional
##	mixer_device	"default"	# optional
##	mixer_control	"PCM"		# optional
##	mixer_index	"0"		# optional
#}
#
# An example of an OSS output:
#
#audio_output {
#	type		"oss"
#	name		"My OSS Device"
##	device		"/dev/dsp"	# optional
##	mixer_type      "hardware"	# optional
##	mixer_device	"/dev/mixer"	# optional
##	mixer_control	"PCM"		# optional
#}
#
# An example of a shout output (for streaming to Icecast):
#
#audio_output {
#	type		"shout"
#	encoder		"vorbis"		# optional
#	name		"My Shout Stream"
#	host		"localhost"
#	port		"8000"
#	mount		"/mpd.ogg"
#	password	"hackme"
#	quality		"5.0"
#	bitrate		"128"
#	format		"44100:16:1"
##	protocol	"icecast2"		# optional
##	user		"source"		# optional
##	description	"My Stream Description"	# optional
##	url		"http://example.com"	# optional
##	genre		"jazz"			# optional
##	public		"no"			# optional
##	timeout		"2"			# optional
##	mixer_type      "software"		# optional
#}
#
# An example of a recorder output:
#
#audio_output {
#	type		"recorder"
#	name		"My recorder"
#	encoder		"vorbis"		# optional, vorbis or lame
#	path		"/var/lib/mpd/recorder/mpd.ogg"
##	quality		"5.0"			# do not define if bitrate is defined
#	bitrate		"128"			# do not define if quality is defined
#	format		"44100:16:1"
#}
#
# An example of a httpd output (built-in HTTP streaming server):
#
#audio_output {
#	type		"httpd"
#	name		"My HTTP Stream"
#	encoder		"vorbis"		# optional, vorbis or lame
#	port		"8000"
#	bind_to_address	"0.0.0.0"		# optional, IPv4 or IPv6
##	quality		"5.0"			# do not define if bitrate is defined
#	bitrate		"128"			# do not define if quality is defined
#	format		"44100:16:1"
#	max_clients	"0"			# optional 0=no limit
#}
#
# An example of a pulseaudio output (streaming to a remote pulseaudio server)
#
#audio_output {
#	type		"pulse"
#	name		"My Pulse Output"
##	server		"remote_server"		# optional
##	sink		"remote_server_sink"	# optional
#}
#
# An example of a winmm output (Windows multimedia API).
#
#audio_output {
#	type		"winmm"
#	name		"My WinMM output"
##	device		"Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
#		or
##	device		"0"		# optional
##	mixer_type	"hardware"	# optional
#}
#
# An example of an openal output.
#
#audio_output {
#	type		"openal"
#	name		"My OpenAL output"
##	device		"Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
#}
#
# An example of an sndio output.
#
#audio_output {
#	type		"sndio"
#	name		"sndio output"
#	mixer_type	"software"
#}
#
# An example of an OS X output:
#
#audio_output {
#	type		"osx"
#	name		"My OS X Device"
##	device		"Built-in Output"	# optional
##	channel_map      "-1,-1,0,1"	# optional
#}
#
## Example "pipe" output:
#
#audio_output {
#	type		"pipe"
#	name		"my pipe"
#	command		"aplay -f cd 2>/dev/null"
## Or if you're want to use AudioCompress
#	command		"AudioCompress -m | aplay -f cd 2>/dev/null"
## Or to send raw PCM stream through PCM:
#	command		"nc example.org 8765"
#	format		"44100:16:2"
#}
#
## An example of a null output (for no audio output):
#
#audio_output {
#	type		"null"
#	name		"My Null Output"
#	mixer_type      "none"			# optional
#}
#
###############################################################################


# Normalization automatic volume adjustments ##################################
#
# This setting specifies the type of ReplayGain to use. This setting can have
# the argument "off", "album", "track" or "auto". "auto" is a special mode that
# chooses between "track" and "album" depending on the current state of
# random playback. If random playback is enabled then "track" mode is used.
# See <http://www.replaygain.org> for more details about ReplayGain.
# This setting is off by default.
#
#replaygain			"album"
#
# This setting sets the pre-amp used for files that have ReplayGain tags. By
# default this setting is disabled.
#
#replaygain_preamp		"0"
#
# This setting sets the pre-amp used for files that do NOT have ReplayGain tags.
# By default this setting is disabled.
#
#replaygain_missing_preamp	"0"
#
# This setting enables or disables ReplayGain limiting.
# MPD calculates actual amplification based on the ReplayGain tags
# and replaygain_preamp / replaygain_missing_preamp setting.
# If replaygain_limit is enabled MPD will never amplify audio signal
# above its original level. If replaygain_limit is disabled such amplification
# might occur. By default this setting is enabled.
#
#replaygain_limit		"yes"
#
# This setting enables on-the-fly normalization volume adjustment. This will
# result in the volume of all playing audio to be adjusted so the output has 
# equal "loudness". This setting is disabled by default.
#
#volume_normalization		"no"
#
###############################################################################

# Character Encoding ##########################################################
#
# If file or directory names do not display correctly for your locale then you 
# may need to modify this setting.
#
#filesystem_charset		"UTF-8"
#
###############################################################################

D .config/.termite/config => .config/.termite/config +0 -87
@@ 1,87 0,0 @@
[options]
#allow_bold = true
#audible_bell = false
#clickable_url = true
#dynamic_title = true
font Inconsolata 11
#font = Fira Code 10
#fullscreen = true
#geometry = 640x480
#icon_name = terminal
#mouse_autohide = false
#scroll_on_output = false
#scroll_on_keystroke = true
# Length of the scrollback buffer, 0 disabled the scrollback buffer
# and setting it to a negative value means "infinite scrollback"
scrollback_lines = 10000
#search_wrap = true
#urgent_on_bell = true
#hyperlinks = false

# $BROWSER is used by default if set, with xdg-open as a fallback
#browser = xdg-open

# "system", "on" or "off"
#cursor_blink = system

# "block", "underline" or "ibeam"
#cursor_shape = block

# Hide links that are no longer valid in url select overlay mode
#filter_unmatched_urls = true

# Emit escape sequences for extra modified keys
#modify_other_keys = false

# set size hints for the window
#size_hints = false

# "off", "left" or "right"
#scrollbar = off

[colors]
# If both of these are unset, cursor falls back to the foreground color,
# and cursor_foreground falls back to the background color.
#cursor = #dcdccc
#cursor_foreground = #dcdccc

#foreground = #dcdccc
#foreground_bold = #ffffff
#background = #3f3f3f

# 20% background transparency (requires a compositor)
#background = rgba(63, 63, 63, 0.8)

# If unset, will reverse foreground and background
highlight = #2f2f2f

# Colors from color0 to color254 can be set
color0 = #3f3f3f
color1 = #705050
color2 = #60b48a
color3 = #dfaf8f
color4 = #506070
color5 = #dc8cc3
color6 = #8cd0d3
color7 = #dcdccc
color8 = #709080
color9 = #dca3a3
color10 = #c3bf9f
color11 = #f0dfaf
color12 = #94bff3
color13 = #ec93d3
color14 = #93e0e3
color15 = #ffffff

[hints]
#font = Monospace 12
#foreground = #dcdccc
#background = #3f3f3f
#active_foreground = #e68080
#active_background = #3f3f3f
#padding = 2
#border = #3f3f3f
#border_width = 0.5
#roundness = 2.0

# vim: ft=dosini cms=#%s

M .gemrc => .gemrc +2 -1
@@ 1,1 1,2 @@
gem: --no-rdoc --no-ri
install: --no-ri --no-rdoc --platform ruby
update:  --no-ri --no-rdoc --platform ruby

M .khdrc => .khdrc +0 -3
@@ 1,9 1,6 @@
# reload config
cmd + alt + ctrl - r : khd -e "reload"

# open terminal, blazingly fast compared to iTerm/Hyper
cmd - return : open -na /Applications/Kitty.app

# focus window
alt - h : chunkc tiling::window --focus west
alt - j : chunkc tiling::window --focus south

A .msmtprc => .msmtprc +25 -0
@@ 0,0 1,25 @@
account gmail 
host smtp.gmail.com
port 587
protocol smtp
auth on
from zah.andrew@gmail.com
user zah.andrew@gmail.com
password qvoslasijhfbwufd
tls on
tls_trust_file /usr/local/etc/openssl/cert.pem

account zoho
host smtp.zoho.com
maildomain andrewzah.com
port 465
protocol smtp
auth on
from zah@andrewzah.com
user zah@andrewzah.com
password MtpmvAT3AqRE
tls on
tls_starttls off
tls_trust_file /usr/local/etc/openssl/cert.pem

account default : zoho

D .muttrc => .muttrc +0 -11
@@ 1,11 0,0 @@
folder-hook 'zah_andrew_gmail' 'source ~/.mutt/account_zah_andrewzah.conf'
folder-hook 'zah_andrewzah' 'source ~/.mutt/account_zah_andrew_gmail.conf'

source ~/.mutt/account_zah_andrew_gmail.conf
#source ~/.mutt/account_zah_andrewzah.conf

macro index <f2> '<sync-mailbox><refresh><enter-command>source ~/.mutt/zah_andrewzah.conf<enter><change-folder>!<enter>'
macro index <f3> '<sync-mailbox><refresh><enter-command>source ~/.mutt/zah_andrew_gmail.conf<enter><change-folder>!<enter>'

# Fetch mail shortcut
bind index G imap-fetch-mail

D .nvimrc => .nvimrc +0 -347
@@ 1,347 0,0 @@
if has('unix')
  set rtp+=/usr/bin/fzf
elseif has('macunix')
  set rtp+=/usr/local/opt/fzf
end

call plug#begin('~/.vim/plugged')

Plug 'AndrewRadev/sideways.vim'
Plug 'ElmCast/elm-vim', { 'for': 'elm' }
Plug 'bhurlow/vim-parinfer', {'for': 'clojure' }
Plug 'c-brenn/phoenix.vim', { 'for': ['elixir'] }
Plug 'cespare/vim-toml', { 'for': 'toml' }
Plug 'chrisbra/NrrwRgn'
Plug 'chrisbra/csv.vim'
Plug 'elixir-editors/vim-elixir', { 'for': ['elixir'] }
Plug 'elorest/vim-slang', { 'for': 'slang' }
Plug 'fisadev/FixedTaskList.vim'
Plug 'gcmt/wildfire.vim'
Plug 'gerw/vim-HiLinkTrace'
Plug 'godlygeek/tabular'
Plug 'haya14busa/vim-signjk-motion'
Plug 'https://github.com/rust-lang/rust.vim'
Plug 'iamcco/markdown-preview.vim', { 'for': 'markdown' }
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'ledger/vim-ledger'
Plug 'luochen1990/rainbow'
Plug 'machakann/vim-sandwich'
Plug 'morhetz/gruvbox'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'rhysd/vim-crystal', { 'for': 'crystal' }
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
Plug 'scrooloose/nerdcommenter'
Plug 'sheerun/vim-polyglot'
Plug 'skywind3000/asyncrun.vim'
Plug 'soramugi/auto-ctags.vim'
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-projectionist', { 'for': ['eex', 'ex'] }
Plug 'venantius/vim-eastwood', { 'for': 'clojure' }
Plug 'vim-scripts/ReplaceWithRegister'
Plug 'vimlab/split-term.vim'
Plug 'yuttie/comfortable-motion.vim'
Plug '~/Desktop/Sync/_programming/Vim/alpine'

call plug#end()
filetype plugin indent on
runtime macros/matchit.vim

syntax enable
colorscheme gruvbox
"colorscheme alpine

set hidden
set title
set history=1000
set fillchars=vert:\│

" theme / colors
set termguicolors
set background=dark
set scrolloff=3

" Cursor position
set ruler
set rulerformat=%27(%{strftime('%a\ %e,\ %H:%M')}\ %5l,%-1(%c%V%)\ %P%)

set clipboard+=unnamedplus

" Line Numbers
set number

" make backspace behave
set backspace=eol,start,indent
set whichwrap+=<,>

set magic

set showmatch
set mat=2

" tab behavior
set tabstop=2
set shiftwidth=2
set expandtab
set smarttab "paste correctly

set cursorline

" searching
set hls "highlight search
set is "incsearch
set ignorecase " Ignore case when searching...
set smartcase  " Except when starting with a capital
set incsearch

" Quick timeouts on key combinations.
set timeoutlen=300

set shortmess=atIwmfl

set lazyredraw

"shows info or documentation below code, so code doesn't move
set splitbelow 

" Backup, Swap, and Undo
set directory^=~/.nvim/tmp,/tmp
set backupdir=~/.nvim/backup,/tmp
set undodir=~/.nvim/undo,/tmp

" Remove swapfiles, autoread changes instead
set noswapfile
set autoread


"""
""" Variables for plugins
"""

" after/syntax concealing
let g:clojure_conceal_extras = 1

" Rainbow brackets/parens
let g:rainbow_active = 1

let g:fzf_tags_command = 'ctags --extra=+f -R'

" gruvbox coloring for fzf
let g:fzf_colors =
\ { 'fg':      ['fg', 'Normal'],
  \ 'bg':      ['bg', 'Normal'],
  \ 'hl':      ['fg', 'Comment'],
  \ 'fg+':     ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
  \ 'bg+':     ['bg', 'CursorLine', 'CursorColumn'],
  \ 'hl+':     ['fg', 'Statement'],
  \ 'info':    ['fg', 'PreProc'],
  \ 'prompt':  ['fg', 'Conditional'],
  \ 'pointer': ['fg', 'Exception'],
  \ 'marker':  ['fg', 'Keyword'],
  \ 'spinner': ['fg', 'Label'],
  \ 'header':  ['fg', 'Comment'] }

" Disable arrow movement, resize splits instead.
let g:elite_mode = 1
if get(g:, 'elite_mode')
	nnoremap <Up>    :resize +2<CR>
	nnoremap <Down>  :resize -2<CR>
	nnoremap <Left>  :vertical resize +2<CR>
	nnoremap <Right> :vertical resize -2<CR>
endif

let g:comfortable_motion_scroll_down_key = "j"
let g:comfortable_motion_scroll_up_key = "k"  

" auto-ctags options
let g:auto_ctags = 1
let g:auto_ctags_directory_list = ['.git']

let g:wildfire_objects = {
  \ "*" : ["i'", 'i"', "i)", "i]", "i}"],
  \ "html,xml" : ["at", "it"],
\ }
"for appending types to * rather than excluding: https://github.com/gcmt/wildfire.vim


"" ALE linters
"let g:ale_fixers = {
"\   'clojure' :  ['joker'],
"\   'crystal' :  ['crystal'],
"\   'go'      :  ['gofmt'],
"\   'rust'    :  [],
"\}
"let g:ale_lint_on_text_changed = 'never'
"let g:ale_lint_on_enter = 0
"let g:ale_fix_on_save = 1

"""
""" Key remapping
"""

" Leader key
let mapleader = ","

" signjk 
nmap <Leader>j <Plug>(signjk-j)
nmap <Leader>k <Plug>(signjk-k)

" ease of access
nnoremap ' `
nnoremap ` '

" Get out of insert mode with jj 
inoremap jj <Esc>

" Fast Saving
nmap <leader>w :w!<cr>

" Fast Save+Quit
nmap <leader>x :wq<cr>

" Fast quitting
nmap <leader>q :q!<cr>

" fast fuzzy searching
nmap <Leader>t :Tags<CR>
nmap <Leader>b :Buffers<CR>
nmap <c-p> :Files<cr>

" push window up/down
nnoremap <C-e> 3<C-e>
nnoremap <C-y> 3<C-y>

" clear search highlight
nnoremap <Leader>co :nohl<CR><C-l>

vnoremap <Tab> >gv
vnoremap <S-Tab> <gv
vnoremap < <gv
vnoremap > >gv

" Tabularize
nnoremap <Leader>a= :Tabularize /=<CR>
vnoremap <Leader>a= :Tabularize /=<CR>
nnoremap <Leader>a: :Tabularize /:\zs<CR>
vnoremap <Leader>a: :Tabularize /:\zs<CR>

" Save 1 keystroke on vim splits
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>

" Allow copy/paste
nnoremap <C-x> "+p
vnoremap <C-c> "+y

" Double leader key for toggling visual-line mode
nnoremap <silent> <Leader><Leader> V
vnoremap <Leader><Leader> <Esc>

" When pressing <leader>cd switch to the directory of the open buffer
nnoremap <Leader>cd :lcd %:p:h<CR>:pwd<CR>

" Use backspace key for matchit.vim
nnoremap <BS> %
xnoremap <BS> %

map <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>

" Session stuff
nnoremap <leader>ss :call MakeSession()<cr>
nnoremap <leader>sl :call LoadSession()<cr>

" Highlight syntax for word under cursor
nnoremap <leader>pr :HLT!<cr>

""" Syntaxes """

" Autoset slang syntax highlighting
au BufRead,BufNewFile *.slang set filetype=slang

" Autoset ecr -> erb syntax highlighting
au BufRead,BufNewFile *.ecr set filetype=erb

" Highlight syntax for word under cursor
nnoremap <leader>pr :HLT!<cr>

nnoremap <BS> {
onoremap <BS> {
vnoremap <BS> {

nnoremap <expr> <CR> empty(&buftype) ? '}' : '<CR>'
onoremap <expr> <CR> empty(&buftype) ? '}' : '<CR>'
vnoremap <CR> }

xmap S <Plug>(operator-sandwich-add)

tnoremap <Esc> <C-\><C-n>


" Automatically make the dir if it doesn't exist on the machine.
silent !mkdir -p ~/.nvim/tmp >/dev/null 2>&1

" Autoread on common events
autocmd! FocusGained,BufEnter * checktime


" Clojure
" au Filetype clojure nmap <c-c><c-k> :Require<cr>  

" Formats a ledger entry. Untabs a visual selection, runs :Tab /<space><space>, and re-tabs
let @l = '�kB:tab�kb�kb�kbTab  /�kb�kb�kb /  
gv	:w
'

" ================ Persistent Undo ==================
" Keep undo history across sessions, by storing in file.
" Only works all the time.
if has('persistent_undo') && isdirectory(expand('~').'/.vim/backups')
  silent !mkdir ~/.vim/backups > /dev/null 2>&1
  set undodir=~/.vim/backups
  set undofile
endif

set ssop-=options       " do not store options (vimrc) in a session
"" Make and load method to save session per dir
function! MakeSession()
    let b:sessiondir = $HOME . "/.vim/sessions" . getcwd()
    if (filewritable(b:sessiondir) != 2)
        exe 'silent !mkdir -p ' b:sessiondir
        redraw!
    endif
    let b:filename = b:sessiondir . '/session.vim'
    exe "mksession! " . b:filename
endfunction
function! LoadSession()
    let b:sessiondir = $HOME . "/.vim/sessions" . getcwd()
    let b:sessionfile = b:sessiondir . "/session.vim"
    if (filereadable(b:sessionfile))
        exe 'source ' b:sessionfile
    else
        echo "No session loaded."
    endif

endfunction

" Auto-commands 
augroup autosourcing
    if(argc() == 0)
        "au VimEnter * nested :call LoadSession() " Uncomment to automatically load session
        au VimLeave * :call MakeSession()
    endif
augroup END

"auto source nvimfile on write
augroup mynvimrc
    au!
    au BufWritePost .nvimrc so $MYVIMRC
augroup END

" FZF :Find
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --no-ignore --ignore-case --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)

" Edit new file with a new directory
command! -nargs=1 E execute('silent! !mkdir -p "$(dirname "<args>")"') <Bar> e <args>

A .offlineimaprc => .offlineimaprc +42 -0
@@ 0,0 1,42 @@
# Sample minimal config file.  Copy this to ~/.offlineimaprc and edit to
# get started fast.

[general]
ui = ttyui
accounts = Gmail,Zoho

[Account Gmail]
localrepository = Gmail-Local
remoterepository = Gmail-Remote

[Account Zoho]
localrepository = Zoho-Local
remoterepository = Zoho-Remote

[Repository Gmail-Local]
type = Maildir
localfolders = ~/Mail/Gmail

[Repository Zoho-Local]
type = Maildir
localfolders = ~/Mail/Zoho

[Repository Gmail-Remote]
type = Gmail
remoteuser = zah.andrew@gmail.com
remotepass = qvoslasijhfbwufd
realdelete = no
maxconnections = 3
ssl = yes
sslcacertfile = /usr/local/etc/openssl/cert.pem

[Repository Zoho-Remote]
type = IMAP
remotehost = imappro.zoho.com
remoteport = 993 
remoteuser = zah@andrewzah.com
remotepass = MtpmvAT3AqRE
realdelete = no
maxconnections = 3
ssl = yes
sslcacertfile = /usr/local/etc/openssl/cert.pem

D .xinitrc => .xinitrc +0 -2
@@ 1,2 0,0 @@
exec i3
xautolock -time 5 -locker lock

A config/neomutt/neomuttrc => config/neomutt/neomuttrc +27 -0
@@ 0,0 1,27 @@
set spoolfile = "+Zoho/INBOX"
set sort=threads
set sort_browser=reverse-date
set sort_aux=reverse-last-date-received
#last-date-received

set new_mail_command="terminal-notifier -title '%v' -subtitle 'New Mail' -message '%n new messages, %u unread.' -activate 'com.apple.Terminal'"
set timeout=10
set index_format= "%4C %Z %{%b %d %H:%M} %-15.15L (%?l?%4l&%4c?) %s"

alternative_order text/plain text/html
auto_view text/html

source ~/.neomutt/accounts/zoho

folder-hook Gmail/* source ~/.neomutt/accounts/gmail
folder-hook Zoho/*  source ~/.neomutt/accounts/zoho

macro index ,cga  "<change-folder>=[Gmail]/All Mail<enter>" "go to gmail all mail"
macro index ,cgi  "<change-folder> =Gmail/INBOX<enter>"     "go to Gmail Inbox"
macro index ,cza  "<change-folder> =Zoho/Archives<enter>"   "go to Zoho Archives"
macro index ,czi  "<change-folder> =Zoho/INBOX<enter>"      "go to Zoho Inbox"
macro index,pager ,ag "<save-message>=Gmail/[Gmail].All<quote-char><space>Mail<enter><enter>" "Archive Message to Gmail/[Gmail].All Mail"
macro index,pager ,az "<save-message>=Zoho/Archives<enter><enter>" "Archive Message to Zoho/Archives"

# Fetch mail shortcut
bind index G imap-fetch-mail

D config/nvim/after/syntax/clojure.vim => config/nvim/after/syntax/clojure.vim +0 -0
D config/nvim/indent/README => config/nvim/indent/README +0 -78
@@ 1,78 0,0 @@
Scala Indent file for Vim
=========================

You can check 'testfile.scala' in this directory to see what I'm testing
against.  I'm mostly just trying to fit the major conventions that people would
code in with Scala, and not all of the possibilities - life's too short for that
and I'd rather be writing Scala code than Vim indent code.

With that said, if there's something you're passionate about and you want it to
be properly indented, and you can't hack it in yourself, then feel free to drop
me a line and we'll fight about it.

You'll see the following comments in 'testfile.scala':

    /**
     * The following stuff doesn't work, but honestly, it's pretty
     * pathological stuff... format your code differently.
     *
     * ---- 1. ----
     *
     *    if (b) 1
     *    else
     *      if (c) 2
     *    else 3
     *
     *    Do this instead:
     *
     *    if (b) 1
     *    else {
     *      if (c) 2
     *      else 3
     *    }
     *    
     *
     * ---- 2. ----
     *
     *    if (b) 1
     *    else
     *      if (c)
     *        2
     *        else 3
     *
     *    Do this instead:
     *
     *    if (b) 1
     *    else {
     *      if (c) 2
     *      else 3
     *    }
     *
     *    or this...
     *    
     *    if (b) 1
     *    else {
     *      if (c)
     *        2
     *      else
     *        3
     *    }
     *
     * ---- 3. ----
     *    
     *    if (b) 1
     *    else {
     *      if (c)
     *        2
     *        else 3
     *    }
     *
     *    Do the same as in number 2
     */

In other words, for the forseeable future... do something different to fix the
cases that don't work. :)

If you've got any questions about what's defined now, you can reach me at
http://derekwyatt.org.


D config/nvim/indent/scala.vim => config/nvim/indent/scala.vim +0 -603
@@ 1,603 0,0 @@
" Vim indent file
" Language         : Scala (http://scala-lang.org/)
" Original Author  : Stefan Matthias Aust
" Modifications by : Derek Wyatt
" Last Change: 2011 Mar 19 (Derek Wyatt)

if exists("b:did_indent")
  finish
endif
let b:did_indent = 1

setlocal autoindent
setlocal indentexpr=GetScalaIndent()
setlocal indentkeys=0{,0},0),!^F,<>>,o,O,e,=case,<CR>

if exists("*GetScalaIndent")
  finish
endif

let s:defMatcher = '\%(\%(private\|protected\)\%(\[[^\]]*\]\)\?\s\+\|abstract\s\+\|override\s\+\)*\<def\>'
let s:funcNameMatcher = '\w\+'
let s:typeSpecMatcher = '\%(\s*\[\_[^\]]*\]\)'
let s:defArgMatcher = '\%((\_.\{-})\)'
let s:returnTypeMatcher = '\%(:\s*\w\+' . s:typeSpecMatcher . '\?\)'
let g:fullDefMatcher = '^\s*' . s:defMatcher . '\s\+' . s:funcNameMatcher . '\s*' . s:typeSpecMatcher . '\?\s*' . s:defArgMatcher . '\?\s*' . s:returnTypeMatcher . '\?\s*[={]'

function! scala#ConditionalConfirm(msg)
  if 0
    call confirm(a:msg)
  endif
endfunction

function! scala#GetLine(lnum)
  let line = substitute(getline(a:lnum), '//.*$', '', '')
  let line = substitute(line, '"\(.\|\\"\)\{-}"', '""', 'g')
  return line
endfunction

function! scala#CountBrackets(line, openBracket, closedBracket)
  let line = substitute(a:line, '"\(.\|\\"\)\{-}"', '', 'g')
  let open = substitute(line, '[^' . a:openBracket . ']', '', 'g')
  let close = substitute(line, '[^' . a:closedBracket . ']', '', 'g')
  return strlen(open) - strlen(close)
endfunction

function! scala#CountParens(line)
  return scala#CountBrackets(a:line, '(', ')')
endfunction

function! scala#CountCurlies(line)
  return scala#CountBrackets(a:line, '{', '}')
endfunction

function! scala#LineEndsInIncomplete(line)
  if a:line =~ '[.,]\s*$'
    return 1
  else
    return 0
  endif
endfunction

function! scala#LineIsAClosingXML(line)
  if a:line =~ '^\s*</\w'
    return 1
  else
    return 0
  endif
endfunction

function! scala#LineCompletesXML(lnum, line)
  let savedpos = getpos('.')
  call setpos('.', [savedpos[0], a:lnum, 0, savedpos[3]])
  let tag = substitute(a:line, '^.*</\([^>]*\)>.*$', '\1', '')
  let [lineNum, colnum] = searchpairpos('<' . tag . '>', '', '</' . tag . '>', 'Wbn')
  call setpos('.', savedpos)
  let pline = scala#GetLine(prevnonblank(lineNum - 1))
  if pline =~ '=\s*$'
    return 1
  else
    return 0
  endif
endfunction

function! scala#IsParentCase()
  let savedpos = getpos('.')
  call setpos('.', [savedpos[0], savedpos[1], 0, savedpos[3]])
  let [l, c] = searchpos('^\s*\%(' . s:defMatcher . '\|\%(\<case\>\)\)', 'bnW')
  let retvalue = -1
  if l != 0 && search('\%' . l . 'l\s*\<case\>', 'bnW')
    let retvalue = l
  endif 
  call setpos('.', savedpos)
  return retvalue
endfunction

function! scala#CurlyMatcher()
  let matchline = scala#GetLineThatMatchesBracket('{', '}')
  if scala#CountParens(scala#GetLine(matchline)) < 0
    let savedpos = getpos('.')
    call setpos('.', [savedpos[0], matchline, 9999, savedpos[3]])
    call searchpos('{', 'Wbc')
    call searchpos(')', 'Wb')
    let [lnum, colnum] = searchpairpos('(', '', ')', 'Wbn')
    call setpos('.', savedpos)
    let line = scala#GetLine(lnum)
    if line =~ '^\s*' . s:defMatcher
      return lnum
    else
      return matchline
    endif
  else
    return matchline
  endif
endfunction

function! scala#GetLineAndColumnThatMatchesCurly()
  return scala#GetLineAndColumnThatMatchesBracket('{', '}')
endfunction

function! scala#GetLineAndColumnThatMatchesParen()
  return scala#GetLineAndColumnThatMatchesBracket('(', ')')
endfunction

function! scala#GetLineAndColumnThatMatchesBracket(openBracket, closedBracket)
  let savedpos = getpos('.')
  let curline = scala#GetLine(line('.'))
  if curline =~ a:closedBracket . '.*' . a:openBracket . '.*' . a:closedBracket
    call setpos('.', [savedpos[0], savedpos[1], 0, savedpos[3]])
    call searchpos(a:closedBracket . '\ze[^' . a:closedBracket . a:openBracket . ']*' . a:openBracket, 'W')
  else
    call setpos('.', [savedpos[0], savedpos[1], 9999, savedpos[3]])
    call searchpos(a:closedBracket, 'Wbc')
  endif
  let [lnum, colnum] = searchpairpos(a:openBracket, '', a:closedBracket, 'Wbn')
  call setpos('.', savedpos)
  return [lnum, colnum]
endfunction

function! scala#GetLineThatMatchesCurly()
  return scala#GetLineThatMatchesBracket('{', '}')
endfunction

function! scala#GetLineThatMatchesParen()
  return scala#GetLineThatMatchesBracket('(', ')')
endfunction

function! scala#GetLineThatMatchesBracket(openBracket, closedBracket)
  let [lnum, colnum] = scala#GetLineAndColumnThatMatchesBracket(a:openBracket, a:closedBracket)
  return lnum
endfunction

function! scala#NumberOfBraceGroups(line)
  let line = substitute(a:line, '[^()]', '', 'g')
  if strlen(line) == 0
    return 0
  endif
  let line = substitute(line, '^)*', '', 'g')
  if strlen(line) == 0
    return 0
  endif
  let line = substitute(line, '^(', '', 'g')
  if strlen(line) == 0
    return 0
  endif
  let c = 1
  let counter = 0
  let groupCount = 0
  while counter < strlen(line)
    let char = strpart(line, counter, 1)
    if char == '('
      let c = c + 1
    elseif char == ')'
      let c = c - 1
    endif
    if c == 0
      let groupCount = groupCount + 1
    endif
    let counter = counter + 1
  endwhile
  return groupCount
endfunction

function! scala#MatchesIncompleteDefValr(line)
  if a:line =~ '^\s*\%(' . s:defMatcher . '\|\<va[lr]\>\).*[=({]\s*$'
    return 1
  else
    return 0
  endif
endfunction

function! scala#LineIsCompleteIf(line)
  if scala#CountBrackets(a:line, '{', '}') == 0 &&
   \ scala#CountBrackets(a:line, '(', ')') == 0 &&
   \ a:line =~ '^\s*\<if\>\s*([^)]*)\s*\S.*$'
    return 1
  else
    return 0
  endif
endfunction

function! scala#LineCompletesIfElse(lnum, line)
  if a:line =~ '^\s*\%(\<if\>\|\%(}\s*\)\?\<else\>\)'
    return 0
  endif
  let result = search('^\%(\s*\<if\>\s*(.*).*\n\|\s*\<if\>\s*(.*)\s*\n.*\n\)\%(\s*\<else\>\s*\<if\>\s*(.*)\s*\n.*\n\)*\%(\s*\<else\>\s*\n\|\s*\<else\>[^{]*\n\)\?\%' . a:lnum . 'l', 'Wbn')
  if result != 0 && scala#GetLine(prevnonblank(a:lnum - 1)) !~ '{\s*$'
    return result
  endif
  return 0
endfunction

function! scala#GetPrevCodeLine(lnum)
  " This needs to skip comment lines
  return prevnonblank(a:lnum - 1)
endfunction

function! scala#InvertBracketType(openBracket, closedBracket)
  if a:openBracket == '('
    return [ '{', '}' ]
  else
    return [ '(', ')' ]
  endif
endfunction

function! scala#Testhelper(lnum, line, openBracket, closedBracket, iteration)
  let bracketCount = scala#CountBrackets(a:line, a:openBracket, a:closedBracket)
  " There are more '}' braces than '{' on this line so it may be completing the function definition
  if bracketCount < 0
    let [matchedLNum, matchedColNum] = scala#GetLineAndColumnThatMatchesBracket(a:openBracket, a:closedBracket)
    if matchedLNum == a:lnum
      return -1
    endif
    let matchedLine = scala#GetLine(matchedLNum)
    if ! scala#MatchesIncompleteDefValr(matchedLine)
      let bracketLine = substitute(substitute(matchedLine, '\%' . matchedColNum . 'c.*$', '', ''), '[^{}()]', '', 'g')
      if bracketLine =~ '}$'
        return scala#Testhelper(matchedLNum, matchedLine, '{', '}', a:iteration + 1)
      elseif bracketLine =~ ')$'
        return scala#Testhelper(matchedLNum, matchedLine, '(', ')', a:iteration + 1)
      else
        let prevCodeLNum = scala#GetPrevCodeLine(matchedLNum)
        if scala#MatchesIncompleteDefValr(scala#GetLine(prevCodeLNum))
          return prevCodeLNum
        else
          return -1
        endif
      endif
    else
      " return indent value instead
      return matchedLNum
    endif
  " There's an equal number of '{' and '}' on this line so it may be a single line function definition
  elseif bracketCount == 0
    if a:iteration == 0
      let otherBracketType = scala#InvertBracketType(a:openBracket, a:closedBracket)
      return scala#Testhelper(a:lnum, a:line, otherBracketType[0], otherBracketType[1], a:iteration + 1)
    else
      let prevCodeLNum = scala#GetPrevCodeLine(a:lnum)
      let prevCodeLine = scala#GetLine(prevCodeLNum)
      if scala#MatchesIncompleteDefValr(prevCodeLine) && prevCodeLine !~ '{\s*$'
        return prevCodeLNum
      else
        let possibleIfElse = scala#LineCompletesIfElse(a:lnum, a:line)
        if possibleIfElse != 0
          let defValrLine = prevnonblank(possibleIfElse - 1)
          let possibleDefValr = scala#GetLine(defValrLine)
          if scala#MatchesIncompleteDefValr(possibleDefValr) && possibleDefValr =~ '^.*=\s*$'
            return possibleDefValr
          else
            return -1
          endif
        else
          return -1
        endif
      endif
    endif
  else
    return -1
  endif
endfunction

function! scala#Test(lnum, line, openBracket, closedBracket)
  return scala#Testhelper(a:lnum, a:line, a:openBracket, a:closedBracket, 0)
endfunction

function! scala#LineCompletesDefValr(lnum, line)
  let bracketCount = scala#CountBrackets(a:line, '{', '}')
  if bracketCount < 0
    let matchedBracket = scala#GetLineThatMatchesBracket('{', '}')
    if ! scala#MatchesIncompleteDefValr(scala#GetLine(matchedBracket))
      let possibleDefValr = scala#GetLine(prevnonblank(matchedBracket - 1))
      if matchedBracket != -1 && scala#MatchesIncompleteDefValr(possibleDefValr)
        return 1
      else
        return 0
      endif
    else
      return 0
    endif
  elseif bracketCount == 0
    let bracketCount = scala#CountBrackets(a:line, '(', ')')
    if bracketCount < 0
      let matchedBracket = scala#GetLineThatMatchesBracket('(', ')')
      if ! scala#MatchesIncompleteDefValr(scala#GetLine(matchedBracket))
        let possibleDefValr = scala#GetLine(prevnonblank(matchedBracket - 1))
        if matchedBracket != -1 && scala#MatchesIncompleteDefValr(possibleDefValr)
          return 1
        else
          return 0
        endif
      else
        return 0
      endif
    elseif bracketCount == 0
      let possibleDefValr = scala#GetLine(prevnonblank(a:lnum - 1))
      if scala#MatchesIncompleteDefValr(possibleDefValr) && possibleDefValr =~ '^.*=\s*$'
        return 1
      else
        let possibleIfElse = scala#LineCompletesIfElse(a:lnum, a:line)
        if possibleIfElse != 0
          let possibleDefValr = scala#GetLine(prevnonblank(possibleIfElse - 1))
          if scala#MatchesIncompleteDefValr(possibleDefValr) && possibleDefValr =~ '^.*=\s*$'
            return 2
          else
            return 0
          endif
        else
          return 0
        endif
      endif
    else
      return 0
    endif
  endif
endfunction

function! scala#SpecificLineCompletesBrackets(lnum, openBracket, closedBracket)
  let savedpos = getpos('.')
  call setpos('.', [savedpos[0], a:lnum, 9999, savedpos[3]])
  let retv = scala#LineCompletesBrackets(a:openBracket, a:closedBracket)
  call setpos('.', savedpos)

  return retv
endfunction

function! scala#LineCompletesBrackets(openBracket, closedBracket)
  let savedpos = getpos('.')
  let offline = 0
  while offline == 0
    let [lnum, colnum] = searchpos(a:closedBracket, 'Wb')
    let [lnumA, colnumA] = searchpairpos(a:openBracket, '', a:closedBracket, 'Wbn')
    if lnum != lnumA
      let [lnumB, colnumB] = searchpairpos(a:openBracket, '', a:closedBracket, 'Wbnr')
      let offline = 1
    endif
  endwhile
  call setpos('.', savedpos)
  if lnumA == lnumB && colnumA == colnumB
    return lnumA
  else
    return -1
  endif
endfunction

function! GetScalaIndent()
  " Find a non-blank line above the current line.
  let prevlnum = prevnonblank(v:lnum - 1)

  " Hit the start of the file, use zero indent.
  if prevlnum == 0
    return 0
  endif

  let ind = indent(prevlnum)
  let originalIndentValue = ind
  let prevline = scala#GetLine(prevlnum)
  let curlnum = v:lnum
  let curline = scala#GetLine(curlnum)
  if get(g:, 'scala_scaladoc_indent', 0)
    let star_indent = 2
  else
    let star_indent = 1
  end

  if prevline =~ '^\s*/\*\*'
    if prevline =~ '\*/\s*$'
      return ind
    else
      return ind + star_indent
    endif
  endif

  if curline =~ '^\s*\*'
    return cindent(curlnum)
  endif

  " If this line starts with a { then make it indent the same as the previous line
  if curline =~ '^\s*{'
    call scala#ConditionalConfirm("1")
    " Unless, of course, the previous one is a { as well
    if prevline !~ '^\s*{'
      call scala#ConditionalConfirm("2")
      return indent(prevlnum)
    endif
  endif

  " '.' continuations
  if curline =~ '^\s*\.'
    if prevline =~ '^\s*\.'
      return ind
    else
      return ind + &shiftwidth
    endif
  endif

  " Indent html literals
  if prevline !~ '/>\s*$' && prevline =~ '^\s*<[a-zA-Z][^>]*>\s*$'
    call scala#ConditionalConfirm("3")
    return ind + &shiftwidth
  endif

  " assumes curly braces around try-block
  if curline =~ '^\s*}\s*\<catch\>'
    return ind - &shiftwidth
  elseif curline =~ '^\s*\<catch\>'
    return ind
  endif

  " Add a 'shiftwidth' after lines that start a block
  " If 'if', 'for' or 'while' end with ), this is a one-line block
  " If 'val', 'var', 'def' end with =, this is a one-line block
  if (prevline =~ '^\s*\<\%(\%(}\?\s*else\s\+\)\?if\|for\|while\)\>.*[)=]\s*$' && scala#NumberOfBraceGroups(prevline) <= 1)
        \ || prevline =~ '^\s*' . s:defMatcher . '.*=\s*$'
        \ || prevline =~ '^\s*\<va[lr]\>.*[=]\s*$'
        \ || prevline =~ '^\s*\%(}\s*\)\?\<else\>\s*$'
        \ || prevline =~ '=\s*$'
    call scala#ConditionalConfirm("4")
    let ind = ind + &shiftwidth
  elseif prevline =~ '^\s*\<\%(}\?\s*else\s\+\)\?if\>' && curline =~ '^\s*}\?\s*\<else\>'
    return ind
  endif

  let lineCompletedBrackets = 0
  let bracketCount = scala#CountBrackets(prevline, '{', '}')
  if bracketCount > 0 || prevline =~ '.*{\s*$'
    call scala#ConditionalConfirm("5b")
    let ind = ind + &shiftwidth
  elseif bracketCount < 0
    call scala#ConditionalConfirm("6b")
    " if the closing brace actually completes the braces entirely, then we
    " have to indent to line that started the whole thing
    let completeLine = scala#LineCompletesBrackets('{', '}')
    if completeLine != -1
      call scala#ConditionalConfirm("8b")
      let prevCompleteLine = scala#GetLine(prevnonblank(completeLine - 1))
      " However, what actually started this part looks like it was a function
      " definition, so we need to indent to that line instead.  This is 
      " actually pretty weak at the moment.
      if prevCompleteLine =~ '=\s*$'
        call scala#ConditionalConfirm("9b")
        let ind = indent(prevnonblank(completeLine - 1))
      else
        call scala#ConditionalConfirm("10b")
        let ind = indent(completeLine)
      endif
    else
      let lineCompletedBrackets = 1
    endif
  endif

  if ind == originalIndentValue
    let bracketCount = scala#CountBrackets(prevline, '(', ')')
    if bracketCount > 0 || prevline =~ '.*(\s*$'
      call scala#ConditionalConfirm("5a")
      let ind = ind + &shiftwidth
    elseif bracketCount < 0
      call scala#ConditionalConfirm("6a")
      " if the closing brace actually completes the braces entirely, then we
      " have to indent to line that started the whole thing
      let completeLine = scala#LineCompletesBrackets('(', ')')
      if completeLine != -1 && prevline !~ '^.*{\s*$'
        call scala#ConditionalConfirm("8a")
        let prevCompleteLine = scala#GetLine(prevnonblank(completeLine - 1))
        " However, what actually started this part looks like it was a function
        " definition, so we need to indent to that line instead.  This is 
        " actually pretty weak at the moment.
        if prevCompleteLine =~ '=\s*$'
          call scala#ConditionalConfirm("9a")
          let ind = indent(prevnonblank(completeLine - 1))
        else
          call scala#ConditionalConfirm("10a")
          let ind = indent(completeLine)
        endif
      else
        " This is the only part that's different from from the '{', '}' one below
        " Yup... some refactoring is necessary at some point.
        let ind = ind + (bracketCount * &shiftwidth)
        let lineCompletedBrackets = 1
      endif
    endif
  endif

  if curline =~ '^\s*}\?\s*\<else\>\%(\s\+\<if\>\s*(.*)\)\?\s*{\?\s*$' &&
   \ ! scala#LineIsCompleteIf(prevline) &&
   \ prevline !~ '^.*}\s*$'
    let ind = ind - &shiftwidth
  endif

  " Subtract a 'shiftwidth' on '}' or html
  let curCurlyCount = scala#CountCurlies(curline)
  if curCurlyCount < 0
    call scala#ConditionalConfirm("14a")
    let matchline = scala#CurlyMatcher()
    return indent(matchline)
  elseif curline =~ '^\s*</[a-zA-Z][^>]*>'
    call scala#ConditionalConfirm("14c")
    return ind - &shiftwidth
  endif

  let prevParenCount = scala#CountParens(prevline)
  if prevline =~ '^\s*\<for\>.*$' && prevParenCount > 0
    call scala#ConditionalConfirm("15")
    let ind = indent(prevlnum) + 5
  endif

  let prevCurlyCount = scala#CountCurlies(prevline)
  if prevCurlyCount == 0 && prevline =~ '^.*\%(=>\|⇒\)\s*$' && prevline !~ '^\s*this\s*:.*\%(=>\|⇒\)\s*$' && curline !~ '^\s*\<case\>'
    call scala#ConditionalConfirm("16")
    let ind = ind + &shiftwidth
  endif

  if ind == originalIndentValue && curline =~ '^\s*\<case\>'
    call scala#ConditionalConfirm("17")
    let parentCase = scala#IsParentCase()
    if parentCase != -1
      call scala#ConditionalConfirm("17a")
      return indent(parentCase)
    endif
  endif

  if prevline =~ '^\s*\*/'
   \ || prevline =~ '*/\s*$'
    call scala#ConditionalConfirm("18")
    let ind = ind - star_indent
  endif

  if scala#LineEndsInIncomplete(prevline)
    call scala#ConditionalConfirm("19")
    return ind
  endif

  if scala#LineIsAClosingXML(prevline)
    if scala#LineCompletesXML(prevlnum, prevline)
      call scala#ConditionalConfirm("20a")
      return ind - &shiftwidth
    else
      call scala#ConditionalConfirm("20b")
      return ind
    endif
  endif

  if ind == originalIndentValue
    "let indentMultiplier = scala#LineCompletesDefValr(prevlnum, prevline)
    "if indentMultiplier != 0
    "  call scala#ConditionalConfirm("19a")
    "  let ind = ind - (indentMultiplier * &shiftwidth)
    let defValrLine = scala#Test(prevlnum, prevline, '{', '}')
    if defValrLine != -1
      call scala#ConditionalConfirm("21a")
      let ind = indent(defValrLine)
    elseif lineCompletedBrackets == 0
      call scala#ConditionalConfirm("21b")
      if scala#GetLine(prevnonblank(prevlnum - 1)) =~ '^.*\<else\>\s*\%(//.*\)\?$'
        call scala#ConditionalConfirm("21c")
        let ind = ind - &shiftwidth
      elseif scala#LineCompletesIfElse(prevlnum, prevline)
        call scala#ConditionalConfirm("21d")
        let ind = ind - &shiftwidth
      elseif scala#CountParens(curline) < 0 && curline =~ '^\s*)' && scala#GetLine(scala#GetLineThatMatchesBracket('(', ')')) =~ '.*(\s*$'
        " Handles situations that look like this:
        " 
        "   val a = func(
        "     10
        "   )
        "
        " or
        "
        "   val a = func(
        "     10
        "   ).somethingHere()
        call scala#ConditionalConfirm("21e")
        let ind = ind - &shiftwidth
      endif
    endif
  endif

  call scala#ConditionalConfirm("returning " . ind)

  return ind
endfunction

" vim:set sw=2 sts=2 ts=8 et:
" vim600:fdm=marker fdl=1 fdc=0:

D config/nvim/indent/testfile.scala => config/nvim/indent/testfile.scala +0 -387
@@ 1,387 0,0 @@
/**
 * Comments are here
 */
class SomeClass {
  val someval = SomeObject.makeWithSomething
  var somevar = SomeObject.makeWithSomething

  def someBracedDef = {
    case ASingleLineCase => a.statement

    case AMultiLineCase =>
      if (this)
        then
      else
        that
  }

  def aSingleLineDef = someval + 12

  def main(args: Array[String]) = run(20000, 20000)

  def multilineParams(
    x: Int,
    y: Int
  ) = {
    ???
  }

  // This
  def aMultiLineSingleStatementDefWithBraces = {
    SomeObject.makeWithSomething
  }

  // This
  def aMultiLineSingleStatementDefWithNoBraces =
    new X {
      def something = 5
    }

  def aMultiLineSingleStatementDefWithNoBraces =
    SomeObject.makeWithSomething

  def someFunc = {
    if (b) 1
    else {
      if (b) 2
      else
        3
    }
  }

  def someOtherFunc =
    if (this)
      that
    else
      theOther

  def someOtherOtherFunc = {
    if (b) 1
    else {
      if (b) 2
      else
        3
    }

    /**
     * The following stuff doesn't work, but honestly, it's pretty
     * pathological stuff... format your code differently.
     *
     * ---- 1. ----
     *
     *    if (b) 1
     *    else
     *      if (c) 2
     *    else 3 // Should be the same as the above 'if'
     *
     *    Do this instead:
     *
     *    if (b) 1
     *    else {
     *      if (c) 2
     *      else 3
     *    }
     *
     *
     * ---- 2. ----
     *
     *    if (b) 1
     *    else
     *      if (c)
     *        2
     *        else 3
     *
     *    Do this instead:
     *
     *    if (b) 1
     *    else {
     *      if (c) 2
     *      else 3
     *    }
     *
     *    or this...
     *
     *    if (b) 1
     *    else {
     *      if (c)
     *        2
     *      else
     *        3
     *    }
     *
     * ---- 3. ----
     *
     *    if (b) 1
     *    else {
     *      if (c)
     *        2
     *        else 3
     *    }
     *
     *    Do the same as in number 2
     */

    if (b) {
      statement
    }
    else
      thing

    if (b)
      statement

    bare_statement

    if (b) {
      statement
    }
    else {
      thing
      that
    }

    if (statement(nested statement(another nested statement))) func(statement)
    if (statement(nested statement(another nested statement))) statement

    if (b) {
      statement
      statement
    } else if (b) {
      statement
      statement
    } else if (c) {
      statement
      statement
    } else
      dohicky

    if (b) { // comment
      statement
      statement
    } else if (b) { // comment
      statement
      statement
    } else if (c) { // comment
      statement
      statement
    } else // comment
      dohicky

    if (b)
      statement
    else {
      statement
      statement
    }

    val a = if (b) {
      10
    } else { statement }

    val a = func(
      10
    ).goThere()

    val a = func(
      10
    )

    if (b) (statement)
    else 2

    if (b) 1
    else 2

    if (b)
      1
    else if (b)
      2
    else if (b)
      2
    else
      3
    4

    if (b)
      1
    else if (b)
      2
    else
      3
    4
  }

  /**
   * This
   */
  def SomeOtherFunc = ...

  /** This */
  def blah = ...

  def func = {
    val reply = new Something()
    some.block {
      def foo("string", bar("string"))
      new X {
        statement
        statement
      }
    }
    () => goAndDo.something
  }

  def func(param: Int) = new this.Something.Or.Other(
    new SillyObject {
      override def booger() = {
        statement
        statement
      }
    },
    otherParam) // comment

  class AnotherSomeClass {
    this: Actor =>
    def func = {
      booger
    }
  }

  /**
   * Pulled this stuff from the fors.scala example file in the source distribution
   */
  def findNums(n: Int): Iterable[(Int, Int)] =
    for (i <- 1 until n;
         j <- 1 until (i-1);
         if isPrime(i+j)) yield (i, j)

  val books = List(
    Elem(prefix, "book", e, scope,
      Elem(prefix, "title", e, scope,
        Text("Structure and Interpretation of Computer Programs")),
      Elem(prefix, "author", e, scope,
        Text("Abelson, Harald")),
      Elem(prefix, "author", e, scope,
        Text("Sussman, Gerald J."))),
    Elem(prefix, "book", e, scope,
      Elem(prefix, "title", e, scope,
        Text("Principles of Compiler Design")),
      Elem(prefix, "author", e, scope,
        Text("Aho, Alfred")),
      Elem(prefix, "author", e, scope,
        Text("Ullman, Jeffrey"))),
    Elem(prefix, "book", e, scope,
      Elem(prefix, "title", e, scope,
        Text("Programming in Modula-2")),
      Elem(prefix, "author", e, scope,
        Text("Wirth, Niklaus")))
    )

  def mufync(statement): Int = {
    val x = function(thing)
    if (statement) func(statement)
    else func(statement)
  }

  def SomeOtherFunc = statement

  def receive = {
    case Something =>
    case OrOther =>
      here
    case There =>
  }

  def func[A <: B](one: One, two: Two) : ReturnType = ...
  def func(one: One, two: Two) : ReturnType = ...
  def func(one: (A, B) => B) : ReturnType = ...
  def func(one: One, two: Two) = ...
  def func(one: One, two: Two) = ...
  def func[A <: B](one: One,
    two: Two) : ReturnType = ...
  def func(one: One, two: Two, three: Three, four: Four,
    five: Five) : ReturnType = ...
  def func(one: One, two: Two, three: Three, four: Four,
    five: Five) = ...

  def func = oneliner
  private def func = oneliner
  private[thing] def func = oneliner
  protected def func = oneliner
  protected[thing] def func = oneliner
  override def func = oneliner
  abstract override def func = oneliner
  override abstract def func = oneliner
  protected override def func = oneliner
  protected abstract override def func = oneliner
  protected override abstract def func = oneliner
  protected[thing] override def func = oneliner
  protected[thing] abstract override def func = oneliner
  protected[thing] override abstract def func = oneliner
  private override def func = oneliner
  private abstract override def func = oneliner
  private override abstract def func = oneliner
  private[thing] override def func = oneliner
  private[thing] abstract override def func = oneliner
  private[thing] override abstract def func = oneliner

  <outertag>
    <innertag>
      <in-innertag>
        Something
      </in-innertag>
    </innertag>
  </outertag>

  val someXML =
    <outertag>
      <innertag>
        <in-innertag>
          Something
        </in-innertag>
      </innertag>
    </outertag>

  private[somepackage] abstract override def somethingWithDots = {
    SomeObject.build
      .withSomething
      .withSomethingElse
      .withSomethingElseAgain
  }

  private def oneLineFunc = actorOf(new Actor {
    def receive = {
      case _ => thing
    }
  })

  private def oneLineFunc = factory(
    arg1,
    arg2,
    arg3).build

  def someFunction[T <: U](
    x: Int): SomeType = {
      val someValue: Option[Int] = {
        someValue match {
          some stuff here
        }
      }
  }

  def someFunction[T <: U](
    x: Int,
    y: Int,
    z: Long): SomeType = {
      val someValue: Option[Int] = {
        someValue match {
          some stuff here
        }
      }
  }

  private[this] def followingFunction = oneliner

  val someFunction: List[(Option[T], Option[U])] = TODO
}


M config/nvim/init.vim => config/nvim/init.vim +78 -61
@@ 6,41 6,40 @@ end

call plug#begin('~/.vim/plugged')

""" Langs
""" Language/Syntax
Plug 'ElmCast/elm-vim', { 'for': 'elm' }
Plug 'cespare/vim-toml', { 'for': 'toml' }
Plug 'chrisbra/csv.vim', { 'for': 'csv' }
Plug 'elixir-editors/vim-elixir', { 'for': ['elixir'] }
Plug 'elixir-editors/vim-elixir', { 'for': 'elixir' }
Plug 'elorest/vim-slang', { 'for': 'slang' }
Plug 'https://github.com/rust-lang/rust.vim'
Plug 'isobit/vim-caddyfile', { 'for': 'caddyfile' }
Plug 'ledger/vim-ledger'
Plug 'luochen1990/rainbow'
Plug 'rhysd/vim-crystal', { 'for': 'crystal' }
Plug 'sheerun/vim-polyglot'
Plug 'rust-lang/rust.vim', { 'for': 'rust' }

""" Vim behavior/functionality
Plug 'Yggdroot/indentLine', { 'for': ['yaml', 'python'] }
Plug 'bhurlow/vim-parinfer', {'for': ['clojure', 'lisp'] }
""" Vim Behavior/Functionality
Plug 'bhurlow/vim-parinfer', {'for': 'clojure' }
Plug 'chrisbra/NrrwRgn'
Plug 'gerw/vim-HiLinkTrace'
Plug 'godlygeek/tabular'
Plug 'janko-m/vim-test'
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'luochen1990/rainbow'
Plug 'machakann/vim-sandwich'
Plug 'mattn/emmet-vim', { 'for': ['html'] }
Plug 'mattn/emmet-vim'
Plug 'mhinz/vim-grepper', { 'on': ['Grepper', '<plug>(GrepperOperator)'] }
Plug 'morhetz/gruvbox'
Plug 'nathanaelkane/vim-indent-guides', { 'for': ['yaml', 'python', 'haml', 'slim', 'slang'] }
Plug 'radenling/vim-dispatch-neovim'
Plug 'scrooloose/nerdcommenter'
Plug 'soramugi/auto-ctags.vim'
Plug 'tpope/vim-dispatch'
Plug 'tpope/vim-fugitive'
Plug 'w0rp/ale'

""" Nice in theory, not sure if I'll actually use
Plug 'chrisbra/NrrwRgn', { 'on': 'NR' }
Plug 'gcmt/wildfire.vim', { 'for': ['clojure', 'lisp'] }
Plug 'gerw/vim-HiLinkTrace', { 'on': 'HLT!'}
Plug 'mhinz/vim-grepper', { 'on': ['Grepper', '<plug>(GrepperOperator)'] }
Plug 'radenling/vim-dispatch-neovim'
Plug 'skywind3000/asyncrun.vim', { 'on': ['AsyncRun'] }
Plug 'tpope/vim-dispatch'
""" Want to use in theory, need to look into
" Plug 'gcmt/wildfire.vim'

call plug#end()
filetype plugin indent on


@@ 52,16 51,29 @@ set title
set history=1000

" theme / colors
set termguicolors
set background=dark
colorscheme gruvbox
set termguicolors

set scrolloff=3

" Cursor position
set ruler
set rulerformat=%27(%{strftime('%a\ %e,\ %H:%M')}\ %5l,%-1(%c%V%)\ %P%)

set clipboard+=unnamedplus
" Remember things between sessions
"
" '20  - remember marks for 20 previous files
" \"50 - save 50 lines for each register
" :20  - remember 20 items in command-line history
" /20  - remember 20 items in search history
" %    - remember the buffer list (if vim started without a file arg)
" n    - set name of viminfo file
set viminfo='20,\"50,:20,/20,%

if exists('+clipboard')
  set clipboard=unnamedplus  " Yanks go to the ctrl-c '+' clipboard register
endif

" Line Numbers
set number


@@ 76,17 88,26 @@ set showmatch
set mat=2

" tab behavior
set tabstop=2
set shiftwidth=2
set autoindent
set expandtab
set smarttab "paste correctly
set shiftround
set shiftwidth=2
set smartindent
set smarttab 
set softtabstop=2
set tabstop=8

" searching
set hlsearch "highlight search
set incsearch
set hls "highlight search
set is "incsearch
set ignorecase " Ignore case when searching...
set smartcase  " Except when starting with a capital

set showmatch  " When a bracket is inserted, jump to the matching bracket.
set mat=5      " How long to jump to the matching bracket in tenths of a second.
set list       " Enable 'list mode', which visually displays certain characters
               " upon listchars rules.
               
" Quick timeouts on key combinations.
set timeoutlen=300



@@ 101,11 122,23 @@ set undodir=~/.nvim/undo,/tmp
set noswapfile
set autoread

set showcmd " display incomplete commands in laststatus.
            " For example, typing the start of a multi-key binding will
            " show each successive key typed in the lower right. Useful
            " for identifying when you're starting a command.

set hidden  " When you 'abandon' a buffer (i.e., when you no longer have a
            " buffer displayed), simply hide it rather than unloading it.
            " Without this, hiding a modified buffer would error due to that
            " buffer not being saved.

"""
""" Variables for plugins
"""

" Conceal
let g:clojure_conceal_extras = 1

" Rainbow brackets/parens
let g:rainbow_active = 1



@@ 147,31 180,18 @@ let g:wildfire_objects = {

let g:indentLine_char = '|'

""" ALE
let g:ale_lint_on_text_changed = 'never'
let g:ale_lint_on_enter = 0
let g:ale_lint_on_filetype_changed = 0
let g:ale_lint_on_save = 1
let g:ale_linters = {
  \ 'javascript': ['eslint'],
  \ 'rust': ['cargo'],
\ }

let g:grepper = {}
let g:grepper.tools = ['rg', 'git', 'grep']

let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'

"" ALE linters
let g:ale_fixers = {
\   'go'      :  ['gofmt'],
\   'rust'    :  ['rustfmt'],
\}
let g:ale_lint_on_text_changed = 'never'
let g:ale_lint_on_enter = 0
let g:ale_fix_on_save = 1
let test#strategy = "dispatch"

"""
""" Key remapping


@@ 210,8 230,6 @@ nnoremap <Leader>co :nohl<CR><C-l>

vnoremap <Tab> >gv
vnoremap <S-Tab> <gv
vnoremap < <gv
vnoremap > >gv

" Tabularize
nnoremap <Leader>a= :Tabularize /=<CR>


@@ 225,9 243,10 @@ nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>

" Allow mac copy/paste
vnoremap <C-x> :!pbcopy<CR>  
vnoremap <C-c> :w !pbcopy<CR><CR>

" Allow copy/paste
nnoremap <C-x> "+p
vnoremap <C-c> "+y

" Double leader key for toggling visual-line mode
nnoremap <silent> <Leader><Leader> V


@@ 248,8 267,8 @@ nnoremap <leader>sl :call LoadSession()<cr>
nnoremap <leader>pr :HLT!<cr>

" In order to traverse ALE warnings
nnoremap [w <Plug>(ale_previous_wrap)
nnoremap ]w <Plug>(ale_next_wrap)
nnoremap <silent> [w <Plug>(ale_previous_wrap)
nnoremap <silent> ]w <Plug>(ale_next_wrap)

" Grepper
nnoremap <Leader>* :Grepper -cword -noprompt<CR>


@@ 264,12 283,6 @@ au BufRead,BufNewFile *.slang set filetype=slang
" Autoset ecr -> erb syntax highlighting
au BufRead,BufNewFile *.ecr set filetype=erb

" Highlight syntax for word under cursor
nnoremap <leader>pr :HLT!<cr>

nnoremap <BS> {
onoremap <BS> {
vnoremap <BS> {

" Automatically make the dir if it doesn't exist on the machine.
silent !mkdir -p ~/.nvim/tmp >/dev/null 2>&1


@@ 277,11 290,6 @@ silent !mkdir -p ~/.nvim/tmp >/dev/null 2>&1
" Autoread on common events
autocmd! FocusGained,BufEnter * checktime

tnoremap <Esc> <C-\><C-n>

" Clojure
" au Filetype clojure nmap <c-c><c-k> :Require<cr>  

" ================ Persistent Undo ==================
" Keep undo history across sessions, by storing in file.
" Only works all the time.


@@ 321,11 329,20 @@ augroup autosourcing
    endif
augroup END

"auto source nvimfile on write
augroup mynvimrc
    au!
    au BufWritePost ~/.config/nvim/init.vim so $MYVIMRC
augroup END
autocmd BufReadPost *
     \ if line("'\"") > 0 && line("'\"") <= line("$") && &ft != 'gitcommit' |
     \   exe "normal! g`\"" |
     \ endif

autocmd filetype crontab setlocal nobackup nowritebackup

" FZF :Find
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)

" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
if !exists(":DiffOrig")
  command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
  \ | wincmd p | diffthis
endif

D config/nvim/syntax/scala.vim => config/nvim/syntax/scala.vim +0 -230
@@ 1,230 0,0 @@
" Vim syntax file
" Language:             Scala
" Maintainer:           Derek Wyatt
" URL:                  https://github.com/derekwyatt/vim-scala
" License:              Apache 2
" ----------------------------------------------------------------------------

if !exists('main_syntax')
  if version < 600
    syntax clear
  elseif exists("b:current_syntax")
    finish
  endif
  let main_syntax = 'scala'
endif

scriptencoding utf-8

let b:current_syntax = "scala"

" Allows for embedding, see #59; main_syntax convention instead? Refactor TOP
"
" The @Spell here is a weird hack, it means *exclude* if the first group is
" TOP. Otherwise we get spelling errors highlighted on code elements that
" match scalaBlock, even with `syn spell notoplevel`.
function! s:ContainedGroup()
  try
    silent syn list @scala
    return '@scala,@NoSpell'
  catch /E392/
    return 'TOP,@Spell'
  endtry
endfunction

unlet! b:current_syntax

syn case match
syn sync minlines=200 maxlines=1000

syn keyword scalaKeyword catch do else final finally for forSome if
syn keyword scalaKeyword match return throw try while yield macro
syn keyword scalaKeyword class trait object extends with nextgroup=scalaInstanceDeclaration skipwhite
syn keyword scalaKeyword case nextgroup=scalaKeyword,scalaCaseFollowing skipwhite
syn keyword scalaKeyword val nextgroup=scalaNameDefinition,scalaQuasiQuotes skipwhite
syn keyword scalaKeyword def var nextgroup=scalaNameDefinition skipwhite
hi link scalaKeyword Keyword

exe 'syn region scalaBlock start=/{/ end=/}/ contains=' . s:ContainedGroup() . ' fold'

syn keyword scalaAkkaSpecialWord when goto using startWith initialize onTransition stay become unbecome
hi link scalaAkkaSpecialWord PreProc

syn keyword scalatestSpecialWord shouldBe
syn match scalatestShouldDSLA /^\s\+\zsit should/
syn match scalatestShouldDSLB /\<should\>/
hi link scalatestSpecialWord PreProc
hi link scalatestShouldDSLA PreProc
hi link scalatestShouldDSLB PreProc

syn match scalaSymbol /'[_A-Za-z0-9$]\+/
hi link scalaSymbol Number

syn match scalaChar /'.'/
syn match scalaChar /'\\[\\"'ntbrf]'/ contains=scalaEscapedChar
syn match scalaChar /'\\u[A-Fa-f0-9]\{4}'/ contains=scalaUnicodeChar
syn match scalaEscapedChar /\\[\\"'ntbrf]/
syn match scalaUnicodeChar /\\u[A-Fa-f0-9]\{4}/
hi link scalaChar Character
hi link scalaEscapedChar Function
hi link scalaUnicodeChar Special

syn match scalaOperator "||"
syn match scalaOperator "&&"
hi link scalaOperator Special

syn match scalaNameDefinition /\<[_A-Za-z0-9$]\+\>/ contained nextgroup=scalaPostNameDefinition,scalaVariableDeclarationList
syn match scalaNameDefinition /`[^`]\+`/ contained nextgroup=scalaPostNameDefinition
syn match scalaVariableDeclarationList /\s*,\s*/ contained nextgroup=scalaNameDefinition
syn match scalaPostNameDefinition /\_s*:\_s*/ contained nextgroup=scalaTypeDeclaration
hi link scalaNameDefinition Function

syn match scalaInstanceDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaInstanceHash
syn match scalaInstanceDeclaration /`[^`]\+`/ contained
syn match scalaInstanceHash /#/ contained nextgroup=scalaInstanceDeclaration
hi link scalaInstanceDeclaration Special
hi link scalaInstanceHash Type

syn match scalaUnimplemented /???/
hi link scalaUnimplemented ERROR

syn match scalaCapitalWord /\<[A-Z][A-Za-z0-9$]*\>/
hi link scalaCapitalWord Special

" Handle type declarations specially
syn region scalaTypeStatement matchgroup=Keyword start=/\<type\_s\+\ze/ end=/$/ contains=scalaTypeTypeDeclaration,scalaSquareBrackets,scalaTypeTypeEquals,scalaTypeStatement

" Ugh... duplication of all the scalaType* stuff to handle special highlighting
" of `type X =` declarations
syn match scalaTypeTypeDeclaration /(/ contained nextgroup=scalaTypeTypeExtension,scalaTypeTypeEquals contains=scalaRoundBrackets skipwhite
syn match scalaTypeTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeTypeDeclaration contains=scalaTypeTypeExtension skipwhite
syn match scalaTypeTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypeExtension,scalaTypeTypeEquals skipwhite
syn match scalaTypeTypeEquals /=\ze[^>]/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite
syn match scalaTypeTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained nextgroup=scalaTypeTypeDeclaration skipwhite
syn match scalaTypeTypePostDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypePostExtension skipwhite
syn match scalaTypeTypePostExtension /\%(⇒\|=>\|<:\|:>\|=:=\|::\)/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite
hi link scalaTypeTypeDeclaration Type
hi link scalaTypeTypeExtension Keyword
hi link scalaTypeTypePostDeclaration Special
hi link scalaTypeTypePostExtension Keyword

syn match scalaTypeDeclaration /(/ contained nextgroup=scalaTypeExtension contains=scalaRoundBrackets skipwhite
syn match scalaTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeDeclaration contains=scalaTypeExtension skipwhite
syn match scalaTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeExtension skipwhite
syn match scalaTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained nextgroup=scalaTypeDeclaration skipwhite
hi link scalaTypeDeclaration Type
hi link scalaTypeExtension Keyword
hi link scalaTypePostExtension Keyword

syn match scalaTypeAnnotation /\%([_a-zA-Z0-9$\s]:\_s*\)\ze[_=(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeDeclaration contains=scalaRoundBrackets
syn match scalaTypeAnnotation /)\_s*:\_s*\ze[_=(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeDeclaration
hi link scalaTypeAnnotation Normal

syn match scalaCaseFollowing /\<[_\.A-Za-z0-9$]\+\>/ contained
syn match scalaCaseFollowing /`[^`]\+`/ contained
hi link scalaCaseFollowing Special

syn keyword scalaKeywordModifier abstract override final lazy implicit implicitly private protected sealed null require super
hi link scalaKeywordModifier Function

syn keyword scalaSpecial this true false ne eq
syn keyword scalaSpecial new nextgroup=scalaInstanceDeclaration skipwhite
syn match scalaSpecial "\%(=>\|⇒\|<-\|←\|->\|→\)"
syn match scalaSpecial /`[^`]\+`/  " Backtick literals
hi link scalaSpecial PreProc

syn keyword scalaExternal package import
hi link scalaExternal Include

syn match scalaStringEmbeddedQuote /\\"/ contained
syn region scalaString start=/"/ end=/"/ contains=scalaStringEmbeddedQuote,scalaEscapedChar,scalaUnicodeChar
hi link scalaString String
hi link scalaStringEmbeddedQuote String

syn region scalaIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
syn region scalaTripleIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
hi link scalaIString String
hi link scalaTripleIString String

syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained
exe 'syn region scalaInterpolationB matchgroup=scalaInterpolationBoundary start=/\${/ end=/}/ contained contains=' . s:ContainedGroup()
hi link scalaInterpolation Function
hi link scalaInterpolationB Normal

syn region scalaFString matchgroup=scalaInterpolationBrackets start=/f"/ skip=/\\"/ end=/"/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+\(%[-A-Za-z0-9\.]\+\)\?/ contained
exe 'syn region scalaFInterpolationB matchgroup=scalaInterpolationBoundary start=/${/ end=/}\(%[-A-Za-z0-9\.]\+\)\?/ contained contains=' . s:ContainedGroup()
hi link scalaFString String
hi link scalaFInterpolation Function
hi link scalaFInterpolationB Normal

syn region scalaTripleString start=/"""/ end=/"""\%([^"]\|$\)/ contains=scalaEscapedChar,scalaUnicodeChar
syn region scalaTripleFString matchgroup=scalaInterpolationBrackets start=/f"""/ end=/"""\%([^"]\|$\)/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
hi link scalaTripleString String
hi link scalaTripleFString String

hi link scalaInterpolationBrackets Special
hi link scalaInterpolationBoundary Function

syn match scalaNumber /\<0[dDfFlL]\?\>/ " Just a bare 0
syn match scalaNumber /\<[1-9]\d*[dDfFlL]\?\>/  " A multi-digit number - octal numbers with leading 0's are deprecated in Scala
syn match scalaNumber /\<0[xX][0-9a-fA-F]\+[dDfFlL]\?\>/ " Hex number
syn match scalaNumber /\%(\<\d\+\.\d*\|\.\d\+\)\%([eE][-+]\=\d\+\)\=[fFdD]\=/ " exponential notation 1
syn match scalaNumber /\<\d\+[eE][-+]\=\d\+[fFdD]\=\>/ " exponential notation 2
syn match scalaNumber /\<\d\+\%([eE][-+]\=\d\+\)\=[fFdD]\>/ " exponential notation 3
hi link scalaNumber Number

syn region scalaRoundBrackets start="(" end=")" skipwhite contained contains=scalaTypeDeclaration,scalaSquareBrackets,scalaRoundBrackets

syn region scalaSquareBrackets matchgroup=scalaSquareBracketsBrackets start="\[" end="\]" skipwhite nextgroup=scalaTypeExtension contains=scalaTypeDeclaration,scalaSquareBrackets,scalaTypeOperator,scalaTypeAnnotationParameter
syn match scalaTypeOperator /[-+=:<>]\+/ contained
syn match scalaTypeAnnotationParameter /@\<[`_A-Za-z0-9$]\+\>/ contained
hi link scalaSquareBracketsBrackets Type
hi link scalaTypeOperator Keyword
hi link scalaTypeAnnotationParameter Function

syn match scalaShebang "\%^#!.*" display
syn region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,scalaTodo,scalaCommentCodeBlock,@Spell keepend fold
syn match scalaCommentAnnotation "@[_A-Za-z0-9$]\+" contained
syn match scalaParameterAnnotation "\%(@tparam\|@param\|@see\)" nextgroup=scalaParamAnnotationValue skipwhite contained
syn match scalaParamAnnotationValue /[.`_A-Za-z0-9$]\+/ contained
syn region scalaDocLinks start="\[\[" end="\]\]" contained
syn region scalaCommentCodeBlock matchgroup=Keyword start="{{{" end="}}}" contained
syn match scalaTodo "\vTODO|FIXME|XXX" contained
hi link scalaShebang Comment
hi link scalaMultilineComment Comment
hi link scalaDocLinks Function
hi link scalaParameterAnnotation Function
hi link scalaParamAnnotationValue Keyword
hi link scalaCommentAnnotation Function
hi link scalaCommentCodeBlockBrackets String
hi link scalaCommentCodeBlock String
hi link scalaTodo Todo

syn match scalaAnnotation /@\<[`_A-Za-z0-9$]\+\>/
hi link scalaAnnotation PreProc

syn match scalaTrailingComment "//.*$" contains=scalaTodo,@Spell
hi link scalaTrailingComment Comment

syn match scalaAkkaFSM /goto([^)]*)\_s\+\<using\>/ contains=scalaAkkaFSMGotoUsing
syn match scalaAkkaFSM /stay\_s\+using/
syn match scalaAkkaFSM /^\s*stay\s*$/
syn match scalaAkkaFSM /when\ze([^)]*)/
syn match scalaAkkaFSM /startWith\ze([^)]*)/
syn match scalaAkkaFSM /initialize\ze()/
syn match scalaAkkaFSM /onTransition/
syn match scalaAkkaFSM /onTermination/
syn match scalaAkkaFSM /whenUnhandled/
syn match scalaAkkaFSMGotoUsing /\<using\>/
syn match scalaAkkaFSMGotoUsing /\<goto\>/
hi link scalaAkkaFSM PreProc
hi link scalaAkkaFSMGotoUsing PreProc

let b:current_syntax = 'scala'

if main_syntax ==# 'scala'
  unlet main_syntax
endif

" vim:set sw=2 sts=2 ts=8 et:

D config/nvim/syntax/testfile.scala => config/nvim/syntax/testfile.scala +0 -181
@@ 1,181 0,0 @@
package testfile
import java.something.com

package object SomeObject[A <: B] extends Implicits {
  type Booger[A] = A => Unit
  type SomeType = A <: B :> C
  type SomeOtherType = A ⇒ Thing
  type Something
  type Something <: SomethingElse
  type ParserContext = Context { type PrefixType = Parser }
  
  new Something#SomethingElse

  val GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH = Value

  // Doesn't yet work
  val GET, HEAD: Value, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH: Value = Value

  def x: Something#SomethingElse

  def hasFunctionType[A, B <: A, Z](f: A => B, g: (A, B) => Z): Unit = {
    println("Something")
  }

  val f: (Int, String) => Unit = (i: Int, s: String) => println(s"$i -- $s")
  val f: (Int, String) ⇒ Unit = (i: Int, s: String) ⇒ println(s"$i -- $s")
}

object Test {
  def test(
    param1: List[(Int, Int)],
    param2: List[Int]):
  List[Int] = {
    param2 match {
      case head :: tail => tail
    }
  }
}

case class ACaseClass(param1: Float = 14.23f)
case object ACaseObject extends Something

def x(): Unit = {
  case Something(a, b) =>
  case SomethingElse() =>
  case SomethingElseElse =>
}

class ScalaClass(i: Int = 12, b: Trait[A, Trait[B, C]]) extends B with SomeTrait[A, B[String], D] {
  /**
   * I forgot comments! We spelcheck them. [[scala.Option]]
   *
   * {{{
   * scala> This is a REPL line
   * scala> and this is another one
   * }}}
   *
   * <li></li>
   *
   * @param parameter Explanation of the parameter. Speling.
   * @return TODO
   */
  val thing = "A String" // this is a trailing comment, spelchecked too [TODO]
  val thing = "A String with a \" in it"
  val intString = "A string with $stuff // and a comment in it"
  val intString = s"A string /* a comment and */ with $stuff and ${stuff} in it"
  val intString = s"""A string /* a comment and */ with $stuff and ${stuff} in it"""
  val intFString = f"A string with $stuff and ${stuff} and ${eval this}%-2.2f and $stuff%2d in it"
  val intFString = f"""A string with $stuff and ${stuff} and ${eval this}%-2.2f and $stuff%2d in it"""
  val otherThings = """|This is a string
                       |that spans multiple lines.
                       |""".stripMargin
  val intString = sql"select * from T where id = $id and name = ${name}"
  val intString = sql"""
    select * from T
    where id = $id and name = ${s"$name Jr"} and age > ${age + 10}
  """

  val notImplemented = ???

  implicit val somethingImplicit = true

  // Ripped off from Scalaz
  final def foldMap[B: Monoid](f: A => B = (a: A) => A): B = F.foldMap(self)(f)
  final def foldRight[B](z: => B)(f: (A, => B) => B): B = F.foldRight(self, z)(f)
  final def foldLeft[B](z: B)(f: (B, A) => B): B = F.foldLeft(self, z)(f)
  final def foldRightM[G[_], B](z: => B)(f: (A, => B) => G[B])(implicit M: Monad[G]): G[B] = F.foldRightM(self, z)(f)
  final def foldLeftM[G[_], B](z: B)(f: (B, A) => G[B])(implicit M: Monad[G]): G[B] = F.foldLeftM(self, z)(f)
  final def foldr[B](z: => B)(f: A => (=> B) => B): B = F.foldr(self, z)(f)
  final def foldl[B](z: B)(f: B => A => B): B = F.foldl(self, z)(f)
  final def foldrM[G[_], B](z: => B)(f: A => ( => B) => G[B])(implicit M: Monad[G]): G[B] = F.foldrM(self, z)(f)

  val aChar = 'a'
  val anEscapedChar = '\\'
  val anotherEscapedChar = '\n'
  val aUnicodeChar = '\u00ab'
  val aSymbol = 'SomeSymbol
  def number = 0xAf903adeL
  def float = 1f
  def float = 1F
  def float = 1.1f
  def float = 1.1F
  def float = 231.1232f
  def float = 231.2321F
  def float = .2f
  def float = .2F
  def double = 1d
  def double = 1D
  def double = 1.1d
  def double = 1.1D
  def double = 231.1232d
  def double = 231.2321D
  def double = 231.2321
  def double = .2d
  def double = .2
  def double = .2D
  def exp = 1.2342e-24
  def exp = 1e+24
  var flarf: Int = 12
  def flooger(x: String): Unit = println(42)
  private val booger = "Hithere"
  protected[this] def something[A](y: SomeTrait[A])(implicit shoot: Function[Int, String]): Long = 12
  private final val do = done

  someVar match {
    case Flooger(thing, that, matches) =>
      flender ! Message(hi, there, guys)
    case '"' => Bah
  }

  try {
    whatever
  } catch {
    case e: Throwable
  } finally {
    at the end
  }

  while (a == b) {
  }

  for (x <- somecall) {
    dothing
  }

  for {
    a <- futureCall1
    b <- futureCall2
  } yield (a, b)

  protected[package] something = null

  def receive = super.receive

  require(something == true)

  val q"This $is a $string" = something

  q"""return this $thing"""
  tq"""return this $thing"""
  tq"return this $thing"
  cq"""return this $thing"""
  cq"return this $thing"
  pq"""return this $thing"""
  pq"return this $thing"

  val something = s"""bar="foo""""
  val something = f"""bar="foo""""
  val something = """bar="foo""""
  val something = s"Interpolatin' fancy expressions ${bar map (_.toString)}"

  def someFunc[A <: B, X =:= Y]

  val soManyEscapes = "\\\"\u0031\n\b\r\f\t" // and a comment
  val soManyEscapes = """\\\"\u0031\n\b\r\f\t""" // and a comment
  val soManyEscapes = s"\\\"\u0031\n\b\r\f\t" // and a comment
  val soManyEscapes = f"\\\"\u0031\n\b\r\f\t" // and a comment
  val soManyEscapes = s"""\\\"\u0031\n\b\r\f\t""" // and a comment
  val soManyEscapes = f"""\\\"\u0031\n\b\r\f\t""" // and a comment
  val soManyEscapes = "\\\"\u0031\n\b\r\f\t" // and a comment
}

D gruvbox_palette.sh => gruvbox_palette.sh +0 -119
@@ 1,119 0,0 @@
#!/bin/sh

if [ "${TERM%%-*}" = "screen" ]; then
  if [ -n "$TMUX" ]; then
    printf "\033Ptmux;\033\033]4;236;rgb:32/30/2f\007\033\\"
    printf "\033Ptmux;\033\033]4;234;rgb:1d/20/21\007\033\\"

    printf "\033Ptmux;\033\033]4;235;rgb:28/28/28\007\033\\"
    printf "\033Ptmux;\033\033]4;237;rgb:3c/38/36\007\033\\"
    printf "\033Ptmux;\033\033]4;239;rgb:50/49/45\007\033\\"
    printf "\033Ptmux;\033\033]4;241;rgb:66/5c/54\007\033\\"
    printf "\033Ptmux;\033\033]4;243;rgb:7c/6f/64\007\033\\"

    printf "\033Ptmux;\033\033]4;244;rgb:92/83/74\007\033\\"
    printf "\033Ptmux;\033\033]4;245;rgb:92/83/74\007\033\\"

    printf "\033Ptmux;\033\033]4;228;rgb:f2/e5/bc\007\033\\"
    printf "\033Ptmux;\033\033]4;230;rgb:f9/f5/d7\007\033\\"

    printf "\033Ptmux;\033\033]4;229;rgb:fb/f1/c7\007\033\\"
    printf "\033Ptmux;\033\033]4;223;rgb:eb/db/b2\007\033\\"
    printf "\033Ptmux;\033\033]4;250;rgb:d5/c4/a1\007\033\\"
    printf "\033Ptmux;\033\033]4;248;rgb:bd/ae/93\007\033\\"
    printf "\033Ptmux;\033\033]4;246;rgb:a8/99/84\007\033\\"

    printf "\033Ptmux;\033\033]4;167;rgb:fb/49/34\007\033\\"
    printf "\033Ptmux;\033\033]4;142;rgb:b8/bb/26\007\033\\"
    printf "\033Ptmux;\033\033]4;214;rgb:fa/bd/2f\007\033\\"
    printf "\033Ptmux;\033\033]4;109;rgb:83/a5/98\007\033\\"
    printf "\033Ptmux;\033\033]4;175;rgb:d3/86/9b\007\033\\"
    printf "\033Ptmux;\033\033]4;108;rgb:8e/c0/7c\007\033\\"
    printf "\033Ptmux;\033\033]4;208;rgb:fe/80/19\007\033\\"

    printf "\033Ptmux;\033\033]4;88;rgb:9d/00/06\007\033\\"
    printf "\033Ptmux;\033\033]4;100;rgb:79/74/0e\007\033\\"
    printf "\033Ptmux;\033\033]4;136;rgb:b5/76/14\007\033\\"
    printf "\033Ptmux;\033\033]4;24;rgb:07/66/78\007\033\\"
    printf "\033Ptmux;\033\033]4;96;rgb:8f/3f/71\007\033\\"
    printf "\033Ptmux;\033\033]4;66;rgb:42/7b/58\007\033\\"
    printf "\033Ptmux;\033\033]4;130;rgb:af/3a/03\007\033\\"
  else
    printf "\033P\033]4;236;rgb:32/30/2f\007\033\\"
    printf "\033P\033]4;234;rgb:1d/20/21\007\033\\"

    printf "\033P\033]4;235;rgb:28/28/28\007\033\\"
    printf "\033P\033]4;237;rgb:3c/38/36\007\033\\"
    printf "\033P\033]4;239;rgb:50/49/45\007\033\\"
    printf "\033P\033]4;241;rgb:66/5c/54\007\033\\"
    printf "\033P\033]4;243;rgb:7c/6f/64\007\033\\"

    printf "\033P\033]4;244;rgb:92/83/74\007\033\\"
    printf "\033P\033]4;245;rgb:92/83/74\007\033\\"

    printf "\033P\033]4;228;rgb:f2/e5/bc\007\033\\"
    printf "\033P\033]4;230;rgb:f9/f5/d7\007\033\\"

    printf "\033P\033]4;229;rgb:fb/f1/c7\007\033\\"
    printf "\033P\033]4;223;rgb:eb/db/b2\007\033\\"
    printf "\033P\033]4;250;rgb:d5/c4/a1\007\033\\"
    printf "\033P\033]4;248;rgb:bd/ae/93\007\033\\"
    printf "\033P\033]4;246;rgb:a8/99/84\007\033\\"

    printf "\033P\033]4;167;rgb:fb/49/34\007\033\\"
    printf "\033P\033]4;142;rgb:b8/bb/26\007\033\\"
    printf "\033P\033]4;214;rgb:fa/bd/2f\007\033\\"
    printf "\033P\033]4;109;rgb:83/a5/98\007\033\\"
    printf "\033P\033]4;175;rgb:d3/86/9b\007\033\\"
    printf "\033P\033]4;108;rgb:8e/c0/7c\007\033\\"
    printf "\033P\033]4;208;rgb:fe/80/19\007\033\\"

    printf "\033P\033]4;88;rgb:9d/00/06\007\033\\"
    printf "\033P\033]4;100;rgb:79/74/0e\007\033\\"
    printf "\033P\033]4;136;rgb:b5/76/14\007\033\\"
    printf "\033P\033]4;24;rgb:07/66/78\007\033\\"
    printf "\033P\033]4;96;rgb:8f/3f/71\007\033\\"
    printf "\033P\033]4;66;rgb:42/7b/58\007\033\\"
    printf "\033P\033]4;130;rgb:af/3a/03\007\033\\"
  fi

elif [ "$TERM" != "linux" ] && [ "$TERM" != "vt100" ] && [ "$TERM" != "vt220" ]; then

  printf "\033]4;236;rgb:32/30/2f\033\\"
  printf "\033]4;234;rgb:1d/20/21\033\\"

  printf "\033]4;235;rgb:28/28/28\033\\"
  printf "\033]4;237;rgb:3c/38/36\033\\"
  printf "\033]4;239;rgb:50/49/45\033\\"
  printf "\033]4;241;rgb:66/5c/54\033\\"
  printf "\033]4;243;rgb:7c/6f/64\033\\"

  printf "\033]4;244;rgb:92/83/74\033\\"
  printf "\033]4;245;rgb:92/83/74\033\\"

  printf "\033]4;228;rgb:f2/e5/bc\033\\"
  printf "\033]4;230;rgb:f9/f5/d7\033\\"

  printf "\033]4;229;rgb:fb/f1/c7\033\\"
  printf "\033]4;223;rgb:eb/db/b2\033\\"
  printf "\033]4;250;rgb:d5/c4/a1\033\\"
  printf "\033]4;248;rgb:bd/ae/93\033\\"
  printf "\033]4;246;rgb:a8/99/84\033\\"

  printf "\033]4;167;rgb:fb/49/34\033\\"
  printf "\033]4;142;rgb:b8/bb/26\033\\"
  printf "\033]4;214;rgb:fa/bd/2f\033\\"
  printf "\033]4;109;rgb:83/a5/98\033\\"
  printf "\033]4;175;rgb:d3/86/9b\033\\"
  printf "\033]4;108;rgb:8e/c0/7c\033\\"
  printf "\033]4;208;rgb:fe/80/19\033\\"

  printf "\033]4;88;rgb:9d/00/06\033\\"
  printf "\033]4;100;rgb:79/74/0e\033\\"
  printf "\033]4;136;rgb:b5/76/14\033\\"
  printf "\033]4;24;rgb:07/66/78\033\\"
  printf "\033]4;96;rgb:8f/3f/71\033\\"
  printf "\033]4;66;rgb:42/7b/58\033\\"
  printf "\033]4;130;rgb:af/3a/03\033\\"
fi


A scripts/offline-imap.sh => scripts/offline-imap.sh +6 -0
@@ 0,0 1,6 @@
#!/bin/bash

shopt -s expand_aliases
#source ~/.zsh/aliases.zsh
export PATH=/usr/local/bin:$PATH
/usr/local/bin/offlineimap -o