diff --git a/.bash_aliases/all b/.bash_aliases/all index 93bf1a9..dc796d1 100644 --- a/.bash_aliases/all +++ b/.bash_aliases/all @@ -34,6 +34,7 @@ alias fzfpac="pacman -Slq | fzf -m --preview 'pacman -Si {1}' | xargs -ro sudo p alias path='echo -e ${PATH//:/\\n}' # Pretty print path variables # Programs +alias h="history" alias o="xdg-open" alias v="nvim" alias g='git' diff --git a/.bash_aliases/jira b/.bash_aliases/jira deleted file mode 100644 index d8f4ac1..0000000 --- a/.bash_aliases/jira +++ /dev/null @@ -1,4 +0,0 @@ -# shellcheck shell=bash -# vim: set ft=bash : - -alias jira-me='jira issue list -a$(jira me)' diff --git a/.bashrc b/.bashrc index 94a32dd..5b91e52 100644 --- a/.bashrc +++ b/.bashrc @@ -15,7 +15,6 @@ [ -f "$HOME/.bash_aliases/hosts/$HOSTNAME" ] && . "$HOME/.bash_aliases/hosts/$HOSTNAME" [ -f "$HOME/.bash_aliases/private" ] && . "$HOME/.bash_aliases/private" [ -f "$HOME/.bash_aliases/lang-js" ] && . "$HOME/.bash_aliases/lang-js" -command -v jira >/dev/null && [ -f "$HOME/.bash_aliases/jira" ] && . "$HOME/.bash_aliases/jira" # Completions {{{ [ -d "$HOME/.bash_completions" ] && for file in "$HOME/.bash_completions"/*; do diff --git a/.vim/after/ftplugin/pandoc/sandwich.vim b/.config/nvim/after/ftplugin/pandoc/sandwich.vim.lua similarity index 98% rename from .vim/after/ftplugin/pandoc/sandwich.vim rename to .config/nvim/after/ftplugin/pandoc/sandwich.vim.lua index 5dc31e0..2b111dd 100644 --- a/.vim/after/ftplugin/pandoc/sandwich.vim +++ b/.config/nvim/after/ftplugin/pandoc/sandwich.vim.lua @@ -1,3 +1,4 @@ +vim.cmd([[ function GetClozeNumber() let REGEX_CLOZE_START = '{{c\d\+::' @@ -33,3 +34,4 @@ let g:sandwich#recipes += [ \ 'nesting': 1 \ } \ ] +]]) diff --git a/.vim/after/plugin/md-img-paste.vim b/.config/nvim/after/plugin/md-img-paste.vim.lua similarity index 93% rename from .vim/after/plugin/md-img-paste.vim rename to .config/nvim/after/plugin/md-img-paste.vim.lua index df5e68c..edbe386 100644 --- a/.vim/after/plugin/md-img-paste.vim +++ b/.config/nvim/after/plugin/md-img-paste.vim.lua @@ -1,3 +1,5 @@ +vim.cmd([[ " Paste clipboard images au FileType pandoc nmap v :call mdip#MarkdownClipboardImage() au FileType markdown nmap v :call mdip#MarkdownClipboardImage() +]]) diff --git a/.config/nvim/after/plugin/nvim-lint.lua b/.config/nvim/after/plugin/nvim-lint.lua index 2e931ec..d28c631 100644 --- a/.config/nvim/after/plugin/nvim-lint.lua +++ b/.config/nvim/after/plugin/nvim-lint.lua @@ -1,3 +1,5 @@ +vim.env.ESLINT_D_PPID = vim.fn.getpid() + local eslint_linter = "eslint_d" require("lint").linters_by_ft = { diff --git a/.vim/after/plugin/sandwich.vim b/.config/nvim/after/plugin/sandwich.vim.lua similarity index 85% rename from .vim/after/plugin/sandwich.vim rename to .config/nvim/after/plugin/sandwich.vim.lua index f923ec7..7e01eec 100644 --- a/.vim/after/plugin/sandwich.vim +++ b/.config/nvim/after/plugin/sandwich.vim.lua @@ -1,3 +1,5 @@ +vim.cmd([[ nmap s xmap s let g:sandwich#recipes = deepcopy(g:sandwich#default_recipes) +]]) diff --git a/.vim/after/plugin/taskwiki.vim b/.config/nvim/after/plugin/taskwiki.vim.lua similarity index 91% rename from .vim/after/plugin/taskwiki.vim rename to .config/nvim/after/plugin/taskwiki.vim.lua index 98ba633..8f64eff 100644 --- a/.vim/after/plugin/taskwiki.vim +++ b/.config/nvim/after/plugin/taskwiki.vim.lua @@ -1,4 +1,6 @@ +vim.cmd([[ let g:taskwiki_taskrc_location='/home/h/.config/task/taskrc' let g:taskwiki_disable_concealcursor=1 let g:taskwiki_dont_preserve_folds=1 let g:taskwiki_dont_fold=1 +]]) diff --git a/.vim/after/plugin/vim-javascript.vim b/.config/nvim/after/plugin/vim-javascript.vim.lua similarity index 94% rename from .vim/after/plugin/vim-javascript.vim rename to .config/nvim/after/plugin/vim-javascript.vim.lua index b74903e..c64c8a2 100644 --- a/.vim/after/plugin/vim-javascript.vim +++ b/.config/nvim/after/plugin/vim-javascript.vim.lua @@ -1,6 +1,8 @@ +vim.cmd([[ let g:javascript_plugin_jsdoc = 1 " jsdoc syntax highlighting let g:javascript_plugin_flow = 1 " flow syntax highlighting let g:javascript_conceal_function = "ƒ" let g:javascript_conceal_return = "⇖" let g:svelte_indent_script = 0 let g:svelte_indent_style = 0 +]]) diff --git a/.vim/after/plugin/vim-pandoc-syntax.vim b/.config/nvim/after/plugin/vim-pandoc-syntax.vim.lua similarity index 96% rename from .vim/after/plugin/vim-pandoc-syntax.vim rename to .config/nvim/after/plugin/vim-pandoc-syntax.vim.lua index 0e1ef9a..f909087 100644 --- a/.vim/after/plugin/vim-pandoc-syntax.vim +++ b/.config/nvim/after/plugin/vim-pandoc-syntax.vim.lua @@ -1,3 +1,4 @@ +vim.cmd([[ let g:pandoc#syntax#conceal#urls=1 let g:pandoc#syntax#codeblocks#embeds#langs=[ \ 'python', @@ -13,3 +14,4 @@ let g:pandoc#syntax#codeblocks#embeds#langs=[ let g:pandoc#syntax#style#emphases=0 " Bug workaround let g:pandoc#syntax#conceal#cchar_overrides = { "atx": " ", "li": "·" } let g:pandoc#syntax#conceal#blacklist=[] +]]) diff --git a/.vim/after/plugin/vim-pandoc.vim b/.config/nvim/after/plugin/vim-pandoc.vim.lua similarity index 95% rename from .vim/after/plugin/vim-pandoc.vim rename to .config/nvim/after/plugin/vim-pandoc.vim.lua index ac72619..3380812 100644 --- a/.vim/after/plugin/vim-pandoc.vim +++ b/.config/nvim/after/plugin/vim-pandoc.vim.lua @@ -1,3 +1,4 @@ +vim.cmd([[ au FileType pandoc call pandoc#completion#Init() let g:pandoc#filetypes#pandoc_markdown=0 let g:pandoc#spell#enabled=0 @@ -5,3 +6,4 @@ let g:pandoc#spell#default_langs=['en_us', 'nl_be'] let g:pandoc#formatting#mode='a' let g:pandoc#formatting#textwidth=90 let g:pandoc#modules#disabled = ["formatting", "dashes", "yaml", "metadata"] +]]) diff --git a/.vim/after/plugin/vim-tidal.vim b/.config/nvim/after/plugin/vim-tidal.vim.lua similarity index 97% rename from .vim/after/plugin/vim-tidal.vim rename to .config/nvim/after/plugin/vim-tidal.vim.lua index 0705fa8..3a2fd2f 100644 --- a/.vim/after/plugin/vim-tidal.vim +++ b/.config/nvim/after/plugin/vim-tidal.vim.lua @@ -1,3 +1,4 @@ +vim.cmd([[ " Tidalcycles (sclang and vim-tidal) let g:tidal_default_config = {"socket_name": "default", "target_pane": "tidal:1.1"} let g:tidal_no_mappings = 1 @@ -12,3 +13,4 @@ au FileType tidal com! -nargs=0 H :TidalHush " SuperCollider au BufEnter,BufWinEnter,BufNewFile,BufRead *.sc,*.scd se filetype=supercollider au Filetype supercollider packadd scvim +]]) diff --git a/.vim/after/plugin/vimtex.vim b/.config/nvim/after/plugin/vimtex.vim.lua similarity index 88% rename from .vim/after/plugin/vimtex.vim rename to .config/nvim/after/plugin/vimtex.vim.lua index 4bfb858..478d5c3 100644 --- a/.vim/after/plugin/vimtex.vim +++ b/.config/nvim/after/plugin/vimtex.vim.lua @@ -1,4 +1,6 @@ +vim.cmd([[ let g:vimtex_view_method='zathura' let g:tex_flavor='latex' let g:tex_conceal='abdmgs' let g:vimtex_quickfix_mode=0 +]]) diff --git a/.vim/after/plugin/wiki.vim b/.config/nvim/after/plugin/wiki.vim.lua similarity index 99% rename from .vim/after/plugin/wiki.vim rename to .config/nvim/after/plugin/wiki.vim.lua index 289810b..6a8492d 100644 --- a/.vim/after/plugin/wiki.vim +++ b/.config/nvim/after/plugin/wiki.vim.lua @@ -1,3 +1,4 @@ +vim.cmd([[ " Change local buffer to directory of current file after the plugin has loaded autocmd VimEnter * lcd %:p:h @@ -106,3 +107,4 @@ let g:wiki_write_on_nav=1 let g:wiki_zotero_root='~/.local/share/zotero' " ... mappings and commands " ... +]]) diff --git a/.vim/after/syntax/_comment_keywords.vim b/.config/nvim/after/syntax/_comment_keywords.lua similarity index 88% rename from .vim/after/syntax/_comment_keywords.vim rename to .config/nvim/after/syntax/_comment_keywords.lua index 867c34a..838904a 100644 --- a/.vim/after/syntax/_comment_keywords.vim +++ b/.config/nvim/after/syntax/_comment_keywords.lua @@ -1,5 +1,7 @@ +vim.cmd([[ syn match Todo /TODO/ syn match Todo /FIXME/ syn match Todo /FIX/ syn match Todo /QUESTION/ syn match Todo /NOTE/ +]]) diff --git a/.vim/after/syntax/pandoc.vim b/.config/nvim/after/syntax/pandoc.lua similarity index 92% rename from .vim/after/syntax/pandoc.vim rename to .config/nvim/after/syntax/pandoc.lua index dd4cad3..198286b 100644 --- a/.vim/after/syntax/pandoc.vim +++ b/.config/nvim/after/syntax/pandoc.lua @@ -1,3 +1,4 @@ +vim.cmd([[ " Override the pandoc-syntax highlighting colors for more subtle citations hi! link pandocPCite Comment hi! link pandocICite Comment @@ -5,9 +6,6 @@ hi! link pandocCiteKey Comment hi! link pandocCiteAnchor Comment hi! link pandocCiteLocator Comment -" Don't show the CiteKey within the CiteLocator -syn match pandocCiteKey /\v\[[^]]+\]/ contained - " Match cloze delimiters e.g. `{{c1::` and `}}` syn match ClozeDelimiter /{{c\d\+::/ conceal containedin=pandocUListItem,pandocListItem syn match ClozeDelimiter /}}/ conceal containedin=pandocUListItem,pandocListItem @@ -23,4 +21,6 @@ syn match TaskWikiTaskUuid containedin=TaskWikiTask /\v#([A-Z]:)?[0-9a-fA-F]{8}- syn match TaskWikiTaskUuid containedin=TaskWikiTask /\v#([A-Z]:)?[0-9a-fA-F]{8}$/ highlight link TaskWikiTaskUuid Comment -:runtime! syntax/_comment_keywords.vim +]]) + +vim.cmd.runtime("syntax/_comment_keywords.lua") diff --git a/.vim/after/syntax/prolog.vim b/.config/nvim/after/syntax/prolog.lua similarity index 66% rename from .vim/after/syntax/prolog.vim rename to .config/nvim/after/syntax/prolog.lua index 1afd2b3..be57a3b 100644 --- a/.vim/after/syntax/prolog.vim +++ b/.config/nvim/after/syntax/prolog.lua @@ -1,5 +1,7 @@ +vim.cmd([[ syn keyword Operator \+ conceal cchar=¬ syn keyword Operator , conceal cchar=∧ syn keyword Operator ; conceal cchar=∨ +]]) -:runtime! syntax/_comment_keywords.vim +vim.cmd.runtime("syntax/_comment_keywords.lua") diff --git a/.vim/after/syntax/scheme.vim b/.config/nvim/after/syntax/scheme.lua similarity index 95% rename from .vim/after/syntax/scheme.vim rename to .config/nvim/after/syntax/scheme.lua index b82337b..3b0111a 100644 --- a/.vim/after/syntax/scheme.vim +++ b/.config/nvim/after/syntax/scheme.lua @@ -1,3 +1,4 @@ +vim.cmd([[ syntax keyword Statement define conceal cchar=≔ syn keyword Operator not conceal cchar=¬ @@ -35,5 +36,6 @@ syn keyword Operator phi conceal cchar=φ syn keyword Operator chi conceal cchar=χ syn keyword Operator psi conceal cchar=ψ syn keyword Operator omega conceal cchar=ω +]]) -:runtime! syntax/_comment_keywords.vim +vim.cmd.runtime("syntax/_comment_keywords.lua") diff --git a/.config/nvim/ftplugin/javascript.lua b/.config/nvim/ftplugin/javascript.lua new file mode 100644 index 0000000..095fefd --- /dev/null +++ b/.config/nvim/ftplugin/javascript.lua @@ -0,0 +1 @@ +vim.opt.matchpairs:append("=:;") diff --git a/.config/nvim/ftplugin/pandoc.lua b/.config/nvim/ftplugin/pandoc.lua deleted file mode 100644 index 1a97d9e..0000000 --- a/.config/nvim/ftplugin/pandoc.lua +++ /dev/null @@ -1,15 +0,0 @@ --- NOTE: May want to move this, as it is more specific to wiki than to pandoc -vim.api.nvim_create_user_command("AnkiDeck", function() - local handle = io.popen("get-anki-decks") - local decks = {} - for line in handle:lines() do - table.insert(decks, line) - end - handle:close() - - vim.ui.select(decks, { prompt = "Select Anki deck" }, function(choice) - if choice then - vim.api.nvim_put({ choice }, "", true, true) - end - end) -end, {}) diff --git a/.vim/ftplugin/pandoc/anki.vim b/.config/nvim/ftplugin/pandoc/anki.lua similarity index 97% rename from .vim/ftplugin/pandoc/anki.vim rename to .config/nvim/ftplugin/pandoc/anki.lua index 95f3789..9887c1f 100644 --- a/.vim/ftplugin/pandoc/anki.vim +++ b/.config/nvim/ftplugin/pandoc/anki.lua @@ -1,3 +1,4 @@ +vim.cmd([[ " Anki helper functions " Convert cloze note to regular text @@ -20,3 +21,4 @@ au FileType pandoc com! -range AnkiRemoveAllClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge au FileType pandoc com! -range AnkiRemoveSelectedClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge +]]) diff --git a/.vim/ftplugin/pandoc/wiki.vim b/.config/nvim/ftplugin/pandoc/wiki.lua similarity index 53% rename from .vim/ftplugin/pandoc/wiki.vim rename to .config/nvim/ftplugin/pandoc/wiki.lua index 58c9a69..1651a7b 100644 --- a/.vim/ftplugin/pandoc/wiki.vim +++ b/.config/nvim/ftplugin/pandoc/wiki.lua @@ -1,3 +1,20 @@ +-- NOTE: May want to move this, as it is more specific to wiki than to pandoc +vim.api.nvim_create_user_command("AnkiDeck", function() + local handle = io.popen("get-anki-decks") + local decks = {} + for line in handle:lines() do + table.insert(decks, line) + end + handle:close() + + vim.ui.select(decks, { prompt = "Select Anki deck" }, function(choice) + if choice then + vim.api.nvim_put({ choice }, "", true, true) + end + end) +end, {}) + +vim.cmd([[ set cc=81 set cocu="" func! GetContext() @@ -17,3 +34,4 @@ func! GetContext() endif endfunc com! -nargs=0 GetContext :call GetContext() +]]) diff --git a/.vim/ftplugin/scheme/repl.vim b/.config/nvim/ftplugin/scheme/repl.vim similarity index 97% rename from .vim/ftplugin/scheme/repl.vim rename to .config/nvim/ftplugin/scheme/repl.vim index af61d92..35427c9 100644 --- a/.vim/ftplugin/scheme/repl.vim +++ b/.config/nvim/ftplugin/scheme/repl.vim @@ -1,3 +1,4 @@ +vim.cmd([[ " " Source: https://wiki.call-cc.org/vim / Jonathan Palardy " @@ -23,3 +24,4 @@ fun! Scheme_eval_defun() call Scheme_send_sexp(@") call setpos('.', pos) endfun +]]) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 2ed7ee5..31ef908 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,12 +1,29 @@ require("nixCatsUtils").setup({ non_nix_value = true }) -- https://github.com/BirdeeHub/nixCats-nvim/blob/77dffad8235eb77684fcb7599487c8e9f23d5b8f/templates/example/init.lua -require("vim") +vim.cmd([[ +set termguicolors +set bg=light +hi Normal ctermbg=none guibg=NONE +]]) + +require("base") +require("cursor") +require("fold") +require("netrw") require("ftdetect") +require("plug") +require("pandoc") require("keymaps") require("highlight") +require("paq-setup") +require("statusline") require("diagnostic") +require("utils") +require("zk") +require("reload") require("paq-setup") -- when not on nixCats -- vim.opt.background = "dark" -- vim.opt.laststatus = 3 +vim.opt.laststatus = 3 diff --git a/.vim/init/base.vim b/.config/nvim/lua/base.lua similarity index 95% rename from .vim/init/base.vim rename to .config/nvim/lua/base.lua index b96b18b..1cb023a 100644 --- a/.vim/init/base.vim +++ b/.config/nvim/lua/base.lua @@ -1,7 +1,5 @@ -" General config {{{ -" +vim.cmd([[ " Tip: acronyms for overview, use `:h` for a quick lookup. - set nocp " Disable vi incompatibility filetype plugin indent on " Filetype recognition set enc=utf8 " Default to UTF-8 encoding @@ -28,6 +26,5 @@ set lcs=trail:·,tab:→\ ,nbsp:␣ " Whitespace rendering set ar " Autoread set spellsuggest+=5 " Limit spell suggestions set wildignore+=*/node_modules/*,*/tmp/*,*.so,*.swp,*.zip -set thesaurus+=~/.vim/thesaurus/mthesaur.txt - -" }}} +" set thesaurus+=./thesaurus/mthesaur.txt " FIXME +]]) diff --git a/.vim/plugin/cursor.vim b/.config/nvim/lua/cursor.lua similarity index 97% rename from .vim/plugin/cursor.vim rename to .config/nvim/lua/cursor.lua index 7143a60..c50b092 100644 --- a/.vim/plugin/cursor.vim +++ b/.config/nvim/lua/cursor.lua @@ -1,3 +1,4 @@ +vim.cmd([[ " Taken from /usr/share/vim/vim90/defaults.vim augroup vimStartup au! @@ -12,3 +13,4 @@ augroup vimStartup \ | endif augroup END +]]) diff --git a/.vim/plugin/fold.vim b/.config/nvim/lua/fold.lua similarity index 96% rename from .vim/plugin/fold.vim rename to .config/nvim/lua/fold.lua index 15092b5..77ab37d 100644 --- a/.vim/plugin/fold.vim +++ b/.config/nvim/lua/fold.lua @@ -1,3 +1,4 @@ +vim.cmd([[ " Folds {{{ set foldmethod=marker @@ -22,3 +23,4 @@ augroup filetype_snippets augroup END " }}} +]]) diff --git a/.config/nvim/lua/ftdetect.lua b/.config/nvim/lua/ftdetect.lua index b8337fe..3da7b6b 100644 --- a/.config/nvim/lua/ftdetect.lua +++ b/.config/nvim/lua/ftdetect.lua @@ -7,5 +7,6 @@ vim.filetype.add({ [".*/%.vscode/.*%.json"] = "jsonc", [".*/%.ssh/config%.d/.*"] = "sshconfig", ["%.env.*"] = "dotenv", + ["%.pl$"] = "prolog", }, }) diff --git a/.config/nvim/lua/keymaps.lua b/.config/nvim/lua/keymaps.lua index 0dbf725..5d2c59f 100644 --- a/.config/nvim/lua/keymaps.lua +++ b/.config/nvim/lua/keymaps.lua @@ -1,3 +1,50 @@ +vim.cmd([[ +" Leader keys +let mapleader = " " +let maplocalleader = ";" + +" Splits & navigation +nm s " Split horizontal +nm ss :spw| " Split horizontal +nm sv :vsw| " Split vertical +nm sw w| " Navigate splits +nm sh h| " +nm sj j| " +nm sk k| " +nm sl l| " +nn sH 8<| " Resize splits +nn sJ 8-| " +nn sK 8+| " +nn sL 8>| " +nn s= =| " Equalize splits + +" Open +nn sb :Lex| " File tree +nn :noh |" +nn t :term| " Open terminal + +" Remaps +ino jj | " Normal now +nn | " Hard mode +nn | " " +nn | " " +nn | " " +ino | " " +ino | " " +ino | " " +ino | " " + +" Search +nn :noh| " map 'ctrl + /' + +" Line numbers +nn n :set nu! rnu! + +" Vim configuration +nn ec :vs $MYVIMRC +nn so :so % +]]) + local set = vim.keymap.set set("n", "cx", "!chmod +x %", { silent = true, desc = "Run `chmod +x` on current file" }) diff --git a/.vim/plugin/netrw.vim b/.config/nvim/lua/netrw.lua similarity index 82% rename from .vim/plugin/netrw.vim rename to .config/nvim/lua/netrw.lua index 9a7719b..149b327 100644 --- a/.vim/plugin/netrw.vim +++ b/.config/nvim/lua/netrw.lua @@ -1,3 +1,5 @@ +vim.cmd([[ let g:netrw_winsize = 30 let g:netrw_liststyle=3 let g:netrw_banner = 0 +]]) diff --git a/.vim/plugin/pandoc.vim b/.config/nvim/lua/pandoc.lua similarity index 92% rename from .vim/plugin/pandoc.vim rename to .config/nvim/lua/pandoc.lua index f51d807..d4bc7e9 100644 --- a/.vim/plugin/pandoc.vim +++ b/.config/nvim/lua/pandoc.lua @@ -1,3 +1,4 @@ +vim.cmd([[ fu! Compile() if expand('%:e') == "md" :silent exec "!pandoc % -s -o /tmp/op.pdf &" @@ -8,3 +9,4 @@ fu! Preview() :call Compile() :silent exec "!zathura /tmp/op.pdf &" endfu +]]) diff --git a/.vim/init/plugins.vim b/.config/nvim/lua/plug.lua similarity index 94% rename from .vim/init/plugins.vim rename to .config/nvim/lua/plug.lua index b3d86f0..a7df64c 100644 --- a/.vim/init/plugins.vim +++ b/.config/nvim/lua/plug.lua @@ -1,7 +1,4 @@ -" Plugins {{{ - -" Plug setup {{{ - +vim.cmd([[ call plug#begin() Plug 'machakann/vim-sandwich' Plug 'Shougo/context_filetype.vim' @@ -31,4 +28,4 @@ Plug 'goerz/jupytext.vim' " OpenSCAD Plug 'sirtaj/vim-openscad' call plug#end() -" }}} +]]) diff --git a/.vim/plugin/reload.vim b/.config/nvim/lua/reload.lua similarity index 91% rename from .vim/plugin/reload.vim rename to .config/nvim/lua/reload.lua index eaf5d18..3f8d2e4 100644 --- a/.vim/plugin/reload.vim +++ b/.config/nvim/lua/reload.lua @@ -1,5 +1,7 @@ +vim.cmd([[ augroup Vim au! " Reload vim config when ~/.vimrc is changed au BufWritePost $HOME/.vimrc so $MYVIMRC | redraw | echo "Reloaded vimrc" augroup END +]]) diff --git a/.vim/plugin/statusline.vim b/.config/nvim/lua/statusline.lua similarity index 87% rename from .vim/plugin/statusline.vim rename to .config/nvim/lua/statusline.lua index 5195284..f7abc28 100644 --- a/.vim/plugin/statusline.vim +++ b/.config/nvim/lua/statusline.lua @@ -1,3 +1,4 @@ +vim.cmd([[ se ls=2 se stl=\ %0*%n se stl+=\ %m @@ -5,3 +6,4 @@ se stl+=\ %y%0* se stl+=\ %<%F se stl+=\ %0*%=%5l%* se stl+=%0*/%L%* +]]) diff --git a/.vim/plugin/utils.vim b/.config/nvim/lua/utils.lua similarity index 92% rename from .vim/plugin/utils.vim rename to .config/nvim/lua/utils.lua index 2974e03..152da4e 100644 --- a/.vim/plugin/utils.vim +++ b/.config/nvim/lua/utils.lua @@ -1,6 +1,8 @@ +vim.cmd([[ function! SynGroup() let l:s = synID(line('.'), col('.'), 1) echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name') endfun com! -nargs=0 Syn :call SynGroup() +]]) diff --git a/.config/nvim/lua/vim.lua b/.config/nvim/lua/vim.lua deleted file mode 100644 index d84410f..0000000 --- a/.config/nvim/lua/vim.lua +++ /dev/null @@ -1,5 +0,0 @@ -vim.cmd([[ -set runtimepath^=~/.vim runtimepath+=~/.vim/after -let &packpath = &runtimepath -source ~/.vimrc" -]]) diff --git a/.vim/plugin/zk.vim b/.config/nvim/lua/zk.lua similarity index 98% rename from .vim/plugin/zk.vim rename to .config/nvim/lua/zk.lua index 9c01a56..dcd366d 100644 --- a/.vim/plugin/zk.vim +++ b/.config/nvim/lua/zk.lua @@ -1,3 +1,4 @@ +vim.cmd([[ let s:zk_preview_enabled = 0 let s:live_server_job = -1 au BufEnter /home/h/.zk/*.md silent exe '!echo "%" > /home/h/.zk/current-zettel.txt' @@ -18,3 +19,4 @@ endfunction command! ToggleZKPreview call ToggleZKPreview() nn o :ToggleZKPreview :!xdg-open http://localhost:8080/%:t:r.html & +]]) diff --git a/.config/nvim/snips/css.lua b/.config/nvim/snips/css.lua index 233e536..b48635c 100644 --- a/.config/nvim/snips/css.lua +++ b/.config/nvim/snips/css.lua @@ -27,7 +27,7 @@ return { t("flex-wrap: wrap;"), i(0), }), - s({ trig = "dfc", dscr = "Display flex column" }, { + s({ trig = "dfc", dscr = "Add 'flex-direction: column;'" }, { t("display: flex;"), t("flex-direction: column;"), i(0), diff --git a/.config/nvim/snips/pandoc.lua b/.config/nvim/snips/pandoc.lua index d636602..4bc29bf 100644 --- a/.config/nvim/snips/pandoc.lua +++ b/.config/nvim/snips/pandoc.lua @@ -5,6 +5,909 @@ local d = ls.dynamic_node local sn = ls.snippet_node local fmta = require("luasnip.extras.fmt").fmta +-- Original .snippets file - TODO: Migrate to lua snippets +-- ```viml +-- global !p +-- from datetime import datetime +-- from math import factorial +-- import subprocess +-- import re +-- import sys +-- +-- ZOTERO_BASE = "http://127.0.0.1:23119/better-bibtex/cayw" +-- FENCES = { +-- "i": "idea", +-- "q": "question", +-- "n": "note", +-- "t": "thought", +-- } +-- +-- def math_inline(): +-- return vim.command_output('GetContext') == 'math_inline' +-- +-- def math_block(): +-- return vim.command_output('GetContext') == 'math_block' +-- +-- def math(): +-- return math_inline() or math_block() +-- +-- def code_block(): +-- return vim.command_output('GetContext') == 'pandocDelimitedCodeBlock' +-- +-- def code_inline(): +-- return vim.command_output('GetContext') == 'pandocNoFormatted' +-- +-- def code(): +-- return code_inline() or code_block() +-- +-- def slugify(text): +-- return re.sub('\s+', '-', text.lower()) +-- +-- def linkify(text, link): +-- return f"[{text}]({link})" +-- +-- def zot(action): +-- if action == "get_title": +-- cmd = f"curl -s '{ZOTERO_BASE}?format=json&selected=1' | jq '.[].title' -r" +-- elif action == "get_citekey": +-- cmd = f"curl -s '{ZOTERO_BASE}?format=pandoc&selected=1'" +-- elif action == "get_citekey_brackets": +-- cmd = f"curl -s '{ZOTERO_BASE}?format=pandoc&selected=1&brackets=1'" +-- elif action == "get_link": +-- link_path = re.sub("^@", "", zot("get_citekey")) +-- link_title = zot("get_title") +-- link = linkify(link_title, link_path) +-- return link +-- elif action == "get_file": +-- link_path = re.sub("^@", "", zot("get_citekey")) +-- link_title = zot("get_title") +-- link = linkify(link_title, f"file://{link_path}.pdf") +-- return link +-- else: +-- return "Zotero action not found" +-- return subprocess.check_output(cmd, shell=True).decode("utf-8").strip() +-- endglobal +-- +-- snippet ctx "Context" i +-- `!p snip.rv = vim.command_output('GetContext')` +-- endsnippet +-- +-- # General markdown +-- +-- snippet ^h "Markdown header" r +-- # $1 +-- endsnippet +-- +-- snippet ^sec "Markdown section" r +-- ## $1 +-- endsnippet +-- +-- snippet ^ssec "Markdown subsection" r +-- ### $1 +-- endsnippet +-- +-- snippet ^sex "Markdown example section" r +-- ## Example: $1 +-- endsnippet +-- +-- snippet ^ssex "Markdown example subsection" r +-- ### Example: $1 +-- endsnippet +-- +-- # Zettelkasten templating +-- +-- snippet nl +-- *nld*: $1 +-- endsnippet +-- +-- snippet eng +-- *eng*: $1 +-- endsnippet +-- +-- snippet fr +-- *fra*: $1 +-- endsnippet +-- +-- snippet (de +-- *deu*: $1 +-- endsnippet +-- +-- snippet (nl +-- (*nld*: $1) +-- endsnippet +-- +-- snippet (eng +-- (*eng*: $1) +-- endsnippet +-- +-- snippet (fr +-- (*fra*: $1) +-- endsnippet +-- +-- snippet (de +-- (*deu*: $1) +-- endsnippet +-- +-- snippet in +-- (In [$1]($2))$3 +-- endsnippet +-- +-- snippet liwhat "What?" A +-- `!p snip.rv = "* [What?](" + snip.basename + "_what)"`$1 +-- endsnippet +-- +-- snippet liwhy "Why?" A +-- `!p snip.rv = "* [Why?](" + snip.basename + "_why)"`$1 +-- endsnippet +-- +-- snippet < "Comment (html)" +-- $2 +-- endsnippet +-- +-- snippet <. "Comment (html) ..." i +-- $1 +-- endsnippet +-- +-- snippet +-- endsnippet +-- +-- snippet +-- endsnippet +-- +-- snippet +-- endsnippet +-- +-- snippet +-- endsnippet +-- +-- snippet td "Todo" +-- TODO${1:: $2} +-- endsnippet +-- +-- snippet ref "References" +-- +-- endsnippet +-- +-- snippet sort "Sort" +-- +-- endsnippet +-- +-- snippet foot "Footnotes" +-- +-- [^0]: +-- endsnippet +-- +-- snippet def "Definition" +-- **Definition${1:: $2}**${3: [${4:citation}${5:, ${6:pointer}}]} +-- +-- $7 +-- +-- ___ +-- endsnippet +-- +-- snippet theo "Theorem" +-- **Theorem${1:: $2}**${3: [${4:citation}${5:, ${6:pointer}}]} +-- +-- $7 +-- +-- ${8/(\w+).*/**Theorem** \n\n.../} +-- +-- ___ +-- endsnippet +-- +-- snippet prop "Property" +-- **Property $1** [@] +-- +-- $2 +-- +-- ___ +-- endsnippet +-- +-- snippet lemm "Lemma" +-- **Lemma $1** [@] +-- +-- $2 +-- +-- ___ +-- endsnippet +-- +-- snippet coro "Corollary" +-- **Corollary $1** [@] +-- +-- $2 +-- +-- ___ +-- endsnippet +-- +-- # Greek symbols +-- +-- context "math()" +-- snippet alpha "Alpha" +-- \\alpha +-- endsnippet +-- +-- context "math()" +-- snippet beta "Beta" +-- \\beta +-- endsnippet +-- +-- context "math()" +-- snippet gamma "Gamma" +-- \\gamma +-- endsnippet +-- +-- context "math()" +-- snippet delta "Delta" +-- \\delta +-- endsnippet +-- +-- context "math()" +-- snippet epsilon "Epsilon" +-- \\epsilonilon +-- endsnippet +-- +-- context "math()" +-- snippet zeta "Zeta" +-- \\zeta +-- endsnippet +-- +-- context "math()" +-- snippet eta "Eta" +-- \\eta +-- endsnippet +-- +-- context "math()" +-- snippet theta "Theta" +-- \\theta +-- endsnippet +-- +-- context "math()" +-- snippet iota "Iota" +-- \\iota +-- endsnippet +-- +-- context "math()" +-- snippet kappa "Kappa" +-- \\kappa +-- endsnippet +-- +-- context "math()" +-- snippet lambda "Lambda" i +-- \\lambda +-- endsnippet +-- +-- context "math()" +-- snippet mu "Mu" +-- \\mu +-- endsnippet +-- +-- context "math()" +-- snippet nu "Nu" +-- \\nu +-- endsnippet +-- +-- context "math()" +-- snippet xi "Xi" +-- \\xi +-- endsnippet +-- +-- context "math()" +-- snippet omicron "Omicron" +-- \\omicron +-- endsnippet +-- +-- context "math()" +-- snippet pi "Pi" +-- \\pi +-- endsnippet +-- +-- context "math()" +-- snippet rho "Rho" +-- \\rho +-- endsnippet +-- +-- context "math()" +-- snippet sigma "Sigma" +-- \\sigma +-- endsnippet +-- +-- context "math()" +-- snippet tau "Tau" +-- \\tau +-- endsnippet +-- +-- context "math()" +-- snippet upsilon "Upsilon" +-- \\upsilon +-- endsnippet +-- +-- context "math()" +-- snippet phi "Phi" +-- \\phi +-- endsnippet +-- +-- context "math()" +-- snippet chi "Chi" +-- \\chi +-- endsnippet +-- +-- context "math()" +-- snippet psi "Psi" +-- \\psi +-- endsnippet +-- +-- context "math()" +-- snippet omega "Omega" +-- \\omega +-- endsnippet +-- +-- context "math()" +-- snippet Gamma "Gamma" +-- \\Gamma +-- endsnippet +-- +-- context "math()" +-- snippet Delta "Delta" +-- \\Delta +-- endsnippet +-- +-- context "math()" +-- snippet Theta "Theta" +-- \\Theta +-- endsnippet +-- +-- context "math()" +-- snippet Lambda "Lambda" +-- \\Lambda +-- endsnippet +-- +-- context "math()" +-- snippet Xi "Xi" +-- \\Xi +-- endsnippet +-- +-- context "math()" +-- snippet Pi "Pi" +-- \\Pi +-- endsnippet +-- +-- context "math()" +-- snippet Sigma "Sigma" +-- \\Sigma +-- endsnippet +-- +-- context "math()" +-- snippet Upsilon "Upsilon" +-- \\Upsilon +-- endsnippet +-- +-- context "math()" +-- snippet Phi "Phi" +-- \\Phi +-- endsnippet +-- +-- context "math()" +-- snippet Psi "Psi" +-- \\Psi +-- endsnippet +-- +-- context "math()" +-- snippet Omega "Omega" +-- \\Omega +-- endsnippet +-- +-- snippet asaw "Als en slechts als (woorden)" i +-- als en slechts als +-- endsnippet +-- +-- snippet iffw "If and only if (words)" i +-- if and only if +-- endsnippet +-- +-- snippet asas "Als en slechts als (shorthand)" i +-- **asa** +-- endsnippet +-- +-- snippet iffs "If and only if (shorthand)" i +-- **iff** +-- endsnippet +-- +-- snippet beg "Begin" +-- \begin{$1} +-- $2 +-- \end{$1} +-- endsnippet +-- +-- snippet align "" i +-- \begin{align} +-- $1 +-- \end{align} +-- endsnippet +-- +-- snippet cases "" i +-- \begin{cases} +-- $1 \\\\ +-- $2 +-- \end{cases} +-- $3 +-- endsnippet +-- +-- snippet tik "Tikzpicture" i +-- \begin{tikzpicture} +-- $1 +-- \end{tikzpicture} +-- endsnippet +-- +-- snippet matrix "Matrix" i +-- \begin{bmatrix} +-- $1 +-- \end{bmatrix} +-- endsnippet +-- +-- # Insert anything after m/M in math mode +-- +-- snippet "(\b)m(.*)" "MathJax" r +-- `!p snip.rv = match.group(1) + "$" + match.group(2) + "$"` +-- endsnippet +-- +-- snippet (\b)M(.*) "MathJax block" irw +-- $$ +-- `!p snip.rv = match.group(2)` +-- $$ +-- endsnippet +-- +-- # Calligraphic letters +-- +-- context "math()" +-- snippet c([A-z]) "Calligraphic A" r +-- `!p snip.rv = "\\mathcal{" + match.group(1) + "}"`$1 +-- endsnippet +-- +-- # Subscripts +-- +-- context "math()" +-- snippet '([A-z])(\w+)' "Subscripts" irw +-- `!p snip.rv = match.group(1) + '_' + match.group(2) if len(match.group(2)) == 1 else match.group(1) + '_{' + match.group(2) + '}'`$1 +-- endsnippet +-- +-- # MathJax +-- +-- snippet fa "For all" i +-- \forall +-- endsnippet +-- +-- snippet frac "" i +-- \frac{$1}{$2}$3 +-- endsnippet +-- +-- snippet set "" i +-- \\{$1\\}$2 +-- endsnippet +-- +-- snippet N "" i +-- \mathbb{N} +-- endsnippet +-- +-- snippet N0 "" i +-- \mathbb{N}_0 +-- endsnippet +-- +-- snippet N+ "" i +-- \mathbb{N}^+ +-- endsnippet +-- +-- snippet Z "" i +-- \mathbb{Z} +-- endsnippet +-- +-- snippet Z0 "" i +-- \mathbb{Z}_0 +-- endsnippet +-- +-- snippet Z+ "" i +-- \mathbb{Z}^+ +-- endsnippet +-- +-- snippet R "" i +-- \mathbb{R} +-- endsnippet +-- +-- snippet R0 "" i +-- \mathbb{R}_0 +-- endsnippet +-- +-- snippet R+ "" i +-- \mathbb{R}^+ +-- endsnippet +-- +-- snippet C "" i +-- \mathbb{C} +-- endsnippet +-- +-- snippet lim "" i +-- \lim_{$1}$2 +-- endsnippet +-- +-- snippet limn "" i +-- \lim_{n \to \infty}$2 +-- endsnippet +-- +-- snippet binom "" i +-- \binom{$1}{$2}$3 +-- endsnippet +-- +-- snippet andmath "description" i +-- \text{ and } +-- endsnippet +-- +-- snippet enmath "description" i +-- \text{ en } +-- endsnippet +-- +-- snippet lra "MathJax: long right arrow" i +-- \longrightarrow +-- endsnippet +-- +-- snippet Ra "MathJax: right arrow" i +-- \Rightarrow +-- endsnippet +-- +-- snippet Im "MathJax: image operator" i +-- \operatorname{Im} +-- endsnippet +-- +-- snippet ggd "Grootste gemene deler" i +-- \operatorname{ggd} +-- endsnippet +-- +-- snippet fl "Floating point" i +-- \operatorname{fl} +-- endsnippet +-- +-- snippet Var "Variance" i +-- \operatorname{Var} +-- endsnippet +-- +-- snippet E "Expectation" i +-- \operatorname{E} +-- endsnippet +-- +-- snippet Cov "Covariance" i +-- \operatorname{Cov} +-- endsnippet +-- +-- context "math()" i +-- snippet ntup "Alpha" +-- (x_1, \ldots, x_n) +-- endsnippet +-- +-- snippet mxn "Matrix" i +-- m \times n +-- endsnippet +-- +-- snippet mxn- "Matrix" i +-- $m \times n$-matrix +-- endsnippet +-- +-- snippet nxn "Matrix" i +-- n \times n +-- endsnippet +-- +-- snippet det "Determinant" i +-- \operatorname{det}(${1:A})$2 +-- endsnippet +-- +-- snippet det| "Determinant alternative notation" i +-- |${1:A}|$2 +-- endsnippet +-- +-- snippet Span "Span" i +-- \operatorname{Span}\\{$1\\}$2 +-- endsnippet +-- +-- snippet Nul "Null" i +-- \operatorname{Nul}($1)$2 +-- endsnippet +-- +-- snippet Col "Column space" i +-- \operatorname{Col}($1)$2 +-- endsnippet +-- +-- snippet kern "Kernel" i +-- \operatorname{kern}($1)$2 +-- endsnippet +-- +-- context "math()" +-- snippet vec "Vector" i +-- \mathbf{$1}$2 +-- endsnippet +-- +-- context "math()" +-- snippet vec([A-z]) "Vector ..." r +-- `!p snip.rv = "\\mathbf{" + match.group(1) + "}"`$1 +-- endsnippet +-- +-- snippet v1tovp "Vectors v indexed from 1 to p" +-- \mathbf{v_1},...,\mathbf{v_p}$2 +-- endsnippet +-- +-- snippet a1toan "Vectors a indexed from 1 to n" +-- \mathbf{a_1},...,\mathbf{v_n}$2 +-- endsnippet +-- +-- snippet .. "Dot dot dot" i +-- \dots $1 +-- endsnippet +-- +-- snippet text "MathJax text" i +-- \text{$1}$2 +-- endsnippet +-- +-- snippet leq "Less than or equal to" i +-- \leq +-- endsnippet +-- +-- snippet leq "Greater than or equal to" i +-- \geq +-- endsnippet +-- +-- snippet eat "Evaluated at" i +-- {\biggr\rvert}_{$1}$2 +-- endsnippet +-- +-- snippet sketch "Link a sketch" i +-- [$1](file:///home/h/sketches/$2) +-- endsnippet +-- +-- snippet deck "Get anki deck" +-- `get-anki-decks` +-- endsnippet +-- +-- # snippet ` "Inline code" i +-- # `$1` +-- # endsnippet +-- +-- # Escape backticks +-- snippet `` "Code block" bA +-- \`\`\`$1 +-- $2 +-- \`\`\` +-- endsnippet +-- +-- snippet `tex "Latex block (see latex filter)" bA +-- \`\`\`{.tex} +-- $1 +-- \`\`\` +-- endsnippet +-- +-- snippet `tik "Tikz block (see tikz filter)" bA +-- \`\`\`{.tex} +-- \\begin{tikzpicture} +-- $1 +-- \\end{tikzpicture} +-- \`\`\` +-- endsnippet +-- +-- snippet task "Task" i +-- * [ ] $1 -- pro:$2 +-- endsnippet +-- +-- snippet "(\b)fn(\d+)" "" ir +-- `!p snip.rv = snip.basename + "_" + match.group(2).zfill(2)`$1 +-- endsnippet +-- +-- snippet "ch(\d+)" "Link chapter" ir +-- `!p +-- num_str = match.group(1).zfill(2) +-- title = 3*"." +-- link = snip.basename + "_" + num_str +-- snip.rv = num_str + ". " + linkify(title, link) +-- ` +-- endsnippet +-- +-- snippet "ch(\d+)to(\d+)" "Link chapters ... to ..." irA +-- `!p +-- for i in range(int(match.group(1)), int(match.group(2)) + 1): +-- num_str = str(i).zfill(2) +-- title = 3*"." +-- link = snip.basename + "_" + num_str +-- snip.rv += num_str + ". " + linkify(title, link) + "\n" +-- ` +-- endsnippet +-- +-- snippet "sec([\sA-z]+)" "Link section titled ..." r +-- `!p +-- snip.rv = "* " + linkify(match.group(1), f"{snip.basename}_{slugify(match.group(1))}") +-- ` +-- endsnippet +-- +-- snippet cp(\d+) "Comment current page (and date)" r +-- `!p snip.rv = ""` +-- endsnippet +-- +-- snippet (\d+)! "Factorial of ..." r +-- `!p snip.rv = factorial(int(match.group(1)))` +-- endsnippet +-- +-- snippet d "Date" +-- `!p snip.rv = datetime.now().strftime("%Y-%m-%d")` +-- endsnippet +-- +-- snippet :(\w*) "Fence" r +-- `!p snip.rv += ":::" + FENCES.get(match.group(1) or "", "") + "\n" `$1 +-- `!p snip.rv += ":::"`$2 +-- endsnippet +-- +-- snippet \[(\w*) "Fence inline" ir +-- `!p snip.rv += "["`$1`!p snip.rv += "]{." + FENCES.get(match.group(1) or "", "") + "}"`$2 +-- endsnippet +-- +-- snippet ^eg "Example" r +-- E.g. $1 +-- endsnippet +-- +-- # E.g. after list (or list preceded by space) +-- snippet (\*\s|\*)eg "Example" r +-- * E.g. $1 +-- endsnippet +-- +-- # E.g. after dot (or dot preceded by space) +-- snippet (\.\s|\.)eg "Example" r +-- . E.g. $1 +-- endsnippet +-- +-- snippet (?" +-- TARGET DECK: $1::$2 +-- endsnippet +-- +-- snippet clo "Cloze" +-- START +-- Cloze +-- ${0:${VISUAL}}$1 +-- END +-- $2 +-- endsnippet +-- +-- snippet clos "Cloze start" +-- START +-- Cloze +-- $1 +-- endsnippet +-- +-- snippet cloe "Cloze end" +-- END +-- endsnippet +-- +-- snippet clod +-- START +-- Cloze +-- **Definition$1** +-- +-- $2 +-- END +-- endsnippet +-- +-- snippet clop +-- START +-- Cloze +-- **Property$1** +-- +-- $2 +-- END +-- endsnippet +-- +-- snippet clot +-- START +-- Cloze +-- **Theorem$1** +-- +-- $2 +-- END +-- endsnippet +-- +-- snippet clol +-- START +-- Cloze +-- **Lemma$1** +-- +-- $2 +-- END +-- endsnippet +-- +-- snippet "c(\d+)" "Cloze " r +-- {{c`!p snip.rv = int(match.group(1))`::${0:${VISUAL}}$1}}$2 +-- endsnippet +-- +-- # Match preceded by whitespace or start of line +-- snippet (?\n> --' + zot("get_citekey_brackets")` +-- endsnippet +-- +-- snippet acz "According to ..." +-- `!p snip.rv = "According to " + zot("get_citekey")` +-- endsnippet +-- +-- snippet azex "As ... explains" +-- `!p snip.rv = "As " + zot("get_citekey") + " explains, "` +-- endsnippet +-- +-- snippet iz "In ..." +-- `!p snip.rv = "In " + zot("get_citekey")` +-- endsnippet +-- +-- snippet izd "In ...'s definition" +-- `!p snip.rv = "In " + zot("get_citekey") + "'s definition, "` +-- endsnippet +-- +-- snippet zintends "... intends to ..." A +-- `!p snip.rv = zot("get_citekey") + " intends to "` +-- endsnippet +-- +-- snippet tfol "The following" wA +-- the following +-- endsnippet +-- +-- snippet tfolt "It follows that" wA +-- it follows that +-- endsnippet +-- +-- snippet ntfol "In the following" wA +-- in the following +-- endsnippet +-- +-- snippet algos "algorithms" wA +-- algorithms +-- endsnippet +-- +-- snippet algo "algorithm" wA +-- algorithm +-- endsnippet +-- +-- # TODO: Make only available in tikzpicture +-- context "code()" +-- snippet q "State" w +-- \node[state] ($1) [] {$2}; +-- endsnippet +-- +-- context "code()" +-- snippet q0 "Initial state" w +-- \node[initial,state] ($1) {$2}; +-- endsnippet +-- ``` + -- Taken from https://ejmastnak.com/tutorials/vim-latex/luasnip/#anatomy local get_visual = function(_, parent) if #parent.snippet.env.LS_SELECT_RAW > 0 then diff --git a/.config/nvim/snips/scheme.lua b/.config/nvim/snips/scheme.lua new file mode 100644 index 0000000..b452668 --- /dev/null +++ b/.config/nvim/snips/scheme.lua @@ -0,0 +1,24 @@ +local ls = require("luasnip") +local s = ls.snippet +local t = ls.text_node +local i = ls.insert_node + +return { + s("reqtrace", t({ "(#%require racket/trace)" })), + s("strln", t({ "(string-length " }), i(1), t({ ")" })), + s("impb", t({ "(import (rnrs base (6))", " (rnrs io simple" }), i(0), t({ ")" })), + s("def", { + t("(define "), + i(1), + t(" "), + i(2), + t(")"), + }), + s("defp", { + t("(define ("), + i(1), + t(" "), + i(2), + t("))"), + }), +} diff --git a/.config/nvim/snips/tex.lua b/.config/nvim/snips/tex.lua new file mode 100644 index 0000000..1bca1a1 --- /dev/null +++ b/.config/nvim/snips/tex.lua @@ -0,0 +1,69 @@ +local ls = require("luasnip") +local s = ls.snippet +local i = ls.insert_node +local t = ls.text_node +local f = ls.function_node + +-- Inspired by https://castel.dev/post/lecture-notes-1/ + +ls.add_snippets("tex", { + s("beg", { + t("\\begin{"), + i(1), + t({ "}", "\t" }), + i(0), + t({ "", "\\end{" }), + f(function(args) + return args[1][1] + end, { 1 }), + t("}"), + }), + + s("def", { + t("\\begin{definition}"), + t({ "", "\t" }), + i(0), + t({ "", "\\end{definition}" }), + }), + + s("fig", { + t("\\begin{figure}"), + t({ "", "\t" }), + i(0), + t({ "", "\\end{figure}" }), + }), + + s( + "time", + f(function() + return os.date("%H:%M") + end) + ), + + s("i", t("\\textit{"), i(0), t("}")), + + s("b", t("\\textbf{"), i(0), t("}")), + + s("center", { + t("\\begin{center}"), + t({ "", "" }), + i(0), + t({ "", "\\end{center}" }), + }), + + s("pac", t("\\usepackage{"), i(0), t("}")), + + s("foot", t("\\footnote{"), i(0), t("}")), + + s("dm", { + t({ "\\[", "" }), + i(1), + t({ "", "\\]" }), + i(0), + }), + + s("ch", t("\\chapter{"), i(0), t("}")), + s("sec", t("\\section{"), i(0), t("}")), + s("ssec", t("\\subsection{"), i(0), t("}")), + s("sssec", t("\\subsubsection{"), i(0), t("}")), +}) diff --git a/.config/user-dirs.conf b/.config/user-dirs.conf new file mode 100644 index 0000000..f184210 --- /dev/null +++ b/.config/user-dirs.conf @@ -0,0 +1 @@ +enabled=False diff --git a/.vim/colors/yang.vim b/.vim/colors/yang.vim deleted file mode 100644 index c56dbd1..0000000 --- a/.vim/colors/yang.vim +++ /dev/null @@ -1,210 +0,0 @@ -" YinYang - black/white color scheme - -if (&background ==# "dark" && get(g:, "colors_name", "") ==# "yang") - runtime! colors/yin.vim - finish -endif - -highlight clear - -if exists("syntax_on") - syntax reset -endif -let g:colors_name = "yang" - - -let s:palette = {} - -let s:palette.white = [254, '#f7f7f7'] -let s:palette.gray15 = [253, '#e4e4e4'] -let s:palette.gray14 = [250, '#bcbcbc'] -let s:palette.gray13 = [249, '#b2b2b2'] -let s:palette.gray12 = [248, '#a8a8a8'] -let s:palette.gray11 = [247, '#9e9e9e'] -let s:palette.gray10 = [246, '#949494'] -let s:palette.gray09 = [245, '#8a8a8a'] -let s:palette.gray08 = [244, '#808080'] -let s:palette.gray07 = [243, '#767676'] -let s:palette.gray06 = [242, '#666666'] -let s:palette.gray05 = [241, '#606060'] -let s:palette.gray04 = [240, '#585858'] -let s:palette.gray03 = [239, '#4e4e4e'] -let s:palette.gray02 = [238, '#444444'] -let s:palette.gray01 = [235, '#262626'] -let s:palette.black = [233, '#121212'] - -let s:palette.purple = [98, '#875fd7'] -let s:palette.brown = [130, '#af5f00'] -let s:palette.blue = [67, '#5f87af'] -let s:palette.darkblue = [27, '#005fff'] -let s:palette.green = [65, '#5f875f'] -let s:palette.red = [88, '#870000'] -let s:palette.orange = [166, '#5f5fd7'] - -if has("nvim") - let g:terminal_color_0 = s:palette.gray01[1] - let g:terminal_color_1 = s:palette.gray06[1] - let g:terminal_color_2 = s:palette.gray03[1] - let g:terminal_color_3 = s:palette.gray11[1] - let g:terminal_color_4 = s:palette.gray02[1] - let g:terminal_color_5 = s:palette.gray08[1] - let g:terminal_color_6 = s:palette.gray09[1] - let g:terminal_color_7 = s:palette.gray13[1] - let g:terminal_color_8 = s:palette.gray03[1] - let g:terminal_color_9 = s:palette.gray10[1] - let g:terminal_color_10 = s:palette.gray07[1] - let g:terminal_color_11 = s:palette.gray13[1] - let g:terminal_color_12 = s:palette.gray05[1] - let g:terminal_color_13 = s:palette.gray12[1] - let g:terminal_color_14 = s:palette.gray14[1] - let g:terminal_color_15 = s:palette.white[1] -elseif has("terminal") - let g:terminal_ansi_colors = [ - \ s:palette.gray01[1], - \ s:palette.gray06[1], - \ s:palette.gray03[1], - \ s:palette.gray11[1], - \ s:palette.gray02[1], - \ s:palette.gray08[1], - \ s:palette.gray09[1], - \ s:palette.gray13[1], - \ s:palette.gray03[1], - \ s:palette.gray10[1], - \ s:palette.gray07[1], - \ s:palette.gray13[1], - \ s:palette.gray05[1], - \ s:palette.gray12[1], - \ s:palette.gray14[1], - \ s:palette.white[1] - \ ] -endif - -function! s:hi(group, fg_color, bg_color, style) - let highlight_command = ['hi', a:group] - if !empty(a:fg_color) - let [ctermfg, guifg] = a:fg_color - call add(highlight_command, printf('ctermfg=%d guifg=%s', ctermfg, guifg)) - endif - if !empty(a:bg_color) - let [ctermbg, guibg] = a:bg_color - call add(highlight_command, printf('ctermbg=%d guibg=%s', ctermbg, guibg)) - endif - if !empty(a:style) - call add(highlight_command, printf('cterm=%s gui=%s', a:style, a:style)) - endif - execute join(highlight_command, ' ') -endfunction - - -call s:hi('Normal', s:palette.gray05, s:palette.white, '') -set background=light - -call s:hi('Constant', s:palette.gray11, [], 'bold') -call s:hi('String', s:palette.gray08, [], '') -call s:hi('Number', s:palette.gray10, [], '') - -call s:hi('Identifier', s:palette.gray06, [], 'none') -call s:hi('Function', s:palette.gray06, [], '') - -call s:hi('Statement', s:palette.gray08, [], 'bold') -call s:hi('Operator', s:palette.gray03, [], 'none') -call s:hi('Keyword', s:palette.gray10, [], '') - -call s:hi('PreProc', s:palette.gray10, [], 'none') - -call s:hi('Type', s:palette.gray09, [], 'bold') - -call s:hi('Special', s:palette.gray10, [], '') -call s:hi('SpecialComment', s:palette.gray12, [], 'bold') - -call s:hi('Title', s:palette.gray10, [], 'bold') -call s:hi('Todo', s:palette.purple, s:palette.white, '') -if has("nvim") || has("gui_running") - call s:hi('Comment', s:palette.gray12, [], 'italic') -else - call s:hi('Comment', s:palette.gray12, [], '') -endif - -call s:hi('LineNr', s:palette.gray13, s:palette.gray15, 'none') -call s:hi('FoldColumn', s:palette.gray08, s:palette.gray15, 'none') -call s:hi('CursorLine', [], s:palette.gray15, 'none') -call s:hi('CursorLineNr', s:palette.gray06, s:palette.gray15, 'none') - -call s:hi('Visual', s:palette.white, s:palette.gray06, '') -call s:hi('Search', s:palette.gray15, s:palette.gray03, 'none') -call s:hi('IncSearch', s:palette.white, s:palette.gray11, 'bold') - -call s:hi('SpellBad', s:palette.red, s:palette.white, 'undercurl') -call s:hi('SpellCap', s:palette.red, s:palette.white, 'undercurl') -call s:hi('SpellLocal', s:palette.red, s:palette.white, 'undercurl') -call s:hi('SpellRare', s:palette.brown, s:palette.white, 'undercurl') - -call s:hi('Error', s:palette.red, s:palette.white, 'bold') -call s:hi('ErrorMsg', s:palette.red, s:palette.white, '') -call s:hi('WarningMsg', s:palette.brown, s:palette.white, '') -call s:hi('ModeMsg', s:palette.gray10, [], '') -call s:hi('MoreMsg', s:palette.gray10, [], '') - -call s:hi('MatchParen', s:palette.orange, s:palette.white, '') - -call s:hi('Cursor', [], s:palette.gray12, '') -call s:hi('Underlined', s:palette.gray08, [], 'underline') -call s:hi('SpecialKey', s:palette.gray13, [], '') -call s:hi('NonText', s:palette.gray13, [], '') -call s:hi('Directory', s:palette.gray08, [], '') - -call s:hi('Pmenu', s:palette.gray05, s:palette.gray14, 'none') -call s:hi('PmenuSbar', s:palette.white, s:palette.gray01, 'none') -call s:hi('PmenuSel', s:palette.gray14, s:palette.gray05, '') -call s:hi('PmenuThumb', s:palette.gray14, s:palette.gray03, 'none') - -call s:hi('StatusLine', s:palette.gray03, s:palette.gray13, 'none') -call s:hi('StatusLineNC', s:palette.gray13, s:palette.gray15, 'none') -call s:hi('WildMenu', s:palette.gray08, [], '') -call s:hi('VertSplit', s:palette.gray13, s:palette.white, 'none') - -call s:hi('DiffAdd', s:palette.white, s:palette.green, '') -call s:hi('DiffChange', s:palette.white, s:palette.blue, '') -call s:hi('DiffDelete', s:palette.white, s:palette.red, '') -call s:hi('DiffText', s:palette.white, s:palette.darkblue, '') -call s:hi('DiffAdded', s:palette.green, s:palette.white, '') -call s:hi('DiffChanged', s:palette.blue, s:palette.white, '') -call s:hi('DiffRemoved', s:palette.red, s:palette.white, '') - - -highlight! link Character Constant -highlight! link Float Number -highlight! link Boolean Number - -highlight! link SignColumn FoldColumn -highlight! link ColorColumn FoldColumn -highlight! link CursorColumn CursorLine - -highlight! link Folded LineNr -highlight! link Conceal Normal -highlight! link ErrorMsg Error - -highlight! link Conditional Statement -highlight! link Repeat Statement -highlight! link Label Statement -highlight! link Exception Statement - -highlight! link Include PreProc -highlight! link Define PreProc -highlight! link Macro PreProc -highlight! link PreCondit PreProc - -highlight! link StorageClass Type -highlight! link Structure Type -highlight! link Typedef Type - -highlight! link SpecialChar Special -highlight! link Tag Special -highlight! link Delimiter Special -highlight! link Debug Special -highlight! link Question Special - -highlight! link VisualNOS Visual -highlight! link TabLine StatusLineNC -highlight! link TabLineFill StatusLineNC -highlight! link TabLineSel StatusLine diff --git a/.vim/colors/yin.vim b/.vim/colors/yin.vim deleted file mode 100644 index 9eced57..0000000 --- a/.vim/colors/yin.vim +++ /dev/null @@ -1,212 +0,0 @@ -" YinYang - black/white color scheme - -if (&background ==# "light" && get(g:, "colors_name", "") ==# "yin") - runtime! colors/yang.vim - finish -endif - -highlight clear - -if exists("syntax_on") - syntax reset -endif -let g:colors_name = "yin" - - -let s:palette = {} - -let s:palette.blackest = [0, '#0c0c0c'] -let s:palette.black = [233, '#111111'] -let s:palette.gray01 = [235, '#1e1e1e'] -let s:palette.gray02 = [238, '#444444'] -let s:palette.gray03 = [239, '#4e4e4e'] -let s:palette.gray04 = [240, '#585858'] -let s:palette.gray05 = [242, '#666666'] -let s:palette.gray06 = [243, '#767676'] -let s:palette.gray07 = [244, '#808080'] -let s:palette.gray08 = [245, '#8a8a8a'] -let s:palette.gray09 = [246, '#949494'] -let s:palette.gray10 = [247, '#9e9e9e'] -let s:palette.gray11 = [248, '#a8a8a8'] -let s:palette.gray12 = [249, '#b2b2b2'] -let s:palette.gray13 = [250, '#bcbcbc'] -let s:palette.gray14 = [251, '#c6c6c6'] -let s:palette.gray15 = [254, '#e4e4e4'] -let s:palette.white = [255, '#eeeeee'] - -let s:palette.comments = copy(s:palette.gray03) - -let s:palette.purple = [62, '#5f5fd7'] -let s:palette.brown = [94, '#875f00'] -let s:palette.blue = [24, '#005f87'] -let s:palette.lightblue = [31, '#00afff'] -let s:palette.green = [29, '#00875f'] -let s:palette.red = [88, '#870000'] -let s:palette.orange = [166, '#5f5fd7'] - -if has("nvim") - let g:terminal_color_0 = s:palette.gray01[1] - let g:terminal_color_1 = s:palette.gray06[1] - let g:terminal_color_2 = s:palette.gray03[1] - let g:terminal_color_3 = s:palette.gray11[1] - let g:terminal_color_4 = s:palette.gray02[1] - let g:terminal_color_5 = s:palette.gray08[1] - let g:terminal_color_6 = s:palette.gray09[1] - let g:terminal_color_7 = s:palette.gray13[1] - let g:terminal_color_8 = s:palette.gray03[1] - let g:terminal_color_9 = s:palette.gray10[1] - let g:terminal_color_10 = s:palette.gray07[1] - let g:terminal_color_11 = s:palette.gray15[1] - let g:terminal_color_12 = s:palette.gray05[1] - let g:terminal_color_13 = s:palette.gray12[1] - let g:terminal_color_14 = s:palette.gray14[1] - let g:terminal_color_15 = s:palette.white[1] -elseif has("terminal") - let g:terminal_ansi_colors = [ - \ s:palette.gray01[1], - \ s:palette.gray06[1], - \ s:palette.gray03[1], - \ s:palette.gray11[1], - \ s:palette.gray02[1], - \ s:palette.gray08[1], - \ s:palette.gray09[1], - \ s:palette.gray13[1], - \ s:palette.gray03[1], - \ s:palette.gray10[1], - \ s:palette.gray07[1], - \ s:palette.gray15[1], - \ s:palette.gray05[1], - \ s:palette.gray12[1], - \ s:palette.gray14[1], - \ s:palette.white[1] - \ ] -endif - -function! s:hi(group, fg_color, bg_color, style) - let highlight_command = ['hi', a:group] - if !empty(a:fg_color) - let [ctermfg, guifg] = a:fg_color - call add(highlight_command, printf('ctermfg=%d guifg=%s', ctermfg, guifg)) - endif - if !empty(a:bg_color) - let [ctermbg, guibg] = a:bg_color - call add(highlight_command, printf('ctermbg=%d guibg=%s', ctermbg, guibg)) - endif - if !empty(a:style) - call add(highlight_command, printf('cterm=%s gui=%s', a:style, a:style)) - endif - execute join(highlight_command, ' ') -endfunction - - -call s:hi('Normal', s:palette.gray11, s:palette.black, '') -set background=dark - -call s:hi('Constant', s:palette.gray05, [], 'bold') -call s:hi('String', s:palette.gray10, [], '') -call s:hi('Number', s:palette.gray06, [], '') - -call s:hi('Identifier', s:palette.gray08, [], 'none') -call s:hi('Function', s:palette.gray08, [], '') - -call s:hi('Statement', s:palette.gray05, [], 'bold') -call s:hi('Operator', s:palette.gray05, [], 'none') -call s:hi('Keyword', s:palette.gray05, [], '') - -call s:hi('PreProc', s:palette.gray07, [], 'none') - -call s:hi('Type', s:palette.gray05, [], 'bold') - -call s:hi('Special', s:palette.gray05, [], '') -call s:hi('SpecialComment', s:palette.comments, [], 'bold') - -call s:hi('Title', s:palette.gray07, [], 'bold') -call s:hi('Todo', s:palette.purple, s:palette.black, '') -if has("nvim") || has("gui_running") - call s:hi('Comment', s:palette.comments, [], 'italic') -else - call s:hi('Comment', s:palette.comments, [], '') -endif - -call s:hi('LineNr', s:palette.gray02, s:palette.black, 'none') -call s:hi('FoldColumn', s:palette.gray07, s:palette.gray01, 'none') -call s:hi('CursorLine', [], s:palette.gray01, 'none') -call s:hi('CursorLineNr', s:palette.gray14, s:palette.gray01, 'none') - -call s:hi('Visual', s:palette.black, s:palette.gray06, '') -call s:hi('Search', s:palette.gray01, s:palette.gray11, 'none') -call s:hi('IncSearch', s:palette.black, s:palette.gray07, 'bold') - -call s:hi('SpellBad', s:palette.red, s:palette.black, 'undercurl') -call s:hi('SpellCap', s:palette.red, s:palette.black, 'undercurl') -call s:hi('SpellLocal', s:palette.red, s:palette.black, 'undercurl') -call s:hi('SpellRare', s:palette.brown, s:palette.black, 'undercurl') - -call s:hi('Error', s:palette.red, s:palette.black, 'bold') -call s:hi('ErrorMsg', s:palette.red, s:palette.black, '') -call s:hi('WarningMsg', s:palette.brown, s:palette.black, '') -call s:hi('ModeMsg', s:palette.gray10, [], '') -call s:hi('MoreMsg', s:palette.gray10, [], '') - -call s:hi('MatchParen', s:palette.orange, s:palette.black, '') - -call s:hi('Cursor', [], s:palette.gray12, '') -call s:hi('Underlined', s:palette.gray08, [], 'underline') -call s:hi('SpecialKey', s:palette.gray04, [], '') -call s:hi('NonText', s:palette.gray04, [], '') -call s:hi('Directory', s:palette.gray08, [], '') - -call s:hi('Pmenu', s:palette.gray10, s:palette.gray03, 'none') -call s:hi('PmenuSbar', s:palette.black, s:palette.gray15, 'none') -call s:hi('PmenuSel', s:palette.gray03, s:palette.gray10, '') -call s:hi('PmenuThumb', s:palette.gray03, s:palette.gray09, 'none') - -call s:hi('StatusLine', s:palette.gray12, s:palette.gray01, 'none') -call s:hi('StatusLineNC', s:palette.black, s:palette.black, 'none') -call s:hi('WildMenu', s:palette.gray08, [], '') -call s:hi('VertSplit', s:palette.gray03, s:palette.black, 'none') - -call s:hi('DiffAdd', s:palette.blackest, s:palette.green, '') -call s:hi('DiffChange', s:palette.blackest, s:palette.blue, '') -call s:hi('DiffDelete', s:palette.blackest, s:palette.red, '') -call s:hi('DiffText', s:palette.black, s:palette.lightblue, '') -call s:hi('DiffAdded', s:palette.green, s:palette.black, '') -call s:hi('DiffChanged', s:palette.blue, s:palette.black, '') -call s:hi('DiffRemoved', s:palette.red, s:palette.black, '') - -highlight! link Character Constant -highlight! link Float Number -highlight! link Boolean Number - -highlight! link SignColumn FoldColumn -highlight! link ColorColumn FoldColumn -highlight! link CursorColumn CursorLine - -highlight! link Folded LineNr -highlight! link Conceal Normal -highlight! link ErrorMsg Error - -highlight! link Conditional Statement -highlight! link Repeat Statement -highlight! link Label Statement -highlight! link Exception Statement - -highlight! link Include PreProc -highlight! link Define PreProc -highlight! link Macro PreProc -highlight! link PreCondit PreProc - -highlight! link StorageClass Type -highlight! link Structure Type -highlight! link Typedef Type - -highlight! link SpecialChar Special -highlight! link Tag Special -highlight! link Delimiter Special -highlight! link Debug Special -highlight! link Question Special - -highlight! link VisualNOS Visual -highlight! link TabLine StatusLineNC -highlight! link TabLineFill StatusLineNC -highlight! link TabLineSel StatusLine diff --git a/.vim/ftdetect/prolog.vim b/.vim/ftdetect/prolog.vim deleted file mode 100644 index 38eff75..0000000 --- a/.vim/ftdetect/prolog.vim +++ /dev/null @@ -1 +0,0 @@ -autocmd BufNewFile,BufReadPost *.pl set filetype=prolog diff --git a/.vim/ftplugin/javascript.vim b/.vim/ftplugin/javascript.vim deleted file mode 100644 index c4582b6..0000000 --- a/.vim/ftplugin/javascript.vim +++ /dev/null @@ -1 +0,0 @@ -set mps+==:; diff --git a/.vim/init/colors.vim b/.vim/init/colors.vim deleted file mode 100644 index b025225..0000000 --- a/.vim/init/colors.vim +++ /dev/null @@ -1,3 +0,0 @@ -set termguicolors -set bg=light -hi Normal ctermbg=none guibg=NONE diff --git a/.vim/init/mappings.vim b/.vim/init/mappings.vim deleted file mode 100644 index 5e942a4..0000000 --- a/.vim/init/mappings.vim +++ /dev/null @@ -1,44 +0,0 @@ -" Leader keys -let mapleader = " " -let maplocalleader = ";" - -" Splits & navigation -nm s " Split horizontal -nm ss :spw| " Split horizontal -nm sv :vsw| " Split vertical -nm sw w| " Navigate splits -nm sh h| " -nm sj j| " -nm sk k| " -nm sl l| " -nn sH 8<| " Resize splits -nn sJ 8-| " -nn sK 8+| " -nn sL 8>| " -nn s= =| " Equalize splits - -" Open -nn sb :Lex| " File tree -nn :noh |" -nn t :term| " Open terminal - -" Remaps -ino jj | " Normal now -nn | " Hard mode -nn | " " -nn | " " -nn | " " -ino | " " -ino | " " -ino | " " -ino | " " - -" Search -nn :noh| " map 'ctrl + /' - -" Line numbers -nn n :set nu! rnu! - -" Vim configuration -nn ec :vs $MYVIMRC -nn so :so % diff --git a/.vim/snips/all.snippets b/.vim/snips/all.snippets deleted file mode 100644 index 63c2db3..0000000 --- a/.vim/snips/all.snippets +++ /dev/null @@ -1,7 +0,0 @@ -snippet fne "Filename (+extension)" i -`!p snip.rv = snip.fn` -endsnippet - -# snippet ^fn "Filename basename" ir -# `!p snip.rv = snip.basename` -endsnippet diff --git a/.vim/snips/css.snippets b/.vim/snips/css.snippets deleted file mode 100644 index deb9e3f..0000000 --- a/.vim/snips/css.snippets +++ /dev/null @@ -1,72 +0,0 @@ -snippet b1(\w+) "Border (1px)" r -`!p -import re -colors = { - 'r': 'red', - 'g': 'green', - 'b': 'blue', - 'y': 'yellow', - 'o': 'orange', - 'p': 'purple', - 'c': 'cyan', - 'm': 'magenta', - 'w': 'white', -} -color = colors.get(match.group(1), 'black') -snip.rv = f"border: 1px solid {color};" -`$0 -endsnippet - -snippet df "Use flexbox layout" -display: flex; -$0 -endsnippet - -snippet fr "Use row direction (flex)" -flex-direction: row; -$0 -endsnippet - -snippet fc "Use column direction (flex)" -flex-direction: column; -$0 -endsnippet - -snippet dfr "Use flexbox layout in row direction" -display: flex; -flex-direction: row; -$0 -endsnippet - -snippet dfr "Use flexbox layout in column direction" -display: flex; -flex-direction: column; -$0 -endsnippet - -snippet dg "Use CSS grid layout" -display: grid; -$0 -endsnippet - -snippet db "Use block layout" -display: block; -$0 -endsnippet - -snippet dn "Set display to 'none'" -display: none; -$0 -endsnippet - -snippet var "Use CSS variable" -var(--$1)$0 -endsnippet - -snippet m -margin: $0; -endsnippet - -snippet p -padding: $0; -endsnippet diff --git a/.vim/snips/glsl.snippets b/.vim/snips/glsl.snippets deleted file mode 100644 index c8f916a..0000000 --- a/.vim/snips/glsl.snippets +++ /dev/null @@ -1,51 +0,0 @@ -snippet ifdef -#ifdef GL_ES -precision mediump float; -#endif -endsnippet - -snippet defpi -#define PI 3.14159265359 -endsnippet - -snippet main -void main() { - $1 -} -endsnippet - -snippet uni -uniform $1; -endsnippet - -snippet unif -uniform float $1; -endsnippet - -snippet univ -uniform vec$1 float $2; -endsnippet - -snippet univ2 -uniform vec2 float $1; -endsnippet - -snippet univ3 -uniform vec3 float $1; -endsnippet - -snippet univ4 -uniform vec4 float $1; -endsnippet - -snippet f -float -endsnippet - -snippet v -vec -endsnippet - -snippet ss -smoothstep($1)$2 -endsnippet diff --git a/.vim/snips/javascript.snippets b/.vim/snips/javascript.snippets deleted file mode 100644 index 3f00b27..0000000 --- a/.vim/snips/javascript.snippets +++ /dev/null @@ -1,11 +0,0 @@ -snippet clg "console.log" -console.log($0) -endsnippet - -snippet Js "JSON.stringify" -JSON.stringify($0) -endsnippet - -snippet Jsf "JSON.stringify (formatted)" -JSON.stringify($0, 0, 2) -endsnippet diff --git a/.vim/snips/pandoc.snippets b/.vim/snips/pandoc.snippets deleted file mode 100644 index f2c8ce0..0000000 --- a/.vim/snips/pandoc.snippets +++ /dev/null @@ -1,900 +0,0 @@ - -global !p -from datetime import datetime -from math import factorial -import subprocess -import re -import sys - -ZOTERO_BASE = "http://127.0.0.1:23119/better-bibtex/cayw" -FENCES = { - "i": "idea", - "q": "question", - "n": "note", - "t": "thought", -} - -def math_inline(): - return vim.command_output('GetContext') == 'math_inline' - -def math_block(): - return vim.command_output('GetContext') == 'math_block' - -def math(): - return math_inline() or math_block() - -def code_block(): - return vim.command_output('GetContext') == 'pandocDelimitedCodeBlock' - -def code_inline(): - return vim.command_output('GetContext') == 'pandocNoFormatted' - -def code(): - return code_inline() or code_block() - -def slugify(text): - return re.sub('\s+', '-', text.lower()) - -def linkify(text, link): - return f"[{text}]({link})" - -def zot(action): - if action == "get_title": - cmd = f"curl -s '{ZOTERO_BASE}?format=json&selected=1' | jq '.[].title' -r" - elif action == "get_citekey": - cmd = f"curl -s '{ZOTERO_BASE}?format=pandoc&selected=1'" - elif action == "get_citekey_brackets": - cmd = f"curl -s '{ZOTERO_BASE}?format=pandoc&selected=1&brackets=1'" - elif action == "get_link": - link_path = re.sub("^@", "", zot("get_citekey")) - link_title = zot("get_title") - link = linkify(link_title, link_path) - return link - elif action == "get_file": - link_path = re.sub("^@", "", zot("get_citekey")) - link_title = zot("get_title") - link = linkify(link_title, f"file://{link_path}.pdf") - return link - else: - return "Zotero action not found" - return subprocess.check_output(cmd, shell=True).decode("utf-8").strip() -endglobal - -snippet ctx "Context" i -`!p snip.rv = vim.command_output('GetContext')` -endsnippet - -# General markdown - -snippet ^h "Markdown header" r -# $1 -endsnippet - -snippet ^sec "Markdown section" r -## $1 -endsnippet - -snippet ^ssec "Markdown subsection" r -### $1 -endsnippet - -snippet ^sex "Markdown example section" r -## Example: $1 -endsnippet - -snippet ^ssex "Markdown example subsection" r -### Example: $1 -endsnippet - -# Zettelkasten templating - -snippet nl -*nld*: $1 -endsnippet - -snippet eng -*eng*: $1 -endsnippet - -snippet fr -*fra*: $1 -endsnippet - -snippet (de -*deu*: $1 -endsnippet - -snippet (nl -(*nld*: $1) -endsnippet - -snippet (eng -(*eng*: $1) -endsnippet - -snippet (fr -(*fra*: $1) -endsnippet - -snippet (de -(*deu*: $1) -endsnippet - -snippet in -(In [$1]($2))$3 -endsnippet - -snippet liwhat "What?" A -`!p snip.rv = "* [What?](" + snip.basename + "_what)"`$1 -endsnippet - -snippet liwhy "Why?" A -`!p snip.rv = "* [Why?](" + snip.basename + "_why)"`$1 -endsnippet - -snippet < "Comment (html)" -$2 -endsnippet - -snippet <. "Comment (html) ..." i -$1 -endsnippet - -snippet -endsnippet - -snippet -endsnippet - -snippet -endsnippet - -snippet -endsnippet - -snippet td "Todo" -TODO${1:: $2} -endsnippet - -snippet ref "References" - -endsnippet - -snippet sort "Sort" - -endsnippet - -snippet foot "Footnotes" - -[^0]: -endsnippet - -snippet def "Definition" -**Definition${1:: $2}**${3: [${4:citation}${5:, ${6:pointer}}]} - -$7 - -___ -endsnippet - -snippet theo "Theorem" -**Theorem${1:: $2}**${3: [${4:citation}${5:, ${6:pointer}}]} - -$7 - -${8/(\w+).*/**Theorem** \n\n.../} - -___ -endsnippet - -snippet prop "Property" -**Property $1** [@] - -$2 - -___ -endsnippet - -snippet lemm "Lemma" -**Lemma $1** [@] - -$2 - -___ -endsnippet - -snippet coro "Corollary" -**Corollary $1** [@] - -$2 - -___ -endsnippet - -# Greek symbols - -context "math()" -snippet alpha "Alpha" -\\alpha -endsnippet - -context "math()" -snippet beta "Beta" -\\beta -endsnippet - -context "math()" -snippet gamma "Gamma" -\\gamma -endsnippet - -context "math()" -snippet delta "Delta" -\\delta -endsnippet - -context "math()" -snippet epsilon "Epsilon" -\\epsilonilon -endsnippet - -context "math()" -snippet zeta "Zeta" -\\zeta -endsnippet - -context "math()" -snippet eta "Eta" -\\eta -endsnippet - -context "math()" -snippet theta "Theta" -\\theta -endsnippet - -context "math()" -snippet iota "Iota" -\\iota -endsnippet - -context "math()" -snippet kappa "Kappa" -\\kappa -endsnippet - -context "math()" -snippet lambda "Lambda" i -\\lambda -endsnippet - -context "math()" -snippet mu "Mu" -\\mu -endsnippet - -context "math()" -snippet nu "Nu" -\\nu -endsnippet - -context "math()" -snippet xi "Xi" -\\xi -endsnippet - -context "math()" -snippet omicron "Omicron" -\\omicron -endsnippet - -context "math()" -snippet pi "Pi" -\\pi -endsnippet - -context "math()" -snippet rho "Rho" -\\rho -endsnippet - -context "math()" -snippet sigma "Sigma" -\\sigma -endsnippet - -context "math()" -snippet tau "Tau" -\\tau -endsnippet - -context "math()" -snippet upsilon "Upsilon" -\\upsilon -endsnippet - -context "math()" -snippet phi "Phi" -\\phi -endsnippet - -context "math()" -snippet chi "Chi" -\\chi -endsnippet - -context "math()" -snippet psi "Psi" -\\psi -endsnippet - -context "math()" -snippet omega "Omega" -\\omega -endsnippet - -context "math()" -snippet Gamma "Gamma" -\\Gamma -endsnippet - -context "math()" -snippet Delta "Delta" -\\Delta -endsnippet - -context "math()" -snippet Theta "Theta" -\\Theta -endsnippet - -context "math()" -snippet Lambda "Lambda" -\\Lambda -endsnippet - -context "math()" -snippet Xi "Xi" -\\Xi -endsnippet - -context "math()" -snippet Pi "Pi" -\\Pi -endsnippet - -context "math()" -snippet Sigma "Sigma" -\\Sigma -endsnippet - -context "math()" -snippet Upsilon "Upsilon" -\\Upsilon -endsnippet - -context "math()" -snippet Phi "Phi" -\\Phi -endsnippet - -context "math()" -snippet Psi "Psi" -\\Psi -endsnippet - -context "math()" -snippet Omega "Omega" -\\Omega -endsnippet - -snippet asaw "Als en slechts als (woorden)" i -als en slechts als -endsnippet - -snippet iffw "If and only if (words)" i -if and only if -endsnippet - -snippet asas "Als en slechts als (shorthand)" i -**asa** -endsnippet - -snippet iffs "If and only if (shorthand)" i -**iff** -endsnippet - -snippet beg "Begin" -\begin{$1} -$2 -\end{$1} -endsnippet - -snippet align "" i -\begin{align} -$1 -\end{align} -endsnippet - -snippet cases "" i -\begin{cases} -$1 \\\\ -$2 -\end{cases} -$3 -endsnippet - -snippet tik "Tikzpicture" i -\begin{tikzpicture} -$1 -\end{tikzpicture} -endsnippet - -snippet matrix "Matrix" i -\begin{bmatrix} -$1 -\end{bmatrix} -endsnippet - -# Insert anything after m/M in math mode - -snippet "(\b)m(.*)" "MathJax" r -`!p snip.rv = match.group(1) + "$" + match.group(2) + "$"` -endsnippet - -snippet (\b)M(.*) "MathJax block" irw -$$ -`!p snip.rv = match.group(2)` -$$ -endsnippet - -# Calligraphic letters - -context "math()" -snippet c([A-z]) "Calligraphic A" r -`!p snip.rv = "\\mathcal{" + match.group(1) + "}"`$1 -endsnippet - -# Subscripts - -context "math()" -snippet '([A-z])(\w+)' "Subscripts" irw -`!p snip.rv = match.group(1) + '_' + match.group(2) if len(match.group(2)) == 1 else match.group(1) + '_{' + match.group(2) + '}'`$1 -endsnippet - -# MathJax - -snippet fa "For all" i -\forall -endsnippet - -snippet frac "" i -\frac{$1}{$2}$3 -endsnippet - -snippet set "" i -\\{$1\\}$2 -endsnippet - -snippet N "" i -\mathbb{N} -endsnippet - -snippet N0 "" i -\mathbb{N}_0 -endsnippet - -snippet N+ "" i -\mathbb{N}^+ -endsnippet - -snippet Z "" i -\mathbb{Z} -endsnippet - -snippet Z0 "" i -\mathbb{Z}_0 -endsnippet - -snippet Z+ "" i -\mathbb{Z}^+ -endsnippet - -snippet R "" i -\mathbb{R} -endsnippet - -snippet R0 "" i -\mathbb{R}_0 -endsnippet - -snippet R+ "" i -\mathbb{R}^+ -endsnippet - -snippet C "" i -\mathbb{C} -endsnippet - -snippet lim "" i -\lim_{$1}$2 -endsnippet - -snippet limn "" i -\lim_{n \to \infty}$2 -endsnippet - -snippet binom "" i -\binom{$1}{$2}$3 -endsnippet - -snippet andmath "description" i -\text{ and } -endsnippet - -snippet enmath "description" i -\text{ en } -endsnippet - -snippet lra "MathJax: long right arrow" i -\longrightarrow -endsnippet - -snippet Ra "MathJax: right arrow" i -\Rightarrow -endsnippet - -snippet Im "MathJax: image operator" i -\operatorname{Im} -endsnippet - -snippet ggd "Grootste gemene deler" i -\operatorname{ggd} -endsnippet - -snippet fl "Floating point" i -\operatorname{fl} -endsnippet - -snippet Var "Variance" i -\operatorname{Var} -endsnippet - -snippet E "Expectation" i -\operatorname{E} -endsnippet - -snippet Cov "Covariance" i -\operatorname{Cov} -endsnippet - -context "math()" i -snippet ntup "Alpha" -(x_1, \ldots, x_n) -endsnippet - -snippet mxn "Matrix" i -m \times n -endsnippet - -snippet mxn- "Matrix" i -$m \times n$-matrix -endsnippet - -snippet nxn "Matrix" i -n \times n -endsnippet - -snippet det "Determinant" i -\operatorname{det}(${1:A})$2 -endsnippet - -snippet det| "Determinant alternative notation" i -|${1:A}|$2 -endsnippet - -snippet Span "Span" i -\operatorname{Span}\\{$1\\}$2 -endsnippet - -snippet Nul "Null" i -\operatorname{Nul}($1)$2 -endsnippet - -snippet Col "Column space" i -\operatorname{Col}($1)$2 -endsnippet - -snippet kern "Kernel" i -\operatorname{kern}($1)$2 -endsnippet - -context "math()" -snippet vec "Vector" i -\mathbf{$1}$2 -endsnippet - -context "math()" -snippet vec([A-z]) "Vector ..." r -`!p snip.rv = "\\mathbf{" + match.group(1) + "}"`$1 -endsnippet - -snippet v1tovp "Vectors v indexed from 1 to p" -\mathbf{v_1},...,\mathbf{v_p}$2 -endsnippet - -snippet a1toan "Vectors a indexed from 1 to n" -\mathbf{a_1},...,\mathbf{v_n}$2 -endsnippet - -snippet .. "Dot dot dot" i -\dots $1 -endsnippet - -snippet text "MathJax text" i -\text{$1}$2 -endsnippet - -snippet leq "Less than or equal to" i -\leq -endsnippet - -snippet leq "Greater than or equal to" i -\geq -endsnippet - -snippet eat "Evaluated at" i -{\biggr\rvert}_{$1}$2 -endsnippet - -snippet sketch "Link a sketch" i -[$1](file:///home/h/sketches/$2) -endsnippet - -snippet deck "Get anki deck" -`get-anki-decks` -endsnippet - -# snippet ` "Inline code" i -# `$1` -# endsnippet - -# Escape backticks -snippet `` "Code block" bA -\`\`\`$1 -$2 -\`\`\` -endsnippet - -snippet `tex "Latex block (see latex filter)" bA -\`\`\`{.tex} -$1 -\`\`\` -endsnippet - -snippet `tik "Tikz block (see tikz filter)" bA -\`\`\`{.tex} -\\begin{tikzpicture} -$1 -\\end{tikzpicture} -\`\`\` -endsnippet - -snippet task "Task" i -* [ ] $1 -- pro:$2 -endsnippet - -snippet "(\b)fn(\d+)" "" ir -`!p snip.rv = snip.basename + "_" + match.group(2).zfill(2)`$1 -endsnippet - -snippet "ch(\d+)" "Link chapter" ir -`!p -num_str = match.group(1).zfill(2) -title = 3*"." -link = snip.basename + "_" + num_str -snip.rv = num_str + ". " + linkify(title, link) -` -endsnippet - -snippet "ch(\d+)to(\d+)" "Link chapters ... to ..." irA -`!p -for i in range(int(match.group(1)), int(match.group(2)) + 1): - num_str = str(i).zfill(2) - title = 3*"." - link = snip.basename + "_" + num_str - snip.rv += num_str + ". " + linkify(title, link) + "\n" -` -endsnippet - -snippet "sec([\sA-z]+)" "Link section titled ..." r -`!p -snip.rv = "* " + linkify(match.group(1), f"{snip.basename}_{slugify(match.group(1))}") -` -endsnippet - -snippet cp(\d+) "Comment current page (and date)" r -`!p snip.rv = ""` -endsnippet - -snippet (\d+)! "Factorial of ..." r -`!p snip.rv = factorial(int(match.group(1)))` -endsnippet - -snippet d "Date" -`!p snip.rv = datetime.now().strftime("%Y-%m-%d")` -endsnippet - -snippet :(\w*) "Fence" r -`!p snip.rv += ":::" + FENCES.get(match.group(1) or "", "") + "\n" `$1 -`!p snip.rv += ":::"`$2 -endsnippet - -snippet \[(\w*) "Fence inline" ir -`!p snip.rv += "["`$1`!p snip.rv += "]{." + FENCES.get(match.group(1) or "", "") + "}"`$2 -endsnippet - -snippet ^eg "Example" r -E.g. $1 -endsnippet - -# E.g. after list (or list preceded by space) -snippet (\*\s|\*)eg "Example" r -* E.g. $1 -endsnippet - -# E.g. after dot (or dot preceded by space) -snippet (\.\s|\.)eg "Example" r -. E.g. $1 -endsnippet - -snippet (?" -TARGET DECK: $1::$2 -endsnippet - -snippet clo "Cloze" -START -Cloze -${0:${VISUAL}}$1 -END -$2 -endsnippet - -snippet clos "Cloze start" -START -Cloze -$1 -endsnippet - -snippet cloe "Cloze end" -END -endsnippet - -snippet clod -START -Cloze -**Definition$1** - -$2 -END -endsnippet - -snippet clop -START -Cloze -**Property$1** - -$2 -END -endsnippet - -snippet clot -START -Cloze -**Theorem$1** - -$2 -END -endsnippet - -snippet clol -START -Cloze -**Lemma$1** - -$2 -END -endsnippet - -snippet "c(\d+)" "Cloze " r -{{c`!p snip.rv = int(match.group(1))`::${0:${VISUAL}}$1}}$2 -endsnippet - -# Match preceded by whitespace or start of line -snippet (?\n> --' + zot("get_citekey_brackets")` -endsnippet - -snippet acz "According to ..." -`!p snip.rv = "According to " + zot("get_citekey")` -endsnippet - -snippet azex "As ... explains" -`!p snip.rv = "As " + zot("get_citekey") + " explains, "` -endsnippet - -snippet iz "In ..." -`!p snip.rv = "In " + zot("get_citekey")` -endsnippet - -snippet izd "In ...'s definition" -`!p snip.rv = "In " + zot("get_citekey") + "'s definition, "` -endsnippet - -snippet zintends "... intends to ..." A -`!p snip.rv = zot("get_citekey") + " intends to "` -endsnippet - -snippet tfol "The following" wA -the following -endsnippet - -snippet tfolt "It follows that" wA -it follows that -endsnippet - -snippet ntfol "In the following" wA -in the following -endsnippet - -snippet algos "algorithms" wA -algorithms -endsnippet - -snippet algo "algorithm" wA -algorithm -endsnippet - -# TODO: Make only available in tikzpicture -context "code()" -snippet q "State" w -\node[state] ($1) [] {$2}; -endsnippet - -context "code()" -snippet q0 "Initial state" w -\node[initial,state] ($1) {$2}; -endsnippet diff --git a/.vim/snips/scheme.snippets b/.vim/snips/scheme.snippets deleted file mode 100644 index b8e3828..0000000 --- a/.vim/snips/scheme.snippets +++ /dev/null @@ -1,20 +0,0 @@ -snippet reqtrace "(#%require racket/trace)" b -(#%require racket/trace) -endsnippet - -snippet strln "(string-length )" b -(string-length $0) -endsnippet - -snippet impb "Import rnrs base libraries" b -(import (rnrs base (6)) - (rnrs io simple)$0) -endsnippet - -snippet def "(define )" b -(define $0 $1) -endsnippet - -snippet defp "(define ( ))" b -(define ($0 $1)) -endsnippet diff --git a/.vim/snips/svelte.snippets b/.vim/snips/svelte.snippets deleted file mode 100644 index f4cd5eb..0000000 --- a/.vim/snips/svelte.snippets +++ /dev/null @@ -1,19 +0,0 @@ -extends html, javascript, css - -snippet oM -onMount(() => $0) -endsnippet - -snippet oD -onDestroy(() => $0) -endsnippet - -snippet preJsf "JSON.stringify (formatted and wrapped)" -
-{JSON.stringify($0, 0, 2)}
-
-endsnippet - -snippet :g "Open :global(" -:global( -endsnippet diff --git a/.vim/snips/tex.snippets b/.vim/snips/tex.snippets deleted file mode 100644 index dee379d..0000000 --- a/.vim/snips/tex.snippets +++ /dev/null @@ -1,78 +0,0 @@ -# -# Inspired by https://castel.dev/post/lecture-notes-1/ -# - -snippet beg "begin{} / end{}" b -\begin{$1} - $0 -\end{$1} -endsnippet - -snippet def "begin{definition} / end{definition}" b -\begin{definition} - $0 -\end{defintion} -endsnippet - -snippet fig "begin{figure} / end{figure}" b -\begin{figure} - $0 -\end{figure} -endsnippet - -snippet time "Time" -`date +%R` -endsnippet - -snippet i -\textit{$0} -endsnippet - -snippet b -\textbf{$0} -endsnippet - -snippet center -\begin{center} -$0 -\end{center} -endsnippet - -snippet pac -\usepackage{$0} -endsnippet - -snippet foot -\footnote{$0} -endsnippet - -# snippet m "Math" wA -# $${1}$`!p -# if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']: -# snip.rv = ' ' -# else: -# snip.rv = '' -# `$2 -# endsnippet - -snippet dm "Math" wA -\[ -$1 -\]$0 -endsnippet - -snippet ch -\chapter{$0} -endsnippet - -snippet sec -\section{$0} -endsnippet - -snippet ssec -\subsection{$0} -endsnippet - -snippet sssec -\subsubsection{$0} -endsnippet diff --git a/.vimrc b/.vimrc deleted file mode 100644 index e67cfb4..0000000 --- a/.vimrc +++ /dev/null @@ -1,4 +0,0 @@ -source ~/.vim/init/base.vim -source ~/.vim/init/mappings.vim -source ~/.vim/init/plugins.vim -source ~/.vim/init/colors.vim