Compare commits
1 commit
main
...
feat/neovi
Author | SHA1 | Date | |
---|---|---|---|
de597bc5e9 |
41 changed files with 876 additions and 187 deletions
|
@ -4,7 +4,7 @@
|
|||
# a development environment based on git and nvim.
|
||||
|
||||
[base]
|
||||
depends = ["shell", "vcs", "nvim", "scripts", "ssh", "terminal", "bootstrap"]
|
||||
depends = ["shell", "git", "nvim", "scripts", "ssh", "terminal", "bootstrap"]
|
||||
|
||||
[bootstrap.files]
|
||||
"bootstrap/dotlink.sh" = "~/.config/sh/alias.d/dotlink.sh"
|
||||
|
@ -13,13 +13,9 @@ depends = ["shell", "vcs", "nvim", "scripts", "ssh", "terminal", "bootstrap"]
|
|||
"sh/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" }
|
||||
sh = "~"
|
||||
|
||||
[vcs.files]
|
||||
"vcs/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" }
|
||||
"vcs/git/config" = "~/.config"
|
||||
"vcs/jj/config" = "~/.config"
|
||||
"vcs/gitignore/config" = "~/.config"
|
||||
"vcs/gitignore/local" = "~/.local"
|
||||
vcs = "~"
|
||||
[git.files]
|
||||
"git/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" }
|
||||
git = "~"
|
||||
|
||||
[nvim.files]
|
||||
"nvim/.config/nvim/spell/de.utf-8.add.spl" = { target = "~/.config/nvim/spell/de.utf-8.add.spl", type = "symbolic" }
|
||||
|
@ -71,14 +67,8 @@ social = "~"
|
|||
|
||||
[writing.files]
|
||||
"writing/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" }
|
||||
"writing/jrnl/config" = "~/.config"
|
||||
"writing/papis/config/papis/papistui.yaml" = { target = "~/.config/papis/papistui.yaml", type = "symbolic" }
|
||||
"writing/papis/config" = "~/.config"
|
||||
"writing/sioyek/config/sioyek/prefs_user.config" = { target = "~/.config/sioyek/prefs_user.config", type = "template", prepend = "# TEMPLATED BY DOTTER\n" }
|
||||
"writing/sioyek/config" = "~/.config"
|
||||
"writing/zathura/config" = "~/.config"
|
||||
"writing/zk/config" = "~/.config"
|
||||
"writing/pandoc/local" = "~/.local"
|
||||
"writing/.config/papis/papistui.yaml" = { target = "~/.config/papis/papistui.yaml", type = "symbolic" }
|
||||
"writing/.config/sioyek/prefs_user.config" = { target = "~/.config/sioyek/prefs_user.config", type = "template", prepend = "# TEMPLATED BY DOTTER\n" }
|
||||
writing = "~"
|
||||
|
||||
# WORKSTATION: A desktop machine, with wayland environment and display attached.
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
# Version control software module
|
||||
# Git module
|
||||
|
||||
[git](https://git-scm.com/) - a distributed version control system
|
||||
[jujutsu](https://martinvonz.github.io/jj/latest/) - a change-based version control system
|
||||
|
||||
## What's in this module
|
||||
|
||||
[[_TOC_]]
|
||||
|
||||
## Global vcs settings
|
||||
## Global git settings
|
||||
|
||||
This are probably the first things that need to be customized, since it points to a different identity for each git user.
|
||||
This is probably the first thing that needs to be customized, since it points to a different identity for each git user.
|
||||
I sign all my commits by default, so take out the corresponding lines if you don't, or exchange it with your gpg key.
|
||||
Similarly for jujutsu, change the identity and remove the lines concerning gpg signing if you don't use it.
|
||||
|
||||
Git will rewrite any remotes using http(s) to use the ssh notation for pushes to github and gitlab so that, even if you set up the repository using an https url you can utilize your usual ssh key for pushing.
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
|
||||
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
||||
"Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" },
|
||||
"aerial.nvim": { "branch": "master", "commit": "9c29a1a66eb31384888e413e510ba72496e06770" },
|
||||
"aerial.nvim": { "branch": "master", "commit": "d5ba0e3cfede432cec7e6ab28724c4a554ea0f09" },
|
||||
"bats.vim": { "branch": "master", "commit": "6a5d2ef22b0ede503d867770afd02ebb1f97b709" },
|
||||
"cmp-beancount": { "branch": "main", "commit": "29e23297c06b9d69771e4b14e0fb3b9d583a150e" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
|
@ -14,79 +14,74 @@
|
|||
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" },
|
||||
"cmp-pandoc-references": { "branch": "master", "commit": "2c808dff631a783ddd2c554c4c6033907589baf6" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp-rg": { "branch": "master", "commit": "70a43543f61b6083ba9c3b7deb9ccee671410ac6" },
|
||||
"cmp-rg": { "branch": "master", "commit": "677a7874ee8f1afc648c2e7d63a97bc21a7663c5" },
|
||||
"cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" },
|
||||
"cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"completion-vcard": { "branch": "master", "commit": "2220fd517a985ececed1adcf0e5be8f2815564c7" },
|
||||
"conform.nvim": { "branch": "master", "commit": "6239d9986f51ca93ded99ecdb1af0e287eabb651" },
|
||||
"dial.nvim": { "branch": "master", "commit": "46b4375e84e8eb771129bff6b2b1e47746601ef9" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "43b8f74e0b1e3f41e51f640f8efa3bcd401cea0d" },
|
||||
"conform.nvim": { "branch": "master", "commit": "acc7337cfd24ddfa3109bfc8c258c09c88c5c450" },
|
||||
"dial.nvim": { "branch": "master", "commit": "ed4d6a5bbd5e479b4c4a3019d148561a2e6c1490" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "71349f24c6e07b39f33600985843c289ca735308" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" },
|
||||
"flash.nvim": { "branch": "main", "commit": "ec0bf2842189f65f60fd40bf3557cac1029cc932" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" },
|
||||
"fwatch.nvim": { "branch": "main", "commit": "a691f7349dc66285cd75a1a698dd28bca45f2bf8" },
|
||||
"git-conflict.nvim": { "branch": "main", "commit": "4bbfdd92d547d2862a75b4e80afaf30e73f7bbb4" },
|
||||
"git-conflict.nvim": { "branch": "main", "commit": "bfd9fe6fba9a161fc199771d85996236a0d0faad" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "0b04035bb7b3c83e999b9676e2fb46fd0aa9f910" },
|
||||
"glance.nvim": { "branch": "master", "commit": "17ee84e29ac33e7e5d91609f675cee8477586bda" },
|
||||
"grug-far.nvim": { "branch": "main", "commit": "9a2f78219390b47d67795ab09390d7f092e23976" },
|
||||
"helpview.nvim": { "branch": "main", "commit": "34be34afd0811dee17e6b0c46176d9140659fe8e" },
|
||||
"hunk.nvim": { "branch": "master", "commit": "eb89245a66bdfce10436d15923bf4deb43d23c96" },
|
||||
"glance.nvim": { "branch": "master", "commit": "51059bcf21016387b6233c89eed220cf47fca752" },
|
||||
"grug-far.nvim": { "branch": "main", "commit": "536b23dcf3165a622654544e5f9f395584e73b57" },
|
||||
"heirline.nvim": { "branch": "master", "commit": "0d797435e54645a5f98bad7ad6046aac1ef95c1e" },
|
||||
"image.nvim": { "branch": "master", "commit": "da64ce69598875c9af028afe129f916b02ccc42e" },
|
||||
"img-clip.nvim": { "branch": "main", "commit": "28a32d811d69042f4fa5c3d5fa35571df2bc1623" },
|
||||
"img-clip.nvim": { "branch": "main", "commit": "fc30500c35663aa1762697f5aba31d43b86028f0" },
|
||||
"jupytext.nvim": { "branch": "main", "commit": "c8baf3ad344c59b3abd461ecc17fc16ec44d0f7b" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" },
|
||||
"lsp-setup.nvim": { "branch": "main", "commit": "6e4e977512ce426d8b52c27f3b6e6aefc73e1452" },
|
||||
"ltex_extra.nvim": { "branch": "dev", "commit": "57192d7ae5ba8cef3c10e90f2cd62d4a7cdaab69" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
|
||||
"luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" },
|
||||
"luvit-meta": { "branch": "main", "commit": "57d464c4acb5c2e66bd4145060f5dc9e96a7bbb7" },
|
||||
"luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" },
|
||||
"markmap.nvim": { "branch": "main", "commit": "5fb6755cf5434511cc23a4936c9eb76b9142fba5" },
|
||||
"mason-conform.nvim": { "branch": "main", "commit": "abce2be529f3b4b336c56d0ba6336a9144e0fee6" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "62360f061d45177dda8afc1b0fd1327328540301" },
|
||||
"mason-nvim-lint": { "branch": "main", "commit": "b579a00ee39dcd590b1023028dc8fb3d203a67b0" },
|
||||
"mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
|
||||
"mdeval.nvim": { "branch": "master", "commit": "0e1b248db174a9659a9ab16eb8c90ff3aec55264" },
|
||||
"mini.nvim": { "branch": "main", "commit": "64e95aa77587d04f97a5579b2106a82a08a7d968" },
|
||||
"molten-nvim": { "branch": "main", "commit": "66ee5c0a0fbe3e014b867d04db44592f2d3eb30f" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" },
|
||||
"mdeval.nvim": { "branch": "master", "commit": "2c32e2f3e7d8f222e7a4724989f218d036e1081d" },
|
||||
"mini.nvim": { "branch": "main", "commit": "19e1584124cda35388d4fdb911eab7124014e541" },
|
||||
"molten-nvim": { "branch": "main", "commit": "eb6d0fe33e14989b0f1fbe25d9732889ee57bd1a" },
|
||||
"neogen": { "branch": "main", "commit": "dc50715c009f89b8111197fd2f282f6042daa7ea" },
|
||||
"neotest": { "branch": "master", "commit": "6d3d22cdad49999ef774ebe1bc250a4994038964" },
|
||||
"neotest-python": { "branch": "master", "commit": "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e" },
|
||||
"nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" },
|
||||
"neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" },
|
||||
"neotest-python": { "branch": "master", "commit": "e5bff6dcf3cb33e6dfb97722e142961099c6021e" },
|
||||
"nvim-FeMaco.lua": { "branch": "main", "commit": "96bbf843595dbe865838b3f2484b73557f34700c" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "ca4d3330d386e76967e53b85953c170658255ecb" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "4acf88d31b3a7a1a7f31e9c30bf2b23c6313abdb" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "194ec600488f7c7229668d0e80bd197f3a2b84ff" },
|
||||
"nvim-coverage": { "branch": "main", "commit": "aa4b4400588e2259e87e372b1e4e90ae13cf5a39" },
|
||||
"nvim-lint": { "branch": "master", "commit": "6b46370d02cd001509a765591a3ffc481b538794" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "7b0a2f6b14485bb5a237fc1328a487ff3e4a08c5" },
|
||||
"nvim-lint": { "branch": "master", "commit": "ad0fe35e80f5cd31a0f19176d7b30e5c3011119d" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "ad32182cc4a03c8826a64e9ced68046c575fdb7d" },
|
||||
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
|
||||
"nvim-surround": { "branch": "main", "commit": "9f0cb495f25bff32c936062d85046fbda0c43517" },
|
||||
"nvim-toggleterm.lua": { "branch": "main", "commit": "022ff5594acccc8d90d2e46dc43994f7722ebdf7" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "cfc6f2c117aaaa82f19bcce44deec2c194d900ab" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "920999bf53daa63ddf12efdeb5137a7cea1cc201" },
|
||||
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
|
||||
"nvim-toggleterm.lua": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "ad0b95dee55955817af635fa121f6e2486b10583" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "f197a15b0d1e8d555263af20add51450e5aaa1f0" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "0f3332788e0bd37716fbd25f39120dcfd557c90f" },
|
||||
"nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" },
|
||||
"nvim-treesitter-textsubjects": { "branch": "master", "commit": "a8d2844bba925d9450ef7ab215f3b054028288ca" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "f2d24aca1bcbbd2c0306fd93d52e3697027b77ff" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "9c74db656c3d0b1c4392fc89a016b1910539e7c0" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "dc5e1687ab76ee02e0f11c5ce137f530b36e98b3" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "6b5f95aa4d24f2c629a74f2c935c702b08dbde62" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" },
|
||||
"otter.nvim": { "branch": "main", "commit": "ca9ce67d0399380b659923381b58d174344c9ee7" },
|
||||
"parrot.nvim": { "branch": "main", "commit": "413679a79cf220c261a4700cee5a01cadd99db53" },
|
||||
"otter.nvim": { "branch": "main", "commit": "3b4fa74f0a385207fa9c29b61b07178345a3dab2" },
|
||||
"peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
|
||||
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
|
||||
"quarto-nvim": { "branch": "main", "commit": "23083a0152799ca7263ac9ae53d768d4dd93d24e" },
|
||||
"rainbow-delimiters.nvim": { "branch": "master", "commit": "e0f9b3efe150724af2d2ed59997d5ece373840e3" },
|
||||
"render-markdown": { "branch": "main", "commit": "6096cf3608b576a38fd1396227dbc0473091714d" },
|
||||
"quarto-nvim": { "branch": "main", "commit": "09fabb62d414e56ee3245c558aaedbdc662b6493" },
|
||||
"rainbow-delimiters.nvim": { "branch": "master", "commit": "a2072fef01645c5b06045f126437ff8e2057ef3c" },
|
||||
"render-markdown": { "branch": "main", "commit": "ced4a66f9bc38580f4797a789d2d5575fcd809fd" },
|
||||
"smartcolumn.nvim": { "branch": "main", "commit": "d01b99355c7fab13233f48d0f28dc097e68a03f7" },
|
||||
"stickybuf.nvim": { "branch": "master", "commit": "2160fcd536d81f5fa43f7167dba6634e814e3154" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
|
||||
"telescope-jj.nvim": { "branch": "main", "commit": "9527e39f30eded7950ca127698422ec412d633c4" },
|
||||
"telescope-luasnip.nvim": { "branch": "master", "commit": "11668478677de360dea45cf2b090d34f21b8ae07" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"texpresso.vim": { "branch": "main", "commit": "1cc949fde8ed3220968039b6b1b6ccdd9f475087" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "313b04e5b02d29ab9275c9295ff5e2b73921b0eb" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "40c5317a6e90fe3393f07b0fee580d9e93a216b4" },
|
||||
"twilight.nvim": { "branch": "main", "commit": "8bb7fa7b918baab1ca81b977102ddb54afa63512" },
|
||||
"undotree": { "branch": "main", "commit": "eab459ab87dd249617b5f7187bb69e614a083047" },
|
||||
|
@ -95,8 +90,8 @@
|
|||
"vim-numbertoggle": { "branch": "main", "commit": "df9b1fe616507340718716204ba7f434125bdf7a" },
|
||||
"vim-spellsync": { "branch": "master", "commit": "3d6dd50de9c4d953cc16638112a6ae196df41463" },
|
||||
"wezterm.nvim": { "branch": "main", "commit": "f73bba23ab4becd146fa2d0a3a16a84b987eeaca" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" },
|
||||
"wrapping.nvim": { "branch": "master", "commit": "3a823200c297885b70515fa8d974e1763c578e26" },
|
||||
"zen-mode.nvim": { "branch": "main", "commit": "04b52674b8c800f8b7d4609e8bd8d0212e3ffa79" },
|
||||
"zk-nvim": { "branch": "main", "commit": "469e7562b8dbf1bcbfe1be245ca5d1724917f5c6" }
|
||||
"zk-nvim": { "branch": "main", "commit": "66b9b490e930fb77f93a2a0c64e0da9a5144fd0a" }
|
||||
}
|
||||
|
|
310
nvim/.config/nvim/lua/custom/components.lua
Normal file
310
nvim/.config/nvim/lua/custom/components.lua
Normal file
|
@ -0,0 +1,310 @@
|
|||
local M = {}
|
||||
|
||||
local conditions = require("heirline.conditions")
|
||||
local utils = require("heirline.utils")
|
||||
M.Align = { provider = "%=" }
|
||||
M.Space = { provider = " " }
|
||||
M.Separator = {
|
||||
static = {
|
||||
component = { left = " ", right = " " },
|
||||
section = {
|
||||
left = "█ ",
|
||||
right = "█",
|
||||
},
|
||||
},
|
||||
}
|
||||
M.ViMode = {
|
||||
init = function(self)
|
||||
self.mode = vim.fn.mode(1)
|
||||
end,
|
||||
static = {
|
||||
mode_names = {
|
||||
n = "N",
|
||||
no = "N?",
|
||||
nov = "N?",
|
||||
noV = "N?",
|
||||
["no\22"] = "N?",
|
||||
niI = "Ni",
|
||||
niR = "Nr",
|
||||
niV = "Nv",
|
||||
nt = "Nt",
|
||||
v = "V",
|
||||
vs = "Vs",
|
||||
V = "_V",
|
||||
Vs = "Vs",
|
||||
["\22"] = "^V",
|
||||
["\22s"] = "^V",
|
||||
s = "S",
|
||||
S = "S_",
|
||||
["\19"] = "^S",
|
||||
i = "I",
|
||||
ic = "Ic",
|
||||
ix = "Ix",
|
||||
R = "R",
|
||||
Rc = "Rc",
|
||||
Rx = "Rx",
|
||||
Rv = "Rv",
|
||||
Rvc = "Rv",
|
||||
Rvx = "Rv",
|
||||
c = "C",
|
||||
cv = "Ex",
|
||||
r = "...",
|
||||
rm = "M",
|
||||
["r?"] = "?",
|
||||
["!"] = "!",
|
||||
t = "T",
|
||||
},
|
||||
mode_colors = {
|
||||
n = "white",
|
||||
i = "green",
|
||||
v = "cyan",
|
||||
V = "cyan",
|
||||
["\22"] = "cyan",
|
||||
c = "orange",
|
||||
s = "purple",
|
||||
S = "purple",
|
||||
["\19"] = "purple",
|
||||
R = "orange",
|
||||
r = "orange",
|
||||
["!"] = "red",
|
||||
t = "red",
|
||||
},
|
||||
},
|
||||
provider = function(self)
|
||||
return "%3(" .. self.mode_names[self.mode] .. "%) "
|
||||
end,
|
||||
hl = function(self)
|
||||
local general_mode = self.mode:sub(1, 1)
|
||||
self.bg = self.mode_colors[general_mode]
|
||||
return { bg = self.bg, fg = utils.get_highlight("StatusLine").bg, bold = true }
|
||||
end,
|
||||
update = {
|
||||
"ModeChanged",
|
||||
pattern = "*:*",
|
||||
callback = vim.schedule_wrap(function()
|
||||
vim.cmd("redrawstatus")
|
||||
end),
|
||||
},
|
||||
}
|
||||
local FileIcon = {
|
||||
init = function(self)
|
||||
local filename = self.filename
|
||||
local ext = vim.fn.fnamemodify(filename, ":e")
|
||||
self.icon, self.icon_color = require("nvim-web-devicons").get_icon_color(filename, ext, { default = true })
|
||||
end,
|
||||
provider = function(self)
|
||||
if self.icon then
|
||||
return " " .. self.icon .. " "
|
||||
end
|
||||
return ""
|
||||
end,
|
||||
hl = function(self)
|
||||
return { fg = self.icon_color }
|
||||
end,
|
||||
}
|
||||
local FileName = {
|
||||
provider = function(self)
|
||||
local filename = vim.fn.fnamemodify(self.filename, ":.")
|
||||
if filename == "" then
|
||||
return " [Unnamed] "
|
||||
end
|
||||
if not conditions.width_percent_below(#filename, 0.25) then
|
||||
filename = vim.fn.pathshorten(filename)
|
||||
end
|
||||
return " " .. filename .. " "
|
||||
end,
|
||||
hl = { fg = "bright_fg" },
|
||||
update = { "BufRead", "BufNewFile", "BufEnter", "FileReadPost", "FileWritePre" },
|
||||
}
|
||||
local FileFlags = {
|
||||
{
|
||||
condition = function()
|
||||
return vim.bo.modified
|
||||
end,
|
||||
provider = "[+]",
|
||||
hl = { fg = "green" },
|
||||
},
|
||||
{
|
||||
condition = function()
|
||||
return not vim.bo.modifiable or vim.bo.readonly
|
||||
end,
|
||||
provider = "",
|
||||
hl = { fg = "orange" },
|
||||
},
|
||||
}
|
||||
M.FileNameBlock = {
|
||||
init = function(self)
|
||||
self.filename = vim.api.nvim_buf_get_name(0)
|
||||
end,
|
||||
FileIcon,
|
||||
M.Space,
|
||||
FileName,
|
||||
-- M.Space,
|
||||
FileFlags,
|
||||
}
|
||||
|
||||
local FileType = {
|
||||
provider = function()
|
||||
return string.upper(vim.bo.filetype)
|
||||
end,
|
||||
hl = { fg = utils.get_highlight("Type").fg, bold = true },
|
||||
}
|
||||
local FileEncoding = {
|
||||
provider = function()
|
||||
local enc = (vim.bo.fenc ~= "" and vim.bo.fenc) or vim.o.enc -- :h 'enc'
|
||||
return enc ~= "utf-8" and enc:upper()
|
||||
end,
|
||||
}
|
||||
local FileFormat = {
|
||||
provider = function()
|
||||
local fmt = vim.bo.fileformat
|
||||
return fmt ~= "unix" and fmt:upper()
|
||||
end,
|
||||
}
|
||||
M.FileAttributesBlock = {
|
||||
FileFormat,
|
||||
M.Space,
|
||||
FileEncoding,
|
||||
M.Space,
|
||||
FileType,
|
||||
}
|
||||
|
||||
M.Ruler = {
|
||||
-- %l = current line number
|
||||
-- %L = number of lines in the buffer
|
||||
-- %c = column number
|
||||
-- %P = percentage through file of displayed window
|
||||
-- TODO: check how many lines file has in total and
|
||||
-- set amount of 'whitespace' here accordingly
|
||||
provider = "%l:%2c",
|
||||
}
|
||||
M.ScrollBar = {
|
||||
static = {
|
||||
sbar = { "▔", "🮂", "🮃", "▀", "🮄", "🮅", "🮆", "█" },
|
||||
-- sbar = { '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█' }
|
||||
-- sbar = { '🭶', '🭷', '🭸', '🭹', '🭺', '🭻' }
|
||||
},
|
||||
provider = function(self)
|
||||
local curr_line = vim.api.nvim_win_get_cursor(0)[1]
|
||||
local lines = vim.api.nvim_buf_line_count(0)
|
||||
local i = math.floor((curr_line - 1) / lines * #self.sbar) + 1
|
||||
return string.rep(self.sbar[i], 2)
|
||||
end,
|
||||
hl = { fg = "blue", bg = "bright_bg" },
|
||||
}
|
||||
M.FilePositionBlock = {
|
||||
M.ScrollBar,
|
||||
M.Space,
|
||||
M.Ruler,
|
||||
update = "CursorMoved",
|
||||
}
|
||||
|
||||
M.LSPActive = {
|
||||
condition = conditions.lsp_attached,
|
||||
update = { "LspAttach", "LspDetach" },
|
||||
provider = " ",
|
||||
hl = { fg = "green", bold = true },
|
||||
}
|
||||
|
||||
M.Diagnostics = {
|
||||
condition = conditions.has_diagnostics,
|
||||
static = {
|
||||
-- error_icon = vim.fn.sign_getdefined("DiagnosticSignError")[1].text,
|
||||
-- warn_icon = vim.fn.sign_getdefined("DiagnosticSignWarn")[1].text,
|
||||
-- info_icon = vim.fn.sign_getdefined("DiagnosticSignInfo")[1].text,
|
||||
-- hint_icon = vim.fn.sign_getdefined("DiagnosticSignHint")[1].text,
|
||||
},
|
||||
init = function(self)
|
||||
self.error_icon = vim.fn.sign_getdefined("DiagnosticSignError")[1].text
|
||||
self.warn_icon = vim.fn.sign_getdefined("DiagnosticSignWarn")[1].text
|
||||
self.info_icon = vim.fn.sign_getdefined("DiagnosticSignInfo")[1].text
|
||||
self.hint_icon = vim.fn.sign_getdefined("DiagnosticSignHint")[1].text
|
||||
self.errors = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR })
|
||||
self.warnings = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN })
|
||||
self.hints = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT })
|
||||
self.info = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.INFO })
|
||||
end,
|
||||
update = { "DiagnosticChanged", "BufEnter" },
|
||||
|
||||
{
|
||||
provider = "![",
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
-- 0 is just another output, we can decide to print it or not!
|
||||
return self.errors > 0 and (self.error_icon .. self.errors .. " ")
|
||||
end,
|
||||
hl = { fg = "diag_error" },
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
return self.warnings > 0 and (self.warn_icon .. self.warnings .. " ")
|
||||
end,
|
||||
hl = { fg = "diag_warn" },
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
return self.info > 0 and (self.info_icon .. self.info .. " ")
|
||||
end,
|
||||
hl = { fg = "diag_info" },
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
return self.hints > 0 and (self.hint_icon .. self.hints)
|
||||
end,
|
||||
hl = { fg = "diag_hint" },
|
||||
},
|
||||
{
|
||||
provider = "]",
|
||||
},
|
||||
}
|
||||
|
||||
M.Git = {
|
||||
condition = require("core.util").is_available("gitsigns") and conditions.is_git_repo,
|
||||
init = function(self)
|
||||
self.status_dict = vim.b.gitsigns_status_dict
|
||||
self.has_changes = self.status_dict.added ~= 0 or self.status_dict.removed ~= 0 or self.status_dict.changed ~= 0
|
||||
end,
|
||||
hl = { fg = "orange" },
|
||||
{ -- git branch name
|
||||
provider = function(self)
|
||||
return " " .. self.status_dict.head
|
||||
end,
|
||||
hl = { bold = true },
|
||||
},
|
||||
-- You could handle delimiters, icons and counts similar to Diagnostics
|
||||
{
|
||||
condition = function(self)
|
||||
return self.has_changes
|
||||
end,
|
||||
provider = "(",
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
local count = self.status_dict.added or 0
|
||||
return count > 0 and ("+" .. count)
|
||||
end,
|
||||
hl = { fg = "green" },
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
local count = self.status_dict.removed or 0
|
||||
return count > 0 and ("-" .. count)
|
||||
end,
|
||||
hl = { fg = "red" },
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
local count = self.status_dict.changed or 0
|
||||
return count > 0 and ("~" .. count)
|
||||
end,
|
||||
hl = { fg = "orange" },
|
||||
},
|
||||
{
|
||||
condition = function(self)
|
||||
return self.has_changes
|
||||
end,
|
||||
provider = ")",
|
||||
},
|
||||
}
|
||||
return M
|
|
@ -22,7 +22,6 @@ return {
|
|||
"mfussenegger/nvim-lint",
|
||||
config = function()
|
||||
require("lint").linters_by_ft = linters
|
||||
require("lint").linters.markdownlint.args = { "--stdin", "--disable", "MD013", "--" }
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost", "InsertLeave" }, {
|
||||
callback = function()
|
||||
if not vim.g.disable_autolint then
|
||||
|
|
|
@ -35,7 +35,7 @@ local servers = {
|
|||
taplo = {},
|
||||
texlab = {},
|
||||
tinymist = {},
|
||||
ts_ls = {},
|
||||
tsserver = {},
|
||||
yamlls = {},
|
||||
}
|
||||
|
||||
|
@ -239,40 +239,9 @@ return {
|
|||
on_attach = function(client, bufnr)
|
||||
-- TODO: for some reason this stays true even after rootdir switch?
|
||||
if client.config.in_zk_notebook then
|
||||
local default_handler = vim.diagnostic.handlers.virtual_text
|
||||
vim.diagnostic.handlers.virtual_text = {
|
||||
show = function(namespace, bufnrr, diagnostics, opts)
|
||||
for i, diagnostic in ipairs(diagnostics) do
|
||||
if
|
||||
diagnostic.source
|
||||
== "Marksman" -- You need to check what the correct value should be here
|
||||
then
|
||||
table.remove(diagnostics, i)
|
||||
end
|
||||
end
|
||||
default_handler.show(namespace, bufnrr, diagnostics, opts)
|
||||
end,
|
||||
hide = function(...)
|
||||
default_handler.hide(...)
|
||||
end,
|
||||
}
|
||||
local default_handler = vim.diagnostic.handlers.signs
|
||||
vim.diagnostic.handlers.signs = {
|
||||
show = function(namespace, bufnrr, diagnostics, opts)
|
||||
for i, diagnostic in ipairs(diagnostics) do
|
||||
if
|
||||
diagnostic.source
|
||||
== "Marksman" -- You need to check what the correct value should be here
|
||||
then
|
||||
table.remove(diagnostics, i)
|
||||
end
|
||||
end
|
||||
default_handler.show(namespace, bufnrr, diagnostics, opts)
|
||||
end,
|
||||
hide = function(...)
|
||||
default_handler.hide(...)
|
||||
end,
|
||||
}
|
||||
vim.defer_fn(function()
|
||||
vim.lsp.buf_detach_client(bufnr, client.id)
|
||||
end, 1000)
|
||||
end
|
||||
on_attach(client, bufnr)
|
||||
end,
|
||||
|
|
|
@ -1,4 +1,35 @@
|
|||
return {
|
||||
-- vista-like outline view for code
|
||||
{
|
||||
"stevearc/aerial.nvim",
|
||||
config = true,
|
||||
-- Optional dependencies
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
cmd = {
|
||||
"AerialToggle",
|
||||
"AerialOpen",
|
||||
"AerialOpenAll",
|
||||
"AerialClose",
|
||||
"AerialCloseAll",
|
||||
"AerialNext",
|
||||
"AerialPrev",
|
||||
"AerialGo",
|
||||
"AerialInfo",
|
||||
"AerialNavToggle",
|
||||
"AerialNavOpen",
|
||||
"AerialNavClose",
|
||||
},
|
||||
opts = {
|
||||
backends = { "treesitter", "lsp", "markdown", "man" },
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>so", "<cmd>AerialNavToggle<cr>", silent = true, desc = "symbol navigator" },
|
||||
{ "<leader>sO", "<cmd>AerialToggle<cr>", silent = true, desc = "symbol outline" },
|
||||
},
|
||||
},
|
||||
-- useful quickfix-like buffer
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
|
@ -15,8 +46,6 @@ return {
|
|||
silent = true,
|
||||
desc = "diagnostics document",
|
||||
},
|
||||
{ "<leader>so", "<cmd>Trouble symbols toggle focus=true win.type=float<cr>", silent = true, desc = "symbol outline" },
|
||||
{ "<leader>sO", "<cmd>Trouble symbols toggle focus=false win.position=right<cr>", silent = true, desc = "symbol outline" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -15,20 +15,13 @@ return {
|
|||
event = { "BufEnter" },
|
||||
}, -- integrate file manager
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
{ "nvim-tree/nvim-web-devicons", optional = true },
|
||||
},
|
||||
cmd = "Neotree",
|
||||
opts = {
|
||||
source_selector = { winbar = true },
|
||||
},
|
||||
"nvim-tree/nvim-tree.lua", -- integrate file tree
|
||||
config = true,
|
||||
dependencies = { "nvim-tree/nvim-web-devicons", config = true },
|
||||
cmd = "NvimTreeToggle",
|
||||
keys = {
|
||||
{ "<leader>se", "<cmd>Neotree toggle left<cr>", desc = "filetree", silent = true },
|
||||
{ "<leader>se", "<cmd>NvimTreeToggle<cr>", desc = "filetree", silent = true },
|
||||
},
|
||||
lazy = false
|
||||
},
|
||||
{ "MagicDuck/grug-far.nvim", lazy = false, opts = {} },
|
||||
-- fuzzy matching picker
|
||||
|
|
|
@ -69,24 +69,14 @@ local prose_plugs = {
|
|||
main = "render-markdown",
|
||||
opts = {
|
||||
file_types = { unpack(md_like) },
|
||||
render_modes = { "n", "c", "i" },
|
||||
code = {
|
||||
sign = false,
|
||||
width = "block",
|
||||
right_pad = 1,
|
||||
},
|
||||
checkbox = {
|
||||
custom = {
|
||||
todo = { raw = "[-]", rendered = " ", highlight = "RenderMarkdownTodo" },
|
||||
removed = { raw = "[_]", rendered = " ", highlight = "RenderMarkdownTodo" },
|
||||
},
|
||||
},
|
||||
},
|
||||
name = "render-markdown", -- Only needed if you have another plugin named markdown.nvim
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" }, -- if you prefer nvim-web-devicons
|
||||
ft = md_like,
|
||||
cmd = "RenderMarkdown",
|
||||
keys = {
|
||||
|
|
|
@ -87,4 +87,70 @@ return {
|
|||
end,
|
||||
event = { "VeryLazy" },
|
||||
},
|
||||
{
|
||||
"rebelot/heirline.nvim",
|
||||
dependencies = { { "nvim-tree/nvim-web-devicons", optional = true } },
|
||||
cond = false,
|
||||
lazy = false,
|
||||
config = function()
|
||||
local cond = require("heirline.conditions")
|
||||
local utils = require("heirline.utils")
|
||||
local c = require("custom.components")
|
||||
|
||||
local function setup_colors()
|
||||
return {
|
||||
bright_bg = utils.get_highlight("Folded").bg,
|
||||
bright_fg = utils.get_highlight("Folded").fg,
|
||||
red = utils.get_highlight("DiagnosticError").fg,
|
||||
dark_red = utils.get_highlight("DiffDelete").bg,
|
||||
green = utils.get_highlight("String").fg,
|
||||
blue = utils.get_highlight("Function").fg,
|
||||
gray = utils.get_highlight("NonText").fg,
|
||||
orange = utils.get_highlight("Constant").fg,
|
||||
purple = utils.get_highlight("Statement").fg,
|
||||
cyan = utils.get_highlight("Special").fg,
|
||||
diag_warn = utils.get_highlight("DiagnosticWarn").fg,
|
||||
diag_error = utils.get_highlight("DiagnosticError").fg,
|
||||
diag_hint = utils.get_highlight("DiagnosticHint").fg,
|
||||
diag_info = utils.get_highlight("DiagnosticInfo").fg,
|
||||
git_del = utils.get_highlight("diffDeleted").fg,
|
||||
git_add = utils.get_highlight("diffAdded").fg,
|
||||
git_change = utils.get_highlight("diffChanged").fg,
|
||||
}
|
||||
end
|
||||
vim.api.nvim_create_augroup("Heirline", { clear = true })
|
||||
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||
callback = function()
|
||||
utils.on_colorscheme(setup_colors)
|
||||
end,
|
||||
group = "Heirline",
|
||||
})
|
||||
|
||||
require("heirline").setup({
|
||||
opts = {
|
||||
colors = setup_colors(),
|
||||
},
|
||||
statusline = {
|
||||
hl = {
|
||||
fg = utils.get_highlight("StatusLineNC").fg,
|
||||
bg = utils.get_highlight("StatusLineNC").bg,
|
||||
},
|
||||
-- TODO: load dynamically: color and surrounding sep shapes
|
||||
-- utils.surround({ "", c.Separator.static.section.left }, "white", c.ViMode),
|
||||
|
||||
{
|
||||
c.ViMode,
|
||||
-- c.Git,
|
||||
-- c.Diagnostics,
|
||||
c.FileNameBlock,
|
||||
c.Align,
|
||||
c.LSPActive,
|
||||
c.FileAttributesBlock,
|
||||
c.Space,
|
||||
c.FilePositionBlock,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -92,12 +92,4 @@ return {
|
|||
opts = {},
|
||||
event = "VeryLazy",
|
||||
},
|
||||
{
|
||||
"OXY2DEV/helpview.nvim",
|
||||
-- lazy = false, -- Recommended by dev?
|
||||
ft = "help",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
[user]
|
||||
email = "marty.oehme@gmail.com"
|
||||
name = "Marty Oehme"
|
||||
|
||||
[signing]
|
||||
sign-all = false
|
||||
backend = "gpg"
|
||||
key = "73BA40D5AFAF49C9"
|
||||
|
||||
[ui]
|
||||
default-command = "log"
|
||||
diff-editor = ["nvim", "-c", "DiffEditor $left $right $output"]
|
|
@ -1,30 +0,0 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
if ! exist jj; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
alias j='jj' # necessary for a thing as easy to type?
|
||||
if exist lazyjj; then
|
||||
alias lj="lazyjj"
|
||||
fi
|
||||
alias js="jj status"
|
||||
|
||||
alias jd="jj describe"
|
||||
alias jn="jj new"
|
||||
alias jc="jj commit"
|
||||
|
||||
alias jl='jj log'
|
||||
alias jlo='jj log --summary'
|
||||
alias jloo='jj log --patch'
|
||||
alias jo="jj op log"
|
||||
|
||||
alias jss="jj squash"
|
||||
alias jsi="jj squash --interactive"
|
||||
|
||||
alias je="jj edit"
|
||||
alias jee="jj next --edit"
|
||||
|
||||
alias jun="jj undo"
|
||||
|
||||
alias jp="jj git push"
|
166
writing/.config/pubs/pubsrc
Normal file
166
writing/.config/pubs/pubsrc
Normal file
|
@ -0,0 +1,166 @@
|
|||
|
||||
[main]
|
||||
|
||||
# Where the pubs repository files (bibtex, metadata, notes) are located
|
||||
pubsdir = ~/documents/library
|
||||
|
||||
# Where the documents files are located (default: $(pubsdir)/doc/)
|
||||
docsdir = ~/documents/library/doc
|
||||
|
||||
# Specify if a document should be copied or moved in the docdir, or only
|
||||
# linked when adding a publication.
|
||||
doc_add = copy
|
||||
|
||||
# the command to use when opening document files
|
||||
open_cmd = open
|
||||
|
||||
# which editor to use when editing bibtex files.
|
||||
# if using a graphical editor, use the --wait or --block option, i.e.:
|
||||
# "atom --wait"
|
||||
# "kate --block"
|
||||
# If set to an empty string (default) pubs uses the value of the environment
|
||||
# variable $EDITOR.
|
||||
edit_cmd = ""
|
||||
|
||||
# Which default extension to use when creating a note file.
|
||||
note_extension = md
|
||||
|
||||
# How many authors to display when displaying a citation. If there are more
|
||||
# authors, only the first author is diplayed followed by 'et al.'.
|
||||
max_authors = 3
|
||||
|
||||
# If true debug mode is on which means exceptions are not catched and
|
||||
# the full python stack is printed.
|
||||
debug = False
|
||||
|
||||
# If true the citekey is normalized using the 'citekey_format' on adding new publications.
|
||||
normalize_citekey = False
|
||||
|
||||
# String specifying how to format the citekey. All strings of
|
||||
# the form '{substitution:modifier}' and '{substitution}' will
|
||||
# be substituted with their appropriate values. The following
|
||||
# substitutions are used:
|
||||
# author_last_name: last name of the first author
|
||||
# year: year of publication
|
||||
# short_title: first word of the title (excluding words such as "the", "an", ...)
|
||||
# modifiers:
|
||||
# l: converts the text to lowercase
|
||||
# u: converts the text to uppercase
|
||||
# examples:
|
||||
# {author_last_name:l}{year} generates 'yang2020'
|
||||
# {author_last_name}{year}{short_title} generates 'Yang2020Towards'
|
||||
# {author_last_name:l}{year}{short_title:l} generates 'yang2020towards'
|
||||
# {author_last_name:u}{year} generates 'YANG2020'
|
||||
#
|
||||
citekey_format = {author_last_name}{year}
|
||||
|
||||
# which bibliographic fields to exclude from bibtex files. By default, none.
|
||||
# Please note that excluding critical fields such as `title` or `author`
|
||||
# will break many commands of pubs.
|
||||
exclude_bibtex_fields = ,
|
||||
|
||||
[formating]
|
||||
|
||||
# Enable bold formatting, if the terminal supports it.
|
||||
bold = True
|
||||
|
||||
# Enable italics, if the terminal supports it.
|
||||
italics = True
|
||||
|
||||
# Enable colors, if the terminal supports it.
|
||||
color = True
|
||||
|
||||
|
||||
[theme]
|
||||
|
||||
# Here you can define the color theme used by pubs, if enabled in the
|
||||
# 'formating' section. Predefined theme are available at:
|
||||
# https://github.com/pubs/pubs/blob/master/extra/themes.md
|
||||
|
||||
# Available colors are: 'black', 'red', 'green', 'yellow', 'blue', 'purple',
|
||||
# 'cyan', and 'grey'. Bold colors are available by prefixing 'b' in front of
|
||||
# the color name ('bblack', 'bred', etc.), italic colors by prefixing 'i',
|
||||
# and bold italic by prefixing 'bi'. Finally, 'bold', 'italic' and
|
||||
# 'bolditalic' can be used to apply formatting without changing the color.
|
||||
# For no color, use an empty string ''
|
||||
|
||||
# messages
|
||||
ok = green
|
||||
warning = yellow
|
||||
error = red
|
||||
|
||||
# ui elements
|
||||
filepath = bold
|
||||
citekey = purple
|
||||
tag = cyan
|
||||
|
||||
# bibliographic fields
|
||||
author = bold
|
||||
title = ""
|
||||
publisher = ""
|
||||
year = bold
|
||||
volume = bold
|
||||
pages = ""
|
||||
|
||||
|
||||
[plugins]
|
||||
# Comma-separated list of the plugins to load.
|
||||
# Currently pubs comes with built-in plugins alias and git.
|
||||
active = alias,git
|
||||
|
||||
[[alias]]
|
||||
# new subcommands can be defined, e.g.:
|
||||
# print = open --with lp
|
||||
# evince = open --with evince
|
||||
|
||||
# shell commands can also be defined, by prefixing them with a bang `!`, e.g:
|
||||
# count = !pubs list -k | wc -l
|
||||
|
||||
# aliases can also be defined with descriptions using the following configobj
|
||||
# subsectioning. NOTE: any aliases defined this way should come after all other
|
||||
# aliases, otherwise simple aliases will be ignored.
|
||||
# [[[count]]]
|
||||
# command = !pubs list -k | wc -l
|
||||
# description = lists number of pubs in repo
|
||||
# new subcommands can be defined, e.g.:
|
||||
# print = open --with lp
|
||||
# evince = open --with evince
|
||||
|
||||
# shell commands can also be defined, by prefixing them with a bang `!`, e.g:
|
||||
# count = !pubs list -k | wc -l
|
||||
|
||||
# aliases can also be defined with descriptions using the following configobj
|
||||
# subsectioning. NOTE: any aliases defined this way should come after all other
|
||||
# aliases, otherwise simple aliases will be ignored.
|
||||
# [[[count]]]
|
||||
# command = !pubs list -k | wc -l
|
||||
# description = lists number of pubs in repo
|
||||
|
||||
# To use commas in the description, wrap them in a "" string. For example:
|
||||
# description = "lists number of pubs in repo, greets the user afterward"
|
||||
|
||||
[[git]]
|
||||
# The git plugin will commit changes to the repository in a git repository
|
||||
# created at the root of the pubs directory. All detected changes will be
|
||||
# commited every time a change is made by a pubs command.
|
||||
# The plugin also propose the `pubs git` subcommand, to directly send git
|
||||
# commands to the pubs repository. Therefore, `pubs git status` is equivalent
|
||||
# to `git -C <pubsdir> status`, with the `-C` flag instructing
|
||||
# to invoke git as if the current directory was <pubsdir>. Note that a
|
||||
# limitation of the subcommand is that you cannot use git commands with the
|
||||
# `-c` option (pubs will interpret it first.)
|
||||
|
||||
# if False, will display git output when automatic commit are made.
|
||||
# Invocation of `pubs git` will always have output displayed.
|
||||
quiet = True
|
||||
# if True, git will not automatically commit changes
|
||||
manual = False
|
||||
# if True, color will be conserved from git output (this add `-c color:always`
|
||||
# to the git invocation).
|
||||
force_color = True
|
||||
|
||||
|
||||
[internal]
|
||||
# The version of this configuration file. Do not edit.
|
||||
version = 0.9.0
|
||||
|
8
writing/.config/sh/alias.d/pubs.sh
Normal file
8
writing/.config/sh/alias.d/pubs.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
pubs() {
|
||||
command pubs --config "$XDG_CONFIG_HOME/pubs/pubsrc" "${@}"
|
||||
if [ -f "$BIBFILE" ]; then
|
||||
command pubs export > "$BIBFILE"
|
||||
fi
|
||||
}
|
147
writing/.local/bin/bib-due
Executable file
147
writing/.local/bin/bib-due
Executable file
|
@ -0,0 +1,147 @@
|
|||
#!/usr/bin/env sh
|
||||
# shows due entries of bibtex file passed in
|
||||
# HACK: brittle! will break on various bibfile abnormities (even just on due date w/o priority)
|
||||
# FIXME: reimplementation with real library needed
|
||||
#
|
||||
|
||||
OPTIND=1 # Reset in case getopts has been used previously in the shell.
|
||||
fields="due|priority|\bauthor\b|\btitle\b"
|
||||
filterby="due"
|
||||
file="${BIBFILE}"
|
||||
until=""
|
||||
|
||||
show_help() {
|
||||
printf "%s\n" \
|
||||
"" \
|
||||
" bib-due Show due readings from bibtex file." \
|
||||
"" \
|
||||
" Usage: bib-due [-hv] -i input.bib -r 'due|priority|\bauthor|\btitle' -l 'due' -u '2020-05-12'" \
|
||||
"" \
|
||||
" Options:" \
|
||||
"" \
|
||||
" -i [bibtex-file] Input bibtex file to scrape and get items from." \
|
||||
"" \
|
||||
" -r [fields] Field values to read in file." \
|
||||
"" \
|
||||
" -l [filter] Field to use as filter entity." \
|
||||
" This field is required for the scraper to pick entries up." \
|
||||
"" \
|
||||
" help | -h | --help Print out this help." \
|
||||
"" \
|
||||
" Invoked without arguments, bib-due will scrape the file defined in BIBFILE environment variable, " \
|
||||
" filtering entries with the 'due' field, and getting the values for 'due', 'priority', 'author', " \
|
||||
" and 'title' fields. It will then print the entries to stdout." \
|
||||
"" \
|
||||
" Example output line:" \
|
||||
"" \
|
||||
' 2020-06-25 (1): Sergei Gerasymchuk -- “Ze” time in Ukraine (Gerasymchuk2019) ' \
|
||||
""
|
||||
}
|
||||
|
||||
filter_until() {
|
||||
# filter for dates, with line numbers
|
||||
filtered=$(echo "$entries" | grep -noE '[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}')
|
||||
|
||||
# redirect entries to fifo pipe
|
||||
mkfifo filteredentries
|
||||
finish() {
|
||||
rm filteredentries
|
||||
}
|
||||
trap finish EXIT
|
||||
echo "$filtered" >filteredentries &
|
||||
|
||||
# find first date past until filter
|
||||
lastline=""
|
||||
while IFS= read -r line; do
|
||||
cond=$(printf '%s' "$line" | cut -d: -f2)
|
||||
cond=$(date -d "$cond" +%s)
|
||||
if [ "$cond" -gt "$until" ]; then
|
||||
lastline=$(printf '%s' "$line" | cut -d: -f1)
|
||||
break
|
||||
fi
|
||||
done <filteredentries
|
||||
|
||||
# special cases all in filter, or none in filter
|
||||
if [ -z "$lastline" ]; then
|
||||
return
|
||||
elif [ "$lastline" -eq 1 ]; then
|
||||
entries=""
|
||||
# filter
|
||||
else
|
||||
# remove lines below found
|
||||
lastprinted="$((lastline - 1))"
|
||||
entries=$(echo "$entries" | sed -n "1,${lastprinted}p;${lastline}q")
|
||||
fi
|
||||
}
|
||||
|
||||
filter_priority() {
|
||||
priority="$1"
|
||||
# filter for dates, with line numbers
|
||||
# filtered=$(echo "$entries" | grep -noE '[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}')
|
||||
filtered=""
|
||||
while [ "$priority" -gt 0 ]; do
|
||||
current=$(echo "$entries" | grep -E "\($priority\)")
|
||||
|
||||
# append found to filtered entries
|
||||
filtered=$(printf "%s\n%s" "$filtered" "$current")
|
||||
|
||||
# go to next 'higher' priority
|
||||
priority="$((priority - 1))"
|
||||
done
|
||||
# sort them chronologically again, remove empty lines
|
||||
entries="$(echo "$filtered" | sed -e '/^$/d' | sort)"
|
||||
}
|
||||
|
||||
main() {
|
||||
if [ -z "$file" ]; then
|
||||
echo "Requires a bibtex file as argument."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# filter all entries for those containing filterby field (default: due)
|
||||
# retain values of all fields mentioned in fields variable
|
||||
entries=$(grep -E "^@|$fields" "$file" | awk 1 ORS=' ' | sed -E 's/@\w+\{/\n/g' | grep "$filterby" | tail -n +2 | sed -E 's/(,\s+(\w+)\s+=\s+|,\s*$)/\t/g' | awk -F'\t' '{ print $4 "\t" $5 "\t" $2 "\t" $3 "\t" $1 }')
|
||||
|
||||
# prettify and sort the entries for display (remove {}, order by date,prio,author,title)
|
||||
entries=$(echo "$entries" | awk -F'\t' '{ gsub(/{/,""); gsub(/}/,""); gsub(/prio/,"",$2) } { print $1 " (" $2 "): " $3 " -- " $4 " (" $5 ")"}' | sort)
|
||||
|
||||
if [ -n "$until" ]; then
|
||||
filter_until
|
||||
fi
|
||||
if [ -n "$priority" ]; then
|
||||
filter_priority "$priority"
|
||||
fi
|
||||
|
||||
echo "$entries"
|
||||
}
|
||||
|
||||
while getopts "h?i:u:r:l:p:" opt; do
|
||||
case "$opt" in
|
||||
h | \?)
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
# v) verbose=1
|
||||
# ;;
|
||||
r)
|
||||
fields="$OPTARG"
|
||||
;;
|
||||
l)
|
||||
filterby="$OPTARG"
|
||||
;;
|
||||
i)
|
||||
file="$OPTARG"
|
||||
;;
|
||||
u)
|
||||
until="$(date -d "$OPTARG" +%s)"
|
||||
;;
|
||||
p)
|
||||
priority="$OPTARG"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
[ "${1:-}" = "--" ] && shift
|
||||
|
||||
main "$@"
|
29
writing/.local/bin/rofi-bib-due
Executable file
29
writing/.local/bin/rofi-bib-due
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
exist rofi normal
|
||||
|
||||
_rofi() {
|
||||
rofi -dmenu -no-auto-select -i -theme themes/dropdown -p "papers" -l 25 -yoffset 20 -columns 1 -u "$urgent"
|
||||
}
|
||||
|
||||
# call for whatever file is passed in
|
||||
results="$(bib-due "$@")"
|
||||
|
||||
# mark priority 1 items as urgent in rofi
|
||||
urgent="$(
|
||||
# find all lines with priority 1, (marked as `(1):` );
|
||||
# print them on 1 line, -1 since dmenu is 0 indexed
|
||||
echo "$results" | grep -n '(1):' | cut -d: -f1 | awk '{ $0=$0-1; print $0 }' ORS=','
|
||||
)"
|
||||
|
||||
# get user choice, exit if nothing selected
|
||||
choice=$(echo "$results" | _rofi)
|
||||
[ -z "$choice" ] && exit 0
|
||||
|
||||
key=$(echo "$choice" | sed -E 's/.*\((\w+)\)$/\1/')
|
||||
|
||||
# get library pdf folder (only searches for default ./pdf path)
|
||||
library="$(dirname "$(realpath "$BIBFILE")")/pdf"
|
||||
|
||||
# find and open the key-associated pdf file
|
||||
${FILEREADER:-open} "$(find "$library" -type f -name "$key *.pdf")"
|
|
@ -1,15 +1,65 @@
|
|||
# Writing module
|
||||
|
||||
This module contains everything that is specific for me writing prose, journaling and pursuing academic work.
|
||||
|
||||
That means there are configurations for reference management (`papis`),
|
||||
for daily journaling (`jrnl`),
|
||||
for reading PDFs (`sioyek`, `zathura`)
|
||||
and for general notetaking (`zk`).
|
||||
|
||||
[bibtex](https://en.wikipedia.org/wiki/BibTeX) - plain-text references
|
||||
[papis](https://github.com/papis/papis) - yaml-driven and bibtex-compatible reference management
|
||||
[jrnl](https://github.com/jrnl-org/jrnl) - journaling on the command line
|
||||
[zk](https://github.com/zk-org/zk) - notetaking with a 'zettelkasten' principle
|
||||
[bibtex](https://en.wikipedia.org/wiki/BibTeX) - plain-text reference management
|
||||
[zathura](git.pwmt.org) - keyboard-driven PDF reading
|
||||
[sioyek](http://sioyek.info/) - keyboard-driven PDF reading *and annotating*
|
||||
|
||||
This readme is a little out of date, as are the scripts below.
|
||||
They are old, I used them during my time as a student and they are probably written terribly.
|
||||
But I still think there is value in them, hence not removing them from the repo just yet.
|
||||
|
||||
## bib-due
|
||||
|
||||
The `bib-due` script depends on (gnu) grep, awk, and sed, date if using date filtering capabilities. It is currently written in a rather haphazard way, and prone to breakage.
|
||||
On the other hand, it does what it's supposed to do: list bibtex entries which have their due-date coming up.
|
||||
|
||||
The script needs bibtex entries to be marked with two fields: `due`, containing a due date (ideally in YYYY-MM-DD format, for easy sorting), and `priority` containing a read priority. It will also, by default attempt to grab the values of the fields `author` and `title`, as well as the name of the bibtex key of the entry.
|
||||
|
||||
It can be invoked with the path to a bibtex file `bib-due path/to/library.bib`, and will gather the entries from the respective file. It can be invoked without an argument if the environment variable `$BIBFILE` is declared (pointing to a bibtex file).
|
||||
|
||||
Example output looks as follows:
|
||||
|
||||
![bib-due example output](.assets/bibtex/list.png)
|
||||
|
||||
The output can then be filtered further through other programs.
|
||||
|
||||
Bib-due itself allows 2 filtering options: *until* a certain date (`-u`), and *at least* a certain priority (`-p`).
|
||||
|
||||
Using priority is relatively self-explanatory: 1 is the highest priority, 3 the lowest (technically, no priority is the lowest). Choosing `-p3` means priority 1, 2, and 3 will be displayed. Choosing `-p1` will only display the highest priority items.
|
||||
|
||||
Using the date works as a cut-off for the future, and it uses gnu `date` to calculate the correct date. That makes things like `-u 'fri this week'` possible, showing only upcoming items until the end of the week. Read the `date` manual for more information.
|
||||
There will likely not be a new option for filtering dates *from* a certain point forward since I don't need it and before implementing more stuff what's there should be more solid. (and read your damn overdue texts!)
|
||||
|
||||
Again, this script will (for now[^time]) break when bibtex files are formatted in any way other than what it expects.
|
||||
An example of a working entry:
|
||||
|
||||
[^time]: And probably for some time since I don't see myself sinking too much more time into this in the near future. I actually need to get some of the upcoming readings done that I can now list! 🙂
|
||||
|
||||
```
|
||||
@InBook{Borhi2016,
|
||||
author = {László Borhi},
|
||||
chapter = {1956: Self-Liberation},
|
||||
pages = {117--137},
|
||||
publisher = {Indiana University Press},
|
||||
title = {Dealing with dictators: the {United States}, {Hungary}, and {East Central Europe}, 1942-1989},
|
||||
year = {2016},
|
||||
due = {2020-05-07},
|
||||
file = {:Borhi2016 - Dealing with Dictators_ the United States, Hungary, and East Central Europe, 1942 1989.pdf:PDF},
|
||||
pagetotal = {564},
|
||||
priority = {prio1},
|
||||
timestamp = {2020-05-08},
|
||||
}
|
||||
```
|
||||
|
||||
Important fields are author, title, due, priority. These need to exist, and need to be ordered alphabetically. Otherwise there will probably be some breakage.
|
||||
|
||||
## rofi-bib-due
|
||||
|
||||
The `rofi-bib-due` script utilizes the `bib-due` script and depends on an existing installed `rofi` module (see [here](rofi/)).
|
||||
On invocation, it creates a list of upcoming readings, and allows selecting one of the readings. The selected reading will be passed along to `$FILEREADER` if it is declared, falling back to `xdg-open` if not.
|
||||
|
||||
Currently, the path to the reading pdf is hard-coded to be `path/to/bibtex.bib/pdf`, and the name has to begin with the exact bibtex key; otherwise the script will not be able to find the pdf.
|
||||
|
||||
An example of the script in action: (window size has been reduced for the recording, cutting off most entry names)
|
||||
|
||||
![rofi-bib-due demonstration](.assets/bibtex/rofi.gif)
|
||||
|
|
Loading…
Reference in a new issue