Compare commits

..

No commits in common. "eee2e16d3dd357f0a82f6a1b2cdd499914a38523" and "f62ef92753125931f932967788ab8fceb5e2cba4" have entirely different histories.

40 changed files with 1130 additions and 1049 deletions

139
.bashrc Normal file
View file

@ -0,0 +1,139 @@
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# =============================================================================
# Personalized Logging for Shell Setup
# =============================================================================
logging_enabled=false
log_dir="$HOME/log/$USER"
log_file="$log_dir/shell.log"
if [ -d "$log_dir" ]; then
export SHELL_LOG_FILE="$log_file"
logging_enabled=true
touch "$SHELL_LOG_FILE"
fi
# =============================================================================
# Ripped from default .bashrc
# =============================================================================
HISTCONTROL=ignoreboth
shopt -s histappend
HISTSIZE=1000
HISTFILESIZE=2000
shopt -s checkwinsize
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# =============================================================================
# Command Prompt Customization
# =============================================================================
ps1_startup_file="$HOME/.startup/ps1"
if [ -f "$ps1_startup_file" ]; then
source $ps1_startup_file
else
if $logging_enabled; then
echo "[warn] Custom PS1 for bash missing at " \
"'$ps1_startup_file': " \
"see git@git.sr.ht:~eidolon/scripts" >> "$log_file"
fi
fi
# =============================================================================
# Common Environment Configuration
# =============================================================================
export EDITOR=vim
# =============================================================================
# PATH
# =============================================================================
if [ -d "$HOME/bin" ]; then
export PATH="$HOME/bin:$PATH"
fi
if [ -d "$HOME/.local/bin" ]; then
export PATH="$HOME/.local/bin:$PATH"
fi
if [ -f "$HOME/.cargo/env" ]; then
source "$HOME/.cargo/env"
fi
if [ -f ~/.fzf.bash ]; then
source ~/.fzf.bash
fi
export RACKET_HOME="$HOME/opt/racket"
if [ -d "$RACKET_HOME" ]; then
export PATH="$RACKET_HOME/bin:$PATH"
fi
export BUILDKIT_HOME="$HOME/opt/buildkit"
if [ -d "$BUILDKIT_HOME" ]; then
export PATH="$HOME/opt/buildkit/bin:$PATH"
fi
export JAVA_HOME="$HOME/opt/jdk"
if [ -d "$JAVA_HOME/bin" ]; then
export PATH="$JAVA_HOME/bin:$PATH"
fi
export COURSIER_HOME="$HOME/.local/share/coursier"
if [ -d "$COURSIER_HOME/bin" ]; then
export PATH="$COURSIER_HOME/bin:$PATH"
fi
export N_PREFIX=/home/pfm/.n
if [ -d "$N_PREFIX/bin" ]; then
export PATH="$N_PREFIX/bin:$PATH"
fi
# =============================================================================
# SSH Agent Management
# =============================================================================
ssh_agent_startup_file="$HOME/.startup/start-ssh-agent"
if [ -f "$ssh_agent_startup_file" ]; then
source "$ssh_agent_startup_file"
else
if $logging_enabled; then
echo "[warn] SSH Agent startup code missing at " \
"'$ssh_agent_startup_file': " \
"see git@git.sr.ht:~eidolon/scripts" >> "$log_file"
fi
fi
# =============================================================================
# Aliases
# =============================================================================
if command -v exa > /dev/null 2>&1; then
alias ls='exa'
alias ll='exa -l'
else
if $logging_enabled; then
echo "[warn] exa is not setup! Using the system ls" >> "$log_file"
fi
fi
if command -v nvim > /dev/null 2>&1; then
alias vim='nvim'
else
if $logging_enabled; then
echo "[warn] Neovim is not setup! Using the system vim" >> "$log_file"
fi
fi
# =============================================================================
# Scala/SBT Setup
# =============================================================================
if command -v sbt > /dev/null 2>&1; then
export SBT_OPTS="-XX:+UseG1GC -Xmx2048m"
fi

View file

@ -1,77 +0,0 @@
[colors.bright]
black = "0x32302f"
blue = "0x7daea3"
cyan = "0x89b482"
green = "0xa9b665"
magenta = "0xd3869b"
red = "0xea6962"
white = "0xd4be98"
yellow = "0xd8a657"
[colors.cursor]
cursor = "CellForeground"
text = "CellBackground"
[colors.normal]
black = "0x32302f"
blue = "0x7daea3"
cyan = "0x89b482"
green = "0xa9b665"
magenta = "0xd3869b"
red = "0xea6962"
white = "0xd4be98"
yellow = "0xd8a657"
[colors.primary]
background = "0x1d2021"
foreground = "0xd4be98"
[colors.selection]
background = "CellForeground"
text = "CellBackground"
[colors.vi_mode_cursor]
cursor = "CellForeground"
text = "CellBackground"
[cursor]
unfocused_hollow = true
[cursor.style]
blinking = "Off"
shape = "Block"
[env]
TERM = "xterm-256color"
[font]
size = 13.0
[font.bold]
family = "Iosevka Term"
style = "Bold"
[font.bold_italic]
family = "Iosevka Term"
style = "Bold Italic"
[font.italic]
family = "Iosevka Term"
style = "Italic"
[font.normal]
family = "Iosevka Term"
[scrolling]
history = 10000
multiplier = 3
[selection]
semantic_escape_chars = ",│`|:\"' ()[]{}<>\t"
[window]
decorations = "full"
dynamic_title = false
opacity = 1.0
startup_mode = "Windowed"
title = "Alacritty"

View file

@ -117,7 +117,7 @@ font:
# - (macOS) Menlo
# - (Linux/BSD) monospace
# - (Windows) Consolas
family: "Iosevka Term"
family: monospace
# The `style` can be specified to pick a specific face.
#style: Regular
@ -128,7 +128,7 @@ font:
#
# If the bold family is not specified, it will fall back to the
# value specified for the normal font.
family: "Iosevka Term"
family: monospace
# The `style` can be specified to pick a specific face.
style: Bold
@ -139,7 +139,7 @@ font:
#
# If the italic family is not specified, it will fall back to the
# value specified for the normal font.
family: "Iosevka Term"
family: monospace
# The `style` can be specified to pick a specific face.
style: Italic
@ -150,7 +150,7 @@ font:
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
family: "Iosevka Term"
family: monospace
# The `style` can be specified to pick a specific face.
style: Bold Italic
@ -191,60 +191,60 @@ font:
# Nightfox Alacritty Colors
# Style: terafox
# Upstream: https://github.com/edeneast/nightfox.nvim/raw/main/extra/terafox/nightfox_alacritty.yml
#colors:
# primary:
# background: '0x152528'
# foreground: '0xe6eaea'
#
# normal:
# black: '0x2f3239'
# red: '0xe85c51'
# green: '0x7aa4a1'
# yellow: '0xfda47f'
# blue: '0x5a93aa'
# magenta: '0xad5c7c'
# cyan: '0xa1cdd8'
# white: '0xebebeb'
#
# bright:
# black: '0x4e5157'
# red: '0xeb746b'
# green: '0x8eb2af'
# yellow: '0xfdb292'
# blue: '0x73a3b7'
# magenta: '0xb97490'
# cyan: '0xafd4de'
# white: '0xeeeeee'
#
# indexed_colors:
# - { index: 16, color: '0xff8349' }
# - { index: 17, color: '0xcb7985' }
# Gruvbox Material Hard Dark
colors:
primary:
background: '0x1d2021'
foreground: '0xd4be98'
background: '0x152528'
foreground: '0xe6eaea'
normal:
black: '0x32302f'
red: '0xea6962'
green: '0xa9b665'
yellow: '0xd8a657'
blue: '0x7daea3'
magenta: '0xd3869b'
cyan: '0x89b482'
white: '0xd4be98'
black: '0x2f3239'
red: '0xe85c51'
green: '0x7aa4a1'
yellow: '0xfda47f'
blue: '0x5a93aa'
magenta: '0xad5c7c'
cyan: '0xa1cdd8'
white: '0xebebeb'
bright:
black: '0x32302f'
red: '0xea6962'
green: '0xa9b665'
yellow: '0xd8a657'
blue: '0x7daea3'
magenta: '0xd3869b'
cyan: '0x89b482'
white: '0xd4be98'
black: '0x4e5157'
red: '0xeb746b'
green: '0x8eb2af'
yellow: '0xfdb292'
blue: '0x73a3b7'
magenta: '0xb97490'
cyan: '0xafd4de'
white: '0xeeeeee'
indexed_colors:
- { index: 16, color: '0xff8349' }
- { index: 17, color: '0xcb7985' }
# Gruvbox Material Hard Dark
# colors:
# primary:
# background: '0x1d2021'
# foreground: '0xd4be98'
#
# normal:
# black: '0x32302f'
# red: '0xea6962'
# green: '0xa9b665'
# yellow: '0xd8a657'
# blue: '0x7daea3'
# magenta: '0xd3869b'
# cyan: '0x89b482'
# white: '0xd4be98'
#
# bright:
# black: '0x32302f'
# red: '0xea6962'
# green: '0xa9b665'
# yellow: '0xd8a657'
# blue: '0x7daea3'
# magenta: '0xd3869b'
# cyan: '0x89b482'
# white: '0xd4be98'
cursor:
text: CellBackground

