13 Commits

Author SHA1 Message Date
  Brennen Bearnes ba97f1acfb notes-tag-index: a TODO 1 month ago
  Brennen Bearnes d21a74692b notes-links: add bare names of wiki pages 1 month ago
  Brennen Bearnes 2a565dfdfc git: try zdiff3 for merge conflicts 1 month ago
  Brennen Bearnes 0559492c01 zsh: bump HISTSIZE to 90000 1 month ago
  Brennen Bearnes fb7d9b6fb0 fragments/gerrit-commit-hook 1 month ago
  Brennen Bearnes c68dcaf3ff fragment-lyons-weather: add tags to output 1 month ago
  Brennen Bearnes daf0246d7b vim: fzf tag finder comment 1 month ago
  Brennen Bearnes 4a5a32a621 vim: example vimwiki comment marker config 1 month ago
  Brennen Bearnes cc9f49b068 vim: TwoWide() (via maya) 1 month ago
  Brennen Bearnes 0037524fa3 vim: F6 pulls up FZF history window intead of MRU 1 month ago
  Brennen Bearnes e5d0302a1e vim: ttymouse=xterm2 1 month ago
  Brennen Bearnes ea6181e88c vimwiki: add example option for turning off folding 1 month ago
  Brennen Bearnes 9a381c6062 tmux: enable mouse 1 month ago
10 changed files with 151 additions and 6 deletions
Split View
  1. +3
    -0
      home/.gitconfig
  2. +3
    -0
      home/.tmux.conf
  3. +25
    -2
      home/.vim/vimrc
  4. +1
    -1
      home/.zshrc
  5. +2
    -0
      home/bin/fragment-lyons-weather
  6. +6
    -0
      home/bin/notes-links
  7. +8
    -3
      home/bin/notes-tag-index
  8. +19
    -0
      home/fragments/gerrit-commit-hook/README
  9. +81
    -0
      home/fragments/gerrit-commit-hook/commit-msg
  10. +3
    -0
      home/fragments/gerrit-commit-hook/test-install-commit-hook

+ 3
- 0
home/.gitconfig View File

@ -66,3 +66,6 @@
rebase = true
[init]
defaultBranch = main
[merge]
# Via https://jvns.ca/blog/2024/02/16/popular-git-config-options/
conflictstyle = zdiff3

+ 3
- 0
home/.tmux.conf View File

@ -29,6 +29,9 @@ set -g default-terminal "screen-256color"
# set-option -sa terminal-overrides ',XXX:RGB'
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Does this work?
set -g mouse on
# Vi copy and paste in tmux
# http://joncairns.com/2013/06/copying-between-tmux-buffers-and-the-system-clipboard/
# by way of thcipriani


+ 25
- 2
home/.vim/vimrc View File

@ -364,11 +364,16 @@ let mapleader = ","
" the default list, since that's supported.
let g:vimwiki_valid_html_tags = 'b,i,s,u,sub,sup,kbd,br,hr,span'
" i think this _replaces_ the existing comment markers, in theory - not
" clear if it works:
" let g:vimwiki_commentstring = '<!--%s-->'
" don't make temporary wikis based on file extensions in the list - this
" is necessary to avoid .md files getting a filetype of vimwiki instead of
" markdown:
let g:vimwiki_global_ext = 0
" let g:vimwiki_folding = ''
let g:vimwiki_folding = 'expr'
" let g:vimwiki_folding = 'syntax'
" let g:vimwiki_folding = 'list'
@ -523,6 +528,9 @@ let mapleader = ","
" mode - seems to work in most terminals
set mouse=a
" https://unix.stackexchange.com/questions/50733/cant-use-mouse-properly-when-running-vim-in-tmux
set ttymouse=xterm2
" render a useful popup menu for right-click instead of extending
" selection (good for spellchecking, etc.):
set mousemodel=popup_setpos
@ -703,7 +711,10 @@ let mapleader = ","
amenu Cheatsheet.Write\ All<Tab>F5 <F5>
" F6 brings up a recently-used file list using MRU
map <F6> :MRU<CR>
" map <F6> :MRU<CR>
" Bring up an fzf history window
map <F6> :History<CR>
imap <F6> <Esc><F6>
amenu Cheatsheet.Most\ Recently\ Used<Tab>F6 <F6>
@ -1001,6 +1012,18 @@ let mapleader = ","
inoremap <buffer> <silent> <End> <C-o>g<End>
endfunction
" via maya:
" https://occult.institute/@maya/111325120027749937
function! TwoWide()
call setpos(".", [0, 1, 1, 0])
wincmd v
call setpos(".", [0, 1, 1, 0])
execute "normal L"
execute "normal zt"
set scrollopt "ver,jump"
windo set scrollbind
endfunction
" add some display sugar that helps highlight cursor, searches, and
" textwidth. good for fiddling with alignment, reflowing text, etc.
function! s:Crosshairs()
@ -1109,7 +1132,7 @@ let mapleader = ","
call <SID>AppendAtCursor(bracketed)
endfunc
" Make a link from an fzf-found page or known tag name:
" Make a link from an fzf-found known tag name:
function! s:VimwikiMakeLink()
call fzf#run({
\ 'options': [


+ 1
- 1
home/.zshrc View File

@ -10,7 +10,7 @@
autoload -Uz compinit
export HISTFILE=~/.histfile
export HISTSIZE=15000
export HISTSIZE=90000
export SAVEHIST=9999999
# vi-style cycling through completions on repeated tab presses:


+ 2
- 0
home/bin/fragment-lyons-weather View File

@ -1,6 +1,8 @@
#!/bin/sh
# markers for vimwiki:
echo '[[/lyons-colorado]] [[/weather]]'
echo
echo '{{{'
lynx -dump 'https://forecast.weather.gov/MapClick.php?lat=40.2229&lon=-105.269&unit=0&lg=english&FcstType=text&TextType=1'


+ 6
- 0
home/bin/notes-links View File

@ -101,6 +101,12 @@ my %FORMATS = (
return $result;
},
# Bare names of wiki pages (no extension):
name => sub {
my ($data) = @_;
return $data->{page} . "\n";
},
);
# Handle options, including help generated from the POD above.


