This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
shopt -s inherit_errexit | |
function main() { | |
local -i row_width=${1:-990} | |
local -i total_height=${2:-500} | |
local -i row_height=$((total_height / 4)) | |
local mods=".w${row_width}.h${row_height}.d" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef git-tag-version | |
# zsh completion for git-tag-version | |
_git-tag-version () { | |
_arguments -S -s "-h[usage]" "1:version-name" "2:from:__git_commits" "3:to:__git_commits" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! MoveWindow(dir) | |
let l:orig_win = winnr() | |
let l:orig_buf = bufnr() | |
exe 'wincmd ' . a:dir | |
let l:dest_win = winnr() | |
let l:dest_buf = bufnr() | |
exe l:orig_win . 'windo hide buf' l:dest_buf | |
exe l:dest_win . 'windo hide buf' l:orig_buf | |
endfunction | |
nnoremap <M-S-h> :call MoveWindow('h')<Cr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Version=1.0 | |
Name=Kitty (Neovim) | |
GenericName=Text Editor | |
Comment=Neovim in Kitty | |
Keywords=kitty;nvim;neovim | |
Icon=kitty | |
Terminal=false | |
X-MultipleArgs=false | |
Type=Application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Default Applications] | |
text/plain=kitty-nvim.desktop; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Copyright (c) 2018-2021 Maddison Hellstrom (github.com/b0o) | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local shebang_regex = vim.regex([[^#!]]) | |
local blank_or_comment_line_regex = vim.regex([[^\s*\(#.*\)\?$]]) | |
local shellcheck_disable_regex = vim.regex([[^\s*#\s*shellcheck\s\+disable=\(\(SC\)\?\d\+\)\(,\(SC\)\?\d\+\)*\s*$]]) | |
local shellcheck_disable_pattern = "^%s*#%s*shellcheck%s+disable=([^%s]*)%s*$" | |
-- Searches a region of the buffer `bufnr` for a ShellCheck disable directive. | |
-- The search proceeds from `row_start` to `row_end`. | |
-- If `row_start` is greater than `row_end`, the region is effectively searched in reverse. | |
-- A table representing first directive that's found is returned, otherwise nil. | |
local find_disable_directive = function(bufnr, row_start, row_end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let stringOfChannel ch = | |
let ok = ref false in | |
let result = ref "" in | |
let _ = | |
try | |
while true do | |
result := !result ^ "\n" ^ input_line ch | |
done | |
with End_of_file -> ( | |
match Unix.close_process_in ch with |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
shopt -s inherit_errexit | |
declare vim="nvim" | |
command -v nvim &>/dev/null || vim="vim" | |
if [[ ! -t /dev/stdin ]]; then | |
MANPAGER='less' man "$@" -l - | |
elif [[ $# -gt 0 ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Use (neo)vim as your MANPAGER | |
# Set MANPAGER=/path/to/viman in your shellrc | |
# | |
# Copyright 2020-2022 Maddison Hellstrom <https://github.com/b0o> | |
# MIT License | |
set -Eeuo pipefail | |
shopt -s inherit_errexit |