View file

@ -1,4 +1,9 @@
# vim: filetype=i3config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
@ -10,8 +15,15 @@ set $mod Mod4
# is used in the bar {} block below.
font pango:Iosevka Term 11
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
# they are included here as an example. Modify as you see fit.
# Set the desktop background
exec --no-startup-id feh --bg-scale ~/images/backgrounds/current-background.jpg
exec --no-startup-id feh --bg-scale /home/pfm/images/backgrounds/nasa_carina_nircam.jpg
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
@ -32,14 +44,19 @@ bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOU
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec ~/.cargo/bin/alacritty
bindsym $mod+Return exec alacritty
# kill focused window
bindsym $mod+Shift+q kill
# rofi - omnibar which can run new applications or show an open window and more
# start dmenu (a program launcher)
bindsym $mod+d exec --no-startup-id "rofi -show run"
bindsym $mod+p exec --no-startup-id "rofi -show window"
# A more modern dmenu replacement is rofi:
# bindcode $mod+40 exec "rofi -modi drun,run -show drun"
# There also is i3-dmenu-desktop which only displays applications shipping a
# .desktop file. It is a wrapper around dmenu, so you need that installed.
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+j focus left
@ -47,12 +64,24 @@ bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+h split h
@ -63,6 +92,7 @@ bindsym $mod+v split v
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
#bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
#bindsym $mod+e layout toggle split
@ -75,28 +105,6 @@ bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
bindsym $mod+s exec --no-startup-id "~/.local/bin/,ss-region"
bindsym $mod+Shift+s exec --no-startup-id "~/.local/bin/,ss-screen"
bindsym $mod+Control+s exec --no-startup-id "~/.local/bin/,ss-window"
# the default for workspaces should be tabbed
workspace_layout tabbed
# The indicator color is used for indicating where a new window will be opened.
# class | border | background | text | indicator | child_border
#client.focused #bdae93 #3c3836 #fbf1c7 #665c54 #665c54
client.focused #d65d0e #3c3836 #fbf1c7 #665c54 #665c54
client.focused_inactive #282828 #1d2021 #928374 #282828 #282828
client.unfocused #282828 #1d2021 #928374 #282828 #282828
title_align center
for_window [class=".*"] title_format "<b>%title</b>"
for_window [all] title_window_icon off
for_window [class="(?i)firefox"] border pixel 1
for_window [class="(?i)discord"] border pixel 1
#for_window [all] title_window_icon on
#for_window [all] title_window_icon padding 8px
# focus the child container
#bindsym $mod+d focus child
@ -126,16 +134,16 @@ bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
# reload the configuration file
bindsym $mod+Shift+c reload
@ -171,10 +179,8 @@ mode "resize" {
bindsym $mod+r mode "resize"
# Polybar
exec_always --no-startup-id $HOME/.config/polybar/launch.sh
# Backup plan -- use i3bar
#bar {
#status_command i3status
#}
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command i3status
}

View file

@ -1,23 +1,11 @@
-- Configure basic Neovim settings.
require('packer_init')
require('general')
-- Configure key mappings not defined for plugins. This also establishes the
-- leader keys, which are important for plugins. Must be present before plugins
-- are loaded.
require('keymap')
-- This loads (lazily) all plugins and configures things like plugin-specific
-- key mappings.
require('plugin_management')
-- Initialize the color scheme, depends on plugins being available.
require('colorscheme')
-- Setup autocmd for metals - metals is a little weird and needs to load itself.
-- The plugin that's loaded just makes metals code available in the first place.
require('plugins/metals')
-- Setup treesitter, select the configs to load, etc.
require('plugins/treesitter')
require('keymap')
require('plugins/lsp')
require('plugins/scala')
require('plugins/cmp')
require('plugins/lualine')
require('plugins/telescope')
require('plugins/floaterm')
require('plugins/treesitter')

View file

@ -1,3 +0,0 @@
{
"workspace.checkThirdParty": false
}

View file

@ -1,6 +1,40 @@
-- I use dark terminals and schemes, so use a dark background.
vim.opt.background = 'dark'
--vim.opt.background = 'light'
-- Settings for gruvbox-material
vim.g.gruvbox_material_palette = 'mix'
vim.g.gruvbox_material_background = 'hard'
vim.g.gruvbox_material_enable_bold = 1
-- Settings for material
vim.g.material_style = "palenight"
require('material').setup {
italics = {
comments = true, -- Enable italic comments
},
plugins = {
neogit = false,
sidebar_nvim = false,
lsp_saga = false,
nvim_dap = false,
nvim_navic = false,
hop = false,
}
}
-- Settings for nightfox
-- Available colorscheme values: nightfox, duskfox, nordfox, terafox
require('nightfox').setup({
options = {
styles = {
comments = "italic",
keywords = "bold",
}
}
})
-- Set the color scheme
vim.cmd 'colorscheme gruvbox-material'
vim.cmd 'colorscheme terafox'

View file

