Compare commits

...

15 commits

Author SHA1 Message Date
72eda6a992
vifm: Fix Makefile and yaml icons 2025-02-22 19:35:40 +01:00
225641c1f0
zk: Create aliases for creating new note/draft/log 2025-02-22 19:35:39 +01:00
068fc77019
nvim: Only enable markdown mdeval mappings if available
Check for the existence of the 'mdeval' plugin before setting the
corresponding key mappings in markdown type files.
2025-02-22 19:35:39 +01:00
613df98520
zk: Ensure global wiki cmds are always executed in wiki
We use a custom zk indirection which ensures that any short alias for
interacting with the zk wiki will actually act on the globally assigned
wiki (by ensuring notebooks dir is "$WIKIROOT").
2025-02-22 19:35:38 +01:00
44cd4481a2
zk: Only create aliases if local wiki found
Local wiki requires the '$WIKIROOT' env var to be set, pointing to the
root of the (zk) wiki. So we only create associated aliases if the wiki
actually exists on a machine.
2025-02-22 19:35:38 +01:00
5ab95c724f
jj: Rework jj bookmark main alias
Changed into a function which takes the revision to set the bookmark to
as an argument. This should work without interfering much since the
bookmark name that the `bookmark set` function _usually_ takes as
argument is already given by the alias (always 'main') and thus we do
not have to manually provide other arguments.

It default to the current working copy just like the command and
otherwise can point to any change.
2025-02-22 19:35:37 +01:00
89737536ea
jj: Revert js to simple jj status alias
I have gotten more used to using `jw` to 'show' the current changes in
the working copy, and having `js` be _both_ status and show has become
more confusing than helpful. For now, we just revert it to be a simple
alias for the status command.
2025-02-22 19:35:37 +01:00
5a9be5479d
jj: Add an alias to abandon a commit
I have begun abandoning more commits recently, so this seems a good time
to introduce an alias for it. It is not _so_ common as to require a 1 or
2-letter alias so we can go with the mnemonic `jab` for jj abandon.
2025-02-22 19:35:36 +01:00
dc7bf66052
jj: Add revset alias for current git head
Adds a very simple 'githead' revset alias. This is not much simpler than
directly invoking `git_head()` but it will remind me in the future of
its existence.
2025-02-22 19:35:36 +01:00
98dca7ec04
jj: Extend log aliases
The new log aliases follow one logic: small letters are default and
capital letters show 'all' changes. Thus, `j` defaults to showing the
simple log and `J` the same log but for all changes.
`jl` shows oneline logs, `JL` oneline logs for all changes.
`jlo` shows log summaries, `JLO` for all changes.
And finally `jloo` and `JLOO` show the details patches for each change.
2025-02-22 19:35:35 +01:00
f9d0401132
jj: Mirror edit next with edit previous alias
This new alias setup provides four quick traversal options:
Moving ahead one commit (`jen` for edit next), backwards (`jep` for edit
previous), as well as doing the same but creating new 'working copies'
instead of going directly to a commit (`jenn` and `jepp`).
2025-02-22 19:35:35 +01:00
66005a9948
jj: Switch manual commit splitting alias to use split
Currently `ji` (for jj insert) does a 'manual' `jj split` by creating an
empty commit underneath, squasing interactively and then moving back to
the original. All of that is done by the existing `jj split` command.

So we simply use it. I am keeping the `ji` alias for now, could still be
'jj insert' or 'jj spl(I)t' I suppose.
2025-02-22 19:35:34 +01:00
612b92d148
jj: Make private commit matching case insensitive
Whether you prefix your commit with 'WIP:' or 'wip:',
'private:' or 'PRIVATE:' it will be caught.
2025-02-22 19:35:34 +01:00
86306afc08
qutebrowser: Manually redirect to FOSS genius frontends
Since farside linking currently does not work we take the work into our
own hands.
2025-02-22 19:35:33 +01:00
dc1a02ebeb
jrnl: Move default location to be under notes 2025-02-22 19:35:32 +01:00
7 changed files with 74 additions and 35 deletions

View file

