Compare commits

..

No commits in common. "main" and "master" have entirely different histories.
main ... master

68 changed files with 2195 additions and 1895 deletions

View File

@ -1,10 +0,0 @@
---
kind: pipeline
type: kubernetes
name: default
steps:
- name: lint
image: koalaman/shellcheck-alpine:latest
commands:
- shellcheck script/*

19
LICENCE
View File

@ -1,19 +0,0 @@
Copyright © 2023 Rob Watson
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,5 +1,25 @@
# Dotfiles
Dotfiles for various things. Enter at your own risk.
Dotfiles for various things.
![Dotfiles of Hell](https://git.netflux.io/rob/dotfiles/raw/branch/main/picture.jpg)
## License
Copyright © 2022 Rob Watson
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,221 +0,0 @@
[env]
TERM = "xterm-256color"
[font]
size = 13.5
[font.normal]
family = "Ubuntu Mono"
[[keyboard.bindings]]
action = "Paste"
key = "V"
mods = "Shift|Control"
[[keyboard.bindings]]
action = "Copy"
key = "C"
mods = "Shift|Control"
[[keyboard.bindings]]
action = "ScrollToBottom"
key = "Space"
mode = "Vi"
mods = "Shift|Control"
[[keyboard.bindings]]
action = "ToggleViMode"
key = "Space"
mods = "Shift|Control"
[[keyboard.bindings]]
action = "ClearSelection"
key = "Escape"
mode = "Vi"
[[keyboard.bindings]]
action = "ScrollToBottom"
key = "I"
mode = "Vi"
[[keyboard.bindings]]
action = "ToggleViMode"
key = "I"
mode = "Vi"
[[keyboard.bindings]]
action = "ScrollLineUp"
key = "Y"
mode = "Vi"
mods = "Control"
[[keyboard.bindings]]
action = "ScrollLineDown"
key = "E"
mode = "Vi"
mods = "Control"
[[keyboard.bindings]]
action = "ScrollToTop"
key = "G"
mode = "Vi"
[[keyboard.bindings]]
action = "ScrollToBottom"
key = "G"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "ScrollPageUp"
key = "B"
mode = "Vi"
mods = "Control"
[[keyboard.bindings]]
action = "ScrollPageDown"
key = "F"
mode = "Vi"
mods = "Control"
[[keyboard.bindings]]
action = "ScrollHalfPageUp"
key = "U"
mode = "Vi"
mods = "Control"
[[keyboard.bindings]]
action = "ScrollHalfPageDown"
key = "D"
mode = "Vi"
mods = "Control"
[[keyboard.bindings]]
action = "Copy"
key = "Y"
mode = "Vi"
[[keyboard.bindings]]
action = "ClearSelection"
key = "Y"
mode = "Vi"
[[keyboard.bindings]]
action = "ClearSelection"
key = "Copy"
mode = "Vi"
[[keyboard.bindings]]
action = "ToggleNormalSelection"
key = "V"
mode = "Vi"
[[keyboard.bindings]]
action = "ToggleLineSelection"
key = "V"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "Left"
key = "H"
mode = "Vi"
[[keyboard.bindings]]
action = "Right"
key = "L"
mode = "Vi"
[[keyboard.bindings]]
action = "Up"
key = "Up"
mode = "Vi"
[[keyboard.bindings]]
action = "Down"
key = "Down"
mode = "Vi"
[[keyboard.bindings]]
action = "Left"
key = "Left"
mode = "Vi"
[[keyboard.bindings]]
action = "Right"
key = "Right"
mode = "Vi"
[[keyboard.bindings]]
action = "First"
key = "Key0"
mode = "Vi"
[[keyboard.bindings]]
action = "Last"
key = "Key4"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "FirstOccupied"
key = "Key6"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "High"
key = "H"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "Middle"
key = "M"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "Low"
key = "L"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "SemanticLeft"
key = "B"
mode = "Vi"
[[keyboard.bindings]]
action = "SemanticRight"
key = "W"
mode = "Vi"
[[keyboard.bindings]]
action = "SemanticRightEnd"
key = "E"
mode = "Vi"
[[keyboard.bindings]]
action = "WordLeft"
key = "B"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "WordRight"
key = "W"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "WordRightEnd"
key = "E"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "Bracket"
key = "Key5"
mode = "Vi"
mods = "Shift"

644
alacritty.macos.yml Normal file
View File

@ -0,0 +1,644 @@
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
TERM: xterm-256color
#window:
# Window dimensions (changes require restart)
#
# Specified in number of columns/lines, not pixels.
# If both are `0`, this setting is ignored.
#dimensions:
# columns: 0
# lines: 0
# Window position (changes require restart)
#
# Specified in number of pixels.
# If the position is not set, the window manager will handle the placement.
#position:
# x: 0
# y: 0
# Window padding (changes require restart)
#
# Blank space added around the window in pixels. This padding is scaled
# by DPI and the specified value is always added at both opposing sides.
#padding:
# x: 0
# y: 0
# Spread additional padding evenly around the terminal content.
#dynamic_padding: false
# Window decorations
#
# Values for `decorations`:
# - full: Borders and title bar
# - none: Neither borders nor title bar
#
# Values for `decorations` (macOS only):
# - transparent: Title bar, transparent background and title bar buttons
# - buttonless: Title bar, transparent background, but no title bar buttons
#decorations: full
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
#startup_mode: Windowed
# Window title
#title: Alacritty
# Window class (Linux/BSD only):
#class:
# Application instance name
#instance: Alacritty
# General application class
#general: Alacritty
# GTK theme variant (Linux/BSD only)
#
# Override the variant of the GTK theme. Commonly supported values are `dark` and `light`.
# Set this to `None` to use the default theme variant.
#gtk_theme_variant: None
#scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
#history: 10000
# Scrolling distance multiplier.
#multiplier: 3
# Font configuration
font:
# Normal (roman) font face
normal:
# Font family
#
# Default:
# - (macOS) Menlo
# - (Linux/BSD) monospace
# - (Windows) Consolas
family: Ubuntu Mono
# The `style` can be specified to pick a specific face.
#style: Regular
# Bold font face
#bold:
# Font family
#
# If the bold family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Bold
# Italic font face
#italic:
# Font family
#
# If the italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Italic
# Bold italic font face
#bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Bold Italic
# Point size
size: 13.5
# Offset is the extra space around each character. `offset.y` can be thought of
# as modifying the line spacing, and `offset.x` as modifying the letter spacing.
#offset:
# x: 0
# y: 0
# Glyph offset determines the locations of the glyphs within their cells with
# the default being at the bottom. Increasing `x` moves the glyph to the right,
# increasing `y` moves the glyph upwards.
#glyph_offset:
# x: 0
# y: 0
# Thin stroke font rendering (macOS only)
#
# Thin strokes are suitable for retina displays, but for non-retina screens
# it is recommended to set `use_thin_strokes` to `false`.
#use_thin_strokes: true
# If `true`, bold text is drawn using the bright color variants.
#draw_bold_text_with_bright_colors: false
# Colors (Tomorrow Night)
#colors:
# Default colors
#primary:
# background: '#1d1f21'
# foreground: '#c5c8c6'
# Bright and dim foreground colors
#
# The dimmed foreground color is calculated automatically if it is not present.
# If the bright foreground color is not set, or `draw_bold_text_with_bright_colors`
# is `false`, the normal foreground color will be used.
#dim_foreground: '#828482'
#bright_foreground: '#eaeaea'
# Cursor colors
#
# Colors which should be used to draw the terminal cursor. If these are
# unset, the cursor color will be the inverse of the cell color.
#cursor:
# text: '#000000'
# cursor: '#ffffff'
# Vi mode cursor colors
#
# Colors for the cursor when the vi mode is active. If these are unset, the
# cursor color will be the inverse of the cell color.
#vi_mode_cursor:
# text: '#000000'
# cursor: '#ffffff'
# Selection colors
#
# Colors which should be used to draw the selection area. If selection
# background is unset, selection color will be the inverse of the cell colors.
# If only text is unset the cell text color will remain the same.
#selection:
# text: '#eaeaea'
# background: '#404040'
# Normal colors
#normal:
# black: '#1d1f21'
# red: '#cc6666'
# green: '#b5bd68'
# yellow: '#f0c674'
# blue: '#81a2be'
# magenta: '#b294bb'
# cyan: '#8abeb7'
# white: '#c5c8c6'
# Bright colors
#bright:
# black: '#666666'
# red: '#d54e53'
# green: '#b9ca4a'
# yellow: '#e7c547'
# blue: '#7aa6da'
# magenta: '#c397d8'
# cyan: '#70c0b1'
# white: '#eaeaea'
# Dim colors
#
# If the dim colors are not set, they will be calculated automatically based
# on the `normal` colors.
#dim:
# black: '#131415'
# red: '#864343'
# green: '#777c44'
# yellow: '#9e824c'
# blue: '#556a7d'
# magenta: '#75617b'
# cyan: '#5b7d78'
# white: '#828482'
# Indexed Colors
#
# The indexed colors include all colors from 16 to 256.
# When these are not set, they're filled with sensible defaults.
#
# Example:
# `- { index: 16, color: '#ff00ff' }`
#
#indexed_colors: []
# Visual Bell
#
# Any time the BEL code is received, Alacritty "rings" the visual bell. Once
# rung, the terminal background will be set to white and transition back to the
# default background color. You can control the rate of this transition by
# setting the `duration` property (represented in milliseconds). You can also
# configure the transition function by setting the `animation` property.
#
# Values for `animation`:
# - Ease
# - EaseOut
# - EaseOutSine
# - EaseOutQuad
# - EaseOutCubic
# - EaseOutQuart
# - EaseOutQuint
# - EaseOutExpo
# - EaseOutCirc
# - Linear
#
# Specifying a `duration` of `0` will disable the visual bell.
#visual_bell:
# animation: EaseOutExpo
# duration: 0
# color: '#ffffff'
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
#background_opacity: 1.0
#selection:
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
# When set to `true`, selected text will be copied to the primary clipboard.
#save_to_clipboard: false
# Allow terminal applications to change Alacritty's window title.
#dynamic_title: true
#cursor:
# Cursor style
#
# Values for `style`:
# - ▇ Block
# - _ Underline
# - | Beam
#style: Block
# Vi mode cursor style
#
# If the vi mode cursor style is `None` or not specified, it will fall back to
# the style of the active value of the normal cursor.
#
# See `cursor.style` for available options.
#vi_mode_style: None
# If this is `true`, the cursor will be rendered as a hollow box when the
# window is not focused.
#unfocused_hollow: true
# Thickness of the cursor relative to the cell width as floating point number
# from `0.0` to `1.0`.
#thickness: 0.15
# Live config reload (changes require restart)
#live_config_reload: true
# Shell
#
# You can set `shell.program` to the path of your favorite shell, e.g. `/bin/fish`.
# Entries in `shell.args` are passed unmodified as arguments to the shell.
#
# Default:
# - (macOS) /bin/bash --login
# - (Linux/BSD) user login shell
# - (Windows) powershell
#shell:
# program: /bin/bash
# args:
# - --login
# Startup directory
#
# Directory the shell is started in. If this is unset, or `None`, the working
# directory of the parent process will be used.
#working_directory: None
# WinPTY backend (Windows only)
#
# Alacritty defaults to using the newer ConPTY backend if it is available,
# since it resolves a lot of bugs and is quite a bit faster. If it is not
# available, the the WinPTY backend will be used instead.
#
# Setting this option to `true` makes Alacritty use the legacy WinPTY backend,
# even if the ConPTY backend is available.
#winpty_backend: false
# Send ESC (\x1b) before characters when alt is pressed.
#alt_send_esc: true
#mouse:
# Click settings
#
# The `double_click` and `triple_click` settings control the time
# alacritty should wait for accepting multiple clicks as one double
# or triple click.
#double_click: { threshold: 300 }
#triple_click: { threshold: 300 }
# If this is `true`, the cursor is temporarily hidden when typing.
#hide_when_typing: false
#url:
# URL launcher
#
# This program is executed when clicking on a text which is recognized as a URL.
# The URL is always added to the command as the last parameter.
#
# When set to `launcher: None`, URL launching will be disabled completely.
#
# Default:
# - (macOS) open
# - (Linux/BSD) xdg-open
# - (Windows) explorer
#launcher:
# program: xdg-open
# args: []
# URL modifiers
#
# These are the modifiers that need to be held down for opening URLs when clicking
# on them. The available modifiers are documented in the key binding section.
#modifiers: None
# Mouse bindings
#
# Mouse bindings are specified as a list of objects, much like the key
# bindings further below.
#
# To trigger mouse bindings when an application running within Alacritty captures the mouse, the
# `Shift` modifier is automatically added as a requirement.
#
# Each mouse binding will specify a:
#
# - `mouse`:
#
# - Middle
# - Left
# - Right
# - Numeric identifier such as `5`
#
# - `action` (see key bindings)
#
# And optionally:
#
# - `mods` (see key bindings)
#mouse_bindings:
# - { mouse: Middle, action: PasteSelection }
# Key bindings
#
# Key bindings are specified as a list of objects. For example, this is the
# default paste binding:
#
# `- { key: V, mods: Control|Shift, action: Paste }`
#
# Each key binding will specify a:
#
# - `key`: Identifier of the key pressed
#
# - A-Z
# - F1-F24
# - Key0-Key9
#
# A full list with available key codes can be found here:
# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants
#
# Instead of using the name of the keys, the `key` field also supports using
# the scancode of the desired key. Scancodes have to be specified as a
# decimal number. This command will allow you to display the hex scancodes
# for certain keys:
#
# `showkey --scancodes`.
#
# Then exactly one of:
#
# - `chars`: Send a byte sequence to the running application
#
# The `chars` field writes the specified string to the terminal. This makes
# it possible to pass escape sequences. To find escape codes for bindings
# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside
# of tmux. Note that applications use terminfo to map escape sequences back
# to keys. It is therefore required to update the terminfo when changing an
# escape sequence.
#
# - `action`: Execute a predefined action
#
# - ToggleViMode
# - Copy
# - Paste
# - PasteSelection
# - IncreaseFontSize
# - DecreaseFontSize
# - ResetFontSize
# - ScrollPageUp
# - ScrollPageDown
# - ScrollHalfPageUp
# - ScrollHalfPageDown
# - ScrollLineUp
# - ScrollLineDown
# - ScrollToTop
# - ScrollToBottom
# - ClearHistory
# - Hide
# - Minimize
# - Quit
# - ToggleFullscreen
# - SpawnNewInstance
# - ClearLogNotice
# - ClearSelection
# - ReceiveChar
# - None
#
# (`mode: Vi` only):
# - Open
# - Up
# - Down
# - Left
# - Right
# - First
# - Last
# - FirstOccupied
# - High
# - Middle
# - Low
# - SemanticLeft
# - SemanticRight
# - SemanticLeftEnd
# - SemanticRightEnd
# - WordRight
# - WordLeft
# - WordRightEnd
# - WordLeftEnd
# - Bracket
# - ToggleNormalSelection
# - ToggleLineSelection
# - ToggleBlockSelection
# - ToggleSemanticSelection
#
# (macOS only):
# - ToggleSimpleFullscreen: Enters fullscreen without occupying another space
#
# (Linux/BSD only):
# - CopySelection: Copies into selection buffer
#
# - `command`: Fork and execute a specified command plus arguments
#
# The `command` field must be a map containing a `program` string and an
# `args` array of command line parameter strings. For example:
# `{ program: "alacritty", args: ["-e", "vttest"] }`
#
# And optionally:
#
# - `mods`: Key modifiers to filter binding actions
#
# - Command
# - Control
# - Option
# - Super
# - Shift
# - Alt
#
# Multiple `mods` can be combined using `|` like this:
# `mods: Control|Shift`.
# Whitespace and capitalization are relevant and must match the example.
#
# - `mode`: Indicate a binding for only specific terminal reported modes
#
# This is mainly used to send applications the correct escape sequences
# when in different modes.
#
# - AppCursor
# - AppKeypad
# - Alt
#
# A `~` operator can be used before a mode to apply the binding whenever
# the mode is *not* active, e.g. `~Alt`.
#
# Bindings are always filled by default, but will be replaced when a new
# binding with the same triggers is defined. To unset a default binding, it can
# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for
# a no-op if you do not wish to receive input characters for that binding.
#
# If the same trigger is assigned to multiple actions, all of them are executed
# at once.
key_bindings:
- { key: V, mods: Shift|Control, action: Paste }
- { key: C, mods: Shift|Control, action: Copy }
#- { key: L, mods: Control, action: ClearLogNotice }
#- { key: L, mods: Control, mode: ~Vi, chars: "\x0c" }
#- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp, }
#- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown }
#- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop, }
#- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom }
# Vi Mode
- { key: Space, mods: Shift|Control, mode: Vi, action: ScrollToBottom }
- { key: Space, mods: Shift|Control, action: ToggleViMode }
- { key: Escape, mode: Vi, action: ClearSelection }
- { key: I, mode: Vi, action: ScrollToBottom }
- { key: I, mode: Vi, action: ToggleViMode }
- { key: Y, mods: Control, mode: Vi, action: ScrollLineUp }
- { key: E, mods: Control, mode: Vi, action: ScrollLineDown }
- { key: G, mode: Vi, action: ScrollToTop }
- { key: G, mods: Shift, mode: Vi, action: ScrollToBottom }
- { key: B, mods: Control, mode: Vi, action: ScrollPageUp }
- { key: F, mods: Control, mode: Vi, action: ScrollPageDown }
- { key: U, mods: Control, mode: Vi, action: ScrollHalfPageUp }
- { key: D, mods: Control, mode: Vi, action: ScrollHalfPageDown }
- { key: Y, mode: Vi, action: Copy }
- { key: Y, mode: Vi, action: ClearSelection }
- { key: Copy, mode: Vi, action: ClearSelection }
- { key: V, mode: Vi, action: ToggleNormalSelection }
- { key: V, mods: Shift, mode: Vi, action: ToggleLineSelection }
- { key: H, mode: Vi, action: Left }
- { key: L, mode: Vi, action: Right }
- { key: Up, mode: Vi, action: Up }
- { key: Down, mode: Vi, action: Down }
- { key: Left, mode: Vi, action: Left }
- { key: Right, mode: Vi, action: Right }
- { key: Key0, mode: Vi, action: First }
- { key: Key4, mods: Shift, mode: Vi, action: Last }
- { key: Key6, mods: Shift, mode: Vi, action: FirstOccupied }
- { key: H, mods: Shift, mode: Vi, action: High }
- { key: M, mods: Shift, mode: Vi, action: Middle }
- { key: L, mods: Shift, mode: Vi, action: Low }
- { key: B, mode: Vi, action: SemanticLeft }
- { key: W, mode: Vi, action: SemanticRight }
- { key: E, mode: Vi, action: SemanticRightEnd }
- { key: B, mods: Shift, mode: Vi, action: WordLeft }
- { key: W, mods: Shift, mode: Vi, action: WordRight }
- { key: E, mods: Shift, mode: Vi, action: WordRightEnd }
- { key: Key5, mods: Shift, mode: Vi, action: Bracket }
# (Windows, Linux, and BSD only)
#- { key: V, mods: Control|Shift, action: Paste }
#- { key: C, mods: Control|Shift, action: Copy }
#- { key: C, mods: Control|Shift, mode: Vi, action: ClearSelection }
#- { key: Insert, mods: Shift, action: PasteSelection }
#- { key: Key0, mods: Control, action: ResetFontSize }
#- { key: Equals, mods: Control, action: IncreaseFontSize }
#- { key: Add, mods: Control, action: IncreaseFontSize }
#- { key: Subtract, mods: Control, action: DecreaseFontSize }
#- { key: Minus, mods: Control, action: DecreaseFontSize }
# (Windows only)
#- { key: Return, mods: Alt, action: ToggleFullscreen }
# (macOS only)
#- { key: K, mods: Command, mode: ~Vi, chars: "\x0c" }
#- { key: Key0, mods: Command, action: ResetFontSize }
#- { key: Equals, mods: Command, action: IncreaseFontSize }
#- { key: Add, mods: Command, action: IncreaseFontSize }
#- { key: Minus, mods: Command, action: DecreaseFontSize }
#- { key: K, mods: Command, action: ClearHistory }
#- { key: V, mods: Command, action: Paste }
#- { key: C, mods: Command, action: Copy }
#- { key: C, mods: Command, mode: Vi, action: ClearSelection }
#- { key: H, mods: Command, action: Hide }
#- { key: M, mods: Command, action: Minimize }
#- { key: Q, mods: Command, action: Quit }
#- { key: W, mods: Command, action: Quit }
#- { key: N, mods: Command, action: SpawnNewInstance }
#- { key: F, mods: Command|Control, action: ToggleFullscreen }
#debug:
# Display the time it takes to redraw each frame.
#render_timer: false
# Keep the log file after quitting Alacritty.
#persistent_logging: false
# Log level
#
# Values for `log_level`:
# - None
# - Error
# - Warn
# - Info
# - Debug
# - Trace
#log_level: Warn
# Print all received window events.
#print_events: false

View File

@ -1,211 +0,0 @@
[env]
TERM = "xterm-256color"
[font]
size = 10.5
[font.normal]
family = "UbuntuMono"
[[keyboard.bindings]]
action = "ScrollToBottom"
key = "Space"
mode = "Vi"
mods = "Shift|Control"
[[keyboard.bindings]]
action = "ToggleViMode"
key = "Space"
mods = "Shift|Control"
[[keyboard.bindings]]
action = "ClearSelection"
key = "Escape"
mode = "Vi"
[[keyboard.bindings]]
action = "ScrollToBottom"
key = "I"
mode = "Vi"
[[keyboard.bindings]]
action = "ToggleViMode"
key = "I"
mode = "Vi"
[[keyboard.bindings]]
action = "ScrollLineUp"
key = "Y"
mode = "Vi"
mods = "Control"
[[keyboard.bindings]]
action = "ScrollLineDown"
key = "E"
mode = "Vi"
mods = "Control"
[[keyboard.bindings]]
action = "ScrollToTop"
key = "G"
mode = "Vi"
[[keyboard.bindings]]
action = "ScrollToBottom"
key = "G"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "ScrollPageUp"
key = "B"
mode = "Vi"
mods = "Control"
[[keyboard.bindings]]
action = "ScrollPageDown"
key = "F"
mode = "Vi"
mods = "Control"
[[keyboard.bindings]]
action = "ScrollHalfPageUp"
key = "U"
mode = "Vi"
mods = "Control"
[[keyboard.bindings]]
action = "ScrollHalfPageDown"
key = "D"
mode = "Vi"
mods = "Control"
[[keyboard.bindings]]
action = "Copy"
key = "Y"
mode = "Vi"
[[keyboard.bindings]]
action = "ClearSelection"
key = "Y"
mode = "Vi"
[[keyboard.bindings]]
action = "ClearSelection"
key = "Copy"
mode = "Vi"
[[keyboard.bindings]]
action = "ToggleNormalSelection"
key = "V"
mode = "Vi"
[[keyboard.bindings]]
action = "ToggleLineSelection"
key = "V"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "Left"
key = "H"
mode = "Vi"
[[keyboard.bindings]]
action = "Right"
key = "L"
mode = "Vi"
[[keyboard.bindings]]
action = "Up"
key = "Up"
mode = "Vi"
[[keyboard.bindings]]
action = "Down"
key = "Down"
mode = "Vi"
[[keyboard.bindings]]
action = "Left"
key = "Left"
mode = "Vi"
[[keyboard.bindings]]
action = "Right"
key = "Right"
mode = "Vi"
[[keyboard.bindings]]
action = "First"
key = "Key0"
mode = "Vi"
[[keyboard.bindings]]
action = "Last"
key = "Key4"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "FirstOccupied"
key = "Key6"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "High"
key = "H"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "Middle"
key = "M"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "Low"
key = "L"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "SemanticLeft"
key = "B"
mode = "Vi"
[[keyboard.bindings]]
action = "SemanticRight"
key = "W"
mode = "Vi"
[[keyboard.bindings]]
action = "SemanticRightEnd"
key = "E"
mode = "Vi"
[[keyboard.bindings]]
action = "WordLeft"
key = "B"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "WordRight"
key = "W"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "WordRightEnd"
key = "E"
mode = "Vi"
mods = "Shift"
[[keyboard.bindings]]
action = "Bracket"
key = "Key5"
mode = "Vi"
mods = "Shift"

644
alacritty.yml Normal file
View File

@ -0,0 +1,644 @@
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
TERM: xterm-256color
#window:
# Window dimensions (changes require restart)
#
# Specified in number of columns/lines, not pixels.
# If both are `0`, this setting is ignored.
#dimensions:
# columns: 0
# lines: 0
# Window position (changes require restart)
#
# Specified in number of pixels.
# If the position is not set, the window manager will handle the placement.
#position:
# x: 0
# y: 0
# Window padding (changes require restart)
#
# Blank space added around the window in pixels. This padding is scaled
# by DPI and the specified value is always added at both opposing sides.
#padding:
# x: 0
# y: 0
# Spread additional padding evenly around the terminal content.
#dynamic_padding: false
# Window decorations
#
# Values for `decorations`:
# - full: Borders and title bar
# - none: Neither borders nor title bar
#
# Values for `decorations` (macOS only):
# - transparent: Title bar, transparent background and title bar buttons
# - buttonless: Title bar, transparent background, but no title bar buttons
#decorations: full
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
#startup_mode: Windowed
# Window title
#title: Alacritty
# Window class (Linux/BSD only):
#class:
# Application instance name
#instance: Alacritty
# General application class
#general: Alacritty
# GTK theme variant (Linux/BSD only)
#
# Override the variant of the GTK theme. Commonly supported values are `dark` and `light`.
# Set this to `None` to use the default theme variant.
#gtk_theme_variant: None
#scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
#history: 10000
# Scrolling distance multiplier.
#multiplier: 3
# Font configuration
font:
# Normal (roman) font face
normal:
# Font family
#
# Default:
# - (macOS) Menlo
# - (Linux/BSD) monospace
# - (Windows) Consolas
family: UbuntuMono
# The `style` can be specified to pick a specific face.
#style: Regular
# Bold font face
#bold:
# Font family
#
# If the bold family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Bold
# Italic font face
#italic:
# Font family
#
# If the italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Italic
# Bold italic font face
#bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Bold Italic
# Point size
size: 10.5
# Offset is the extra space around each character. `offset.y` can be thought of
# as modifying the line spacing, and `offset.x` as modifying the letter spacing.
#offset:
# x: 0
# y: 0
# Glyph offset determines the locations of the glyphs within their cells with
# the default being at the bottom. Increasing `x` moves the glyph to the right,
# increasing `y` moves the glyph upwards.
#glyph_offset:
# x: 0
# y: 0
# Thin stroke font rendering (macOS only)
#
# Thin strokes are suitable for retina displays, but for non-retina screens
# it is recommended to set `use_thin_strokes` to `false`.
#use_thin_strokes: true
# If `true`, bold text is drawn using the bright color variants.
#draw_bold_text_with_bright_colors: false
# Colors (Tomorrow Night)
#colors:
# Default colors
#primary:
# background: '#1d1f21'
# foreground: '#c5c8c6'
# Bright and dim foreground colors
#
# The dimmed foreground color is calculated automatically if it is not present.
# If the bright foreground color is not set, or `draw_bold_text_with_bright_colors`
# is `false`, the normal foreground color will be used.
#dim_foreground: '#828482'
#bright_foreground: '#eaeaea'
# Cursor colors
#
# Colors which should be used to draw the terminal cursor. If these are
# unset, the cursor color will be the inverse of the cell color.
#cursor:
# text: '#000000'
# cursor: '#ffffff'
# Vi mode cursor colors
#
# Colors for the cursor when the vi mode is active. If these are unset, the
# cursor color will be the inverse of the cell color.
#vi_mode_cursor:
# text: '#000000'
# cursor: '#ffffff'
# Selection colors
#
# Colors which should be used to draw the selection area. If selection
# background is unset, selection color will be the inverse of the cell colors.
# If only text is unset the cell text color will remain the same.
#selection:
# text: '#eaeaea'
# background: '#404040'
# Normal colors
#normal:
# black: '#1d1f21'
# red: '#cc6666'
# green: '#b5bd68'
# yellow: '#f0c674'
# blue: '#81a2be'
# magenta: '#b294bb'
# cyan: '#8abeb7'
# white: '#c5c8c6'
# Bright colors
#bright:
# black: '#666666'
# red: '#d54e53'
# green: '#b9ca4a'
# yellow: '#e7c547'
# blue: '#7aa6da'
# magenta: '#c397d8'
# cyan: '#70c0b1'
# white: '#eaeaea'
# Dim colors
#
# If the dim colors are not set, they will be calculated automatically based
# on the `normal` colors.
#dim:
# black: '#131415'
# red: '#864343'
# green: '#777c44'
# yellow: '#9e824c'
# blue: '#556a7d'
# magenta: '#75617b'
# cyan: '#5b7d78'
# white: '#828482'
# Indexed Colors
#
# The indexed colors include all colors from 16 to 256.
# When these are not set, they're filled with sensible defaults.
#
# Example:
# `- { index: 16, color: '#ff00ff' }`
#
#indexed_colors: []
# Visual Bell
#
# Any time the BEL code is received, Alacritty "rings" the visual bell. Once
# rung, the terminal background will be set to white and transition back to the
# default background color. You can control the rate of this transition by
# setting the `duration` property (represented in milliseconds). You can also
# configure the transition function by setting the `animation` property.
#
# Values for `animation`:
# - Ease
# - EaseOut
# - EaseOutSine
# - EaseOutQuad
# - EaseOutCubic
# - EaseOutQuart
# - EaseOutQuint
# - EaseOutExpo
# - EaseOutCirc
# - Linear
#
# Specifying a `duration` of `0` will disable the visual bell.
#visual_bell:
# animation: EaseOutExpo
# duration: 0
# color: '#ffffff'
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
#background_opacity: 1.0
#selection:
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
# When set to `true`, selected text will be copied to the primary clipboard.
#save_to_clipboard: false
# Allow terminal applications to change Alacritty's window title.
#dynamic_title: true
#cursor:
# Cursor style
#
# Values for `style`:
# - ▇ Block
# - _ Underline
# - | Beam
#style: Block
# Vi mode cursor style
#
# If the vi mode cursor style is `None` or not specified, it will fall back to
# the style of the active value of the normal cursor.
#
# See `cursor.style` for available options.
#vi_mode_style: None
# If this is `true`, the cursor will be rendered as a hollow box when the
# window is not focused.
#unfocused_hollow: true
# Thickness of the cursor relative to the cell width as floating point number
# from `0.0` to `1.0`.
#thickness: 0.15
# Live config reload (changes require restart)
#live_config_reload: true
# Shell
#
# You can set `shell.program` to the path of your favorite shell, e.g. `/bin/fish`.
# Entries in `shell.args` are passed unmodified as arguments to the shell.
#
# Default:
# - (macOS) /bin/bash --login
# - (Linux/BSD) user login shell
# - (Windows) powershell
#shell:
# program: /bin/bash
# args:
# - --login
# Startup directory
#
# Directory the shell is started in. If this is unset, or `None`, the working
# directory of the parent process will be used.
#working_directory: None
# WinPTY backend (Windows only)
#
# Alacritty defaults to using the newer ConPTY backend if it is available,
# since it resolves a lot of bugs and is quite a bit faster. If it is not
# available, the the WinPTY backend will be used instead.
#
# Setting this option to `true` makes Alacritty use the legacy WinPTY backend,
# even if the ConPTY backend is available.
#winpty_backend: false
# Send ESC (\x1b) before characters when alt is pressed.
#alt_send_esc: true
#mouse:
# Click settings
#
# The `double_click` and `triple_click` settings control the time
# alacritty should wait for accepting multiple clicks as one double
# or triple click.
#double_click: { threshold: 300 }
#triple_click: { threshold: 300 }
# If this is `true`, the cursor is temporarily hidden when typing.
#hide_when_typing: false
#url:
# URL launcher
#
# This program is executed when clicking on a text which is recognized as a URL.
# The URL is always added to the command as the last parameter.
#
# When set to `launcher: None`, URL launching will be disabled completely.
#
# Default:
# - (macOS) open
# - (Linux/BSD) xdg-open
# - (Windows) explorer
#launcher:
# program: xdg-open
# args: []
# URL modifiers
#
# These are the modifiers that need to be held down for opening URLs when clicking
# on them. The available modifiers are documented in the key binding section.
#modifiers: None
# Mouse bindings
#
# Mouse bindings are specified as a list of objects, much like the key
# bindings further below.
#
# To trigger mouse bindings when an application running within Alacritty captures the mouse, the
# `Shift` modifier is automatically added as a requirement.
#
# Each mouse binding will specify a:
#
# - `mouse`:
#
# - Middle
# - Left
# - Right
# - Numeric identifier such as `5`
#
# - `action` (see key bindings)
#
# And optionally:
#
# - `mods` (see key bindings)
#mouse_bindings:
# - { mouse: Middle, action: PasteSelection }
# Key bindings
#
# Key bindings are specified as a list of objects. For example, this is the
# default paste binding:
#
# `- { key: V, mods: Control|Shift, action: Paste }`
#
# Each key binding will specify a:
#
# - `key`: Identifier of the key pressed
#
# - A-Z
# - F1-F24
# - Key0-Key9
#
# A full list with available key codes can be found here:
# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants
#
# Instead of using the name of the keys, the `key` field also supports using
# the scancode of the desired key. Scancodes have to be specified as a
# decimal number. This command will allow you to display the hex scancodes
# for certain keys:
#
# `showkey --scancodes`.
#
# Then exactly one of:
#
# - `chars`: Send a byte sequence to the running application
#
# The `chars` field writes the specified string to the terminal. This makes
# it possible to pass escape sequences. To find escape codes for bindings
# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside
# of tmux. Note that applications use terminfo to map escape sequences back
# to keys. It is therefore required to update the terminfo when changing an
# escape sequence.
#
# - `action`: Execute a predefined action
#
# - ToggleViMode
# - Copy
# - Paste
# - PasteSelection
# - IncreaseFontSize
# - DecreaseFontSize
# - ResetFontSize
# - ScrollPageUp
# - ScrollPageDown
# - ScrollHalfPageUp
# - ScrollHalfPageDown
# - ScrollLineUp
# - ScrollLineDown
# - ScrollToTop
# - ScrollToBottom
# - ClearHistory
# - Hide
# - Minimize
# - Quit
# - ToggleFullscreen
# - SpawnNewInstance
# - ClearLogNotice
# - ClearSelection
# - ReceiveChar
# - None
#
# (`mode: Vi` only):
# - Open
# - Up
# - Down
# - Left
# - Right
# - First
# - Last
# - FirstOccupied
# - High
# - Middle
# - Low
# - SemanticLeft
# - SemanticRight
# - SemanticLeftEnd
# - SemanticRightEnd
# - WordRight
# - WordLeft
# - WordRightEnd
# - WordLeftEnd
# - Bracket
# - ToggleNormalSelection
# - ToggleLineSelection
# - ToggleBlockSelection
# - ToggleSemanticSelection
#
# (macOS only):
# - ToggleSimpleFullscreen: Enters fullscreen without occupying another space
#
# (Linux/BSD only):
# - CopySelection: Copies into selection buffer
#
# - `command`: Fork and execute a specified command plus arguments
#
# The `command` field must be a map containing a `program` string and an
# `args` array of command line parameter strings. For example:
# `{ program: "alacritty", args: ["-e", "vttest"] }`
#
# And optionally:
#
# - `mods`: Key modifiers to filter binding actions
#
# - Command
# - Control
# - Option
# - Super
# - Shift
# - Alt
#
# Multiple `mods` can be combined using `|` like this:
# `mods: Control|Shift`.
# Whitespace and capitalization are relevant and must match the example.
#
# - `mode`: Indicate a binding for only specific terminal reported modes
#
# This is mainly used to send applications the correct escape sequences
# when in different modes.
#
# - AppCursor
# - AppKeypad
# - Alt
#
# A `~` operator can be used before a mode to apply the binding whenever
# the mode is *not* active, e.g. `~Alt`.
#
# Bindings are always filled by default, but will be replaced when a new
# binding with the same triggers is defined. To unset a default binding, it can
# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for
# a no-op if you do not wish to receive input characters for that binding.
#
# If the same trigger is assigned to multiple actions, all of them are executed
# at once.
key_bindings:
#- { key: Paste, action: Paste }
#- { key: Copy, action: Copy }
#- { key: L, mods: Control, action: ClearLogNotice }
#- { key: L, mods: Control, mode: ~Vi, chars: "\x0c" }
#- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp, }
#- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown }
#- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop, }
#- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom }
# Vi Mode
- { key: Space, mods: Shift|Control, mode: Vi, action: ScrollToBottom }
- { key: Space, mods: Shift|Control, action: ToggleViMode }
- { key: Escape, mode: Vi, action: ClearSelection }
- { key: I, mode: Vi, action: ScrollToBottom }
- { key: I, mode: Vi, action: ToggleViMode }
- { key: Y, mods: Control, mode: Vi, action: ScrollLineUp }
- { key: E, mods: Control, mode: Vi, action: ScrollLineDown }
- { key: G, mode: Vi, action: ScrollToTop }
- { key: G, mods: Shift, mode: Vi, action: ScrollToBottom }
- { key: B, mods: Control, mode: Vi, action: ScrollPageUp }
- { key: F, mods: Control, mode: Vi, action: ScrollPageDown }
- { key: U, mods: Control, mode: Vi, action: ScrollHalfPageUp }
- { key: D, mods: Control, mode: Vi, action: ScrollHalfPageDown }
- { key: Y, mode: Vi, action: Copy }
- { key: Y, mode: Vi, action: ClearSelection }
- { key: Copy, mode: Vi, action: ClearSelection }
- { key: V, mode: Vi, action: ToggleNormalSelection }
- { key: V, mods: Shift, mode: Vi, action: ToggleLineSelection }
- { key: H, mode: Vi, action: Left }
- { key: L, mode: Vi, action: Right }
- { key: Up, mode: Vi, action: Up }
- { key: Down, mode: Vi, action: Down }
- { key: Left, mode: Vi, action: Left }
- { key: Right, mode: Vi, action: Right }
- { key: Key0, mode: Vi, action: First }
- { key: Key4, mods: Shift, mode: Vi, action: Last }
- { key: Key6, mods: Shift, mode: Vi, action: FirstOccupied }
- { key: H, mods: Shift, mode: Vi, action: High }
- { key: M, mods: Shift, mode: Vi, action: Middle }
- { key: L, mods: Shift, mode: Vi, action: Low }
- { key: B, mode: Vi, action: SemanticLeft }
- { key: W, mode: Vi, action: SemanticRight }
- { key: E, mode: Vi, action: SemanticRightEnd }
- { key: B, mods: Shift, mode: Vi, action: WordLeft }
- { key: W, mods: Shift, mode: Vi, action: WordRight }
- { key: E, mods: Shift, mode: Vi, action: WordRightEnd }
- { key: Key5, mods: Shift, mode: Vi, action: Bracket }
# (Windows, Linux, and BSD only)
#- { key: V, mods: Control|Shift, action: Paste }
#- { key: C, mods: Control|Shift, action: Copy }
#- { key: C, mods: Control|Shift, mode: Vi, action: ClearSelection }
#- { key: Insert, mods: Shift, action: PasteSelection }
#- { key: Key0, mods: Control, action: ResetFontSize }
#- { key: Equals, mods: Control, action: IncreaseFontSize }
#- { key: Add, mods: Control, action: IncreaseFontSize }
#- { key: Subtract, mods: Control, action: DecreaseFontSize }
#- { key: Minus, mods: Control, action: DecreaseFontSize }
# (Windows only)
#- { key: Return, mods: Alt, action: ToggleFullscreen }
# (macOS only)
#- { key: K, mods: Command, mode: ~Vi, chars: "\x0c" }
#- { key: Key0, mods: Command, action: ResetFontSize }
#- { key: Equals, mods: Command, action: IncreaseFontSize }
#- { key: Add, mods: Command, action: IncreaseFontSize }
#- { key: Minus, mods: Command, action: DecreaseFontSize }
#- { key: K, mods: Command, action: ClearHistory }
#- { key: V, mods: Command, action: Paste }
#- { key: C, mods: Command, action: Copy }
#- { key: C, mods: Command, mode: Vi, action: ClearSelection }
#- { key: H, mods: Command, action: Hide }
#- { key: M, mods: Command, action: Minimize }
#- { key: Q, mods: Command, action: Quit }
#- { key: W, mods: Command, action: Quit }
#- { key: N, mods: Command, action: SpawnNewInstance }
#- { key: F, mods: Command|Control, action: ToggleFullscreen }
#debug:
# Display the time it takes to redraw each frame.
#render_timer: false
# Keep the log file after quitting Alacritty.
#persistent_logging: false
# Log level
#
# Values for `log_level`:
# - None
# - Error
# - Warn
# - Info
# - Debug
# - Trace
#log_level: Warn
# Print all received window events.
#print_events: false

View File

@ -26,16 +26,15 @@
cp = cherry-pick
cp2 = "!fn() { git cherry-pick $1~2..$1; }; fn"
cp3 = "!fn() { git cherry-pick $1~3..$1; }; fn"
cp4 = "!fn() { git cherry-pick $1~4..$1; }; fn"
cpls = !git cp $(git ls)
d = diff
dls = !git diff $(git branch | fzf)
dom = !git diff origin/$(git mainbranch)...
dom = diff origin/master...
drb = !git diff $(git rb)
ds = diff --staged
f = fetch
fc = commit --allow-empty -m 'Initial commit'
fixom = !sh -c 'git fetch && git rebase -i --autosquash origin/$(git mainbranch)'
fixom = !sh -c 'git fetch && git rebase -i --autosquash origin/master'
fixup = rebase -i --autosquash
l = log
l1 = log --oneline
@ -43,32 +42,28 @@
lp = log -p
lm = logme
logme = !sh -c 'git log --author=\"$(git config --get user.name)\"'
lrb = !git log $(git drb)
ls = !git branch --format '%(refname:short)' | fzf
ma = merge --abort
mainbranch = !gitmainbranch
mls = !git merge $(git ls)
mr = !git merge $(git rb)
mrb = mr
mt = merge -s recursive -X theirs
nb = checkout -b
nuke1 = reset --hard HEAD^
nuke = reset --hard
p = push
pf = push --force-with-lease
pff = push --force
pf = push --force
pl = pull
plr = pull --rebase
ph = push -u origin HEAD
pr = dom
prs = !git diff --stat origin/$(git mainbranch)
prs = diff --stat origin/master
ra = rebase --abort
rb = !git rev-parse --abbrev-ref --symbolic-full-name @{u}
rc = rebase --continue
re = rebase
rels = !git rebase $(git branch | fzf)
rh = reset --hard
ri = rebase -i --autosquash
rom = !sh -c 'git fetch && git rebase origin/$(git mainbranch)'
rils = !git rebase -i --autosquash $(git branch | fzf)
rom = !sh -c 'git fetch && git rebase origin/master'
rr = !sh -c 'git fetch && git reset --hard $(git rb)'
rv = revert
rvh = revert HEAD
@ -83,13 +78,11 @@
sqt = merge --squash -s recursive -X theirs
ss = stash save
st = stash
stus = stash --keep-index -u
sy = !gitsha1yank -s
sum = show --stat
sshp = stash show -p
undo = reset --soft HEAD^
wip = !git add . && git commit -m 'WIP'
wt = worktree
[user]
email = rob@netflux.io
name = Rob Watson

638
nvimrc
View File

@ -1,6 +1,5 @@
" Prefer $HOME/.vim to $HOME/.config/nvim (for now):
" TODO: refactor file structure for nvim
set runtimepath^=~/.vim runtimepath+=~/.vim/after runtimepath+=~/.vim/lua runtimepath+=~/.vim/queries
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
set background=dark
@ -60,7 +59,6 @@ set mousemodel=popup_setpos
" https://github.com/tpope/vim-sensible/issues/78:
set lazyredraw
set timeoutlen=1000
set scroll=10
set scrolloff=15
set dictionary=/usr/share/dict/words
" See :help thesaurus
@ -106,7 +104,7 @@ augroup vimrc
" https://github.com/fatih/vim-go/issues/1757#issuecomment-565130503
autocmd FileType qf if (getwininfo(win_getid())[0].loclist != 1) | wincmd J | endif
" Remove trailing whitespace pre-save:
autocmd FileType go,ruby,markdown,rust,python,markdown,lua,sql,bash autocmd BufWritePre <buffer> silent! %s/\s\+$//e
autocmd FileType go,ruby,markdown,rust,python,markdown,lua autocmd BufWritePre <buffer> silent! %s/\s\+$//e
augroup end
" Don't remember the current directory for a given file:
@ -127,12 +125,6 @@ imap <left> <nop>
imap <right> <nop>
nmap ]q :cn<cr>
nmap [q :cp<cr>
nmap + ]
nmap ` [
nmap YY "+yy
vmap Y "+y
nmap ¨ "
imap ¨ "
nnoremap <silent> <leader>w :up<cr>
nnoremap <silent> <leader>/ :nohlsearch<cr>
@ -153,10 +145,165 @@ nnoremap <leader>dq ggVG"_d:wq<cr>
iabbrev esdebug debugger; // eslint-disable-line no-debugger
iabbrev bashstrict set -euo pipefail<cr>IFS=$'\n\t'<cr>
" include lua
lua require "helpers"
lua require "commands"
lua require "test_runner"
lua <<EOF
function _G.dump(...)
local objects = vim.tbl_map(vim.inspect, {...})
print(unpack(objects))
return ...
end
function _G.insert_uuid()
local uuid = vim.call("system", "uuidprint")
local errcode = vim.v.shell_error
if errcode ~= 0 then
vim.api.nvim_err_writeln("uuidprint returned error code: " .. errcode)
return
end
vim.call("setreg", "u", uuid)
vim.api.nvim_command([[normal! "up]])
end
vim.api.nvim_set_keymap("n", "<leader>pu", [[:lua _G.insert_uuid()<cr>]], {noremap = true, silent = true})
vim.api.nvim_set_keymap("i", "<c-d><c-u>", [[<esc>:lua _G.insert_uuid()<cr>a]], {noremap = true, silent = true})
function _G.insert_jira_url()
local url = vim.call("system", "jira")
local errcode = vim.v.shell_error
if errcode ~= 0 then
vim.api.nvim_err_writeln("jira returned error code: " .. errcode)
return
end
vim.call("setreg", "u", url)
vim.api.nvim_command([[normal! "up]])
end
vim.api.nvim_set_keymap("n", "<leader>pj", [[:lua _G.insert_jira_url()<cr>]], {noremap = true, silent = true})
vim.api.nvim_set_keymap("i", "<c-d><c-j>", [[<esc>:lua _G.insert_jira_url()<cr>a]], {noremap = true, silent = true})
function _G.insert_iso8601_timestamp()
local ts = vim.call("system", "echo -n $(date --iso-8601=seconds)")
local errcode = vim.v.shell_error
if errcode ~= 0 then
vim.api.nvim_err_writeln("date returned error code: " .. errcode)
return
end
vim.call("setreg", "u", ts)
vim.api.nvim_command([[normal! "up]])
end
vim.api.nvim_set_keymap("n", "<leader>pt", [[:lua _G.insert_iso8601_timestamp()<cr>]], {noremap = true, silent = true})
vim.api.nvim_set_keymap("i", "<c-d><c-t>", [[<esc>:lua _G.insert_iso8601_timestamp()<cr>a]], {noremap = true, silent = true})
_G._test_cmd_to_wins = {}
_G._build_test_cmd = function()
local bufnr = vim.call("bufnr", "%")
local filetype = vim.call("getbufvar", bufnr, "&filetype")
if filetype == "" then
vim.api.nvim_err_writeln("cannot build test command for filetype:" .. filetype)
return nil
end
local path = vim.call("expand", "%:p")
-- TODO: allow line number to be passed
-- TODO: check file exists before running command
if filetype == "ruby" then
if not path:find("_spec.rb") then
path = path:gsub("/app/", "/spec/"):gsub([[.rb$]], "_spec.rb")
end
return "bundle exec rspec --format=progress --no-profile " .. path
elseif filetype == "go" then
return "go test -v " .. path:gsub("^(.*)/(.*go)$", "%1/...")
else
vim.api.nvim_err_writeln("filetype not supported: " .. filetype)
return nil
end
end
_G.run_tests = function()
local cmd = _G._build_test_cmd()
if cmd == nil then
return
end
vim.api.nvim_command([[silent up]])
local winid = _G._test_cmd_to_wins[cmd]
local current_winid = vim.call("win_getid")
if winid == nil or not vim.api.nvim_win_is_valid(winid) or winid == current_winid or not vim.call("win_gotoid", winid) == -1 then
vim.api.nvim_command([[10split]])
winid = vim.call("win_getid")
_G._test_cmd_to_wins[cmd] = winid
end
local buf = vim.api.nvim_create_buf(false, true)
vim.api.nvim_buf_set_option(buf, "bufhidden", "delete")
vim.api.nvim_win_set_buf(winid, buf)
vim.call("termopen", cmd)
vim.api.nvim_command([[normal! G]])
vim.api.nvim_command([[wincmd p]])
end
_G.focus_tests = function()
local cmd = _G._build_test_cmd()
if cmd == nil then
return
end
local winid = _G._test_cmd_to_wins[cmd]
if winid == nil or not vim.api.nvim_win_is_valid(winid) then
return
end
vim.call("win_gotoid", winid)
vim.api.nvim_command([[wincmd =]])
end
_G.close_tests = function()
local current_winid = vim.api.nvim_get_current_win()
for _, winid in pairs(_G._test_cmd_to_wins) do
if current_winid == winid and vim.api.nvim_win_is_valid(winid) then
vim.api.nvim_win_close(winid, false)
return
end
end
local cmd = _G._build_test_cmd()
if cmd == nil then
return
end
local winid = _G._test_cmd_to_wins[cmd]
if winid == nil or not vim.api.nvim_win_is_valid(winid) then
return
end
vim.api.nvim_win_close(winid, false)
end
_G.copy_test_cmd = function()
local cmd = _G._build_test_cmd()
if cmd == nil then
return
end
vim.call("setreg", "+", cmd)
print("Copied: " .. cmd)
end
vim.api.nvim_set_keymap("n", "<leader>cr", [[:lua _G.run_tests()<cr>]], {noremap = true, silent = true})
vim.api.nvim_set_keymap("n", "<leader>cf", [[:lua _G.focus_tests()<cr>]], {noremap = true, silent = true})
vim.api.nvim_set_keymap("n", "<leader>cq", [[:lua _G.close_tests()<cr>]], {noremap = true, silent = true})
vim.api.nvim_set_keymap("n", "<leader>cc", [[:lua _G.copy_test_cmd()<cr>]], {noremap = true, silent = true})
EOF
" Function to eat trailing character when applying iabbrevs.
" https://stackoverflow.com/questions/11858927/preventing-trailing-whitespace-when-using-vim-abbreviations
@ -187,7 +334,7 @@ endfunction
nnoremap <leader>as :Git<cr>
nnoremap <leader>ab :Git blame<cr>
nnoremap <leader>ac :Commits<cr>
nnoremap <leader>af gg0jVG:s/^pick/fixup/<cr> \| :redraw!<cr>:wq
nnoremap <leader>ah :GitGutterLineHighlightsToggle<cr>
nnoremap <leader>aY :call CopyGitURLToLineOrRange()<cr>
vnoremap <leader>aY :call CopyGitURLToLineOrRange()<cr>
nnoremap <leader>ao :call OpenGitURLToLineOrRange()<cr>
@ -237,24 +384,83 @@ let g:fzf_action = {
\ 'ctrl-v': 'vsplit',
\ }
nmap <leader>t :GFiles<cr>
nmap <leader>g :GFiles?<cr>
nmap <leader>T :Files<cr>
nmap <leader>b :Buffers<cr>
nmap <leader>rg :Rg<cr>
" lualine.nvim
packadd! lualine.nvim " https://git.netflux.io/rob/lualine.nvim.git
packadd! nvim-web-devicons " https://github.com/nvim-tree/nvim-web-devicons.git
" Lightline configuration:
packadd! lightline.vim " https://github.com/itchyny/lightline.vim.git
set laststatus=2
lua require "lightline_config"
function! LightlineLSPErrorText()
let l:count = luaeval("vim.diagnostic.get(0, [[Error]])")
if l:count == 0
return ''
endif
return l:count . 'E'
endfunction
" gitsigns.nvim
packadd! gitsigns.nvim " https://github.com/lewis6991/gitsigns.nvim.git
function! LightlineLSPWarningText()
let l:count = luaeval("vim.diagnostic.get(0, [[Warning]])")
if l:count == 0
return ''
endif
return l:count . 'W'
endfunction
lua require "gitsigns_config"
function! LightlineLSPInformationText()
let l:count = luaeval("vim.diagnostic.get(0, [[Information]])")
if l:count == 0
return ''
endif
return l:count . 'I'
endfunction
" enable inline vim highlighting:
let g:vimsyn_embed= 'lPr'
let g:lightline = {
\ 'colorscheme': 'seoul256',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'readonly', 'filename', 'modified' ],
\ [ 'gitbranch' ], ['lsperror', 'lspwarn', 'lspinfo' ] ],
\ 'right': [ ['lineinfo'], ['percent'], ['filetype'], ['gobuild'] ],
\ },
\ 'component_function': {
\ 'gobuild': 'go#statusline#Show',
\ 'gitbranch': 'FugitiveStatusline',
\ },
\ 'component_expand': {
\ 'lsperror': 'LightlineLSPErrorText',
\ 'lspwarn': 'LightlineLSPWarningText',
\ 'lspinfo': 'LightlineLSPInformationText',
\ },
\ 'component_type': {
\ 'lsperror': 'error',
\ 'lspwarn': 'warning',
\ },
\ 'mode_map': {
\ 'n' : 'N',
\ 'i' : 'I',
\ 'R' : 'R',
\ 'v' : 'V',
\ 'V' : 'V-LINE',
\ "\<C-v>": 'V-BLOCK',
\ 'c' : 'C',
\ 's' : 'S',
\ 'S' : 'S-LINE',
\ "\<C-s>": 'S-BLOCK',
\ 't': 'TERM',
\ },
\ }
" vim-gitgutter configuration
packadd! vim-gitgutter " https://github.com/airblade/vim-gitgutter.git
set signcolumn=yes
nmap ]h <Plug>(GitGutterNextHunk)
nmap [h <Plug>(GitGutterPrevHunk)
omap ih <Plug>(GitGutterTextObjectInnerPending)
omap ah <Plug>(GitGutterTextObjectOuterPending)
xmap ih <Plug>(GitGutterTextObjectInnerVisual)
xmap ah <Plug>(GitGutterTextObjectOuterVisual)
" vim-fugitive
packadd! vim-fugitive " https://github.com/tpope/vim-fugitive.git
@ -269,6 +475,7 @@ runtime macros/matchit.vim
" load other plugins:
packadd! rust.vim " https://github.com/rust-lang/rust.vim.git
packadd! tmux-complete.vim " https://github.com/wellle/tmux-complete.vim.git
packadd! vim-commentary " https://github.com/tpope/vim-commentary.git
packadd! vim-rails " https://github.com/tpope/vim-rails.git
packadd! vim-jsx-pretty " https://github.com/MaxMEllon/vim-jsx-pretty.git
@ -282,48 +489,391 @@ packadd! vim-rhubarb " https://github.com/tpope/vim-rhubarb.git
packadd! editorconfig-vim " https://github.com/editorconfig/editorconfig-vim.git
packadd! vim-wordmotion " https://github.com/chaoren/vim-wordmotion.git
" aerial
packadd! aerial.nvim " https://github.com/stevearc/aerial.nvim.git
" formatter.nvim
packadd! formatter.nvim " https://github.com/mhartington/formatter.nvim.git
lua <<EOF
local prettier = function()
return {
-- TODO: figure out how to pass a relative path based on project root to
-- formatter.nvim.
exe = "/home/rob/dev/clipper/frontend/node_modules/.bin/prettier",
args = {"--stdin-filepath", vim.api.nvim_buf_get_name(0), '--single-quote'},
stdin = true
}
end
require('formatter').setup({
filetype = {
javascript = { prettier },
typescript = { prettier },
typescriptreact = { prettier },
}
})
lua require "aerial_config"
vim.api.nvim_exec([[
augroup FormatAutogroup
autocmd!
autocmd BufWritePost *.js,*.ts,*.tsx silent FormatWrite
augroup END
]], true)
" conform.nvim:
packadd! conform.nvim " https://github.com/stevearc/conform.nvim.git
local bufnr = vim.call("bufnr", "%")
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>F', '<Cmd>silent Format<CR>', { noremap=true, silent=true })
EOF
lua require "conform_config"
" enable inline vim highlighting:
let g:vimsyn_embed= 'lPr'
" Treesitter
" treesitter:
packadd! nvim-treesitter " https://github.com/nvim-treesitter/nvim-treesitter.git
packadd! nvim-treesitter-textobjects " https://github.com/nvim-treesitter/nvim-treesitter-textobjects.git
packadd! nvim-treesitter-refactor " https://github.com/nvim-treesitter/nvim-treesitter-refactor.git
packadd! nvim-treesitter-context " https://github.com/nvim-treesitter/nvim-treesitter-context.git
packadd! playground " https://github.com/nvim-treesitter/playground.git
lua require "treesitter_config"
lua <<EOF
require 'nvim-treesitter.configs'.setup {
ensure_installed = "all",
highlight = {
enable = true,
disable = {"vim"},
additional_vim_regex_highlighting = true,
},
incremental_selection = {
enable = true,
},
indent = {
-- enabling breaks autoindent:
enable = false,
},
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["ak"] = "@keyed_element.outer",
["av"] = "@keyed_element.inner",
["ia"] = "@parameter.inner",
["aa"] = "@parameter.outer",
["ac"] = "@comment.outer",
["at"] = "@statement.outer",
["ar"] = "@return",
["af"] = "@function.outer",
["if"] = "@function.inner",
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
["]a"] = "@parameter.inner",
["]f"] = "@function.outer",
["]F"] = "@function.inner",
},
goto_previous_start = {
["[a"] = "@parameter.inner",
["[f"] = "@function.outer",
["[F"] = "@function.inner",
},
},
lsp_interop = {
enable = true,
peek_definition_code = {
["<leader>d"] = "@class.outer",
["<leader>d"] = "@function.outer",
},
},
},
refactor = {
highlight_definitions = { enable = true },
highlight_current_scope = { enable = false },
smart_rename = {
enable = true,
keymaps = {
smart_rename = "grr",
},
},
navigation = {
enable = true,
keymaps = {
-- goto_definition_lsp_fallback = "gd",
goto_next_usage = "]r",
goto_previous_usage = "[r",
},
},
},
playground = {
enable = true,
disable = {},
updatetime = 25,
persist_queries = false,
keybindings = {
toggle_query_editor = 'o',
toggle_hl_groups = 'i',
toggle_injected_languages = 't',
toggle_anonymous_nodes = 'a',
toggle_language_display = 'I',
focus_language = 'f',
unfocus_language = 'F',
update = 'R',
goto_node = '<cr>',
show_help = '?',
},
}
}
EOF
" copilot:
packadd! copilot.lua " https://github.com/zbirenbaum/copilot.lua.git
lua require "copilot_config"
lua <<EOF
require'treesitter-context'.setup{
enable = true,
}
EOF
" nvim-cmp:
packadd! nvim-cmp " https://github.com/hrsh7th/nvim-cmp.git
packadd! copilot-cmp " https://github.com/zbirenbaum/copilot-cmp.git
packadd! vim-vsnip " https://github.com/hrsh7th/vim-vsnip.git
packadd! vim-vsnip-integ " https://github.com/hrsh7th/vim-vsnip-integ.git
packadd! cmp-vsnip " https://github.com/hrsh7th/cmp-vsnip.git
packadd! cmp-nvim-lsp " https://github.com/hrsh7th/cmp-nvim-lsp.git
packadd! cmp-buffer " https://github.com/hrsh7th/cmp-buffer.git
packadd! cmp-path " https://github.com/hrsh7th/cmp-path.git
packadd! cmp-calc " https://github.com/hrsh7th/cmp-calc
packadd! cmp-tmux " https://github.com/andersevenrud/cmp-tmux.git
lua require "nvim_cmp_config"
lua require "snippet_config"
lua <<EOF
local cmp = require('cmp')
local cmp_buffer = require('cmp_buffer')
cmp.setup({
completion = {
completeopt = 'menu,menuone,noinsert',
keyword_length = 3,
},
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
mapping = {
['<C-u>'] = cmp.mapping.scroll_docs(-4),
['<C-d>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({ select = true, behaviour = cmp.ConfirmBehavior.Replace }),
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{
name = 'buffer',
option = {
get_bufnrs = function()
return vim.api.nvim_list_bufs()
end
},
},
{ name = 'path' },
{ name = 'calc' },
}),
sorting = {
comparators = {
function(...) return cmp_buffer:compare_locality(...) end,
}
},
view = {
entries = 'native',
},
experimental = {
ghost_text = true,
},
})
EOF
" LSP
" LSP:
packadd! nvim-lspconfig " https://github.com/neovim/nvim-lspconfig.git
packadd! lsp_signature.nvim " https://github.com/ray-x/lsp_signature.nvim.git
packadd! fzf-lsp.nvim " https://github.com/gfanto/fzf-lsp.nvim.git
packadd! lsp-colors.nvim " https://github.com/folke/lsp-colors.nvim.git
lua require "lsp_config"
lua <<EOF
local nvim_lsp = require('lspconfig')
local on_attach = function(client, bufnr)
-- nvim does not expose autocmd via Lua API yet:
vim.api.nvim_exec([[autocmd User LspDiagnosticsChanged call lightline#update()]], false)
local opts = { noremap=true, silent=false }
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<Cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>gD', '<Cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>e', '<Cmd>lua vim.lsp.buf.rename()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>r', '<Cmd>lua vim.lsp.buf.references()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>i', '<Cmd>lua vim.lsp.buf.implementation()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>ca', '<Cmd>lua vim.lsp.buf.code_action()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>ci', '<Cmd>lua vim.lsp.buf.incoming_calls()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>co', '<Cmd>lua vim.lsp.buf.outgoing_calls()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', ']e', '<Cmd>lua vim.diagnostic.goto_next({severity="Error"})<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '[e', '<Cmd>lua vim.diagnostic.goto_prev({severity="Error"})<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', ']d', '<Cmd>lua vim.diagnostic.goto_next()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '[d', '<Cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'cd', '<Cmd>lua vim.diagnostic.hide(nil, 0)<CR>', opts)
-- fzf triggers:
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>fr', '<Cmd>References<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>fi', '<Cmd>Implementations<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>fs', '<Cmd>DocumentSymbols<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>fw', '<Cmd>WorkspaceSymbols<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>fc', '<Cmd>CodeActions<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>fci', '<Cmd>IncomingCalls<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>fco', '<Cmd>OutgoingCalls<CR>', opts)
require 'lsp_signature'.on_attach({
hint_enable = false,
})
end
-- Go
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
capabilities.textDocument.completion.completionItem.resolveSupport = {
properties = {
'documentation',
'detail',
'additionalTextEdits',
}
}
require('cmp_nvim_lsp').update_capabilities(capabilities)
nvim_lsp.gopls.setup{
settings = {
gopls = {
staticcheck = true,
analyses = {
unusedparams = true,
shadow = true,
unusedwrite = true,
unusedresult = true,
nilness = true,
},
},
},
capabilities = capabilities,
on_attach = on_attach,
}
-- Rust
nvim_lsp.rust_analyzer.setup{
on_attach = on_attach,
settings = {
["rust-analyzer"] = {
imports = {
granularity = {
group = "module",
},
prefix = "self",
},
cargo = {
buildScripts = {
enable = true,
},
},
procMacro = {
enable = true
},
}
}
}
-- Ruby
nvim_lsp.solargraph.setup{
on_attach = on_attach,
}
-- Typescript
-- https://jose-elias-alvarez.medium.com/configuring-neovims-lsp-client-for-typescript-development-5789d58ea9c
nvim_lsp.tsserver.setup{
on_attach = on_attach,
}
local filetypes = {
typescript = "eslint",
typescriptreact = "eslint",
}
-- diagnosticls
local linters = {
eslint = {
sourceName = "eslint",
-- fallback to global eslint if the local is not found?
-- https://github.com/creativenull/diagnosticls-configs-nvim/blob/e7d6f7e99f6b416d2aeee89314bc46fc36df7b22/lua/diagnosticls-configs/fs.lua#L20
command = "./node_modules/.bin/eslint",
rootPatterns = {".eslintrc", ".eslintrc.js"},
debounce = 100,
args = {"--stdin", "--stdin-filename", "%filepath", "--format", "json"},
parseJson = {
errorsRoot = "[0].messages",
line = "line",
column = "column",
endLine = "endLine",
endColumn = "endColumn",
message = "${message} [${ruleId}]",
security = "severity"
},
securities = {[1] = "error", [2] = "warning"}
}
}
nvim_lsp.diagnosticls.setup{
on_attach = on_attach,
filetypes = vim.tbl_keys(filetypes),
init_options = {
linters = linters,
filetypes = filetypes,
}
}
-- Lua
local system_name
if vim.fn.has("mac") == 1 then
system_name = "macOS"
elseif vim.fn.has("unix") == 1 then
system_name = "Linux"
else
print("Unsupported system for sumneko")
end
local sumneko_root_path = os.getenv("HOME").."/dev/lua-language-server"
local sumneko_binary = sumneko_root_path.."/bin/"..system_name.."/lua-language-server"
local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, "lua/?.lua")
table.insert(runtime_path, "lua/?/init.lua")
nvim_lsp.sumneko_lua.setup {
cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"};
settings = {
Lua = {
runtime = {
version = 'LuaJIT',
path = runtime_path,
},
diagnostics = {
globals = {'vim'},
},
workspace = {
library = vim.api.nvim_get_runtime_file("", true),
},
telemetry = {
enable = false,
},
},
},
on_attach = on_attach,
}
EOF

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

View File

@ -1,11 +0,0 @@
#!/usr/bin/env bash
#
# Print battery percentage to stdout
set -e
if [ "$(uname -s)" = "Darwin" ]; then
pmset -g batt | tail -n 1 | grep -Eo "\d+%" | cut -d% -f1
else # Linux
cat /sys/class/power_supply/BAT0/capacity
fi

View File

@ -8,7 +8,8 @@ set -e
branchname=$(git bn)
if [ "$branchname" = "HEAD" ]; then
if ! branchoutput=$(git branch --list | grep rebasing); then
branchoutput=$(git branch --list | grep rebasing)
if [ ! $? -eq 0 ]; then
exit 1
fi
@ -20,4 +21,4 @@ if [ "$branchname" = "HEAD" ]; then
fi
fi
printf "%s" "$branchname"
printf $branchname

View File

@ -9,11 +9,11 @@ set -e
pluginhome=$HOME/.vim/pack/git-plugins
cd "$pluginhome/opt"
find . -mindepth 1 -maxdepth 1 -type d -print0 | while read -rd $'\0' pluginpath
cd $pluginhome/opt
find . -mindepth 1 -maxdepth 1 -type d -print0 | while read -d $'\0' pluginpath
do
if ! grep -q "$pluginpath" "$HOME/.config/nvim/init.vim" ; then
basename=$(basename "$pluginpath")
if ! grep -q "$pluginpath" $HOME/.config/nvim/init.vim ; then
basename=$(basename $pluginpath)
echo "rm -rf $pluginhome/opt/$basename"
fi
done

59
script/createrepo Executable file
View File

@ -0,0 +1,59 @@
#!/usr/bin/env ruby
#
# frozen_string_literal: true
# Create a Git repo on git.netflux.io
require 'json'
require 'net/http'
require 'optparse'
require 'uri'
options = {}
banner = 'Usage: createrepo [options] <reponame>'
OptionParser.new do |opts|
opts.banner = banner
opts.on('--private', 'Make repo private') do |v|
options[:private] = v
end
opts.on('-d', '--description=DESC', 'Description') do |v|
options[:description] = v
end
end.parse!
options[:name] = ARGV.pop.to_s.strip
if options[:name].empty?
puts banner
exit 1
end
auth_token = ENV['GIT_NETFLUX_IO_TOKEN']
if !auth_token || auth_token.empty?
puts 'Env var GIT_NETFLUX_IO_TOKEN must be set'
exit 1
end
uri = URI('https://git.netflux.io/api/v1/user/repos')
auth_string = "token #{auth_token}"
req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json', 'Authorization' => auth_string)
req.body = options.to_json
Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
resp = http.request(req)
if resp.code != '201'
begin
errmsg = JSON.parse(resp.body)
puts errmsg['message']
rescue JSON::ParserError
puts resp.body
end
exit 1
end
repo = JSON.parse(resp.body)
puts "git remote add origin #{repo['ssh_url']}"
end

View File

@ -1,36 +0,0 @@
#!/usr/bin/env bash
#
# Delete a vim plugin.
# Use with `-o` argument to delete from opt/
set -e
if [ "$1" = "-o" ]; then
opt=1
dir="$HOME/.vim/pack/git-plugins/opt"
basename=$2
else
opt=0
dir="$HOME/.vim/pack/git-plugins/start"
basename=$1
fi
if [ -z "$basename" ]; then
echo "Usage: deletevimplugin [-o] <basename>"
exit 1
fi
path="$dir/$basename"
if [ ! -d "$path" ]; then
echo "Plugin not found: $basename"
exit 1
fi
rm -rf "$path"
echo "Deleted $basename"
if [ $opt = 1 ]; then
echo "Now, remove the following line to $HOME/.vimrc:"
echo "packadd! $basename \" <git url>"
fi

View File

@ -18,7 +18,7 @@ if [ -z "$filepattern" ]; then
filepattern="*"
fi
if [ "$(uname -s)" = "Linux" ]; then
if [ $(uname -s) = "Linux" ]; then
echo "TODO: fix for Linux"
fi

View File

@ -5,5 +5,5 @@
set -e
ssh-keygen -o -a 100 -t ed25519 -f "$HOME/.ssh/id_ed25519" -C "$USER@$(hostname -s)"
cat "$HOME/.ssh/id_ed25519.pub"
ssh-keygen -o -a 100 -t ed25519 -f $HOME/.ssh/id_ed25519 -C "$USER@$(hostname -s)"
cat $HOME/.ssh/id_ed25519.pub

View File

@ -13,9 +13,9 @@ if ! echo "$ghoutput" | grep -q 'https://'; then
exit 1
fi
url=$(echo "$ghoutput" | grep -o 'https://.*?' | tr -d '?')
url=$(echo $ghoutput | grep -o 'https://.*?' | tr -d '?')
if [ "$(uname -s)" = "Linux" ]; then
if [ $(uname -s) = "Linux" ]; then
progname="xdg-open"
else
progname="open" # macOS

View File

@ -9,7 +9,6 @@ unset BROWSER
if [ "$1" = '-a' ]; then
cmd='gh pr list --limit 100'
elif [ -z "$GITHUB_USERNAME" ]; then
# shellcheck disable=SC2016
echo 'set $GITHUB_USERNAME first'
exit 1
else
@ -17,7 +16,7 @@ else
fi
prid=$(eval "$cmd" | fzf | awk '{print $1}')
if [ -z "$prid" ]; then
if [ -z $prid ]; then
exit 0
fi
gh pr checkout "$prid"
gh pr checkout $prid

View File

@ -22,6 +22,6 @@ if echo "$output" | grep -q "no pull requests found"; then
echo "Opening new PR..."
gh pr create -w
else
echo "$output"
echo $output
exit $exitcode
fi

View File

@ -1,21 +0,0 @@
#!/usr/bin/env bash
#
# Try to detect if the current repo has a main branch, or master.
set -e
if git branch -l | grep -q "main"; then
>&2 echo "mainbranch: selected branch main"
sleep 0.5
echo "main"
exit 0
fi
if git branch -l | grep -q "master"; then
>&2 echo "mainbranch: selected branch master"
sleep 0.5
echo "master"
exit 0
fi
exit 1

View File

@ -9,4 +9,4 @@ if [ "$1" = "-s" ]; then
fi
# TODO: fix for non-Darwin
git rev-parse "$args" HEAD | tr -d '\n' | pbcopy
git rev-parse $args HEAD | tr -d '\n' | pbcopy

View File

@ -14,27 +14,27 @@ if ! [ -x "$(command -v cargo)" ]; then
exit 1
fi
mkdir -p "$HOME/dev" "$HOME/bin"
mkdir -p $HOME/dev $HOME/bin
destdir=$HOME/dev/alacritty
if [ -d "$destdir" ]; then
if [ -d $destdir ]; then
echo "Updating alacritty..."
cd "$destdir"
cd $destdir
git pull --rebase
else
echo "Cloning alacritty..."
cd "$HOME/dev"
cd $HOME/dev
git clone -q https://github.com/alacritty/alacritty.git alacritty
fi
cd "$destdir"
cd $destdir
echo "Building alacritty..."
if [ "$(uname -s)" = "Darwin" ]; then
if [ $(uname -s) = "Darwin" ]; then
make app
sudo cp -av "$destdir/target/release/osx/Alacritty.app" /Applications/
echo "To install: cp -r $destdir/target/release/osx/Alacritty.app /Applications/"
else
cargo build --release
echo "Installing alacritty..."
cp "$destdir/target/release/alacritty" "$HOME/bin/alacritty"
cp $destdir/target/release/alacritty $HOME/bin/alacritty
fi
if [ -z "$ZDOTDIR" ]; then
@ -44,13 +44,13 @@ fi
echo "Installing ZSH completions..."
funcdir=$ZDOTDIR/functions
mkdir -p "$funcdir"
cp "$destdir/extra/completions/_alacritty" "$funcdir/_alacritty"
mkdir -p $funcdir
cp $destdir/extra/completions/_alacritty $funcdir/_alacritty
if [ "$(uname -s)" = "Linux" ]; then
if [ $(uname -s) = "Linux" ]; then
# TODO: fix for Manjaro/xfce4:
sudo cp "$destdir/extra/logo/alacritty-term.svg" /usr/share/pixmaps/Alacritty.svg
sudo desktop-file-install "$destdir/extra/linux/Alacritty.desktop"
sudo cp $destdir/extra/logo/alacritty-term.svg /usr/share/pixmaps/Alacritty.svg
sudo desktop-file-install $destdir/extra/linux/Alacritty.desktop
sudo update-desktop-database
fi

View File

@ -6,49 +6,47 @@
set -e
# General
mkdir -p "$HOME/dev"
ln -sfn "$HOME/dev/dotfiles/script" "$HOME/script"
mkdir -p $HOME/dev
ln -sfn $HOME/dev/dotfiles/script $HOME/script
# ZSH
mkdir -p "$HOME/.config/zsh/functions"
mkdir -p $HOME/.config/zsh/functions
# TODO: ZSH on Mac appears to load zshenv from ZDOTDIR, not HOME.
# Try to consolidate this.
if [ "$(uname -s)" = "Darwin" ]; then
if [ $(uname -s) = "Darwin" ]; then
envpath="$HOME/.config/zsh/.zshenv"
else
envpath="$HOME/.zshenv"
fi
ln -sfn "$HOME/dev/dotfiles/zshenv" "$envpath"
ln -sfn "$HOME/dev/dotfiles/zshrc" "$HOME/.config/zsh/.zshrc"
ln -sfn $HOME/dev/dotfiles/zshenv "$envpath"
ln -sfn $HOME/dev/dotfiles/zshrc $HOME/.config/zsh/.zshrc
secretsfile="$HOME/.config/zsh/.zshsecrets"
if [ ! -f "$secretsfile" ]; then
cp "$HOME/dev/dotfiles/zshsecrets.example" "$secretsfile"
cp $HOME/dev/dotfiles/zshsecrets.example "$secretsfile"
fi
# Tmux
ln -sfn "$HOME/dev/dotfiles/tmux.conf" "$HOME/.tmux.conf"
ln -sfn $HOME/dev/dotfiles/tmux.conf $HOME/.tmux.conf
# Vim
mkdir -p "$HOME/.vim/pack/git-plugins/{opt,start}"
ln -sfn "$HOME/dev/dotfiles/vimrc" "$HOME/.vimrc"
ln -sfn "$HOME/dev/dotfiles/vim/after" "$HOME/.vim/after"
ln -sfn "$HOME/dev/dotfiles/vim/after" "$HOME/.vim/queries"
ln -sfn "$HOME/dev/dotfiles/vim/after" "$HOME/.vim/lua"
mkdir -p $HOME/.vim/pack/git-plugins/{opt,start}
ln -sfn $HOME/dev/dotfiles/vimrc $HOME/.vimrc
ln -sfn $HOME/dev/dotfiles/vim/after $HOME/.vim/after
# Git
ln -sfn "$HOME/dev/dotfiles/gitconfig" "$HOME/.gitconfig"
mkdir -p "$HOME/.config/git"
ln -sfn "$HOME/dev/dotfiles/gitignore" "$HOME/.config/git/ignore"
ln -sfn $HOME/dev/dotfiles/gitconfig $HOME/.gitconfig
mkdir -p $HOME/.config/git
ln -sfn $HOME/dev/dotfiles/gitignore $HOME/.config/git/ignore
# Alacritty
if [ "$(uname -s)" = "Darwin" ]; then
if [ $(uname -s) = "Darwin" ]; then
alacrittyconfig="$HOME/dev/dotfiles/alacritty.macos.yml"
else
alacrittyconfig="$HOME/dev/dotfiles/alacritty.yml"
fi
ln -sfn "$alacrittyconfig" "$HOME/.config/alacritty.yml"
ln -sfn "$alacrittyconfig" $HOME/.config/alacritty.yml
echo "Done"

View File

@ -3,18 +3,18 @@
# Clone or update nvim to $HOME/dev/neovim, build and install to $HOME/local
set -e
mkdir -p "$HOME/dev"
mkdir -p $HOME/dev
destdir=$HOME/dev/neovim
if [ -d "$destdir" ]; then
if [ -d $destdir ]; then
echo "Updating nvim..."
cd "$destdir"
cd $destdir
git pull --rebase
else
echo "Cloning nvim..."
cd "$HOME/dev"
cd $HOME/dev
git clone -q https://github.com/neovim/neovim.git neovim
cd "$destdir"
cd $destdir
fi
make CMAKE_BUILD_TYPE=Release CMAKE_INSTALL_PREFIX="$HOME/local"
make CMAKE_BUILD_TYPE=Release CMAKE_INSTALL_PREFIX=$HOME/local
make install

View File

@ -2,14 +2,14 @@
#
# install packages for a new arch or manjaro installation. requires sudo
if [[ $EUID -gt 0 ]]; then
if [[ $euid > 0 ]]; then
echo "requires administrative privileges"
exit 1
fi
pacman -S --needed --noconfirm base-devel \
git \
eza \
exa \
fzf \
tmux \
ripgrep \
@ -21,4 +21,4 @@ pacman -S --needed --noconfirm base-devel \
syncthing \
ttf-ubuntu-font-family # ubuntu mono font for alacritty
sudo -u "$SUDO_USER" ./script/installpackagesnonroot
sudo -u $SUDO_USER ./script/installpackagesnonroot

View File

@ -4,8 +4,7 @@
# https://rustup.rs/
curl --proto '=https' --tlsv1.2 -ssf https://sh.rustup.rs | sh -s -- -y
# shellcheck disable=SC1091
source "$HOME/.cargo/env"
source $HOME/.cargo/env
# https://github.com/dandavison/delta#installation
cargo install git-delta

28
script/installvim Executable file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env bash
#
# Clone or update vim to $HOME/dev/vim, build and install to $HOME/local
set -e
mkdir -p $HOME/dev
destdir=$HOME/dev/vim
if [ -d $destdir ]; then
echo "Updating vim..."
cd $destdir
git pull --rebase
else
echo "Cloning vim..."
cd $HOME/dev
git clone -q https://github.com/vim/vim.git vim
fi
cd $destdir
# TODO: https://stackoverflow.com/questions/53135863/macos-mojave-ruby-config-h-file-not-found
opts="--enable-luainterp --enable-python3interp --with-features=huge --enable-multibyte --enable-gui=gtk2"
if [ ! $(uname -s) = "Darwin" ]; then
opts="$opts --with-rubyinterp --with-x"
fi
./configure --prefix=$HOME/local $opts
make -j6
make install

View File

@ -7,18 +7,18 @@ set -e
# Note: not currently updated automatically by `updatevimplugins`
url="https://raw.githubusercontent.com/junegunn/fzf/master/plugin/fzf.vim"
echo "Fetching $url..."
mkdir -p "$HOME/.vim/plugin"
curl -sL -o "$HOME/.vim/plugin/fzf.vim" https://raw.githubusercontent.com/junegunn/fzf/master/plugin/fzf.vim
mkdir -p $HOME/.vim/plugin
curl -sL -o $HOME/.vim/plugin/fzf.vim https://raw.githubusercontent.com/junegunn/fzf/master/plugin/fzf.vim
# Relies on vimrc containing lines e.g.:
# packadd! rust.vim " https://github.com/rust-lang/rust.vim.git
pluginhome=$HOME/.vim/pack/git-plugins/opt
mkdir -p "$pluginhome"
cd "$pluginhome"
mkdir -p $pluginhome
cd $pluginhome
grep packadd! "$HOME/.config/nvim/init.vim" | grep -o 'https.*$' | while read -r url ; do
dirname=$(basename "$url" .git)
grep packadd! $HOME/.config/nvim/init.vim | grep -o 'https.*$' | while read -r url ; do
dirname=$(basename $url .git)
if [ -d "$dirname" ]; then
echo "Exists: $dirname"
else

View File

@ -5,12 +5,12 @@
set -e
if [ -z "$JIRADOMAIN" ]; then
# shellcheck disable=SC2016
echo 'set $JIRADOMAIN first'
exit 1
fi
if ! branchname="$(branchname)"; then
branchname="$(branchname)"
if [ ! $? -eq 0 ]; then
echo "branchname returned exit code: $?"
exit 1
fi
@ -21,10 +21,11 @@ if ! echo "$branchname" | grep -q "/"; then
fi
ticket=$(echo "$branchname" | cut -d "/" -f1 | tr '[:lower:]' '[:upper:]')
url="$JIRADOMAIN/browse/$ticket"
if [ "$1" == "-b" ]; then
if [ "$(uname -s)" = "Linux" ]; then
if [ $(uname -s) = "Linux" ]; then
progname="xdg-open"
else
progname="open" # macOS
@ -34,4 +35,4 @@ if [ "$1" == "-b" ]; then
exit $?
fi
printf "%s" "$url"
printf $url

View File

@ -1,8 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
if ! context=$(kubectl config get-contexts -o name | fzf); then
context=$(kubectl config get-contexts -o name | fzf)
if [ $? -ne 0 ]; then
exit $?
fi

View File

@ -7,11 +7,11 @@ set -e
url='https://api.ipify.org?format=text'
if [ "$1" = "-c" ]; then
if [ "$(uname -s)" = "Darwin" ]; then
curl -s "$url" | pbcopy
if [ $(uname -s) = "Darwin" ]; then
curl -s $url | pbcopy
else
curl -s "$url" | xclip -i
curl -s $url | xclip -i
fi
else
curl -s "$url"
curl -s $url
fi

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bash
#
# Enable external screen (office-layout)
set -euo pipefail
if [ "$(uname -s)" != "Linux" ]; then
echo "non-Linux not supported"
exit 1
fi
xrandr --output DP-1 --mode 3440x1440 --left-of eDP-1

View File

@ -21,14 +21,6 @@ case "$1" in
exit 0
;;
"gb")
setxkbmap -model pc105 -layout gb,gb -variant mac, -option compose:rctrl
# keymap mods for Logitech keyboard.
# xmodmap -pke
xmodmap "$(dirname "$0")/../xmodmap-mx-keys-mac"
exit 0
;;
"")
echo "argument required"
exit 1

View File

@ -4,8 +4,8 @@
set -e
if [ "$(uname -s)" = "Darwin" ]; then
uptime | tr -d ',' | grep -o "[0-9]\+\.[0-9]\+ [0-9]\+\.[0-9]\+ [0-9]\+\.[0-9]\+"
if [ $(uname -s) = "Darwin" ]; then
uptime | grep -o "[0-9]\+\.[0-9]\+ [0-9]\+\.[0-9]\+ [0-9]\+\.[0-9]\+"
else # Linux
cut -d " " -f 1-3 /proc/loadavg
fi

View File

@ -1,15 +0,0 @@
#!/usr/bin/env bash
#
# Print battery percentage to stdout
set -e
pc=$(batinfo)
if [[ "$pc" -gt 40 ]]; then
echo "#[fg=black, bg=green] $(batinfo)% #[default]"
elif [[ "$pc" -gt 10 ]]; then
echo "#[fg=black, bg=yellow] $(batinfo)% #[default]"
else
echo "#[fg=black, bg=red] $(batinfo)% #[default]"
fi

View File

@ -9,28 +9,14 @@ set -e
if [ -z "$1" ]; then
cwd=$(pwd)
sessionname=$(basename "$cwd" | tr .: _)
sessionname=$(basename $cwd)
else
sessionname="$1"
fi
tmux_new_result=$(tmux new -d -s "$sessionname" 2>&1) || true
exitcode=$?
if echo "$tmux_new_result" | grep -q "duplicate session"; then
echo "Session $sessionname already exists. Attaching..."
tmux new -d -A -s "$sessionname"
exit 0
fi
if [ $exitcode -ne 0 ]; then
echo "$tmux_new_result"
exit $exitcode
fi
tmux rename-window -t "$sessionname:1" cli
tmux new-window -t "$sessionname" -n vim zsh -ic nvim
tmux select-window -t "$sessionname:1"
tmux new -d -s $sessionname
tmux rename-window -t $sessionname:1 cli
tmux new-window -t $sessionname -n vim nvim
tmux select-window -t $sessionname:1
# https://github.com/tmux/tmux/issues/2064
sleep 0.5
tmux attach -t "$sessionname"
tmux attach -t $sessionname

19
script/unstagebranch Executable file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
#
# Unstage a branch
set -e
branch=$(git rev-parse --abbrev-ref HEAD)
if [ -z "$1" ]; then
basebranch="master"
else
basebranch="$1"
fi
diff=$(git diff $basebranch...HEAD)
git co -q "$basebranch"
echo "$diff" | git apply
echo "Unstaged $branch against $basebranch successfully"
git diff --shortstat "HEAD...$branch"

View File

@ -2,9 +2,7 @@
#
# Update all AUR packages in $HOME/pkg
set -euo pipefail
find "$HOME/pkg" -mindepth 1 -maxdepth 1 -type d -print0 | while read -rd $'\0' pkgdir
find $HOME/pkg -mindepth 1 -maxdepth 1 -type d -print0 | while read -d $'\0' pkgdir
do
cd "$pkgdir"
pullres=$(git pull --rebase)

View File

@ -12,10 +12,8 @@ updatenvim
updatevimplugins
echo "Installing gopls..."
cd "$HOME"
cd $HOME
go install golang.org/x/tools/gopls@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
# TODO: run installdotfiles?
echo "Done"

27
script/updateinvidious Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
#
# Build and push Invidious
#
# TODO: remove Docker hub, push with SSH.
set -e
destdir=$HOME/dev/invidious
image=netfluxio/invidious:latest
remotehost=netflux
if [ ! -d $destdir ]; then
echo "Cloning invidious..."
cd $HOME/dev
git clone -q --depth=1 https://github.com/iv-org/invidious.git invidious
else
echo "Updating invidious..."
cd $destdir
git pull --rebase
fi
cd $destdir
docker build -t $image -f docker/Dockerfile .
docker push $image
ssh $remotehost 'cd dev/netflux-internals && docker-compose pull invidious && docker-compose up -d --force-recreate --no-deps invidious'

12
script/updatenetflux Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
#
# updatenetflux - pull and restart containers on remote server
set -e
remotehost=netflux
ssh $remotehost 'cd dev/netflux-internals && git pull --rebase && docker-compose down -v && docker-compose pull && docker-compose up -d --force-recreate'
# invidious requires a local build, managed by a separate script.
updateinvidious

1
script/updatevim Symbolic link
View File

@ -0,0 +1 @@
installvim

View File

@ -5,13 +5,13 @@
set -e
pluginhome=$HOME/.vim/pack/git-plugins
cd "$pluginhome"
cd $pluginhome
find . -mindepth 2 -maxdepth 2 -type d -print0 | while read -rd $'\0' pluginpath
find . -mindepth 2 -maxdepth 2 -type d -print0 | while read -d $'\0' pluginpath
do
cd "$pluginpath"
basename=$(basename "$pluginpath")
printf "In %s.. " "$basename"
cd $pluginpath
basename=$(basename $pluginpath)
printf "In $basename.. "
git pull --rebase
cd "$pluginhome"
cd $pluginhome
done

View File

@ -2,6 +2,4 @@
#
# uuidprint - generate and print a lower-case UUID v4
set -e
uuidgen | tr '[:upper:]' '[:lower:]' | tr -d '\n'

View File

@ -2,7 +2,5 @@
#
# uuidyank - generate and copy a lower-case UUID v4
set -e
# TODO: fix for Linux
uuidprint | pbcopy

View File

@ -4,7 +4,7 @@
set -e
if [[ $EUID -gt 0 ]]; then
if [[ $EUID > 0 ]]; then
echo "requires administrative privileges"
exit 1
fi

View File

@ -4,7 +4,7 @@
set -e
if [[ $EUID -gt 0 ]]; then
if [[ $EUID > 0 ]]; then
echo "requires administrative privileges"
exit 1
fi

View File

@ -3,7 +3,6 @@
[Unit]
Description=Run tarsnap.service every six hours
Requires=tarsnap.service
After=network-online.target
[Timer]
Unit=tarsnap.service

View File

@ -10,7 +10,7 @@ set-option -g set-titles on
set-option -g focus-events on
set -g status-style 'fg=white, bg=colour8'
set -g window-status-current-style 'fg=black, bg=green'
set -g status-right '#(tmbatinfo) #[fg=black, bg=colour2] #(sysinfo) #[default] #[fg=white, bg=colour238] %H:%M #[default]'
set -g status-right '#[fg=black, bg=colour2] #(sysinfo) #[default] #[fg=white, bg=colour238] %H:%M #[default]'
set -g status-justify centre
set-window-option -g mode-keys vi
@ -24,7 +24,7 @@ bind-key v split-window -h
bind-key s split-window -v
bind-key p new-window \; set window-status-style fg=white,bg=red
bind-key c new-window -n 'cli'
bind-key e new-window -n 'vim' zsh -ic nvim
bind-key e new-window -n 'vim' nvim
bind-key C rename-window 'cli'
bind-key E rename-window 'vim'

View File

@ -14,7 +14,6 @@ nmap <silent> <leader>gV <c-w><c-o>:vsplit<bar>:GoAlternate!<cr>
nmap <silent> <leader>gs :split<bar>:GoAlternate!<cr>
nmap <silent> <leader>gS <c-w><c-o>:split<bar>:GoAlternate!<cr>
nmap <silent> <leader>gat <esc>:GoAddTags<cr>
nmap <silent> <leader>gfs <esc>:GoFillStruct<cr>
nmap <silent> <leader>grt <esc>:GoRemoveTags<cr>
nmap <silent> <leader>gec <esc>:up<bar>:GoErrCheck<cr>
@ -29,7 +28,8 @@ nnoremap <silent> ds :GoDebugStep<cr>
" Vim-Go configuration
let g:go_gopls_enabled = 0
let g:go_fmt_autosave = 0
let g:go_fmt_autosave = 1
let g:go_fmt_command = "goimports"
let g:go_imports_autosave = 0
let g:go_textobj_enabled = 0
let g:go_auto_sameids = 0
@ -42,6 +42,8 @@ let g:go_highlight_diagnostic_errors = 0
let g:go_highlight_diagnostic_warnings = 0
let g:go_highlight_trailing_whitespace_error=0
let g:go_fmt_command = 'goimports'
" g:go_statusline_duration doesn't seem to work accurately, but does help
" reduce the time the build/test success messages are shown in the status
" line.
@ -73,4 +75,3 @@ iabbrev fortc for _, tc := range testCases {<cr>t.Run(tc.name, func(t *testing.T
iabbrev mapss map[string]string
iabbrev mapsi map[string]int
iabbrev mapsa map[string]any
iabbrev mapaa map[any]any

View File

@ -1,4 +1,3 @@
; extends
;; key/value-like types. Works with struct values, struct definitions and parameter value/type pairs:
;;
;; @keyed_element.outer => key and value
@ -7,3 +6,23 @@
(keyed_element (_) . (_) @keyed_element.inner) @keyed_element.outer
(field_declaration type: (_) @keyed_element.inner) @keyed_element.outer
(parameter_declaration type: (_) @keyed_element.inner) @keyed_element.outer
;; return statement
(return_statement (_) @return)
;; functions and methods with an optional preceeding comment:
;;
;; TODO: comment only matches a single line.
((
(comment)? @_start
.
(method_declaration) @_end
) (make-range! "function_with_comment" @_start @_end))
((
(comment)? @_start
.
(function_declaration) @_end
) (make-range! "function_with_comment" @_start @_end))

View File

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

View File

@ -1,9 +0,0 @@
require("aerial").setup({
on_attach = function(bufnr)
vim.keymap.set("n", "[", "<cmd>AerialPrev<CR>", { buffer = bufnr })
vim.keymap.set("n", "]", "<cmd>AerialNext<CR>", { buffer = bufnr })
end,
autojump = true,
})
vim.keymap.set("n", "<leader>a", "<cmd>AerialToggle!<CR>")
vim.keymap.set("n", "<leader>ds", "<cmd>call aerial#fzf()<CR>")

View File

@ -1,61 +0,0 @@
function _G.dump(...)
local objects = vim.tbl_map(vim.inspect, { ... })
print(unpack(objects))
return ...
end
function _G.insert_uuid()
local uuid = vim.fn.system("uuidprint")
local errcode = vim.v.shell_error
if errcode ~= 0 then
vim.api.nvim_err_writeln("uuidprint returned error code: " .. errcode)
return
end
vim.fn.setreg("u", uuid)
vim.api.nvim_command([[normal! "up]])
end
vim.api.nvim_set_keymap("n", "<leader>pu", [[:lua _G.insert_uuid()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<c-d><c-u>", [[<esc>:lua _G.insert_uuid()<cr>a]], { noremap = true, silent = true })
function _G.insert_jira_url()
local url = vim.fn.system("jira")
local errcode = vim.v.shell_error
if errcode ~= 0 then
vim.api.nvim_err_writeln("jira returned error code: " .. errcode)
return
end
vim.fn.setreg("u", url)
vim.api.nvim_command([[normal! "up]])
end
vim.api.nvim_set_keymap("n", "<leader>pj", [[:lua _G.insert_jira_url()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap("i", "<c-d><c-j>", [[<esc>:lua _G.insert_jira_url()<cr>a]], { noremap = true, silent = true })
function _G.insert_iso8601_timestamp()
local ts = vim.fn.system("echo -n $(date --iso-8601=seconds)")
local errcode = vim.v.shell_error
if errcode ~= 0 then
vim.api.nvim_err_writeln("date returned error code: " .. errcode)
return
end
vim.fn.setreg("u", ts)
vim.api.nvim_command([[normal! "up]])
end
vim.api.nvim_set_keymap(
"n",
"<leader>pt",
[[:lua _G.insert_iso8601_timestamp()<cr>]],
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap(
"i",
"<c-d><c-t>",
[[<esc>:lua _G.insert_iso8601_timestamp()<cr>a]],
{ noremap = true, silent = true }
)

View File

@ -1,22 +0,0 @@
-- TODO: prettierd
-- TODO: async save-on-write? Or set timeout.
require("conform").setup({
formatters_by_ft = {
javascript = { "prettier" },
go = { "goimports" },
lua = { "stylua" },
rust = { "rustfmt" },
typescript = { "prettier" },
typescriptreact = { "prettier" },
},
formatters = {
prettier = {
args = { "--stdin-filepath", "$FILENAME", "--single-quote" },
},
},
format_on_save = {
lsp_fallback = true,
},
log_level = vim.log.levels.ERROR,
notify_on_error = true,
})

View File

@ -1,11 +0,0 @@
vim.defer_fn(function()
require("copilot").setup({
panel = {
enabled = false,
auto_refresh = true,
},
suggestion = {
enabled = false,
},
})
end, 100)

View File

@ -1,92 +0,0 @@
require("gitsigns").setup({
signs = {
add = { text = "" },
change = { text = "~" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "%" },
untracked = { text = "" },
},
signcolumn = true,
numhl = false,
linehl = false,
word_diff = false,
watch_gitdir = {
follow_files = true,
},
attach_to_untracked = true,
current_line_blame = true,
current_line_blame_opts = {
virt_text = true,
virt_text_pos = "eol",
delay = 1000,
ignore_whitespace = false,
},
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
sign_priority = 6,
update_debounce = 100,
status_formatter = nil,
max_file_length = 40000,
preview_config = {
border = "single",
style = "minimal",
relative = "cursor",
row = 0,
col = 1,
},
yadm = {
enable = false,
},
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
map("n", "]h", function()
if vim.wo.diff then
return "]h"
end
vim.schedule(function()
gs.next_hunk()
end)
return "<Ignore>"
end, { expr = true })
map("n", "[h", function()
if vim.wo.diff then
return "[h"
end
vim.schedule(function()
gs.prev_hunk()
end)
return "<Ignore>"
end, { expr = true })
map("n", "<leader>hs", gs.stage_hunk)
map("n", "<leader>hr", gs.reset_hunk)
map("v", "<leader>hs", function()
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
end)
map("v", "<leader>hr", function()
gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
end)
map("n", "<leader>hS", gs.stage_buffer)
map("n", "<leader>hu", gs.undo_stage_hunk)
map("n", "<leader>hR", gs.reset_buffer)
map("n", "<leader>hp", gs.preview_hunk)
map("n", "<leader>hb", function()
gs.blame_line({ full = true })
end)
map("n", "<leader>hd", gs.diffthis)
map("n", "<leader>hD", function()
gs.diffthis("~")
end)
map("n", "<leader>hx", gs.toggle_deleted)
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>")
end,
})

View File

@ -1,39 +0,0 @@
-- Return the node_modules path for this project. If the project root contains a
-- frontend/ directory, assume node_modules lives there.
function Get_project_node_modules_path()
local root_path = vim.fn.getcwd()
local frontend_path = root_path .. "/frontend"
local is_frontend = vim.fn.isdirectory(frontend_path) ~= 0
local base_path = root_path
if is_frontend then
base_path = frontend_path
end
return base_path .. "/node_modules"
end
-- Return the project's go module path from go.mod, or an empty string if the file cannot be read.
function Get_project_go_module_path()
local root_path = vim.fn.getcwd()
local mod_path = root_path .. "/go.mod"
if vim.fn.filereadable(mod_path) == 0 then
return ""
end
local file = io.open(mod_path, "r")
if file == nil then
return ""
end
io.input(file)
-- The first line of go.mod, something like:
-- module github.com/username/repo
local line = io.read()
io.close(file)
local match = string.match(line, "^module (.+)")
if match == nil then
return ""
end
return match
end

View File

@ -1,116 +0,0 @@
require("nvim-web-devicons").setup({})
local mode_map = {
NORMAL = "N",
INSERT = "I",
REPLACE = "R",
COMMAND = "C",
VISUAL = "v",
["V-BLOCK"] = "V",
["V-LINE"] = "V-LINE",
}
local function format_diff_element(val, sym)
if val == nil or val < 1 then
return ""
end
return sym .. val
end
local diagnostics = {
"diagnostics",
sources = { "nvim_lsp" },
diagnostics_color = {
error = { fg = "#ffffff", bg = "#bf616a" },
warn = { fg = "#ebcb8b" },
info = { fg = "#81a1c1" },
hint = { fg = "#a3be8c" },
},
always_visible = false,
separator = { left = " " },
symbols = {
error = function(count)
return count .. "E"
end,
warn = function(count)
return count .. "W"
end,
info = function(count)
return count .. "I"
end,
hint = function(count)
return count .. "H"
end,
},
}
require("lualine").setup({
options = {
icons_enabled = false,
theme = "nord",
component_separators = "",
section_separators = { left = "", right = "" },
},
sections = {
lualine_a = {
{
"mode",
fmt = function(mode)
return mode_map[mode] or mode
end,
},
"paste",
},
lualine_b = { "filename" },
lualine_c = {
{
"branch",
padding = 1,
},
-- render coloured output from gitsigns, this doesn't seem to work with b:gitsigns_status:
{
function()
return format_diff_element(vim.b.gitsigns_status_dict.added, "+")
end,
color = { fg = "#a3be8c" },
},
{
function()
return format_diff_element(vim.b.gitsigns_status_dict.changed, "~")
end,
color = { fg = "#ebcb8b" },
},
{
function()
return format_diff_element(vim.b.gitsigns_status_dict.removed, "-")
end,
color = { fg = "#bf616a" },
},
diagnostics,
},
lualine_x = {
{
function()
local go_status_line = vim.api.nvim_call_function("go#statusline#Show", {})
if go_status_line ~= "" then
return go_status_line
end
return vim.bo.filetype
end,
padding = { left = 1, right = 0 },
},
},
lualine_y = { { "progress", padding = { left = 1, right = 1 } } },
lualine_z = { { "location", padding = { left = 1, right = 1 } } },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename", diagnostics },
lualine_x = { { "location", padding = { right = 0 } } },
lualine_y = {},
lualine_z = {},
},
})

View File

@ -1,193 +0,0 @@
local nvim_lsp = require("lspconfig")
local on_attach = function(client, bufnr)
-- TODO: use vim.api.nvim_create_autocmd
vim.api.nvim_exec2([[autocmd User LspDiagnosticsChanged call lightline#update()]], { output = false })
local opts = { noremap = true, silent = false }
vim.api.nvim_buf_set_keymap(bufnr, "n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "<Cmd>lua vim.lsp.buf.type_definition()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>gD", "<Cmd>lua vim.lsp.buf.type_definition()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>e", "<Cmd>lua vim.lsp.buf.rename()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>r", "<Cmd>lua vim.lsp.buf.references()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>i", "<Cmd>lua vim.lsp.buf.implementation()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>ca", "<Cmd>lua vim.lsp.buf.code_action()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>ci", "<Cmd>lua vim.lsp.buf.incoming_calls()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>co", "<Cmd>lua vim.lsp.buf.outgoing_calls()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "]e", '<Cmd>lua vim.diagnostic.goto_next({severity="Error"})<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "[e", '<Cmd>lua vim.diagnostic.goto_prev({severity="Error"})<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", "<Cmd>lua vim.diagnostic.goto_next()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "[d", "<Cmd>lua vim.diagnostic.goto_prev()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "cd", "<Cmd>lua vim.diagnostic.hide(nil, 0)<CR>", opts)
-- fzf triggers:
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>fr", "<Cmd>References<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>fi", "<Cmd>Implementations<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>fs", "<Cmd>DocumentSymbols<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>fw", "<Cmd>WorkspaceSymbols<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>fc", "<Cmd>CodeActions<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>fci", "<Cmd>IncomingCalls<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>fco", "<Cmd>OutgoingCalls<CR>", opts)
require("lsp_signature").on_attach({
hint_enable = false,
})
require("copilot_cmp").setup()
end
-- Go
local capabilities = require("cmp_nvim_lsp").default_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = false
capabilities.textDocument.completion.completionItem.resolveSupport = {
properties = {
"documentation",
"detail",
"additionalTextEdits",
},
}
nvim_lsp.gopls.setup({
settings = {
gopls = {
staticcheck = true,
-- Disalbing linksInHover may not be working as expected:
linksInHover = false,
usePlaceholders = true,
experimentalPostfixCompletions = true,
analyses = {
unusedparams = true,
shadow = true,
unusedwrite = true,
unusedresult = true,
nilness = true,
},
},
},
init_options = {
usePlaceholders = true,
},
capabilities = capabilities,
on_attach = on_attach,
})
-- Rust
nvim_lsp.rust_analyzer.setup({
capabilities = capabilities,
on_attach = on_attach,
settings = {
["rust-analyzer"] = {
imports = {
granularity = {
group = "module",
},
prefix = "self",
},
cargo = {
buildScripts = {
enable = true,
},
},
procMacro = {
enable = false,
},
diagnostics = {
disabled = { "unresolved-proc-macro" },
},
},
},
})
-- Ruby
nvim_lsp.solargraph.setup({
on_attach = on_attach,
})
-- Typescript
-- https://jose-elias-alvarez.medium.com/configuring-neovims-lsp-client-for-typescript-development-5789d58ea9c
nvim_lsp.tsserver.setup({
on_attach = on_attach,
})
local filetypes = {
typescript = "eslint",
typescriptreact = "eslint",
}
-- diagnosticls
local linters = {
eslint = {
sourceName = "eslint",
-- fallback to global eslint if the local is not found?
-- https://github.com/creativenull/diagnosticls-configs-nvim/blob/e7d6f7e99f6b416d2aeee89314bc46fc36df7b22/lua/diagnosticls-configs/fs.lua#L20
command = "./node_modules/.bin/eslint",
rootPatterns = { ".eslintrc", ".eslintrc.js" },
debounce = 100,
args = { "--stdin", "--stdin-filename", "%filepath", "--format", "json" },
parseJson = {
errorsRoot = "[0].messages",
line = "line",
column = "column",
endLine = "endLine",
endColumn = "endColumn",
message = "${message} [${ruleId}]",
security = "severity",
},
securities = { [1] = "error", [2] = "warning" },
},
}
nvim_lsp.diagnosticls.setup({
on_attach = on_attach,
filetypes = vim.tbl_keys(filetypes),
init_options = {
linters = linters,
filetypes = filetypes,
},
})
-- Lua
local runtime_path = vim.split(package.path, ";")
table.insert(runtime_path, "lua/?.lua")
table.insert(runtime_path, "lua/?/init.lua")
nvim_lsp.lua_ls.setup({
settings = {
Lua = {
runtime = {
version = "LuaJIT",
path = runtime_path,
},
diagnostics = {
globals = { "vim" },
},
workspace = {
library = vim.api.nvim_get_runtime_file("", true),
},
telemetry = {
enable = false,
},
},
},
on_attach = on_attach,
})
-- Bash language server
-- https://github.com/bash-lsp/bash-language-server#neovim
vim.api.nvim_create_autocmd("FileType", {
pattern = "sh",
callback = function()
vim.lsp.start({
name = "bash-language-server",
cmd = { "bash-language-server", "start" },
})
end,
})

View File

@ -1,92 +0,0 @@
local cmp = require("cmp")
-- https://github.com/zbirenbaum/copilot-cmp#tab-completion-configuration-highly-recommended
local has_words_before = function()
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then
return false
end
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_text(0, line - 1, 0, line - 1, col, {})[1]:match("^%s*$") == nil
end
cmp.setup({
completion = {
completeopt = "menu,menuone,noinsert,noselect",
},
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
preselect = cmp.PreselectMode.None,
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
["<C-u>"] = cmp.mapping.scroll_docs(-4),
["<C-d>"] = cmp.mapping.scroll_docs(4),
["<C-e>"] = cmp.mapping.close(),
["C-y"] = cmp.mapping.confirm({ select = true, behaviour = cmp.ConfirmBehavior.Replace }),
-- https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings#super-tab-like-mapping
["<C-Space>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Insert,
select = true,
}),
["<Tab>"] = vim.schedule_wrap(function(fallback)
if cmp.visible() and has_words_before() then
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
else
fallback()
end
end),
["<S-Tab>"] = function(fallback)
if not cmp.select_prev_item() then
if vim.bo.buftype ~= "prompt" and has_words_before() then
cmp.complete()
else
fallback()
end
end
end,
}),
sources = cmp.config.sources({
{ name = "copilot" },
{ name = "nvim_lsp" },
{
name = "buffer",
option = {
get_bufnrs = function()
return vim.api.nvim_list_bufs()
end,
},
},
-- { name = "tmux", option = { all_panes = true } },
{ name = "path" },
{ name = "calc" },
}),
sorting = {
comparators = {
cmp.config.compare.exact,
require("copilot_cmp.comparators").prioritize,
cmp.config.compare.offset,
cmp.config.compare.score,
cmp.config.compare.recently_used,
cmp.config.compare.locality,
cmp.config.compare.kind,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.order,
},
},
-- https://github.com/hrsh7th/nvim-cmp/wiki/Advanced-techniques#disabling-completion-in-certain-contexts-such-as-comments
enabled = function()
return true
end,
formatting = {
fields = { "kind", "abbr", "menu" },
},
experimental = {
ghost_text = true,
},
})

View File

@ -1,4 +0,0 @@
vim.api.nvim_set_keymap("i", "<TAB>", [[vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<Tab>']], { expr = true })
vim.api.nvim_set_keymap("s", "<TAB>", [[vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<Tab>']], { expr = true })
vim.api.nvim_set_keymap("i", "<S-TAB>", [[vsnip#jumpable(1) ? '<Plug>(vsnip-jump-prev)' : '<S-Tab>']], { expr = true })
vim.api.nvim_set_keymap("s", "<S-TAB>", [[vsnip#jumpable(1) ? '<Plug>(vsnip-jump-prev)' : '<S-Tab>']], { expr = true })

View File

@ -1,109 +0,0 @@
_G._test_cmd_to_wins = {}
_G._build_test_cmd = function()
local bufnr = vim.fn.bufnr("%")
local filetype = vim.fn.getbufvar(bufnr, "&filetype")
if filetype == "" then
vim.api.nvim_err_writeln("cannot build test command for filetype:" .. filetype)
return nil
end
local path = vim.fn.expand("%:p")
-- TODO: allow line number to be passed
-- TODO: check file exists before running command
if filetype == "ruby" then
if not path:find("_spec.rb") then
path = path:gsub("/app/", "/spec/"):gsub([[.rb$]], "_spec.rb")
end
return "bundle exec rspec --format=progress --no-profile " .. path
elseif filetype == "go" then
return "go test -v " .. path:gsub("^(.*)/(.*go)$", "%1/...")
else
vim.api.nvim_err_writeln("filetype not supported: " .. filetype)
return nil
end
end
_G.run_tests = function()
local cmd = _G._build_test_cmd()
if cmd == nil then
return
end
vim.api.nvim_command([[silent up]])
local winid = _G._test_cmd_to_wins[cmd]
local current_winid = vim.fn.win_getid()
if
winid == nil
or not vim.api.nvim_win_is_valid(winid)
or winid == current_winid
or not vim.fn.win_gotoid(winid) == -1
then
vim.api.nvim_command([[10split]])
winid = vim.fn.win_getid()
_G._test_cmd_to_wins[cmd] = winid
end
local buf = vim.api.nvim_create_buf(false, true)
vim.api.nvim_buf_set_option(buf, "bufhidden", "delete")
vim.api.nvim_win_set_buf(winid, buf)
vim.fn.termopen(cmd)
vim.api.nvim_command([[normal! G]])
vim.api.nvim_command([[wincmd p]])
end
_G.focus_tests = function()
local cmd = _G._build_test_cmd()
if cmd == nil then
return
end
local winid = _G._test_cmd_to_wins[cmd]
if winid == nil or not vim.api.nvim_win_is_valid(winid) then
return
end
vim.fn.win_gotoid(winid)
vim.api.nvim_command([[wincmd =]])
end
_G.close_tests = function()
local current_winid = vim.api.nvim_get_current_win()
for _, winid in pairs(_G._test_cmd_to_wins) do
if current_winid == winid and vim.api.nvim_win_is_valid(winid) then
vim.api.nvim_win_close(winid, false)
return
end
end
local cmd = _G._build_test_cmd()
if cmd == nil then
return
end
local winid = _G._test_cmd_to_wins[cmd]
if winid == nil or not vim.api.nvim_win_is_valid(winid) then
return
end
vim.api.nvim_win_close(winid, false)
end
_G.copy_test_cmd = function()
local cmd = _G._build_test_cmd()
if cmd == nil then
return
end
vim.fn.setreg("+", cmd)
print("Copied: " .. cmd)
end
vim.api.nvim_set_keymap("n", "<leader>cr", [[:lua _G.run_tests()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>cf", [[:lua _G.focus_tests()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>cq", [[:lua _G.close_tests()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>cc", [[:lua _G.copy_test_cmd()<cr>]], { noremap = true, silent = true })

View File

@ -1,114 +0,0 @@
require("nvim-treesitter.configs").setup({
ensure_installed = {
"bash",
"dockerfile",
"go",
"gomod",
"gosum",
"html",
"javascript",
"typescript",
"json",
"lua",
"make",
"python",
"ruby",
"rust",
"sql",
"markdown",
},
sync_install = true,
auto_install = false,
ignore_install = {},
highlight = {
enable = true,
disable = { "vim", "swift" },
additional_vim_regex_highlighting = true,
},
incremental_selection = {
enable = false,
},
indent = {
-- enabling breaks autoindent:
enable = false,
},
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["ak"] = "@keyed_element.outer",
["iv"] = "@keyed_element.inner",
["av"] = "@keyed_element.inner",
["ia"] = "@parameter.inner",
["aa"] = "@parameter.outer",
["ac"] = "@comment.outer",
["at"] = "@statement.outer",
["ar"] = "@return",
["af"] = "@function.outer",
["if"] = "@function.inner",
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
["]a"] = "@parameter.inner",
["]f"] = "@function.outer",
["]F"] = "@function.inner",
},
goto_previous_start = {
["[a"] = "@parameter.inner",
["[f"] = "@function.outer",
["[F"] = "@function.inner",
},
},
lsp_interop = {
enable = true,
peek_definition_code = {
["<leader>d"] = "@class.outer",
-- ["<leader>d"] = "@function.outer",
},
},
},
refactor = {
highlight_definitions = { enable = true },
highlight_current_scope = { enable = false },
smart_rename = {
enable = true,
keymaps = {
smart_rename = "grr",
},
},
navigation = {
enable = true,
keymaps = {
-- goto_definition_lsp_fallback = "gd",
goto_next_usage = "]r",
goto_previous_usage = "[r",
},
},
},
playground = {
enable = true,
disable = {},
updatetime = 25,
persist_queries = false,
keybindings = {
toggle_query_editor = "o",
toggle_hl_groups = "i",
toggle_injected_languages = "t",
toggle_anonymous_nodes = "a",
toggle_language_display = "I",
focus_language = "f",
unfocus_language = "F",
update = "R",
goto_node = "<cr>",
show_help = "?",
},
},
})
require("treesitter-context").setup({
enable = true,
})

View File

@ -1,250 +0,0 @@
keycode 8 =
keycode 9 = Escape NoSymbol Escape
keycode 10 = 1 exclam 1 exclam onesuperior exclamdown onesuperior exclamdown
keycode 11 = 2 at 2 quotedbl EuroSign oneeighth twosuperior oneeighth
keycode 12 = 3 sterling 3 sterling numbersign sterling threesuperior sterling
keycode 13 = 4 dollar 4 dollar onequarter dollar EuroSign onequarter
keycode 14 = 5 percent 5 percent onehalf threeeighths onehalf threeeighths
keycode 15 = 6 asciicircum 6 asciicircum threequarters fiveeighths threequarters fiveeighths
keycode 16 = 7 ampersand 7 ampersand braceleft seveneighths braceleft seveneighths
keycode 17 = 8 asterisk 8 asterisk bracketleft trademark bracketleft trademark
keycode 18 = 9 parenleft 9 parenleft bracketright plusminus bracketright plusminus
keycode 19 = 0 parenright 0 parenright braceright degree braceright degree
keycode 20 = minus underscore minus underscore backslash questiondown backslash questiondown
keycode 21 = equal plus equal plus dead_cedilla dead_ogonek dead_cedilla dead_ogonek
keycode 22 = BackSpace BackSpace BackSpace BackSpace
keycode 23 = Tab ISO_Left_Tab Tab ISO_Left_Tab
keycode 24 = q Q q Q at Greek_OMEGA at Greek_OMEGA
keycode 25 = w W w W U017F section U017F section
keycode 26 = e E e E e E e E
keycode 27 = r R r R paragraph registered paragraph registered
keycode 28 = t T t T tslash Tslash tslash Tslash
keycode 29 = y Y y Y leftarrow yen leftarrow yen
keycode 30 = u U u U downarrow uparrow downarrow uparrow
keycode 31 = i I i I rightarrow idotless rightarrow idotless
keycode 32 = o O o O oslash Oslash oslash Oslash
keycode 33 = p P p P thorn THORN thorn THORN
keycode 34 = bracketleft braceleft bracketleft braceleft dead_diaeresis dead_abovering dead_diaeresis dead_abovering
keycode 35 = bracketright braceright bracketright braceright dead_tilde dead_macron dead_tilde dead_macron
keycode 36 = Return NoSymbol Return
keycode 37 = Control_L NoSymbol Control_L
keycode 38 = a A a A ae AE ae AE
keycode 39 = s S s S ssharp U1E9E ssharp U1E9E
keycode 40 = d D d D eth ETH eth ETH
keycode 41 = f F f F dstroke ordfeminine dstroke ordfeminine
keycode 42 = g G g G eng ENG eng ENG
keycode 43 = h H h H hstroke Hstroke hstroke Hstroke
keycode 44 = j J j J dead_hook dead_horn dead_hook dead_horn
keycode 45 = k K k K kra ampersand kra ampersand
keycode 46 = l L l L lstroke Lstroke lstroke Lstroke
keycode 47 = semicolon colon semicolon colon dead_acute dead_doubleacute dead_acute dead_doubleacute
keycode 48 = apostrophe quotedbl apostrophe at dead_circumflex dead_caron dead_circumflex dead_caron
! keycode 49 = section plusminus grave notsign notsign notsign bar bar
keycode 49 = grave asciitilde backslash bar bar brokenbar bar brokenbar
keycode 50 = Shift_L NoSymbol Shift_L
keycode 51 = backslash bar numbersign asciitilde dead_grave dead_breve dead_grave dead_breve
keycode 52 = z Z z Z guillemetleft less guillemetleft less
keycode 53 = x X x X guillemetright greater guillemetright greater
keycode 54 = c C c C cent copyright cent copyright
keycode 55 = v V v V doublelowquotemark singlelowquotemark doublelowquotemark singlelowquotemark
keycode 56 = b B b B leftdoublequotemark leftsinglequotemark leftdoublequotemark leftsinglequotemark
keycode 57 = n N n N rightdoublequotemark rightsinglequotemark rightdoublequotemark rightsinglequotemark
keycode 58 = m M m M mu ordmasculine mu ordmasculine
keycode 59 = comma less comma less U2022 multiply U2022 multiply
keycode 60 = period greater period greater periodcentered division periodcentered division
keycode 61 = slash question slash question dead_belowdot dead_abovedot dead_belowdot dead_abovedot
keycode 62 = Shift_R NoSymbol Shift_R
keycode 63 = KP_Multiply KP_Multiply KP_Multiply KP_Multiply KP_Multiply KP_Multiply XF86ClearGrab KP_Multiply KP_Multiply XF86ClearGrab
keycode 64 = Alt_L Meta_L Alt_L Meta_L
keycode 65 = space NoSymbol space
keycode 66 = Caps_Lock NoSymbol Caps_Lock
keycode 67 = F1 F1 F1 F1 F1 F1 XF86Switch_VT_1 F1 F1 XF86Switch_VT_1
keycode 68 = F2 F2 F2 F2 F2 F2 XF86Switch_VT_2 F2 F2 XF86Switch_VT_2
keycode 69 = F3 F3 F3 F3 F3 F3 XF86Switch_VT_3 F3 F3 XF86Switch_VT_3
keycode 70 = F4 F4 F4 F4 F4 F4 XF86Switch_VT_4 F4 F4 XF86Switch_VT_4
keycode 71 = F5 F5 F5 F5 F5 F5 XF86Switch_VT_5 F5 F5 XF86Switch_VT_5
keycode 72 = F6 F6 F6 F6 F6 F6 XF86Switch_VT_6 F6 F6 XF86Switch_VT_6
keycode 73 = F7 F7 F7 F7 F7 F7 XF86Switch_VT_7 F7 F7 XF86Switch_VT_7
keycode 74 = F8 F8 F8 F8 F8 F8 XF86Switch_VT_8 F8 F8 XF86Switch_VT_8
keycode 75 = F9 F9 F9 F9 F9 F9 XF86Switch_VT_9 F9 F9 XF86Switch_VT_9
keycode 76 = F10 F10 F10 F10 F10 F10 XF86Switch_VT_10 F10 F10 XF86Switch_VT_10
keycode 77 = Num_Lock NoSymbol Num_Lock
keycode 78 = Scroll_Lock NoSymbol Scroll_Lock
keycode 79 = KP_Home KP_7 KP_Home KP_7
keycode 80 = KP_Up KP_8 KP_Up KP_8
keycode 81 = KP_Prior KP_9 KP_Prior KP_9
keycode 82 = KP_Subtract KP_Subtract KP_Subtract KP_Subtract KP_Subtract KP_Subtract XF86Prev_VMode KP_Subtract KP_Subtract XF86Prev_VMode
keycode 83 = KP_Left KP_4 KP_Left KP_4
keycode 84 = KP_Begin KP_5 KP_Begin KP_5
keycode 85 = KP_Right KP_6 KP_Right KP_6
keycode 86 = KP_Add KP_Add KP_Add KP_Add KP_Add KP_Add XF86Next_VMode KP_Add KP_Add XF86Next_VMode
keycode 87 = KP_End KP_1 KP_End KP_1
keycode 88 = KP_Down KP_2 KP_Down KP_2
keycode 89 = KP_Next KP_3 KP_Next KP_3
keycode 90 = KP_Insert KP_0 KP_Insert KP_0
keycode 91 = KP_Delete KP_Decimal KP_Delete KP_Decimal
keycode 92 = ISO_Level3_Shift NoSymbol ISO_Level3_Shift
keycode 93 =
! keycode 94 = grave asciitilde backslash bar bar brokenbar bar brokenbar
keycode 94 = section plusminus grave notsign notsign notsign bar bar
keycode 95 = F11 F11 F11 F11 F11 F11 XF86Switch_VT_11 F11 F11 XF86Switch_VT_11
keycode 96 = F12 F12 F12 F12 F12 F12 XF86Switch_VT_12 F12 F12 XF86Switch_VT_12
keycode 97 =
keycode 98 = Katakana NoSymbol Katakana
keycode 99 = Hiragana NoSymbol Hiragana
keycode 100 = Henkan_Mode NoSymbol Henkan_Mode
keycode 101 = Hiragana_Katakana NoSymbol Hiragana_Katakana
keycode 102 = Muhenkan NoSymbol Muhenkan
keycode 103 =
keycode 104 = ISO_Level3_Shift NoSymbol ISO_Level3_Shift
keycode 105 = Multi_key Multi_key Multi_key Multi_key
keycode 106 = KP_Divide KP_Divide KP_Divide KP_Divide KP_Divide KP_Divide XF86Ungrab KP_Divide KP_Divide XF86Ungrab
keycode 107 = Print Sys_Req Print Sys_Req
keycode 108 = ISO_Level3_Shift NoSymbol ISO_Level3_Shift
keycode 109 = Linefeed NoSymbol Linefeed
keycode 110 = Home NoSymbol Home
keycode 111 = Up NoSymbol Up
keycode 112 = Prior NoSymbol Prior
keycode 113 = Left NoSymbol Left
keycode 114 = Right NoSymbol Right
keycode 115 = End NoSymbol End
keycode 116 = Down NoSymbol Down
keycode 117 = Next NoSymbol Next
keycode 118 = Insert NoSymbol Insert
keycode 119 = Delete NoSymbol Delete
keycode 120 =
keycode 121 = XF86AudioMute NoSymbol XF86AudioMute
keycode 122 = XF86AudioLowerVolume NoSymbol XF86AudioLowerVolume
keycode 123 = XF86AudioRaiseVolume NoSymbol XF86AudioRaiseVolume
keycode 124 = XF86PowerOff NoSymbol XF86PowerOff
keycode 125 = KP_Equal NoSymbol KP_Equal
keycode 126 = plusminus NoSymbol plusminus
keycode 127 = Pause Break Pause Break
keycode 128 = XF86LaunchA NoSymbol XF86LaunchA
keycode 129 = KP_Decimal KP_Decimal KP_Decimal KP_Decimal
keycode 130 = Hangul NoSymbol Hangul
keycode 131 = Hangul_Hanja NoSymbol Hangul_Hanja
keycode 132 =
keycode 133 = Super_L NoSymbol Super_L
keycode 134 = Super_R NoSymbol Super_R
keycode 135 = Menu NoSymbol Menu
keycode 136 = Cancel NoSymbol Cancel
keycode 137 = Redo NoSymbol Redo
keycode 138 = SunProps NoSymbol SunProps
keycode 139 = Undo NoSymbol Undo
keycode 140 = SunFront NoSymbol SunFront
keycode 141 = XF86Copy NoSymbol XF86Copy
keycode 142 = XF86Open NoSymbol XF86Open
keycode 143 = XF86Paste NoSymbol XF86Paste
keycode 144 = Find NoSymbol Find
keycode 145 = XF86Cut NoSymbol XF86Cut
keycode 146 = Help NoSymbol Help
keycode 147 = XF86MenuKB NoSymbol XF86MenuKB
keycode 148 = XF86Calculator NoSymbol XF86Calculator
keycode 149 =
keycode 150 = XF86Sleep NoSymbol XF86Sleep
keycode 151 = XF86WakeUp NoSymbol XF86WakeUp
keycode 152 = XF86Explorer NoSymbol XF86Explorer
keycode 153 = XF86Send NoSymbol XF86Send
keycode 154 =
keycode 155 = XF86Xfer NoSymbol XF86Xfer
keycode 156 = XF86Launch1 NoSymbol XF86Launch1
keycode 157 = XF86Launch2 NoSymbol XF86Launch2
keycode 158 = XF86WWW NoSymbol XF86WWW
keycode 159 = XF86DOS NoSymbol XF86DOS
keycode 160 = XF86ScreenSaver NoSymbol XF86ScreenSaver
keycode 161 = XF86RotateWindows NoSymbol XF86RotateWindows
keycode 162 = XF86TaskPane NoSymbol XF86TaskPane
keycode 163 = XF86Mail NoSymbol XF86Mail
keycode 164 = XF86Favorites NoSymbol XF86Favorites
keycode 165 = XF86MyComputer NoSymbol XF86MyComputer
keycode 166 = XF86Back NoSymbol XF86Back
keycode 167 = XF86Forward NoSymbol XF86Forward
keycode 168 =
keycode 169 = XF86Eject NoSymbol XF86Eject
keycode 170 = XF86Eject NoSymbol XF86Eject
keycode 171 = XF86AudioNext NoSymbol XF86AudioNext
keycode 172 = XF86AudioPlay XF86AudioPause XF86AudioPlay XF86AudioPause
keycode 173 = XF86AudioPrev NoSymbol XF86AudioPrev
keycode 174 = XF86AudioStop XF86Eject XF86AudioStop XF86Eject
keycode 175 = XF86AudioRecord NoSymbol XF86AudioRecord
keycode 176 = XF86AudioRewind NoSymbol XF86AudioRewind
keycode 177 = XF86Phone NoSymbol XF86Phone
keycode 178 =
keycode 179 = XF86Tools NoSymbol XF86Tools
keycode 180 = XF86HomePage NoSymbol XF86HomePage
keycode 181 = XF86Reload NoSymbol XF86Reload
keycode 182 = XF86Close NoSymbol XF86Close
keycode 183 =
keycode 184 =
keycode 185 = XF86ScrollUp NoSymbol XF86ScrollUp
keycode 186 = XF86ScrollDown NoSymbol XF86ScrollDown
keycode 187 = parenleft NoSymbol parenleft
keycode 188 = parenright NoSymbol parenright
keycode 189 = XF86New NoSymbol XF86New
keycode 190 = Redo NoSymbol Redo
keycode 191 = XF86Tools NoSymbol XF86Tools
keycode 192 = XF86Launch5 NoSymbol XF86Launch5
keycode 193 = XF86Launch6 NoSymbol XF86Launch6
keycode 194 = XF86Launch7 NoSymbol XF86Launch7
keycode 195 = XF86Launch8 NoSymbol XF86Launch8
keycode 196 = XF86Launch9 NoSymbol XF86Launch9
keycode 197 =
keycode 198 = XF86AudioMicMute NoSymbol XF86AudioMicMute
keycode 199 = XF86TouchpadToggle NoSymbol XF86TouchpadToggle
keycode 200 = XF86TouchpadOn NoSymbol XF86TouchpadOn
keycode 201 = XF86TouchpadOff NoSymbol XF86TouchpadOff
keycode 202 =
keycode 203 = ISO_Level5_Shift NoSymbol ISO_Level5_Shift
keycode 204 = NoSymbol Alt_L NoSymbol Alt_L
keycode 205 = NoSymbol Meta_L NoSymbol Meta_L
keycode 206 = NoSymbol Super_L NoSymbol Super_L
keycode 207 = NoSymbol Hyper_L NoSymbol Hyper_L
keycode 208 = XF86AudioPlay NoSymbol XF86AudioPlay
keycode 209 = XF86AudioPause NoSymbol XF86AudioPause
keycode 210 = XF86Launch3 NoSymbol XF86Launch3
keycode 211 = XF86Launch4 NoSymbol XF86Launch4
keycode 212 = XF86LaunchB NoSymbol XF86LaunchB
keycode 213 = XF86Suspend NoSymbol XF86Suspend
keycode 214 = XF86Close NoSymbol XF86Close
keycode 215 = XF86AudioPlay NoSymbol XF86AudioPlay
keycode 216 = XF86AudioForward NoSymbol XF86AudioForward
keycode 217 =
keycode 218 = Print NoSymbol Print
keycode 219 =
keycode 220 = XF86WebCam NoSymbol XF86WebCam
keycode 221 = XF86AudioPreset NoSymbol XF86AudioPreset
keycode 222 =
keycode 223 = XF86Mail NoSymbol XF86Mail
keycode 224 = XF86Messenger NoSymbol XF86Messenger
keycode 225 = XF86Search NoSymbol XF86Search
keycode 226 = XF86Go NoSymbol XF86Go
keycode 227 = XF86Finance NoSymbol XF86Finance
keycode 228 = XF86Game NoSymbol XF86Game
keycode 229 = XF86Shop NoSymbol XF86Shop
keycode 230 =
keycode 231 = Cancel NoSymbol Cancel
keycode 232 = XF86MonBrightnessDown NoSymbol XF86MonBrightnessDown
keycode 233 = XF86MonBrightnessUp NoSymbol XF86MonBrightnessUp
keycode 234 = XF86AudioMedia NoSymbol XF86AudioMedia
keycode 235 = XF86Display NoSymbol XF86Display
keycode 236 = XF86KbdLightOnOff NoSymbol XF86KbdLightOnOff
keycode 237 = XF86KbdBrightnessDown NoSymbol XF86KbdBrightnessDown
keycode 238 = XF86KbdBrightnessUp NoSymbol XF86KbdBrightnessUp
keycode 239 = XF86Send NoSymbol XF86Send
keycode 240 = XF86Reply NoSymbol XF86Reply
keycode 241 = XF86MailForward NoSymbol XF86MailForward
keycode 242 = XF86Save NoSymbol XF86Save
keycode 243 = XF86Documents NoSymbol XF86Documents
keycode 244 = XF86Battery NoSymbol XF86Battery
keycode 245 = XF86Bluetooth NoSymbol XF86Bluetooth
keycode 246 = XF86WLAN NoSymbol XF86WLAN
keycode 247 = XF86UWB NoSymbol XF86UWB
keycode 248 =
keycode 249 = XF86Next_VMode NoSymbol XF86Next_VMode
keycode 250 = XF86Prev_VMode NoSymbol XF86Prev_VMode
keycode 251 = XF86MonBrightnessCycle NoSymbol XF86MonBrightnessCycle
keycode 252 = XF86BrightnessAuto NoSymbol XF86BrightnessAuto
keycode 253 = XF86DisplayOff NoSymbol XF86DisplayOff
keycode 254 = XF86WWAN NoSymbol XF86WWAN
keycode 255 = XF86RFKill NoSymbol XF86RFKill

2
zshenv
View File

@ -6,7 +6,6 @@ export TERM=xterm-256color
export XDG_CONFIG_HOME="$HOME/.config"
export EDITOR="nvim"
export VISUAL="nvim"
export BROWSER=firefox
# ZSH:
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
@ -29,6 +28,7 @@ export BAT_THEME=Nord
export PGUSER=postgres
# NPM, Yarn:
export BROWSER=none
export FAST_REFRESH=false
# k8s

55
zshrc
View File

@ -68,8 +68,8 @@ alias clw="tmux kill-window"
alias d="docker"
alias dc="docker-compose -f docker-compose.yml"
alias dcd="docker-compose -f docker-compose.yml -f docker-compose.development.yml"
alias dockdown="sudo systemctl stop docker"
alias dockup="sudo systemctl start docker"
alias dockdown="sudo systemctl stop docker"
alias gb="go build"
alias gba="go build ./..."
alias gbat="go build ./... && go test ./..."
@ -77,61 +77,52 @@ alias gc="git commit"
alias gd="git diff"
alias gg="go get"
alias gl="git pull"
alias gmt="go mod tidy"
alias gp="git push"
alias gst="git status"
alias gt="go test"
alias gta="go test ./..."
alias h="helm"
alias ji="jira -b"
alias k9="kill -9"
alias k="kubectl"
alias kcc="kubectl config current-context"
alias kcurl="kubectl run curl --image curlimages/curl --image-pull-policy=Always -it --rm -- sh"
alias kd="kubectl describe"
alias kdel="kubectl delete"
alias kg="kubectl get"
alias kgp="kubectl get pod -o wide"
alias kgrpcurl="kubectl run grpcurl --image networld/grpcurl --image-pull-policy=Always -it --rm -- sh"
alias kgp="kubectl get pod -o wide"
alias kgs="kubectl get svc -o wide"
ksecd() { kubectl get secret "$1" -o go-template='{{range $k,$v := .data}}{{printf "%s: " $k}}{{if not $v}}{{$v}}{{else}}{{$v | base64decode}}{{end}}{{"\n"}}{{end}}' }
alias kmplayer="kubectl run mplayer --image olmesm/mplayer-docker:latest --image-pull-policy=Always -it --rm -- sh"
alias kw="kubectl get events -w"
alias ll="eza -l --group-directories-first --git"
alias ls="eza --color=auto"
alias lsoftcpl="sudo lsof -nP -iTCP -sTCP:LISTEN"
alias mc="make check"
alias k9="kill -9"
alias ll="exa -l --group-directories-first --git"
alias ls="exa --color=auto"
alias ng="noglob"
alias open="xdg-open"
alias opin='eval $(op signin)'
alias pg="pgrep -fa"
alias pk="pkill -fc"
alias rez="source $HOME/.zshenv && source $ZDOTDIR/.zshrc"
alias rgo="rg -g '*.go' -g '!vendor/'"
alias rgs="rg -g '*.go' -g '*.rb' -g '!vendor/' -g '!*_test.go' -g '!*_spec.rb'"
alias rgt="rg -g '*_test.go' -g '*_spec.rb' -g '!vendor/'"
alias sc="systemctl"
alias shc="shellcheck"
alias sk="setkeys"
alias ssc="sudo systemctl"
alias sysc="systemctl"
alias rgo="rg -g '*.go' -g '!vendor/'"
alias rgs="rg -g '*.go' -g '*.rb' -g '!vendor/' -g '!*_test.go' -g '!*_spec.rb'"
alias rgt="rg -g '*_test.go' -g '*_spec.rb' -g '!vendor/'"
rgw() { SEARCH_TERM=$1; shift; rg -g '!vendor/' "\b$SEARCH_TERM\b" $* }
alias to="tea open"
alias tm="tmux attach"
alias tmd="tmux new -s default -c $HOME || tmux attach -t default"
alias tms="tmuxsess"
alias to="tea open"
alias tp="telepresence"
alias tpl="telepresence list"
alias vim="nvim"
alias wg="sudo wg"
alias wgdown="sudo wgdown"
alias wgup="sudo wgup"
alias zzz="sudo systemctl hibernate"
ksecd() { kubectl get secret "$1" -o go-template='{{range $k,$v := .data}}{{printf "%s: " $k}}{{if not $v}}{{$v}}{{else}}{{$v | base64decode}}{{end}}{{"\n"}}{{end}}' }
rgw() { SEARCH_TERM=$1; shift; rg -g '!vendor/' "\b$SEARCH_TERM\b" $* }
if [ "$(uname -s)" = "Linux" ]; then
alias pbcopy="xclip -selection clipboard -i"
alias pbpaste="xclip -selection clipboard -o"
fi
# recursive grep with line numbers and colour, ignoring binary files:
alias gnr="grep -nR -I --color"
# same but case-insensitive:
alias gnri="grep -nRi -I --color"
# On boot, power on bluetooth and start xfce
if [ $(tty) = "/dev/tty1" ]; then
@ -166,13 +157,9 @@ if [ -f $ZDOTDIR/.zshrc.local ]; then
. $ZDOTDIR/.zshrc.local
fi
# set up mise
eval "$(~/.local/bin/mise activate zsh)"
# pnpm
export PNPM_HOME="/home/rob/.local/share/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end
# set up asdf
if [ -f $HOME/.asdf/asdf.sh ]; then
. $HOME/.asdf/asdf.sh
else
echo "Warning: asdf not found, skipping"
fi