@ -9,15 +9,11 @@ opt.swapfile = false -- Don't use swapfile
opt.modelines = 0 -- Disable modelines
opt.encoding = 'utf-8' -- Set default encoding to UTF-8
opt.termguicolors = true
-- Note that this setting is important for which-key. Also don't reduce it too
-- low, or the behavior will start getting wonky and always show which-key.
opt.timeout = true
opt.timeoutlen = 300 -- Time in ms to wait for a sequnece to complete
opt.timeoutlen = 500 -- Time in ms to wait for a sequnece to complete
opt.shortmess:remove("F")
vim.opt_global.shortmess:remove("F")
opt.shortmess:append("c")
opt.wildignore = {
@ -26,10 +22,6 @@ opt.wildignore = {
'*/.bloop/*', '*/.bsp/*', '*/node_modules/*'
}
-- Disable netrw in favor of nvim-tree
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-----------------------------------------------------------
-- Completion
-----------------------------------------------------------
@ -79,16 +71,6 @@ vim.api.nvim_create_autocmd("FileType", {
end,
})
-----------------------------------------------------------
-- Custom File Types
-----------------------------------------------------------
vim.api.nvim_create_autocmd({"BufRead", "BufNewFile"}, {
pattern = {'*.aum', '*.aui'},
callback = function()
vim.bo.filetype = "austral"
end,
})
-----------------------------------------------------------
-- Memory, CPU
-----------------------------------------------------------

View file

@ -1,54 +1,138 @@
--------------------------------------------------------------------------------
-- Define keymaps for Neovim
--
-- Note that leader is defined in init.lua to ensure that all mappings are
-- correct in plugins.
--
-- Plugins define their own keymappings in plugin_management.lua
--------------------------------------------------------------------------------
-----------------------------------------------------------
-- Define keymaps for Neovim and plugins.
-----------------------------------------------------------
local map = vim.keymap.set
local function map(mode, lhs, rhs, opts)
local options = { noremap = true, silent = true }
if opts then
options = vim.tbl_extend('force', options, opts)
end
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
end
-- Change leader to a comma
vim.g.mapleader = ','
vim.g.maplocalleader = ' '
-----------------------------------------------------------
-- General
-----------------------------------------------------------
-- Clear search highlighting
map('n', '<leader>/', ':nohlsearch<CR>', { desc = 'Clear Search Highlight' })
map('n', '<leader>/', ':nohlsearch<CR>')
-- Save current buffer
map('n', '<leader>s', ':up<CR>', { desc = 'Save' })
map('n', '<leader>s', ':up<CR>')
-- Move to previous buffer
map('n', '<leader>bp', ':bp<CR>', { desc = 'Prev Buffer' })
map('n', '<leader>bp', ':bp<CR>')
-- Move to next buffer
map('n', '<leader>bn', ':bn<CR>', { desc = 'Next Buffer' })
map('n', '<leader>bn', ':bn<CR>')
-- Delete current buffer
map('n', '<leader>bd', ':bd<CR>', { desc = 'Delete Buffer' })
map('n', '<leader>bd', ':bd<CR>')
-- Close the quickfix window
map('n', '<leader>cq', ':ccl<CR>', { desc = 'Close Quickfix' })
map('n', '<leader>cq', ':ccl<CR>')
-- Create a vertical split
map('n', '<leader>v', ':vsplit<CR>', { desc = 'Vertical Split' })
-- These appear broken with latest neovim, and nvim-cmp has
-- settings that work in any case. Keep as a reminder for a
-- few weeks just in case.
-- Use Tab to jump to the next option in a popup menu
--vim.keymap.set('i', '<Tab>', function()
-- return vim.fn.pumvisible() == 1 and '<C-N>' or '<Tab>'
--end, {expr = true})
-- Enter the lozenge ◊ character.
map('i', '<C-l>', '<C-k>LZ', { desc = 'Enter the Lozenge Character' })
-- Use Shift+Tab to jump to the previous option in a popup menu
--vim.keymap.set('i', '<S-Tab>', function()
-- return vim.fn.pumvisible() == 1 and '<C-P>' or '<Tab>'
--end, {expr = true})
--------------------------------------------------------------------------------
-----------------------------------------------------------
-- Telescope
-----------------------------------------------------------
-- Use ';' to search active buffers
map('n', ';', '<cmd>Telescope buffers<CR>')
-- Use Ctrl+P to show a list of files
map('n', '<C-P>', '<cmd>Telescope find_files<CR>')
-- Live Grep
map('n', '<leader>fg', '<cmd>Telescope live_grep<CR>')
-- Metals commands
map('n', '<leader>fm', '<cmd>Telescope metals commands<CR>')
-- Search project TODOs in Telescope
map('n', '<leader>ft', '<cmd>TodoTelescope<CR>')
-----------------------------------------------------------
-- Trouble
-----------------------------------------------------------
-- Show/hide Trouble
map('n', '<leader>xx', '<cmd>TroubleToggle<CR>')
-- Show workspace diagnostics
map('n', '<leader>xw', '<cmd>TroubleToggle workspace_diagnostics<CR>')
-- Show document diagnostics
map('n', '<leader>xd', '<cmd>TroubleToggle document_diagnostics<CR>')
-- Show quickfix
map('n', '<leader>xq', '<cmd>TroubleToggle quickfix<CR>')
-- Show local list
map('n', '<leader>xl', '<cmd>TroubleToggle loclist<CR>')
-- Show LSP references
map('n', '<leader>xr', '<cmd>TroubleToggle lsp_references<CR>')
-- Show project TODOs in Trouble
map('n', '<leader>xt', '<cmd>TodoTrouble<CR>')
-----------------------------------------------------------
-- Floaterm
-----------------------------------------------------------
-- Create a new floating terminal
vim.g.floaterm_keymap_new = '<leader>tc'
-- Move to the previous terminal
vim.g.floaterm_keymap_prev = '<leader>tp'
-- Move to the next terminal
vim.g.floaterm_keymap_next = '<leader>tn'
-- Toggle the visibility of the floating terminal
vim.g.floaterm_keymap_toggle = '<leader>tt'
-----------------------------------------------------------
-- nvim-tree
-----------------------------------------------------------
-- Toggle the file tree
map('n', '<C-A>tt', '<cmd>NvimTreeToggle<CR>')
-- Find the current buffer in the file tree
map('n', '<C-A>tf', '<cmd>NvimTreeFindFile<CR>')
-----------------------------------------------------------
-- LSP
--------------------------------------------------------------------------------
map('n', 'K', vim.lsp.buf.hover, { desc = 'Hover' })
map('n', 'gi', vim.lsp.buf.implementation, { desc = 'Go To Implementation' })
map('n', 'gr', vim.lsp.buf.references, { desc = 'Go To References' })
map('n', 'gds', vim.lsp.buf.document_symbol, { desc = 'Document Symbol' })
map('n', 'gws', vim.lsp.buf.workspace_symbol, { desc = 'Workspace Symbol' })
map('n', 'gd', vim.lsp.buf.definition, { desc = 'Go To Definition' })
map('n', 'gD', vim.lsp.buf.type_definition, { desc = 'Go To Type Definition' })
map('n', '<leader>cl', vim.lsp.codelens.run, { desc = 'Code Lens' })
map('n', '<leader>rn', vim.lsp.buf.rename, { desc = 'Rename' })
map('n', '<leader>ca', vim.lsp.buf.code_action, { desc = 'Code Action' })
map('n', '[c', '<cmd>lua vim.diagnostic.goto_prev({ wrap = false })<CR>', { desc = 'prev diagnostic' })
map('n', ']c', '<cmd>lua vim.diagnostic.goto_next({ wrap = false })<CR>', { desc = 'next diagnostic' })
map('n', '<leader>ls', ':Telescope lsp_document_symbols<CR>', { desc = 'Browse Document Symbols' })
-----------------------------------------------------------
map('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>')
map('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>')
map('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>')
map('n', 'gds', '<cmd>lua vim.lsp.buf.document_symbol()<CR>')
map('n', 'gws', '<cmd>lua vim.lsp.buf.workspace_symbol()<CR>')
map('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>')
map('n', '<leader>cl', '<cmd>lua vim.lsp.codelens.run()<CR>')
map('n', '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>')
map('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>')
map('n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>')
map('n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>')
map('n', '[c', '<cmd>lua vim.diagnostic.goto_prev { wrap = false }<CR>')
map('n', ']c', '<cmd>lua vim.diagnostic.goto_next { wrap = false }<CR>')

View file

@ -0,0 +1,164 @@
-- Automatically install packer
local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
packer_bootstrap = fn.system({
'git',
'clone',
'--depth',
'1',
'https://github.com/wbthomason/packer.nvim',
install_path
})
vim.o.runtimepath = vim.fn.stdpath('data') .. '/site/pack/*/start/*,' .. vim.o.runtimepath
end
-- Use a protected call so we don't error out on first use
local status_ok, packer = pcall(require, 'packer')
if not status_ok then
return
end
return require('packer').startup(function(use)
-- Plugin/package manager.
use 'wbthomason/packer.nvim'
-- Required for a number of Lua plugins.
use 'nvim-lua/plenary.nvim'
-- Color schemes
use 'sainnhe/gruvbox-material'
use 'rebelot/kanagawa.nvim'
use 'marko-cerovac/material.nvim'
use { 'EdenEast/nightfox.nvim', run = ':NightfoxCompile' }
-- Telescope: fuzzy finder
use {
'nvim-telescope/telescope.nvim',
requires = {
{ 'nvim-lua/plenary.nvim' }
}
}
-- Native Telescope implementation based on FZF for performance.
use {
'nvim-telescope/telescope-fzf-native.nvim',
run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'
}
-- A pretty list for showing diagnostics, references, telescope results,
-- quickfix and location lists to help you solve all the trouble your code
-- is causing.
use {
'folke/trouble.nvim',
requires = 'kyazdani42/nvim-web-devicons',
config = function()
require('trouble').setup()
end
}
-- Treesitter: Neovim bindings for the Tree-sitter parser generator tool and
-- incremental parsing library.
use {
'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate'
}
-- Neovim-native LSP Implementation
use 'neovim/nvim-lspconfig'
-- Snippet engine is REQUIRED for nvim-cmp.
use 'L3MON4D3/LuaSnip'
-- nvim-cmp - completion plugin, used for LSP and Metals
use {
'hrsh7th/nvim-cmp',
requires = {
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
'hrsh7th/cmp-buffer',
'saadparwaiz1/cmp_luasnip'
--'PaterJason/cmp-conjure'
}
}
-- Metals, for Scala development.
use {
'scalameta/nvim-metals',
requires = { 'nvim-lua/plenary.nvim' },
--ft = { 'scala', 'sbt' } -- this is busted for some reason.
}
-- Lualine (configures the bottom bars)
use {
'nvim-lualine/lualine.nvim',
requires = 'kyazdani42/nvim-web-devicons'
}
-- bufferline - shows a bar at the top with open buffers
-- using packer.nvim
use {
'akinsho/bufferline.nvim',
requires = 'kyazdani42/nvim-web-devicons',
config = function()
require('bufferline').setup()
end
}
-- Floating terminal
use 'voldikss/vim-floaterm'
-- Show signs for Git
use {
'lewis6991/gitsigns.nvim',
config = function()
require('gitsigns').setup()
end
}
-- Show unobtrusive indentation guides
use {
'lukas-reineke/indent-blankline.nvim',
config = function()
require('indent_blankline').setup()
end
}
-- nvim-tree for when I want to view files
use {
'kyazdani42/nvim-tree.lua',
requires = {
'kyazdani42/nvim-web-devicons'
},
tag = 'nightly',
config = function()
require('nvim-tree').setup()
end
}
-- Improve startup time by replacing default filetype autocmds
use 'nathom/filetype.nvim'
-- Special highlighting and tracking for certain notable words
use {
'folke/todo-comments.nvim',
requires = 'nvim-lua/plenary.nvim',
config = function()
require('todo-comments').setup()
end
}
-- Racket support
use 'benknoble/vim-racket'
-- PlantUML syntax
use 'aklt/plantuml-syntax'
-- Conjure: Supports all Lisps that I work with.
use {
'Olical/conjure',
ft = { 'rkt', 'racket' }
}
end)

View file

@ -1,350 +0,0 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
-- Color schemes. Lazy, only selected will be loaded.
-- -------------------------------------------------------------------------
{
'sainnhe/gruvbox-material',
config = function(_)
vim.g.gruvbox_material_palette = 'material'
vim.g.gruvbox_material_background = 'hard'
vim.g.gruvbox_material_enable_bold = 1
end
},
{
'rebelot/kanagawa.nvim',
lazy = true,
},
{
'marko-cerovac/material.nvim',
lazy = true,
opts = {
italics = {
comments = true,
},
plugins = {
neogit = false,
sidebar_nvim = false,
lsp_saga = false,
nvim_dap = false,
nvim_navic = false,
hop = false,
}
}
},
{
'EdenEast/nightfox.nvim',
build = ':NightfoxCompile',
lazy = true,
opts = {
options = {
styles = {
comments = "italic",
keywords = "bold",
}
}
}
},
-- Common dependency for Lua plugins
-- -------------------------------------------------------------------------
'nvim-lua/plenary.nvim',
-- Common dependency for many plugins (visual)
-- -------------------------------------------------------------------------
'nvim-tree/nvim-web-devicons',
{
"folke/which-key.nvim",
config = function()
require("which-key").setup({
-- customize as desired
})
end,
},
-- Fuzzy finder (files, buffers, live grep, etc.)
-- Includes a native build based on FZF for performance.
-- -------------------------------------------------------------------------
{
'nvim-telescope/telescope.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
keys = {
{ ';', '<cmd>Telescope buffers<CR>', desc = 'Find Buffer' },
{ '<C-P>', '<cmd>Telescope find_files<CR>', desc = 'Find File' },
{ '<leader>fg', '<cmd>Telescope live_grep<CR>', desc = 'Live Grep' },
{ '<leader>fm', '<cmd>Telescope metals commands<CR>', desc = 'Find Metals Command' },
{ '<leader>ft', '<cmd>TodoTelescope<CR>', desc = 'Find TODO' },
}
},
{
'nvim-telescope/telescope-fzf-native.nvim',
build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build',
config = function(_)
require('telescope').load_extension('fzf')
end
},
-- A pretty list for showing diagnostics, references, telescope results,
-- quickfix and location lists to help you solve all the trouble your code
-- is causing.
-- -------------------------------------------------------------------------
{
'folke/trouble.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
keys = {
{ '<leader>xx', '<cmd>TroubleToggle<CR>', desc = 'Trouble' },
{ '<leader>xw', '<cmd>TroubleToggle workspace_diagnostics<CR>', desc = 'Workspace Diagnostics' },
{ '<leader>xd', '<cmd>TroubleToggle document_diagnostics<CR>', desc = 'Document Diagnostics' },
{ '<leader>xq', '<cmd>TroubleToggle quickfix<CR>', desc = 'Quickfix' },
{ '<leader>xl', '<cmd>TroubleToggle loclist<CR>', desc = 'Local List' },
{ '<leader>xr', '<cmd>TroubleToggle lsp_references<CR>', desc = 'LSP References' },
{ '<leader>xr', '<cmd>TodoTrouble<CR>', desc = 'Show TODOs' },
}
},
-- Treesitter: Neovim bindings for the Tree-sitter parser generator tool and
-- incremental parsing library.
-- -------------------------------------------------------------------------
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate'
},
-- Neovim-native LSP Implementation
-- -------------------------------------------------------------------------
{
'neovim/nvim-lspconfig',
dependencies = {
'hrsh7th/cmp-nvim-lsp',
},
config = function(_)
local lsp = require('lspconfig')
-- Establish a set of capabilities so we can advertise nvim-cmp support.
local capabilities = vim.lsp.protocol.make_client_capabilities()
-- Add nvim-cmp support to the capabilities.
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
-- lua-language-server
lsp.lua_ls.setup {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most
-- likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {'vim'},
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique
-- identifier
telemetry = {
enable = false,
},
},
},
}
-- bash-language-server
lsp.bashls.setup{}
-- texlab = latex language server
lsp.texlab.setup{}
-- terraform-ls = terraform language server (Hashicorp stable)
lsp.terraformls.setup{}
-- tsserver = typescript language server, works for JS as well.
lsp.tsserver.setup{}
end
},
-- nvim-cmp - completion plugin, used for LSP and Metals
-- -------------------------------------------------------------------------
{
'hrsh7th/nvim-cmp',
dependencies = {
'L3MON4D3/LuaSnip',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
'hrsh7th/cmp-buffer',
'saadparwaiz1/cmp_luasnip'
},
config = function(_)
local cmp = require('cmp')
cmp.setup{
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' },
{ name = 'buffer', option = { keyword_length = 5 }, },
},
mapping = {
['<CR>'] = cmp.mapping.confirm({ select = true }),
['<C-Space>'] = cmp.mapping.complete(),
['<Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end,
['<S-Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end,
},
}
end
},
-- Metals, for Scala development.
-- -------------------------------------------------------------------------
{
'scalameta/nvim-metals',
dependencies = { 'nvim-lua/plenary.nvim' }
},
-- Lualine (configures the bottom bars)
-- -------------------------------------------------------------------------
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
},
-- bufferline - shows a bar at the top with open buffers
-- -------------------------------------------------------------------------
{
'akinsho/bufferline.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
opts = {
options = {
mode = 'buffers',
indicator = {
style = 'none'
},
diagnostics = 'nvim_lsp',
color_icons = true,
show_buffer_icons = true,
show_buffer_close_icons = false,
separator_style = 'slant',
always_show_bufferline = true,
hover = {
enabled = false
},
},
}
},
-- Floating terminal
-- -------------------------------------------------------------------------
{
'voldikss/vim-floaterm',
keys = {
{ '<leader>tc', '<cmd>FloatermNew<CR>', desc = 'New Floating Terminal' },
{ '<leader>tc', '<C-\\><C-n><cmd>FloatermNew<CR>', mode = 't', desc = 'New Floating Terminal' },
{ '<leader>tt', '<cmd>FloatermToggle<CR>', desc = 'Toggle Floating Terminal' },
{ '<leader>tt', '<C-\\><C-n><cmd>FloatermToggle<CR>', mode = 't', desc = 'Toggle Floating Terminal' },
{ '<leader>tp', '<cmd>FloatermPrev<CR>', desc = 'Previous Terminal' },
{ '<leader>tp', '<C-\\><C-n><cmd>FloatermPrev<CR>', mode = 't', desc = 'Previous Terminal' },
{ '<leader>tn', '<cmd>FloatermNext<CR>', desc = 'Next Terminal' },
{ '<leader>tn', '<C-\\><C-n><cmd>FloatermNext<CR>', mode = 't', desc = 'Next Terminal' },
},
config = function(_)
vim.g.floaterm_width = 0.8
vim.g.floaterm_height = 0.8
vim.g.floaterm_gitcommit = 'split'
end
},
-- Show signs for Git
-- -------------------------------------------------------------------------
{ 'lewis6991/gitsigns.nvim' },
-- Show unobtrusive indentation guides
-- -------------------------------------------------------------------------
{ 'lukas-reineke/indent-blankline.nvim', },
-- nvim-tree for when I want to view files
-- -------------------------------------------------------------------------
{
'nvim-tree/nvim-tree.lua',
dependencies = { 'nvim-tree/nvim-web-devicons' },
tag = 'nightly',
lazy = false,
keys = {
{ '<C-A>tt', '<cmd>NvimTreeToggle<CR>', desc = 'File Tree' },
{ '<C-A>tf', '<cmd>NvimTreeFindFile<CR>', desc = 'Tree Find File' },
},
config = function(_)
require('nvim-tree').setup()
end
},
-- Special highlighting and tracking for certain notable words
-- -------------------------------------------------------------------------
{
'folke/todo-comments.nvim',
dependencies = 'nvim-lua/plenary.nvim',
config = function()
require("todo-comments").setup{}
end,
},
-- Racket support
-- -------------------------------------------------------------------------
{
'benknoble/vim-racket',
event = { 'BufNewFile *.rkt', 'BufReadPre *.rkt' },
lazy = true,
},
-- Janet support
-- -------------------------------------------------------------------------
{
'bakpakin/janet.vim',
event = { 'BufNewFile *.janet', 'BufReadPre *.janet' },
lazy = true
},
-- PlantUML syntax
-- -------------------------------------------------------------------------
{
'aklt/plantuml-syntax',
event = { 'BufNewFile *.puml', 'BufReadPre *.puml' },
lazy = true,
},
-- i3 configuration syntax
-- -------------------------------------------------------------------------
'mboughaba/i3config.vim',
})