@ -11,12 +11,19 @@ if require("core.util").is_available("zk") and require("zk.util").notebook_root(
map("n", "<CR>", "<cmd>lua vim.lsp.buf.definition()<cr>", { silent = true })
end
-- execute code cells
if vim.fn.mapcheck("<localleader>cc") == "" then
map("n", "<localleader>cc", require("mdeval").eval_code_block, { silent = true, desc = "evaluate code block" })
end
if vim.fn.mapcheck("<localleader>cx") == "" then
map("n", "<localleader>cx", require("mdeval").eval_clean_results, { silent = true, desc = "clear code results" })
if require("core.util").is_available("mdeval") then
-- execute code cells
if vim.fn.mapcheck("<localleader>cc") == "" then
map("n", "<localleader>cc", require("mdeval").eval_code_block, { silent = true, desc = "evaluate code block" })
end
if vim.fn.mapcheck("<localleader>cx") == "" then
map(
"n",
"<localleader>cx",
require("mdeval").eval_clean_results,
{ silent = true, desc = "clear code results" }
)
end
end
-- jump to beginning of previous/ next cell code

View file

@ -65,10 +65,22 @@ default_services = [
),
Service(source=["quora.com"], target=["quetre"]),
Service(source=["google.com"], target=["whoogle"]),
Service(source=["genius.com"], target=["dumb"]),
Service(source=["translate.google.com"], target=["lingva", "simplytranslate"]),
Service(source=["deepl.com"], target=["simplytranslate"]),
Service(source=["bandcamp.com"], target=["tent"]),
Service(
custom_targets=True,
source=["genius.com"],
target=[
"dumb.privacydev.net",
"dumb.privacydev.net",
"dm.vern.cc",
"sing.whatever.social",
"dumb.nunosempere.com",
"dumb.lunar.icu",
"dumb.esmailelbob.xyz",
],
),
Service(
custom_targets=True,
source=["pinterest.com"],

View file

@ -6,7 +6,7 @@
" Specific directories
set classify+=' :dir:/, :exe:, :reg:, :link:,? :?:, ::../::/,
\  ::.git/::/,
\  ::.config/,,Makefile::/,
\  ::.config/::/,
\  ::Desktop/::/,
\  ::Documents/::/,
\  ::Development/::/,
@ -24,7 +24,7 @@ set classify+=' :dir:/, :exe:, :reg:, :link:,? :?:, ::../::
\  ::node_modules/::/'
" Specific files
set classify+=' ::.Xdefaults,,.Xresources,,.bashprofile,,.bash_profile,,.bashrc,,.dmrc,,.d_store,,.fasd,,.gitconfig,,.gitignore,,.jack-settings,,.mime.types,,.nvidia-settings-rc,,.pam_environment,,.profile,,.recently-used,,.selected_editor,,.xinitpurc,,.zprofile,,.yarnc,,.snclirc,,.tmux.conf,,.urlview,,.config,,.ini,,.user-dirs.dirs,,.mimeapps.list,,.offlineimaprc,,.msmtprc,,.Xauthority,,config::/,
set classify+=' ::.Xdefaults,,.Xresources,,.bashprofile,,.bash_profile,,.bashrc,,.dmrc,,.d_store,,.fasd,,.gitconfig,,.gitignore,,.jack-settings,,.mime.types,,.nvidia-settings-rc,,.pam_environment,,.profile,,.recently-used,,.selected_editor,,.xinitpurc,,.zprofile,,.yarnc,,.snclirc,,.tmux.conf,,.urlview,,.config,,.ini,,.user-dirs.dirs,,.mimeapps.list,,.offlineimaprc,,.msmtprc,,.Xauthority,,Makefile::,
\  ::favicon.*,,README,,readme::,
\  ::.vim,,.vimrc,,.gvimrc,,.vifm::,
\  ::gruntfile.coffee,,gruntfile.js,,gruntfile.ls::,
@ -45,7 +45,7 @@ set classify+='λ ::*.ml,,*.mli::,
\  ::*.bmp,,*.gif,,*.ico,,*.jpeg,,*.jpg,,*.png,,*.svg,,*.svgz,,*.tga,,*.tiff,,*.xmb,,*.xcf,,*.xpm,,*.xspf,,*.xwd,,*.cr2,,*.dng,,*.3fr,,*.ari,,*.arw,,*.bay,,*.crw,,*.cr3,,*.cap,,*.data,,*.dcs,,*.dcr,,*.drf,,*.eip,,*.erf,,*.fff,,*.gpr,,*.iiq,,*.k25,,*.kdc,,*.mdc,,*.mef,,*.mos,,*.mrw,,*.obm,,*.orf,,*.pef,,*.ptx,,*.pxn,,*.r3d,,*.raf,,*.raw,,*.rwl,,*.rw2,,*.rwz,,*.sr2,,*.srf,,*.srw,,*.tif,,*.x3f,,*.webp,,*.avif,,*.jxl::,
\  ::*.ejs,,*.htm,,*.html,,*.slim,,*.xml::,
\  ::*.mustasche::,
\  ::*.css,,*.less,,*.bat,,*.conf,,*.ini,,*.rc,,*.yml,,*.cfg::,
\  ::*.css,,*.less,,*.bat,,*.conf,,*.ini,,*.rc,,*.yml,,*.yaml,,*.cfg::,
\  ::*.rss::,
\  ::*.coffee::,
\  ::*.twig::,

View file

@ -9,9 +9,10 @@ key = "73BA40D5AFAF49C9"
[git]
sign-on-push = true
subprocess = true
private-commits = "description(glob:'wip:*') | description(glob:'private:*')" # refuse to push WIP commits
private-commits = "description(glob-i:'WIP:*') | description(glob-i:'PRIVATE:*')" # refuse to push WIP commits
[ui]
default-command = "log"
diff-editor = ["nvim", "-c", "DiffEditor $left $right $output"]
pager = "delta"
@ -39,3 +40,4 @@ log = "ancestors(@, 5) | ancestors(trunk()..(visible_heads() & mine()), 2) | tru
"downstream(x,y)" = "(x::y) & y"
"branches" = "downstream(trunk(), bookmarks()) & mine()"
"curbranch" = "latest(branches::@- & branches)"
"githead" = "::git_head()"

View file

@ -14,20 +14,17 @@ alias jds="jj describe"
alias jc="jj commit"
# finding out the current snapshot
js() {
if [ "$#" -eq 0 ]; then
jj status
else
jj show "$*"
fi
}
alias js="jj status"
alias jw="jj show"
alias jd="jj diff"
# for describe-and-edit workflows
# https://steveklabnik.github.io/jujutsu-tutorial/real-world-workflows/the-edit-workflow.html
alias je="jj edit"
alias jee="jj next --edit"
alias jen="jj next --edit"
alias jep="jj prev --edit"
alias jenn="jj next"
alias jepp="jj prev"
# for squash-and-go workflows
# https://steveklabnik.github.io/jujutsu-tutorial/real-world-workflows/the-squash-workflow.html
@ -36,16 +33,19 @@ alias jsi="jj squash --interactive"
# oops buttons
alias ju="jj undo"
# for damn,-forgot-to-split-this-commit workflow
# Creates a new commit before with your selected changes, lets you describe it and carry on
alias ji="jj new -B@ --no-edit && jj squash --interactive && jj edit '@-' && jj describe && jj edit '@+'"
# allows you to split the current change into multiple
alias ji="jj split"
# quickly get rid of a change
alias jab="jj abandon"
# revset info
alias J="jj log -r 'all()'" # mirror default command being log
alias jl="jj log -T builtin_log_oneline"
alias jL="jj log -r 'all()'"
alias JL="jj log -T builtin_log_oneline -r 'all()'"
alias jlo="jj log --summary"
alias jLO="jj log --summary -r 'all()'"
alias JLO="jj log --summary -r 'all()'"
alias jloo="jj log --patch"
alias JLOO="jj log --patch -r 'all()'"
alias jol="jj op log"
jlf() {
jj log -r "description($*)"
@ -64,7 +64,9 @@ alias jrb="jj rebase"
# 'branching' bookmark work
alias jb="jj bookmark"
alias jbm="jj bookmark set main"
jbm() {
jj bookmark set -r "${1:-@}" main
}
# remote work
alias jrv="jj git remote list"

View file

@ -11,7 +11,7 @@ highlight: true
indent_character: '|'
journals:
default:
journal: ~/documents/records/jrnl.md
journal: ~/documents/notes/journal/jrnl.md
linewrap: 79
tagsymbols: +
template: false

View file

@ -1,19 +1,35 @@
#!/usr/bin/env sh
#
_zk_wiki() {
zk --notebook-dir="$WIKIROOT" "$@"
}
n() {
if [ $# -eq 0 ]; then
zk edit -i
_zk_wiki edit -i
else
zk "${@}"
_zk_wiki "${@}"
fi
}
# open notes with my vim zettelkasten plugin
# TODO better implementation conditional on zk.nvim & zettelkasten existing
# nvim +'lua pcall(require "zk.commands"') --headless +qa 2>&1 or similar to check - but slow
if command -v nvim >/dev/null 2>&1; then
alias ni='nvim +"lua require \"zk.commands\".get(\"ZkCd\")()" +"edit $WIKIROOT/index.md"'
fi
# We have a local wiki
if [ -n "${WIKIROOT}" ]; then
# open notes with my vim zettelkasten plugin
# TODO better implementation conditional on zk.nvim & zettelkasten existing
# nvim +'lua pcall(require "zk.commands"') --headless +qa 2>&1 or similar to check - but slow
if command -v nvim >/dev/null 2>&1; then
alias ni='nvim +"lua require \"zk.commands\".get(\"ZkCd\")()" +"edit $WIKIROOT/index.md"'
fi
alias ncd='pushd $WIKIROOT'
alias ncd='cd $WIKIROOT'
nn() { # 'new note'
_zk_wiki new "$@"
}
nnl() { # 'new note log'
_zk_wiki log "$@"
}
nnd() { # 'new note draft'
_zk_wiki draft "$@"
}
fi