+ 8
- 3
home/bin/notes-tag-index View File

@ -2,9 +2,14 @@
cd "$HOME/notes" || exit 1
# Arguably the following should select _things that are linked to_ as well.
# Also, arguably, the grep should be done in notes-pages instead. It was
# just kind of a pain when I was looking at this.
# TODO:
# - Arguably the following should select _things that are linked to_ as well.
# That is, I want to be able to automate links to stuff that I haven't
# actually defined a page for yet.
# - Also, arguably, the grep should be done in notes-pages instead. It was
# just kind of a pain when I was looking at this.
sort \
<(notes-pages --format name| grep -v '^(log|diary)/') \


+ 19
- 0
home/fragments/gerrit-commit-hook/README View File

@ -0,0 +1,19 @@
Error code of 255 while getting Gerrit commit hook?
IIRC this has to do with the legacy scp protocol vs the newfangled sftp
protocol. Try adding -O to force scp to use the legacy scp protocol
🌘 15:15:43 brennen@inertia:~/fragments/gerrit-commit-hook (main *$%=) ☆ scp -P29418 brennen@gerrit.wikimedia.org:hooks/commit-msg commit-msg
Host key fingerprint is SHA256:j7HQoQ6fIuEgDHjONjI2CZ+2Iwxqgo2Ur5LbPqBgxOU
+---[RSA 1024]----+
| |
|. . |
|= + . |
|+BoE o . |
|BBX . o S |
|@@o+ + o = |
|X=*.. + o . |
|*ooo . |
|o+o. |
+----[SHA256]-----+
commit-msg

+ 81
- 0
home/fragments/gerrit-commit-hook/commit-msg View File

@ -0,0 +1,81 @@
#!/bin/sh
# From Gerrit Code Review 3.5.6
#
# Part of Gerrit Code Review (https://www.gerritcodereview.com/)
#
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -u
# avoid [[ which is not POSIX sh.
if test "$#" != 1 ; then
echo "$0 requires an argument."
exit 1
fi
if test ! -f "$1" ; then
echo "file does not exist: $1"
exit 1
fi
# Do not create a change id if requested
if test "false" = "$(git config --bool --get gerrit.createChangeId)" ; then
exit 0
fi
if git rev-parse --verify HEAD >/dev/null 2>&1; then
refhash="$(git rev-parse HEAD)"
else
refhash="$(git hash-object -t tree /dev/null)"
fi
random=$({ git var GIT_COMMITTER_IDENT ; echo "$refhash" ; cat "$1"; } | git hash-object --stdin)
dest="$1.tmp.${random}"
trap 'rm -f "${dest}"' EXIT
if ! git stripspace --strip-comments < "$1" > "${dest}" ; then
echo "cannot strip comments from $1"
exit 1
fi
if test ! -s "${dest}" ; then
echo "file is empty: $1"
exit 1
fi
reviewurl="$(git config --get gerrit.reviewUrl)"
if test -n "${reviewurl}" ; then
if ! git interpret-trailers --parse < "$1" | grep -q '^Link:.*/id/I[0-9a-f]\{40\}$' ; then
if ! git interpret-trailers \
--trailer "Link: ${reviewurl%/}/id/I${random}" < "$1" > "${dest}" ; then
echo "cannot insert link footer in $1"
exit 1
fi
fi
else
# Avoid the --in-place option which only appeared in Git 2.8
# Avoid the --if-exists option which only appeared in Git 2.15
if ! git -c trailer.ifexists=doNothing interpret-trailers \
--trailer "Change-Id: I${random}" < "$1" > "${dest}" ; then
echo "cannot insert change-id line in $1"
exit 1
fi
fi
if ! mv "${dest}" "$1" ; then
echo "cannot mv ${dest} to $1"
exit 1
fi

+ 3
- 0
home/fragments/gerrit-commit-hook/test-install-commit-hook View File

@ -0,0 +1,3 @@
#!/bin/sh
scp -P29418 brennen@gerrit.wikimedia.org:hooks/commit-msg commit-msg

Loading…
Cancel
Save