View file

@ -0,0 +1,43 @@
local cmp = require('cmp')
cmp.setup{
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' },
{ name = 'buffer', option = { keyword_length = 5 }, },
},
mapping = {
['<CR>'] = cmp.mapping.confirm({ select = true }),
['<C-Space>'] = cmp.mapping.complete(),
['<Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end,
['<S-Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end,
},
}
-- Setup conjure, only for supported files
cmp.setup.filetype('racket', {
sources = {
{ name = 'conjure' },
{ name = 'luasnip' },
{ name = 'path' },
{ name = 'buffer', option = { keyword_length = 5 }, },
}
})

View file

@ -0,0 +1,3 @@
vim.g.floaterm_width = 0.8
vim.g.floaterm_height = 0.8
vim.g.floaterm_gitcommit = 'split'

View file

@ -0,0 +1,54 @@
local lsp = require('lspconfig')
-- Use an on_attach function to configure after LSP attaches to buffer
local on_attach = function(client, bufnr)
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
end
-- Establish a set of capabilities so we can advertise nvim-cmp support.
local capabilities = vim.lsp.protocol.make_client_capabilities()
-- Add nvim-cmp support to the capabilities.
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
-- zls = zig language server
lsp.zls.setup {
on_attach = on_attach,
flags = {
debounce_text_changes = 150
},
capabilities = capabilities
}
-- lua-language-server
lsp.sumneko_lua.setup {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most
-- likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {'vim'},
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique
-- identifier
telemetry = {
enable = false,
},
},
},
}
-- bash-language-server
lsp.bashls.setup{}
-- texlab = latex language server
lsp.texlab.setup{}

