Initializing my dotfiles and some basic documentation and scripts.
This commit is contained in:
commit
4bc00f298b
11 changed files with 1110 additions and 0 deletions
21
README.md
Normal file
21
README.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
# dotfiles
|
||||
|
||||
These are my dotfiles and high-level information regarding my computer setup.
|
||||
It's largely built for me as the primary consumer and not as a general source
|
||||
for others. That being said, if you want to use them, go for it. I recommend
|
||||
reading the files as I try to include at least minimal documentation.
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
$ cd ~
|
||||
$ git clone git@git.sr.ht:~eidolon/dotfiles
|
||||
$ cd dotfiles
|
||||
$ ./setup-directories.sh
|
||||
$ ./install.sh --auto-backup
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
- [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
11
docs/fonts.md
Normal 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
84
docs/programming.md
Normal 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
81
docs/utilities.md
Normal 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
|
||||
```
|
32
git/gitconfig
Normal file
32
git/gitconfig
Normal file
|
@ -0,0 +1,32 @@
|
|||
[user]
|
||||
email = pgfm@meager.io
|
||||
name = pgfm
|
||||
[alias]
|
||||
ll = log --oneline --decorate --graph
|
||||
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
|
||||
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
|
||||
fl = log -u
|
||||
dl = "!git ll -1"
|
||||
la = "!git config -l | grep alias | cut -c 7-"
|
||||
lt = describe --tags --abbrev=0
|
||||
st = status -s
|
||||
[push]
|
||||
default = simple
|
||||
[credential]
|
||||
helper = cache --timeout=3600
|
||||
[pager]
|
||||
branch = false
|
||||
diff = delta
|
||||
log = delta
|
||||
reflog = delta
|
||||
show = delta
|
||||
[core]
|
||||
excludesFile = ~/.gitignore
|
||||
[interactive]
|
||||
diffFilter = delta --color-only
|
||||
[delta]
|
||||
features = side-by-side line-numbers
|
||||
syntax-theme = gruvbox-dark
|
||||
navigate = true
|
||||
[init]
|
||||
defaultBranch = main
|
183
i3/config
Normal file
183
i3/config
Normal file
|
@ -0,0 +1,183 @@
|
|||
# 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)
|
||||
#
|
||||
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
|
||||
|
||||
set $mod Mod4
|
||||
|
||||
# Font for window titles. Will also be used by the bar unless a different font
|
||||
# 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.
|
||||
|
||||
# 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.
|
||||
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
|
||||
|
||||
# NetworkManager is the most popular way to manage wireless networks on Linux,
|
||||
# and nm-applet is a desktop environment-independent system tray GUI for it.
|
||||
exec --no-startup-id nm-applet
|
||||
|
||||
# Use pactl to adjust volume in PulseAudio.
|
||||
set $refresh_i3status killall -SIGUSR1 i3status
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
|
||||
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
|
||||
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
|
||||
|
||||
# Use Mouse+$mod to drag floating windows to their wanted position
|
||||
floating_modifier $mod
|
||||
|
||||
# start a terminal
|
||||
bindsym $mod+Return exec primary-terminal
|
||||
|
||||
# kill focused window
|
||||
bindsym $mod+Shift+q kill
|
||||
|
||||
# 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
|
||||
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
|
||||
|
||||
# split in vertical orientation
|
||||
bindsym $mod+v split v
|
||||
|
||||
# enter fullscreen mode for the focused container
|
||||
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
|
||||
|
||||
# toggle tiling / floating
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
# change focus between tiling / floating windows
|
||||
bindsym $mod+space focus mode_toggle
|
||||
|
||||
# focus the parent container
|
||||
bindsym $mod+a focus parent
|
||||
|
||||
# focus the child container
|
||||
#bindsym $mod+d focus child
|
||||
|
||||
# Define names for default workspaces for which we configure key bindings later on.
|
||||
# We use variables to avoid repeating the names in multiple places.
|
||||
set $ws1 "1"
|
||||
set $ws2 "2"
|
||||
set $ws3 "3"
|
||||
set $ws4 "4"
|
||||
set $ws5 "5"
|
||||
set $ws6 "6"
|
||||
set $ws7 "7"
|
||||
set $ws8 "8"
|
||||
set $ws9 "9"
|
||||
set $ws10 "10"
|
||||
|
||||
# switch to workspace
|
||||
bindsym $mod+1 workspace number $ws1
|
||||
bindsym $mod+2 workspace number $ws2
|
||||
bindsym $mod+3 workspace number $ws3
|
||||
bindsym $mod+4 workspace number $ws4
|
||||
bindsym $mod+5 workspace number $ws5
|
||||
bindsym $mod+6 workspace number $ws6
|
||||
bindsym $mod+7 workspace number $ws7
|
||||
bindsym $mod+8 workspace number $ws8
|
||||
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 $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
|
||||
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||
bindsym $mod+Shift+r restart
|
||||
# exit i3 (logs you out of your X session)
|
||||
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
|
||||
|
||||
# resize window (you can also use the mouse for that)
|
||||
mode "resize" {
|
||||
# These bindings trigger as soon as you enter the resize mode
|
||||
|
||||
# Pressing left will shrink the window’s width.
|
||||
# Pressing right will grow the window’s width.
|
||||
# Pressing up will shrink the window’s height.
|
||||
# Pressing down will grow the window’s height.
|
||||
bindsym j resize shrink width 10 px or 10 ppt
|
||||
bindsym k resize grow height 10 px or 10 ppt
|
||||
bindsym l resize shrink height 10 px or 10 ppt
|
||||
bindsym semicolon resize grow width 10 px or 10 ppt
|
||||
|
||||
# same bindings, but for the arrow keys
|
||||
bindsym Left resize shrink width 10 px or 10 ppt
|
||||
bindsym Down resize grow height 10 px or 10 ppt
|
||||
bindsym Up resize shrink height 10 px or 10 ppt
|
||||
bindsym Right resize grow width 10 px or 10 ppt
|
||||
|
||||
# back to normal: Enter or Escape or $mod+r
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
bindsym $mod+r mode "default"
|
||||
}
|
||||
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
# Start i3bar to display a workspace bar (plus the system information i3status
|
||||
# finds out, if available)
|
||||
bar {
|
||||
status_command i3status
|
||||
}
|
208
install.sh
Executable file
208
install.sh
Executable file
|
@ -0,0 +1,208 @@
|
|||
#!/bin/bash
|
||||
|
||||
# The directory where this script lives - used as the base for finding all
|
||||
# of the configurations to be linked.
|
||||
src_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
# Colors for output
|
||||
COLOR_SUCCESS='\033[0;32m'
|
||||
COLOR_ERROR='\033[0;31m'
|
||||
COLOR_NOTIFY='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Default settings for this script
|
||||
auto_backup=false
|
||||
config_target="all"
|
||||
|
||||
# Installation sources
|
||||
bash_source="$src_dir/shell/bashrc"
|
||||
i3_source="$src_dir/i3/config"
|
||||
xresources_source="$src_dir/xresources/Xresources"
|
||||
neovim_source="$src_dir/neovim/init.vim"
|
||||
git_source="$src_dir/git/gitconfig"
|
||||
|
||||
# Installation targets (symlinks to be created)
|
||||
bash_target="$HOME/.bashrc"
|
||||
i3_target="$HOME/.config/i3/config"
|
||||
xresources_target="$HOME/.Xresources"
|
||||
neovim_target="$HOME/.config/nvim/init.vim"
|
||||
git_target="$HOME/.gitconfig"
|
||||
|
||||
# Backup names
|
||||
backup_dir="$HOME/.dotfiles/backups"
|
||||
bash_backup="$backup_dir/bashrc.backup"
|
||||
i3_backup="$backup_dir/i3.config.backup"
|
||||
xresources_backup="$backup_dir/Xresources.backup"
|
||||
neovim_backup="$backup_dir/neovim.init.vim.backup"
|
||||
git_backup="$backup_dir/global.git.backup"
|
||||
|
||||
function display_configs {
|
||||
echo 'Supported config targets: all, bash, i3, xresources, neovim, git'
|
||||
}
|
||||
|
||||
function display_usage {
|
||||
echo 'Usage: install.sh [-c|--config <target>] [-a|--auto-backup]'
|
||||
echo ' [-h|--help]'
|
||||
echo ''
|
||||
echo 'Install configurations.'
|
||||
echo ''
|
||||
echo ' -c|--config Describes what to install: Default=all'
|
||||
echo " $(display_configs)"
|
||||
echo ' -a|--auto-backup Automatically backup existing configs.'
|
||||
echo ' -h|--help Display this usage text.'
|
||||
echo ''
|
||||
echo 'Examples:'
|
||||
echo ''
|
||||
echo "./install.sh --target=all --auto-backup"
|
||||
}
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-c|--config)
|
||||
config_target="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-a|--auto-backup)
|
||||
auto_backup=true
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
display_usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unrecognized option: $1"
|
||||
display_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
case $config_target in
|
||||
all|bash|i3|xresources|neovim|git)
|
||||
;;
|
||||
*)
|
||||
echo "Unrecognized configuration target selected."
|
||||
display_configs
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Ensure the backup directory exists
|
||||
if $auto_backup; 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'."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install bashrc
|
||||
if [ "$config_target" = "all" ] || [ "$config_target" = "bash" ]; then
|
||||
echo -e "\t- Installing .bashrc to '$bash_target'"
|
||||
if [ -f $bash_target ]; then
|
||||
# The file exists - we either create a backup and remove it, or fail.
|
||||
if $auto_backup; then
|
||||
echo -e "\t ${COLOR_NOTIFY}[Note]${NC} creating a backup of '$bash_target'"
|
||||
cp $bash_target $bash_backup
|
||||
rm $bash_target
|
||||
ln -s $bash_source $bash_target
|
||||
else
|
||||
echo -e "\t ${COLOR_ERROR}[Error]${NC} File '$bash_target' already exists. Please manually remove it or set --auto-backup"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# The file doesn't exist, we can safely create a symlink.
|
||||
ln -s $bash_source $bash_target
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install i3 configuration
|
||||
if [ "$config_target" = "all" ] || [ "$config_target" = "i3" ]; then
|
||||
echo -e "\t- Installing i3 config to '$i3_target'"
|
||||
if [ -f $i3_target ]; then
|
||||
# The file exists - we either create a backup and remove it, or fail.
|
||||
if $auto_backup; then
|
||||
echo -e "\t ${COLOR_NOTIFY}[Note]${NC} creating a backup of '$i3_target'"
|
||||
cp $i3_target $i3_backup
|
||||
rm $i3_target
|
||||
ln -s $i3_source $i3_target
|
||||
else
|
||||
echo -e "\t ${COLOR_ERROR}[Error]${NC} File '$i3_target' already exists. Please manually remove it or set --auto-backup"
|
||||
echo "File '$i3_target' already exists. Please manually remove it or set --auto-backup"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# The file doesn't exist, we can safely create a symlink.
|
||||
ln -s $i3_source $i3_target
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install .Xresources
|
||||
if [ "$config_target" = "all" ] || [ "$config_target" = "xresources" ]; then
|
||||
echo -e "\t- Installing xresources config to '$xresources_target'"
|
||||
if [ -f $xresources_target ]; then
|
||||
# The file exists - we either create a backup and remove it, or fail.
|
||||
if $auto_backup; then
|
||||
echo -e "\t ${COLOR_NOTIFY}[Note]${NC} creating a backup of '$xresources_target'"
|
||||
cp $xresources_target $xresources_backup
|
||||
rm $xresources_target
|
||||
ln -s $xresources_source $xresources_target
|
||||
else
|
||||
echo -e "\t ${COLOR_ERROR}[Error]${NC} File '$xresources_target' already exists. Please manually remove it or set --auto-backup"
|
||||
echo "File '$xresources_target' already exists. Please manually remove it or set --auto-backup"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# The file doesn't exist, we can safely create a symlink.
|
||||
ln -s $xresources_source $xresources_target
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install neovim config
|
||||
if [ "$config_target" = "all" ] || [ "$config_target" = "neovim" ]; then
|
||||
echo -e "\t- Installing neovim config to '$neovim_target'"
|
||||
if [ -f $neovim_target ]; then
|
||||
# The file exists - we either create a backup and remove it, or fail.
|
||||
if $auto_backup; then
|
||||
echo -e "\t ${COLOR_NOTIFY}[Note]${NC} creating a backup of '$neovim_target'"
|
||||
cp $neovim_target $neovim_backup
|
||||
rm $neovim_target
|
||||
ln -s $neovim_source $neovim_target
|
||||
else
|
||||
echo -e "\t ${COLOR_ERROR}[Error]${NC} File '$neovim_target' already exists. Please manually remove it or set --auto-backup"
|
||||
echo "File '$neovim_target' already exists. Please manually remove it or set --auto-backup"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# The file doesn't exist, we can safely create a symlink.
|
||||
ln -s $neovim_source $neovim_target
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install git config
|
||||
if [ "$config_target" = "all" ] || [ "$config_target" = "git" ]; then
|
||||
echo -e "\t- Installing git config to '$git_target'"
|
||||
if [ -f $git_target ]; then
|
||||
# The file exists - we either create a backup and remove it, or fail.
|
||||
if $auto_backup; then
|
||||
echo -e "\t ${COLOR_NOTIFY}[Note]${NC} creating a backup of '$git_target'"
|
||||
cp $git_target $git_backup
|
||||
rm $git_target
|
||||
ln -s $git_source $git_target
|
||||
else
|
||||
echo -e "\t ${COLOR_ERROR}[Error]${NC} File '$git_target' already exists. Please manually remove it or set --auto-backup"
|
||||
echo "File '$git_target' already exists. Please manually remove it or set --auto-backup"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# The file doesn't exist, we can safely create a symlink.
|
||||
ln -s $git_source $git_target
|
||||
fi
|
||||
fi
|
319
neovim/init.vim
Normal file
319
neovim/init.vim
Normal file
|
@ -0,0 +1,319 @@
|
|||
call plug#begin('~/.local/share/nvim/plugged')
|
||||
|
||||
" =============================================================================
|
||||
" Key usability plugins
|
||||
" =============================================================================
|
||||
|
||||
" FZF Fuzzy Search
|
||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf' }
|
||||
Plug 'junegunn/fzf.vim'
|
||||
|
||||
" Floating terminal support for Neovim
|
||||
Plug 'voldikss/vim-floaterm'
|
||||
|
||||
" Neovim LSP
|
||||
Plug 'neovim/nvim-lspconfig'
|
||||
|
||||
" Treesitter
|
||||
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
||||
|
||||
" Plenary - lua components used by other plugins
|
||||
Plug 'nvim-lua/plenary.nvim'
|
||||
|
||||
" Completion
|
||||
Plug 'hrsh7th/cmp-nvim-lsp' " Builtin LSP as a completion source
|
||||
Plug 'hrsh7th/cmp-path' " Support for path as a completion source
|
||||
Plug 'hrsh7th/cmp-buffer' " Support for loaded buffers as completion source
|
||||
Plug 'hrsh7th/nvim-cmp' " Primary plugin
|
||||
|
||||
" =============================================================================
|
||||
" Languages and project type support.
|
||||
" =============================================================================
|
||||
|
||||
" Janet Support
|
||||
Plug 'janet-lang/janet.vim', { 'for': ['janet'] }
|
||||
|
||||
" Racket Support
|
||||
Plug 'wlangstroth/vim-racket', { 'for': ['rkt'] }
|
||||
|
||||
" Generalized support for LISPs (Clojure, Racket, Janet)
|
||||
Plug 'Olical/conjure', { 'tag': 'v4.25.0', 'for': ['janet'] }
|
||||
|
||||
" Zig Support
|
||||
Plug 'ziglang/zig.vim', { 'for': ['zig'] }
|
||||
|
||||
" Scala Support
|
||||
" Note: Metals should not be configured with the other LSP items.
|
||||
Plug 'scalameta/nvim-metals', { 'for': ['scala', 'sbt'] }
|
||||
|
||||
" =============================================================================
|
||||
" Visual enhancements
|
||||
" =============================================================================
|
||||
|
||||
Plug 'sainnhe/gruvbox-material'
|
||||
" Plug 'rebelot/kanagawa.nvim'
|
||||
|
||||
call plug#end()
|
||||
|
||||
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
filetype plugin indent on
|
||||
syntax on
|
||||
let mapleader=","
|
||||
let maplocalleader=","
|
||||
|
||||
" === Color Scheme === {{
|
||||
set termguicolors
|
||||
set background=dark
|
||||
let g:gruvbox_material_palette = 'mix'
|
||||
let g:gruvbox_material_background = 'hard'
|
||||
let g:gruvbox_material_enable_bold = 1
|
||||
colorscheme gruvbox-material
|
||||
"colorscheme kanagawa
|
||||
|
||||
" === History and Undo Levels === {{
|
||||
set history=512
|
||||
set undolevels=128
|
||||
set undofile
|
||||
set undodir=~/.config/nvim/undo
|
||||
" }}
|
||||
|
||||
" === Assorted Core Settings === {{
|
||||
set noswapfile
|
||||
set nocompatible
|
||||
set modelines=0
|
||||
set hidden " Hide buffers
|
||||
set encoding=utf-8 " Always use UTF-8 explicitly
|
||||
set number " Show line numbers by default
|
||||
set cursorline " Highlight the current line
|
||||
set showcmd " Display incomplete commands at the bottom
|
||||
set noerrorbells " ... we just don't like beeping
|
||||
set visualbell " Flash rather than beep
|
||||
set t_vb= " Don't flash please
|
||||
set ttyfast " Some optimizations for rendering
|
||||
set ruler " Show row and column number
|
||||
set laststatus=2 " Last window has a status line
|
||||
set showmatch " Show matching parens
|
||||
set lazyredraw " redraw only when necessary, hopefully more efficient.
|
||||
set pastetoggle=<F2> " Cheap way to paste toggle
|
||||
set colorcolumn=80 " Right margin display
|
||||
set shortmess-=F " Ensure audocmd works for filetype
|
||||
set shortmess+=c " Avoid showing extra message when using completion
|
||||
set spelllang=en_us
|
||||
" }}
|
||||
|
||||
" === Basic Completion Settings === {{
|
||||
" menu = use a popup menu to show possible completions
|
||||
" menuone = show a menu even if there is only one match
|
||||
" noinsert = do not insert text for a match until user selects one
|
||||
" noselect = do not select a match from the menu automatically
|
||||
set completeopt=menu,menuone,noinsert,noselect
|
||||
" }}
|
||||
|
||||
" === Indentation === {{
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set softtabstop=4
|
||||
set expandtab
|
||||
set smarttab
|
||||
set autoindent
|
||||
" }}
|
||||
|
||||
" === Search Settings === {{
|
||||
set ignorecase
|
||||
set smartcase
|
||||
set incsearch
|
||||
set showmatch
|
||||
set hlsearch
|
||||
" }}
|
||||
|
||||
" === General Ignores === {{
|
||||
set wildignore=*.class,*.pyc,*.swp,*.o,*.jar
|
||||
set wildignore+=*/tmp/*,*.zip,*.tar,*.gz,*.bz2,*.xz
|
||||
set wildignore+=*/.git/*
|
||||
set wildignore+=*/.metals/*,*/.bloop/*,*/.bsp/*
|
||||
set wildignore+=*/node_modules/*
|
||||
" }}
|
||||
|
||||
" === FZF Configuration === {{
|
||||
let $FZF_DEFAULT_COMMAND='rg --files --no-messages "" .'
|
||||
" }}
|
||||
|
||||
" === Key Mappings === {{
|
||||
|
||||
" Use Tab and Shift+Tab to navigate popup menus
|
||||
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
||||
|
||||
" Clear search highlighting
|
||||
nmap <silent> <leader>/ :nohlsearch<CR>
|
||||
|
||||
" Save current buffer
|
||||
nnoremap <leader>s :up<cr>
|
||||
|
||||
" Move to previous buffer
|
||||
nnoremap <leader>bp :bp<cr>
|
||||
|
||||
" Move to next buffer
|
||||
nnoremap <leader>bn :bn<cr>
|
||||
|
||||
" Delete current buffer
|
||||
nnoremap <leader>bd :bd<cr>
|
||||
|
||||
" Press ; to show a list of active buffers (+ fuzzy search)
|
||||
nmap ; :Buffers<CR>
|
||||
|
||||
" Press Ctrl+P to show a list of files (+ fuzzy search)
|
||||
nmap <C-p> :Files<CR>
|
||||
|
||||
" Press <leader> + f to use ripgrep for search
|
||||
nmap <leader>f :Rg<space>
|
||||
|
||||
" LSP key bindings
|
||||
nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
|
||||
nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
|
||||
nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>
|
||||
nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
|
||||
nnoremap <silent> gds <cmd>lua vim.lsp.buf.document_symbol()<CR>
|
||||
nnoremap <silent> gws <cmd>lua vim.lsp.buf.workspace_symbol()<CR>
|
||||
nnoremap <silent> <leader>D <cmd>lua vim.lsp.buf.type_definition()<CR>
|
||||
nnoremap <silent> <leader>rn <cmd>lua vim.lsp.buf.rename()<CR>
|
||||
nnoremap <silent> <leader>ca <cmd>lua vim.lsp.buf.code_action()<CR>
|
||||
nnoremap <silent> <leader>q <cmd>lua vim.lsp.diagnostic.set_loclist()<CR>
|
||||
nnoremap <silent> <leader>e <cmd>lua vim.lsp.diagnostic.open_float()<CR>
|
||||
nnoremap <silent> [c <cmd>lua vim.lsp.diagnostic.goto_prev { wrap = false }<CR>
|
||||
nnoremap <silent> ]c <cmd>lua vim.lsp.diagnostic.goto_next { wrap = false }<CR>
|
||||
|
||||
" Window movement
|
||||
map <C-j> <C-w>j
|
||||
map <C-k> <C-w>k
|
||||
map <C-h> <C-w>h
|
||||
map <C-l> <C-w>l
|
||||
" }}
|
||||
|
||||
" === JSON Support === {{
|
||||
|
||||
" Properly handle comments in JSON.
|
||||
autocmd FileType json syntax match Comment +\/\/.\+$+
|
||||
|
||||
" }}
|
||||
|
||||
" === netrw === {{
|
||||
let g:netrw_banner = 0
|
||||
let g:netrw_liststyle = 3
|
||||
let g:netrw_browse_split = 4
|
||||
let g:netrw_altv = 1
|
||||
let g:netrw_winsize = 25
|
||||
" }}
|
||||
|
||||
" === floaterm Configuration === {{
|
||||
let g:floaterm_keymap_new = '<leader>tc'
|
||||
let g:floaterm_keymap_prev = '<leader>tp'
|
||||
let g:floaterm_keymap_next = '<leader>tn'
|
||||
let g:floaterm_keymap_toggle = '<leader>tt'
|
||||
let g:floaterm_width = 0.8
|
||||
let g:floaterm_height = 0.8
|
||||
let g:floaterm_gitcommit = 'split'
|
||||
" }}
|
||||
|
||||
" === nvim-cmp Configuration (Completion Plugin) === {{
|
||||
lua << EOF
|
||||
local cmp = require("cmp")
|
||||
cmp.setup({
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "path" },
|
||||
{ name = 'buffer', option = { keyword_length = 3 }, },
|
||||
},
|
||||
mapping = {
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<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,
|
||||
},
|
||||
})
|
||||
EOF
|
||||
" }}
|
||||
|
||||
" === LSP Configuration === {{
|
||||
lua << EOF
|
||||
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
|
||||
|
||||
-- advertise the nvim-cmp capabilities to LSP servers
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
|
||||
|
||||
lsp.zls.setup {
|
||||
on_attach = on_attach,
|
||||
flags = {
|
||||
debounce_text_changes = 150
|
||||
},
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- Note that metals is totally separate
|
||||
-- It's also absurdly slow on a Raspberry Pi, it's only viable for somewhat
|
||||
-- powerful machines (as is Scala dev in general).
|
||||
metals_config = require("metals").bare_config()
|
||||
|
||||
metals_config.settings = {
|
||||
showImplicitArguments = true,
|
||||
serverVersion = "0.10.9+255-c4955009-SNAPSHOT",
|
||||
}
|
||||
|
||||
metals_config.capabilities = capabilities
|
||||
|
||||
vim.cmd([[augroup lsp]])
|
||||
vim.cmd([[autocmd!]])
|
||||
vim.cmd([[autocmd FileType scala setlocal omnifunc=v:lua.vim.lsp.omnifunc]])
|
||||
vim.cmd([[autocmd FileType java,scala,sbt lua require("metals").initialize_or_attach(metals_config)]])
|
||||
vim.cmd([[augroup end]])
|
||||
EOF
|
||||
" }}
|
||||
|
||||
" === Treesitter Configuration === {{
|
||||
lua <<EOF
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
-- One of "all", "maintained", or a list of languages
|
||||
ensure_installed = { "c", "zig", "bash", "scala" },
|
||||
|
||||
-- Install languages synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- List of parsers to ignore installing
|
||||
ignore_install = { },
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same
|
||||
-- time. Set this to `true` if you depend on 'syntax' being enabled (like
|
||||
-- for indentation). Using this option may slow down your editor, and you
|
||||
-- may see some duplicate highlights. Instead of true it can also be a list
|
||||
-- of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
|
||||
indent = {
|
||||
enable = true
|
||||
}
|
||||
}
|
||||
EOF
|
||||
" }}
|
10
setup-directories.sh
Executable file
10
setup-directories.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir $HOME/.startup
|
||||
mkdir $HOME/bin
|
||||
mkdir $HOME/log
|
||||
mkdir $HOME/log/$USER
|
||||
mkdir $HOME/opt
|
||||
mkdir $HOME/src
|
||||
mkdir $HOME/.dotfiles
|
||||
mkdir $HOME/.dotfiles/backups
|
114
shell/bashrc
Normal file
114
shell/bashrc
Normal file
|
@ -0,0 +1,114 @@
|
|||
# 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
|
||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||
|
||||
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
|
||||
|
||||
# =============================================================================
|
||||
# PATH
|
||||
# =============================================================================
|
||||
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=$PATH:$RACKET_HOME/bin
|
||||
fi
|
||||
|
||||
export BUILDKIT_HOME="$HOME/opt/buildkit"
|
||||
if [ -d "$BUILDKIT_HOME" ]; then
|
||||
export PATH=$PATH:$HOME/opt/buildkit/bin
|
||||
fi
|
||||
|
||||
export JAVA_HOME="$HOME/opt/jdk"
|
||||
if [ -d "$JAVA_HOME" ]; then
|
||||
export PATH=$PATH:$JAVA_HOME/bin
|
||||
fi
|
||||
|
||||
export COURSIER_HOME="$HOME/.local/share/coursier"
|
||||
if [ -d "$COURSIER_HOME" ]; then
|
||||
export PATH="$PATH:$COURSIER_HOME/bin"
|
||||
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 [ `which exa` ]; then
|
||||
alias ls='exa'
|
||||
else
|
||||
if logging_enabled; then
|
||||
echo "[warn] exa is not setup! Using the system ls" >> $log_file
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ `which nvim` ]; then
|
||||
alias vim='nvim'
|
||||
else
|
||||
if logging_enabled; then
|
||||
echo "[warn] Neovim is not setup! Using the system vim" >> $log_file
|
||||
fi
|
||||
fi
|
47
xresources/Xresources
Normal file
47
xresources/Xresources
Normal file
|
@ -0,0 +1,47 @@
|
|||
*.font: xft:Iosevka Term:style=Regular:size=13
|
||||
*.boldFont: xft:Iosevka Term:style=Bold:size=13
|
||||
*.italicFont: xft:Iosevka Term:style=Italic:size=13
|
||||
*.boldItalicFont: xft:Iosevka Term:style=Bold Italic:size=13
|
||||
|
||||
! Colors
|
||||
! hard contrast: *background: #1d2021
|
||||
!*background: #282828
|
||||
*background: #1d2021
|
||||
! soft contrast: *background: #32302f
|
||||
*foreground: #ebdbb2
|
||||
! Black + DarkGrey
|
||||
*color0: #282828
|
||||
*color8: #928374
|
||||
! DarkRed + Red
|
||||
*color1: #cc241d
|
||||
*color9: #fb4934
|
||||
! DarkGreen + Green
|
||||
*color2: #98971a
|
||||
*color10: #b8bb26
|
||||
! DarkYellow + Yellow
|
||||
*color3: #d79921
|
||||
*color11: #fabd2f
|
||||
! DarkBlue + Blue
|
||||
*color4: #458588
|
||||
*color12: #83a598
|
||||
! DarkMagenta + Magenta
|
||||
*color5: #b16286
|
||||
*color13: #d3869b
|
||||
! DarkCyan + Cyan
|
||||
*color6: #689d6a
|
||||
*color14: #8ec07c
|
||||
! LightGrey + White
|
||||
*color7: #a89984
|
||||
*color15: #ebdbb2
|
||||
|
||||
URxvt.letterSpace: 0
|
||||
URxvt.lineSpace: 0
|
||||
!URxvt.internalBorder: 24
|
||||
URxvt.cursorBlink: true
|
||||
URxvt.cursorUnderline: false
|
||||
URxvt.saveline: 2048
|
||||
URxvt.scrollBar: true
|
||||
URxvt.scrollBar_right: false
|
||||
URxvt.urgentOnBell: true
|
||||
URxvt.depth: 24
|
||||
URxvt.iso14755: false
|
Loading…
Add table
Reference in a new issue