View file

@ -3,9 +3,9 @@ local function metals_status_for_lualine()
end
require('lualine').setup {
options = {
theme = 'gruvbox-material'
},
--options = {
-- theme = 'material'
--},
sections = {
lualine_c = {
'filename',

View file

@ -4,7 +4,9 @@
-- Autocmd that will actually be in charging of starting the whole thing
local nvim_metals_group = vim.api.nvim_create_augroup(
'nvim-metals',
{ clear = true }
{
clear = true
}
)
vim.api.nvim_create_autocmd('FileType', {
@ -12,7 +14,12 @@ vim.api.nvim_create_autocmd('FileType', {
callback = function()
local metals_config = require('metals').bare_config()
-- Capabilities for completion.
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
metals_config.settings = {
serverVersion = "0.11.8+167-188f3c7c-SNAPSHOT",
showImplicitArguments = true,
showInferredType = true,
superMethodLensesEnabled = false
@ -23,7 +30,7 @@ vim.api.nvim_create_autocmd('FileType', {
-- status bar somehow."
metals_config.init_options.statusBarProvider = 'on'
metals_config.capabilities = require('cmp_nvim_lsp').default_capabilities()
metals_config.capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
require('metals').initialize_or_attach(metals_config)
end,
group = nvim_metals_group,

View file

@ -0,0 +1,4 @@
require('telescope').setup()
-- This is required to use FZF with Telescope.
require('telescope').load_extension('fzf')

View file

@ -2,8 +2,7 @@ require'nvim-treesitter.configs'.setup {
-- One of "all", "maintained", or a list of languages
ensure_installed = {
"c", "zig", "bash", "scala", "yaml", "css", "javascript",
"latex", "clojure", "lua", "cpp", "hcl", "json", "ocaml", "toml",
"rust", "sql", "python", "gitcommit", "gitignore", "html"
"latex", "clojure", "lua", "cpp"
},
-- Install languages synchronously (only applied to `ensure_installed`)

View file

@ -1,192 +0,0 @@
[colors]
background = #1d2021
background-alt = #504945
foreground = #ebdbb2
foreground-alt = #555
primary = #fabd2f
secondary = #e60053
alert = #fb4934
[bar/mainbar]
monitor = HDMI-0
bottom = true
width = 100%
height = 32
;offset-x = 1%
;offset-y = 1%
;radius = 6.0
radius = 0.0
fixed-center = false
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
;border-size = 4
border-size = 0
border-color = #000000
padding-left = 4
padding-right = 4
module-margin-left = 1
module-margin-right = 3
font-0 = Iosevka Nerd Font Mono:pixelsize=11;1
font-1 = unifont:fontformat=truetype:size=11:antialias=false;0
font-2 = fixed:pixelsize=11;1
modules-left = i3
modules-center =
modules-right = eth pulseaudio filesystem memory cpu date
tray-position = center
tray-padding = 2
override-redirect = false
cursor-click = pointer
cursor-scroll = ns-resize
[module/xwindow]
type = internal/xwindow
label = %title:0:30:...%
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
label-mounted = %{F#83a598}DISK%{F-}: %percentage_used%%
label-mounted-underline = #d79921
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.foreground}
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
; Only show workspaces on the same output as the bar
;pin-workspaces = true
label-mode-padding = 2
label-mode-foreground = #000
label-mode-background = ${colors.primary}
; focused = Active workspace on focused monitor
label-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2
; unfocused = Inactive workspace on any monitor
label-unfocused = %index%
label-unfocused-padding = 2
; visible = Active workspace on unfocused monitor
label-visible = %index%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}
; urgent = Workspace with urgency hint set
label-urgent = %index%
label-urgent-background = ${colors.alert}
label-urgent-padding = 2
; Separator in between workspaces
label-separator = |
[module/cpu]
type = internal/cpu
interval = 3
format-prefix = "CPU "
format-prefix-foreground = ${colors.foreground}
format-underline = #d65d0e
label = %percentage:2%%
[module/memory]
type = internal/memory
interval = 3
format-prefix = "MEM "
format-prefix-foreground = ${colors.foreground}
format-underline = #458588
label = %percentage_used%%
[module/eth]
type = internal/network
interface = enp7s0
interval = 5.0
format-connected-underline = #98971a
;format-connected-prefix = "🗲 "
format-connected-prefix-foreground = ${colors.foreground}
label-connected = %ifname% %local_ip%
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
[module/date]
type = internal/date
interval = 5
date = " %Y-%m-%d%"
date-alt = " %Y-%m-%d"
time = %I:%M
time-alt = %I:%M:%S
format-prefix = ""
format-prefix-foreground = ${colors.foreground}
format-underline = #d3869b
label = %date% %time%
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <label-volume> <bar-volume>
label-volume = VOL %percentage%%
label-volume-foreground = ${root.foreground}
label-muted = 🔇 muted
label-muted-foreground = #666
bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 3
bar-volume-fill =
bar-volume-fill-font = 3
bar-volume-empty =
bar-volume-empty-font = 3
bar-volume-empty-foreground = ${colors.foreground}
[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
;pseudo-transparency = false
[global/wm]
margin-top = 5
margin-bottom = 5
; vim:ft=dosini

View file

@ -1,6 +0,0 @@
#!/usr/bin/env bash
killall -q polybar
echo "---" >> "$HOME/.local/log/$(whoami)/polybar.log"
polybar mainbar >> "$HOME/.local/log/$(whoami)/polybar.log" 2>&1 & disown

View file

@ -1,119 +0,0 @@
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
# Inserts a blank line between shell prompts
add_newline = true
[character]
success_symbol = "[➜](bold #b5bd68)"
[time]
disabled = false
format = '[\[ $time \]]($style) '
style = "bold #b5bd68"
[directory]
read_only = " "
style = "bold white"
[git_branch]
symbol = " "
style = "bold #b294bb"
[rust]
symbol = " "
[lua]
symbol = " "
[nix_shell]
symbol = " "
[nodejs]
symbol = " "
[package]
symbol = " "
[python]
symbol = " "
[aws]
symbol = " "
disabled = true
[buf]
symbol = " "
disabled = true
[c]
symbol = " "
disabled = true
[conda]
symbol = " "
disabled = true
[dart]
symbol = " "
disabled = true
[docker_context]
symbol = " "
disabled = true
[elixir]
symbol = " "
disabled = true
[elm]
symbol = " "
disabled = true
[golang]
symbol = " "
disabled = true
[haskell]
symbol = " "
disabled = true
[hg_branch]
symbol = " "
disabled = true
[java]
symbol = " "
disabled = true
[julia]
symbol = " "
disabled = true
[memory_usage]
symbol = " "
disabled = true
[meson]
symbol = "喝 "
disabled = true
[nim]
symbol = " "
disabled = true
[rlang]
symbol = "ﳒ "
disabled = true
[ruby]
symbol = " "
disabled = true
[scala]
symbol = " "
disabled = true
[spack]
symbol = "🅢 "
disabled = true

View file

@ -1,7 +1,6 @@
[user]
email = pfm@garrity.co
name = Pat Garrity
signingkey = AB7F3A76
email = pgfm@meager.io
name = pfm
[alias]
ll = log --oneline --decorate --graph
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
@ -31,5 +30,3 @@
navigate = true
[init]
defaultBranch = main
[commit]
gpgsign = true

3
.gitignore vendored
View file

@ -2,4 +2,5 @@ metals.sbt
.bsp/
.bloop/
.metals/
jsconfig.json
zig-cache/
zig-out/

View file

@ -0,0 +1,6 @@
" === JSON Support === {{
" Properly handle comments in JSON.
autocmd FileType json syntax match Comment +\/\/.\+$+
" }}

View file

@ -0,0 +1,9 @@
" === Tex / LaTeX Support === {{
" Default tex flavor to use if not detected.
let g:tex_flavor = "latex"
" Zathura is a minimal PDF viewer with Vim bindings.
let g:vimtex_view_method = 'zathura'
" }}

View file

@ -0,0 +1,12 @@
lua << EOF
require('lint').linters_by_ft = {
html = {'tidy',},
markdown = {'vale',},
sh = {'shellcheck',},
vim = {'vint',},
yaml = {'yamllint'},
}
EOF
" Run linting after buffer write
au BufWritePost <buffer> lua require('lint').try_lint()

View file

@ -0,0 +1,5 @@
lua << EOF
require'nvim-web-devicons'.setup {
default = true;
}
EOF

View file

@ -0,0 +1,14 @@
lua << EOF
local actions = require("telescope.actions")
local trouble = require("trouble.providers.telescope")
require('telescope').setup {
defaults = {
mappings = {
i = { ["<c-t>"] = trouble.open_with_trouble },
n = { ["<c-t>"] = trouble.open_with_trouble },
},
},
}
require('telescope').load_extension('fzf')
EOF

View file

@ -0,0 +1,5 @@
lua << EOF
require("trouble").setup {
-- empty = default settings
}
EOF

View file

@ -0,0 +1,2 @@
" Let other signs (e.g. linter errors) take precedence over gitgutter
let g:gitgutter_sign_allow_clobber = 0

View file

@ -0,0 +1,34 @@
" If the format cannot be determined, use this.
let g:tex_flavor = 'latex'
let g:vimtex_view_method = 'zathura'
let g:vimtex_compiler_latexmk = {
\ 'executable' : 'latexmk',
\ 'options' : [
\ '-xelatex',
\ '-file-line-error',
\ '-synctex=1',
\ '-interaction=nonstopmode',
\ ],
\}
"let g:vimtex_compiler_latexmk = {
" \ 'backend' : 'nvim',
" \ 'background' : 1,
" \ 'build_dir' : '',
" \ 'callback' : 1,
" \ 'continuous' : 1,
" \ 'executable' : 'latexmk',
" \ 'hooks' : [],
" \ 'options' : [
" \ '-xelatex',
" \ '-verbose',
" \ '-file-line-error',
" \ '-synctex=1',
" \ '-interaction=nonstopmode',
" \ ],
" \}
"let g:vimtex_compiler_latexmk_engines = {
" \ '_' : '-xelatex',
" \}

28
.startup/ps1 Normal file
View file

@ -0,0 +1,28 @@
# Determine whether or not we should support color.
case "$TERM" in
xterm-color|*-256color|rxvt-unicode) color_prompt=yes;;
esac
# Emit the current date and time.
__prompt_date() {
echo "$(date '+%D %r')"
}
# Define a function that extracts the current git branch, if available.
__git_branch() {
ref="$(git symbolic-ref HEAD 2>/dev/null | cut -d'/' -f3)"
if [ ! -z $ref ]; then
echo " $ref"
else
echo ""
fi
}
# Assign the prompt.
if [ "$color_prompt" = yes ]; then
PS1='\[\033[01;32m\]\u:\[\033[01;34m\]\w\[\033[00m\]\[\033[01;31m\]$(__git_branch)\[\033[00m\] $(__prompt_date)\n\$ '
else
PS1='\u:\w$(__git_branch) $(__prompt_date)\n\$ '
fi
unset color_prompt

22
.startup/start-ssh-agent Normal file
View file

@ -0,0 +1,22 @@
# Start ssh-agent if it is not already running. If it is running, ensure the
# environment variables are set properly.
# This is intended for sourcing within some startup file like .bashrc or .zshrc
sock_file="$HOME/.ssh-agent-sock"
pid_file="$HOME/.ssh-agent-pid"
touch $sock_file
touch $pid_file
if ps -p $(cat $pid_file) > /dev/null 2>&1; then
export SSH_AUTH_SOCK="$(cat $sock_file)"
export SSH_AGENT_PID="$(cat $pid_file)"
else
# Start a new instance of the SSH agent.
eval "$(ssh-agent)"
# Record the new settings in the agent tracking files.
echo $SSH_AUTH_SOCK > $sock_file
echo $SSH_AGENT_PID > $pid_file
fi

118
.zshrc
View file

@ -1,19 +1,37 @@
export HISTFILE="$HOME/.zsh_history"
export HISTSIZE=1000
export SAVEHIST=5000
export ZSH="$HOME/.oh-my-zsh"
local_install_dir="$HOME/.local/install"
ZSH_THEME="spaceship"
SPACESHIP_TIME_SHOW=true
SPACESHIP_TIME_FORMAT="%D{%D %r}"
SPACESHIP_HG_SHOW=false
SPACESHIP_HG_BRANCH_SHOW=false
SPACESHIP_HG_STATUS_SHOW=false
SPACESHIP_XCODE_SHOW_LOCAL=false
SPACESHIP_SWIFT_SHOW_LOCAL=false
SPACESHIP_PHP_SHOW=false
SPACESHIP_AWS_SHOW=false
SPACESHIP_GCLOUD_SHOW=false
SPACESHIP_CONDA_SHOW=false
SPACESHIP_DOTNET_SHOW=false
SPACESHIP_EMBER_SHOW=false
SPACESHIP_BATTERY_SHOW=false
# =============================================================================
# GPG Initialization (Ensure prompts work properly).
# =============================================================================
export GPG_TTY=$(tty)
VI_MODE_RESET_PROMPT_ON_MODE_CHANGE=true
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
DISABLE_UNTRACKED_FILES_DIRTY="true"
plugins=(gitfast vi-mode)
source $ZSH/oh-my-zsh.sh
# =============================================================================
# Personalized Logging for Shell Setup
# =============================================================================
logging_enabled=false
log_dir="$HOME/.local/log/$USER"
log_dir="$HOME/log/$USER"
log_file="$log_dir/shell.log"
if [ -d "$log_dir" ]; then
@ -25,25 +43,38 @@ fi
# =============================================================================
# Common Environment Configuration
# =============================================================================
# Note: use vim here so that if Neovim isn't setup, we gracefully fall back.
export EDITOR=vim
export EDITOR=nvim
# =============================================================================
# PATH
# =============================================================================
if [ -d "$HOME/bin" ]; then
export PATH="$HOME/bin:$PATH"
fi
if [ -d "$HOME/.local/bin" ]; then
export PATH="$HOME/.local/bin:$PATH"
fi
if [ -d "$HOME/.cargo/bin" ]; then
export PATH="$HOME/.cargo/bin:$PATH"
if [ -f "$HOME/.cargo/env" ]; then
source "$HOME/.cargo/env"
fi
if [ -f ~/.fzf.zsh ]; then
source ~/.fzf.zsh
fi
export JAVA_HOME="$local_install_dir/jdk"
export RACKET_HOME="$HOME/opt/racket"
if [ -d "$RACKET_HOME" ]; then
export PATH="$RACKET_HOME/bin:$PATH"
fi
export BUILDKIT_HOME="$HOME/opt/buildkit"
if [ -d "$BUILDKIT_HOME" ]; then
export PATH="$HOME/opt/buildkit/bin:$PATH"
fi
export JAVA_HOME="$HOME/opt/jdk"
if [ -d "$JAVA_HOME/bin" ]; then
export PATH="$JAVA_HOME/bin:$PATH"
fi
@ -53,7 +84,7 @@ if [ -d "$COURSIER_HOME/bin" ]; then
export PATH="$COURSIER_HOME/bin:$PATH"
fi
export N_PREFIX="$HOME/.n"
export N_PREFIX=/home/pfm/.n
if [ -d "$N_PREFIX/bin" ]; then
export PATH="$N_PREFIX/bin:$PATH"
fi
@ -61,25 +92,15 @@ fi
# =============================================================================
# SSH Agent Management
# =============================================================================
# Start ssh-agent if it is not already running. If it is running, ensure the
# environment variables are set properly.
ssh_agent_sock_file="$HOME/.ssh-agent-sock"
ssh_agent_pid_file="$HOME/.ssh-agent-pid"
touch $ssh_agent_sock_file
touch $ssh_agent_pid_file
if ps -p $(cat $ssh_agent_pid_file) > /dev/null 2>&1; then
export SSH_AUTH_SOCK="$(cat $ssh_agent_sock_file)"
export SSH_AGENT_PID="$(cat $ssh_agent_pid_file)"
ssh_agent_startup_file="$HOME/.startup/start-ssh-agent"
if [ -f "$ssh_agent_startup_file" ]; then
source "$ssh_agent_startup_file"
else
# Start a new instance of the SSH agent.
eval "$(ssh-agent)"
# Record the new settings in the agent tracking files.
echo $SSH_AUTH_SOCK > $ssh_agent_sock_file
echo $SSH_AGENT_PID > $ssh_agent_pid_file
if $logging_enabled; then
echo "[warn] SSH Agent startup code missing at " \
"'$ssh_agent_startup_file': " \
"see git@git.sr.ht:~eidolon/scripts" >> "$log_file"
fi
fi
# =============================================================================
@ -102,16 +123,6 @@ else
fi
fi
if command -v podman > /dev/null 2>&1; then
alias docker='podman'
export DOCKER_HOST=unix:///run/podman/podman.sock
export TESTCONTAINERS_RYUK_DISABLED=true
else
if $logging_enabled; then
echo "[warn] Podman is not setup! The 'docker' command will not be available." >> "$log_file"
fi
fi
# =============================================================================
# Scala/SBT Setup
# =============================================================================
@ -119,27 +130,8 @@ if command -v sbt > /dev/null 2>&1; then
export SBT_OPTS="-XX:+UseG1GC -Xmx2048m"
fi
# =============================================================================
# Git Command Completion
# =============================================================================
zstyle ':completion:*:*:git:*' script ~/.zsh/git-completion.bash
fpath=(~/.zsh $fpath)
autoload -Uz compinit && compinit
# =============================================================================
# OPAM Completion
# =============================================================================
[[ ! -r /home/pfm/.opam/opam-init/init.zsh ]] || source /home/pfm/.opam/opam-init/init.zsh > /dev/null 2> /dev/null
# =============================================================================
# Initialize Starship
# =============================================================================
eval "$(starship init zsh)"
# =============================================================================
# Enable Command Syntax Highlighting
# This must be the last item in this file.
# =============================================================================
source $local_install_dir/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $HOME/src/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

View file

@ -14,3 +14,9 @@ $ cd dotfiles
$ ./setup-directories.sh
$ ./install.sh --auto-backup
```
## Documentation
- [Fonts](docs/fonts.md): Fonts that I use regularly.
- [Utilities](docs/utilities.md): List of utilities I use.
- [Programming](docs/programming.md): List of programming languages/tools I use.

11
docs/fonts.md Normal file
View file

@ -0,0 +1,11 @@
# Fonts
## [Iosevka](https://github.com/be5invis/Iosevka/releases)
This is my default font for all terminals and editors.
Use [my scripts](utilities.md#my-scripts):
```bash
$ update-iosevka <version>
```

84
docs/programming.md Normal file
View file

@ -0,0 +1,84 @@
# Programming
The following are relevant for my current projects:
- [OpenJDK](#openjdk)
- [SBT](#sbt)
- [coursier](#coursier)
- [Scala REPL](#scala-repl)
- [zig](#zig)
- [`x86_64`](#x86-64)
- [`arm64`](#arm64)
- [janet](#janet)
- [racket](#racket)
- [`runc` and `containerd`](#runc-and-containerd)
- [buildkit](#buildkit)
## [OpenJDK](https://openjdk.java.net/)
Download the LTS release from [Adoptium](https://adoptium.net/).
## [SBT](https://www.scala-sbt.org/)
Use [my scripts](utilities.md#my-scripts):
```bash
$ update-sbt <version>
```
## [coursier](https://get-coursier.io/)
Visit the website and run the provided script. Note that setup on ARM64 might
require additional work and the provided script might not work properly.
### [Scala REPL](https://www.scala-lang.org/)
```bash
cs install scala3
```
## [zig](https://ziglang.org/)
Use [my scripts](utilities.md#my-scripts):
### `x86_64`
```bash
$ update-zig --arch x86_64
```
### `arm64`
```bash
$ update-zig --arch aarch64
```
## [janet](https://janet-lang.org/)
Clone [https://github.com/janet-lang/janet](https://github.com/janet-lang/janet)
and build from source. Once installed and `janet` is available on the path,
clone [https://github.com/janet-lang/jpm](https://github.com/janet-lang/jpm) and
build from source.
## [racket](https://racket-lang.org/)
There are multiple options for installation. The easiest approach is to use the
system package manager:
```bash
$ sudo apt install racket
```
Alternatively, use the latest
[source distribution](http://download.racket-lang.org/) and build from source.
## `runc` and `containerd`
```bash
sudo apt install runc containerd
```
## [buildkit](https://github.com/moby/buildkit)
Download the latest release from GitHub:
[https://github.com/moby/buildkit/releases](https://github.com/moby/buildkit/releases)

81
docs/utilities.md Normal file
View file

@ -0,0 +1,81 @@
# Utilities
The following are tools I generally install and are actively using.
- [My Scripts](#my-scripts)
- [rxvt-unicode](#rxvt-unicode)
- [fzf](#fzf)
- [rustup](#rustup)
- [btm (bottom)](#btm-bottom)
- [delta](#delta)
- [exa](#exa)
- [fd](#fd)
- [rg (ripgrep)](#rg-ripgrep)
## My Scripts
These need to be pulled down and installed. This should be the first step.
```bash
$ git clone git@git.sr.ht:~eidolon/scripts
$ mkdir $HOME/bin
$ mkdir $HOME/.startup
$ cd scripts
$ ./install.sh
```
## rxvt-unicode
Clone [https://github.com/exg/rxvt-unicode](https://github.com/exg/rxvt-unicode)
and build from source. Note that the GitHub repository is a mirror of the CVS
repository.
## [fzf](https://github.com/junegunn/fzf)
First, clone the `fzf` repository:
```bash
$ git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
```
Then source the installation script:
```bash
$ source ~/.fzf/install
```
## [rustup](https://rustup.rs/)
Visit the website and run the provided script. While the tools I install via
Cargo are available elsewhere, I like having the Rust toolchain and being able
to pull from Cargo.
### [btm (bottom)](https://github.com/clementtsang/bottom)
```bash
$ cargo install bottom
```
### [delta](https://github.com/dandavison/delta)
```bash
$ cargo install git-delta
```
### [exa](https://github.com/ogham/exa)
```bash
$ cargo install exa
```
### [fd](https://github.com/sharkdp/fd)
```bash
$ cargo install fd-find
```
### [rg (ripgrep)](https://github.com/BurntSushi/ripgrep)
```bash
$ cargo install ripgrep
```

View file

@ -5,7 +5,7 @@ set -o pipefail
set -o nounset
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
backup_dir="$HOME/.local/backups/dotfiles"
backup_dir="$HOME/.dotfiles/backups"
# Colors for output. So fancy.
@ -24,12 +24,24 @@ config_selection="all"
# Dotfile locations. Note that these locations should be identical between the
# home directory and the dotfile directory.
bashrc=".bashrc"
bashrc_name="bashrc"
bashrc_source="${__dir}/${bashrc}"
bashrc_target="${HOME}/${bashrc}"
bashrc_backup="${backup_dir}/${bashrc_name}"
zshrc=".zshrc"
zshrc_name="zshrc"
zshrc_source="${__dir}/${zshrc}"
zshrc_target="${HOME}/${zshrc}"
zshrc_backup="${backup_dir}/${zshrc_name}"
ps1=".startup/ps1"
ps1_name="ps1"
ps1_source="${__dir}/${ps1}"
ps1_target="${HOME}/${ps1}"
ps1_backup="${backup_dir}/${ps1_name}"
profile=".profile"
profile_name="profile"
profile_source="${__dir}/${profile}"
@ -78,8 +90,14 @@ fontconfig_source="${__dir}/${fontconfig}"
fontconfig_target="${HOME}/${fontconfig}"
fontconfig_backup="${backup_dir}/${fontconfig_name}"
ssh_agent=".startup/start-ssh-agent"
ssh_agent_name="ssh_agent"
ssh_agent_source="${__dir}/${ssh_agent}"
ssh_agent_target="${HOME}/${ssh_agent}"
ssh_agent_backup="${backup_dir}/${ssh_agent_name}"
function display_configs {
echo 'Supported config targets: all, zshrc, profile, i3, i3status, xresources, gitconfig, gitignore, alacritty, fontconfig, nvim'
echo 'Supported config targets: all, bashrc, zshrc, ps1, profile, i3, i3status, xresources, gitconfig, gitignore, alacritty, fontconfig, ssh_agent, nvim'
}
function display_usage {
@ -213,8 +231,8 @@ done
# Ensure the backup directory exists (if backups are requested).
if $auto_backup; then
if [ ! -d "$backup_dir" ]; then
if eval mkdir "$backup_dir"; then
if [ ! -d $backup_dir ]; then
if `mkdir $backup_dir`; then
echo -e "${COLOR_NOTIFY}[Note]${NC} created '$backup_dir' to store dotfile backups."
else
echo -e "${COLOR_ERROR}[Error]${NC} Failed to create backup directory '$backup_dir'."
@ -223,7 +241,9 @@ if $auto_backup; then
fi
# Install all requested configurations.
install_config "${bashrc_name}" "${bashrc_source}" "${bashrc_target}" "${bashrc_backup}"
install_config "${zshrc_name}" "${zshrc_source}" "${zshrc_target}" "${zshrc_backup}"
install_config "${ps1_name}" "${ps1_source}" "${ps1_target}" "${ps1_backup}"
install_config "${profile_name}" "${profile_source}" "${profile_target}" "${profile_backup}"
install_config "${i3_name}" "${i3_source}" "${i3_target}" "${i3_backup}"
install_config "${i3status_name}" "${i3status_source}" "${i3status_target}" "${i3status_backup}"
@ -232,6 +252,7 @@ install_config "${gitignore_name}" "${gitignore_source}" "${gitignore_target}" "
install_config "${xresources_name}" "${xresources_source}" "${xresources_target}" "${xresources_backup}"
install_config "${alacritty_name}" "${alacritty_source}" "${alacritty_target}" "${alacritty_backup}"
install_config "${fontconfig_name}" "${fontconfig_source}" "${fontconfig_target}" "${fontconfig_backup}"
install_config "${ssh_agent_name}" "${ssh_agent_source}" "${ssh_agent_target}" "${ssh_agent_backup}"
# Note that all of these configurations are Neovim-related:
install_neovim

View file

@ -4,27 +4,18 @@ set -o errexit
set -o pipefail
set -o nounset
# Key locations
local_base="$HOME/.local"
config_base="$HOME/.config"
# User level directories.
mkdir -p "$local_base"
mkdir -p "$local_base/bin"
mkdir -p "$local_base/log"
mkdir -p "$local_base/log/$USER"
mkdir -p "$local_base/install"
# Location for source code.
mkdir -p "$HOME/src"
# Backups, used for dotfiles.
mkdir -p "$HOME/.local/backups/dotfiles"
# User level configuration.
mkdir -p "$config_base"
mkdir -p "$config_base/alacritty"
mkdir -p "$config_base/fontconfig"
mkdir -p "$config_base/i3"
mkdir -p "$config_base/i3status"
mkdir -p "$config_base/nvim"
mkdir $HOME/bin
mkdir $HOME/log
mkdir $HOME/log/$USER
mkdir $HOME/opt
mkdir $HOME/src
mkdir -p $HOME/.dotfiles/backups
mkdir -p $HOME/.config
mkdir -p $HOME/.config/alacritty
mkdir -p $HOME/.config/fontconfig
mkdir -p $HOME/.config/i3
mkdir -p $HOME/.config/i3status
mkdir -p $HOME/.config/nvim
mkdir -p $HOME/.startup
mkdir -p $HOME/.local/share/nvim/site/ftplugin
mkdir -p $HOME/.local/share/nvim/site/plugin