diff options
Diffstat (limited to '.config')
53 files changed, 3588 insertions, 0 deletions
diff --git a/.config/fish/config.fish b/.config/fish/config.fish new file mode 100644 index 0000000..4751ffd --- /dev/null +++ b/.config/fish/config.fish @@ -0,0 +1,32 @@ +fish_add_path -p ~/.juliaup/bin ~/.cargo/bin ~/.local/bin /usr/local/sbin /usr/local/bin /usr/bin + +set -e TERMCAP +set -e MANPATH +set -Ux STARSHIP_CONFIG ~/.config/starship/starship.toml + +source ~/.config/fish/colors.fish + +pyenv init - | source +zoxide init fish | source +starship init fish | source + +function starship_transient_prompt_func + set --local -x STARSHIP_CONFIG ~/.config/starship/transient.toml + starship module character +end + +function xcd + set --local result (command xplr $argv) + [ -n "$result" ] && cd "$result" +end + +if status is-interactive + alias ls='eza -w 80 --icons' + alias cd='z' + alias grep='grep --color=auto' + alias nv=nvim + alias lg=lazygit + + fish_vi_key_bindings + enable_transience +end diff --git a/.config/keybs/README.md b/.config/keybs/README.md new file mode 100644 index 0000000..5848976 --- /dev/null +++ b/.config/keybs/README.md @@ -0,0 +1,5 @@ +# keybs + +My kanata config, along with my old kmonad and xkb configs. See my 34 key +moonlander layout +[here](https://configure.zsa.io/moonlander/layouts/rXG3Q/latest/0). diff --git a/.config/keybs/jo b/.config/keybs/jo new file mode 100644 index 0000000..eaa7e28 --- /dev/null +++ b/.config/keybs/jo @@ -0,0 +1,63 @@ +xkb_symbols "josh_standard" { + + name[Group1]= "English (Josh Standard)"; + + key <TLDE> { [ grave, asciitilde ] }; + key <AE01> { [ 1, exclam ] }; + key <AE02> { [ 2, at ] }; + key <AE03> { [ 3, numbersign ] }; + key <AE04> { [ 4, dollar ] }; + key <AE05> { [ 5, percent ] }; + key <AE06> { [ 6, asciicircum ] }; + key <AE07> { [ 7, ampersand ] }; + key <AE08> { [ 8, asterisk ] }; + key <AE09> { [ 9, parenleft, leftsinglequotemark, leftdoublequotemark ] }; + key <AE10> { [ 0, parenright, rightsinglequotemark, rightdoublequotemark ] }; + key <AE11> { [ minus, underscore, endash, emdash ] }; + key <AE12> { [ equal, plus, multiply, division ] }; + + key <AD01> { [ q, Q ] }; + key <AD02> { [ w, W, bracketleft ] }; + key <AD03> { [ f, F, bracketright ] }; + key <AD04> { [ p, P ] }; + key <AD05> { [ b, B ] }; + key <AD06> { [ j, J ] }; + key <AD07> { [ l, L, Home, Home ] }; + key <AD08> { [ u, U, Page_Down, Page_Down ] }; + key <AD09> { [ y, Y, Page_Up, Page_Up ] }; + key <AD10> { [ semicolon, colon, End, End ] }; + key <AD11> { [ bracketleft, braceleft ] }; + key <AD12> { [ bracketright, braceright ] }; + key <BKSL> { [ backslash, bar ] }; + + key <AC01> { [ a, A, Tab ] }; + key <AC02> { [ r, R, braceleft ] }; + key <AC03> { [ s, S, parenleft ] }; + key <AC04> { [ t, T, parenright ] }; + key <AC05> { [ g, G ] }; + key <AC06> { [ m, M ] }; + key <AC07> { [ n, N, Left, Left ] }; + key <AC08> { [ e, E, Down, Down ] }; + key <AC09> { [ i, I, Up, Up ] }; + key <AC10> { [ o, O, Right, Right ] }; + key <AC11> { [ apostrophe, quotedbl ] }; + + key <LSGT> { [ z, Z ] }; + key <AB01> { [ x, X ] }; + key <AB02> { [ c, C ] }; + key <AB03> { [ d, D ] }; + key <AB04> { [ v, V, braceright ] }; + key <AB05> { [ z, Z ] }; + key <AB06> { [ k, K ] }; + key <AB07> { [ h, H, Home ] }; + key <AB08> { [ comma, less ] }; + key <AB09> { [ period, greater ] }; + key <AB10> { [ slash, question, End ] }; + + key <SPCE> { [ space, space, space, space ] }; + + key <CAPS> { [ ISO_Level3_Shift ] }; + + key <RALT> { [ Super_L ] }; + +}; diff --git a/.config/keybs/kanata.kbd b/.config/keybs/kanata.kbd new file mode 100644 index 0000000..40a8d6d --- /dev/null +++ b/.config/keybs/kanata.kbd @@ -0,0 +1,149 @@ +#| -------------------------------------------------------------------------- + +(deflayer name +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ + _ _ _ +) + + -------------------------------------------------------------------------- |# + +(defcfg + process-unmapped-keys yes + linux-dev-names-include ( + "AT Translated Set 2 keyboard" + "TPPS/2 Elan TrackPoint" + ) +) + +(defalias + nav (layer-while-held navigation) + num (one-shot-press-pcancel 1500 (layer-while-held numbers)) + sym (one-shot-press-pcancel 1500 (layer-while-held symbols)) + fun (one-shot-press-pcancel 1500 (layer-while-held function)) + qwe (layer-switch qwerty) + cdh (layer-switch colemakdh) + oss (one-shot-press 500 lsft) ;; one shot shift + sfd (tap-dance 200 (@oss caps)) ;; shift dance + + hrt (tap-hold-release 200 200 t lmet) + hrn (tap-hold-release 200 200 n lmet) + hrs (tap-hold-release 200 200 s lctl) + hre (tap-hold-release 200 200 e lctl) + hrr (tap-hold-release 200 200 r lalt) + hri (tap-hold-release 200 200 i lalt) + hra (tap-hold-release 200 200 a @nav) + + meq (tap-hold-release 200 200 = lmet) + mco (tap-hold-release 200 200 , lctl) + + pop (tap-hold-release 200 200 S-9 lctl) + pcl (tap-hold-release 200 200 S-0 lsft) + cop (tap-hold-release 200 200 S-[ lalt) + + mau (movemouse-accel-up 5 1000 1 5) + mal (movemouse-accel-left 5 1000 1 5) + mad (movemouse-accel-down 5 1000 1 5) + mar (movemouse-accel-right 5 1000 1 5) + + mwu (mwheel-up 1 1) + mwl (mwheel-left 1 1) + mwd (mwheel-down 1 1) + mwr (mwheel-right 1 1) + + mou (layer-while-held mouse) + mid (tap-hold-press 200 200 mrgt @mou) + + chl (chord midchord a) + chr (chord midchord b) +) + +(defchords midchord 50 + (a ) mlft + ( b) @mid + (a b) mmid +) + +(defsrc +esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 home end ins del + grv 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] \ + caps a s d f g h j k l ; ' ret + lsft z x c v b n m , . / rsft + wkup lctl lmet lalt spc ralt sys rctl pgup up pgdn + mlft mmid mrgt left down rght +) + +(deflayer colemakdh +esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 home end ins del + grv 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w f p b j l u y @fun [ ] \ + esc @hra @hrr @hrs @hrt g m @hrn @hre @hri o ' ret + @sfd x c d v z k h ' @sym bspc @sfd + wkup lctl lmet lalt spc @num sys @qwe pgdn up pgup + @chl @chr @num left down rght +) + +(deflayer navigation +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ [ ] _ _ _ del pgdn pgup _ _ _ _ + _ _ @cop @pop @pcl _ _ left down up rght _ _ + _ _ _ S-] _ _ _ home end _ _ _ + _ _ _ _ _ _ _ _ _ _ _ + _ _ lsft _ _ _ +) + +(deflayer numbers +lrld _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ 4 5 6 S-\ _ S-8 S-, S-. _ _ _ _ + _ tab 1 2 3 S-6 _ @meq @mco . / _ _ + _ 7 8 9 S-` _ _ - S-- S-+ _ _ + _ _ _ _ _ _ _ _ _ _ _ + 0 _ _ _ _ _ +) + +(deflayer symbols +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ S-2 S-3 S-4 S-5 _ _ _ _ _ _ _ _ + _ ` S-1 S-/ S-; S-7 _ _ _ _ _ _ _ + _ \ ; S-' S-\ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ + 0 _ _ _ _ _ +) + +(deflayer mouse +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ @mwl @mwd @mwu @mwr _ _ _ + _ _ mmid mrgt mlft _ _ @mal @mad @mau @mar _ _ + _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ +) + +(deflayer function +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ f4 f5 f6 _ _ _ _ _ _ _ _ _ + f12 f11 f1 f2 f3 _ _ _ _ _ _ _ _ + _ f7 f8 f9 _ _ _ - _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ + f10 _ _ _ _ _ +) + +(deflayer qwerty +esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 home end ins del + grv 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] \ + caps a s d f g h j k l ; ' ret + lsft z x c v b n m , . / rsft + wkup lctl lmet lalt spc ralt sys @cdh pgup up pgdn + mlft mmid mrgt left down rght +) diff --git a/.config/keybs/kmonad.kbd b/.config/keybs/kmonad.kbd new file mode 100644 index 0000000..17ff613 --- /dev/null +++ b/.config/keybs/kmonad.kbd @@ -0,0 +1,120 @@ +#| -------------------------------------------------------------------------- + +(deflayer name +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ + _ _ _ +) + + -------------------------------------------------------------------------- |# + +(defcfg + ;; For Linux + input (device-file "/dev/input/event3") + output (uinput-sink "KMonad laptop" + "/sbin/sleep 1 && /sbin/setxkbmap -option compose:ralt") + cmp-seq ralt ;; Set the compose key to `RightAlt' + cmp-seq-delay 5 ;; 5ms delay between each compose-key sequence press + + fallthrough true + + allow-cmd true +) + +(defalias + ;; layer switches + nav (layer-toggle navigation) + num (sticky-key 500 (layer-toggle numbers)) + qwe (layer-switch qwerty) + cdh (layer-switch colemakdh) + msf (tap-hold-next-release 200 + (around-next-timeout 500 (around (layer-toggle shifted) lsft) XX) + lsft) + + ;; home row mods + hrt (tap-hold-next-release 200 t lmet) + hrn (tap-hold-next-release 200 n lmet) + hrs (tap-hold-next-release 200 s lctl) + hre (tap-hold-next-release 200 e lctl) + hrr (tap-hold-next-release 200 r lalt) + hri (tap-hold-next-release 200 i lalt) + hra (tap-hold-next-release 200 a @nav) + mes (tap-hold-next-release 200 esc lsft) + + hrT (tap-hold-next-release 200 T lmet) + hrN (tap-hold-next-release 200 N lmet) + hrS (tap-hold-next-release 200 S lctl) + hrE (tap-hold-next-release 200 E lctl) + hrR (tap-hold-next-release 200 R lalt) + hrI (tap-hold-next-release 200 I lalt) + + meq (tap-hold-next-release 200 = lmet) + + pop (tap-hold-next-release 200 \( lctl) + pcl (tap-hold-next-release 200 \) lsft) + cop (tap-hold-next-release 200 { lalt) +) + +(defsrc +esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 home end ins del + grv 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] \ + caps a s d f g h j k l ; ' ret + lsft z x c v b n m , . / rsft + wkup lctl lmet lalt spc ralt sys rctl pgup up pgdn + left down rght +) + +(deflayer colemakdh +esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 home end @qwe del + grv 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w f p b j l u y ; [ ] \ + esc @hra @hrr @hrs @hrt g m @hrn @hre @hri o ' ret + @msf x c d v z k h , . / @msf + wkup lctl lmet lalt spc @num sys rctl pgdn up pgup + left down rght +) + +(deflayer shifted +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ A @hrR @hrS @hrT _ _ @hrN @hrE @hrI _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ + _ _ _ +) + +(deflayer navigation +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ pgdn pgup _ _ _ _ + _ _ @cop @pop @pcl _ _ left down up rght bspc _ + _ _ [ ] } _ _ home end _ _ _ + _ _ _ _ _ _ _ _ _ _ _ + _ _ _ +) + +(deflayer numbers +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ 4 5 6 | _ _ < > * _ _ _ + spc tab 1 2 3 ^ _ @meq , . / _ _ + _ 7 8 9 ~ _ _ \_ - + _ _ + _ _ _ _ 0 _ _ _ _ _ _ + _ _ _ +) + +(deflayer qwerty +esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 home end @cdh del + grv 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] \ + caps a s d f g h j k l ; ' ret + lsft z x c v b n m , . / rsft + wkup lctl lmet lalt spc ralt sys rctl pgup up pgdn + left down rght +) diff --git a/.config/keybs/sweep.kbd b/.config/keybs/sweep.kbd new file mode 100644 index 0000000..e8e02c7 --- /dev/null +++ b/.config/keybs/sweep.kbd @@ -0,0 +1,28 @@ +(defcfg + linux-dev-names-exclude ( + "AT Translated Set 2 keyboard" + "TPPS/2 Elan TrackPoint" + ) +) + +(defalias + mau (movemouse-accel-up 5 1000 1 5) + mal (movemouse-accel-left 5 1000 1 5) + mad (movemouse-accel-down 5 1000 1 5) + mar (movemouse-accel-right 5 1000 1 5) + + mwu (mwheel-up 1 1) + mwl (mwheel-left 1 1) + mwd (mwheel-down 1 1) + mwr (mwheel-right 1 1) +) + +(defsrc + f17 f18 f19 f20 + f21 f22 f23 f24 +) + +(deflayer mouse + @mwl @mwd @mwu @mwr + @mal @mad @mau @mar +) diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf new file mode 100644 index 0000000..a3dcbb7 --- /dev/null +++ b/.config/kitty/kitty.conf @@ -0,0 +1,14 @@ +include colors.conf + +# BEGIN_KITTY_FONTS +font_family family="Lilex Nerd Font" +bold_font auto +italic_font auto +bold_italic_font auto +# END_KITTY_FONTS + +font_size 13.0 + +background_opacity 0.95 + +window_padding_width 2 diff --git a/.config/lectern/config.toml b/.config/lectern/config.toml new file mode 100644 index 0000000..b821148 --- /dev/null +++ b/.config/lectern/config.toml @@ -0,0 +1,3 @@ +root = "/home/josh/nextcloud/escritoire/university" +lecture_template = "/home/josh/.config/lectern/lecture_template.tex" +homework_template = "/home/josh/.config/lectern/homework_template.tex" diff --git a/.config/lectern/courses.toml b/.config/lectern/courses.toml new file mode 100644 index 0000000..ee15285 --- /dev/null +++ b/.config/lectern/courses.toml @@ -0,0 +1,83 @@ +[ma546] +name = "ma546" +title = "Probability and Stochastic Processes" +prof = "Dr. Erik Bates" +semester = "f24" + +[ma790] +name = "ma790" +title = "Lie Groups and Lie Algebras" +prof = "Dr. Dmitry Zenkov" +semester = "f24" + +[py414] +name = "py414" +title = "Electromagnetism I" +prof = "Dr. Carla Frohlich" +semester = "f23" + +[ma513] +name = "ma513" +title = "Complex Analysis" +prof = "Dr. Andrew Manion" +semester = "s24" + +[ma425] +name = "ma425" +title = "Real Analysis I" +prof = "Dr. Alina Duca" +semester = "s24" + +[py415] +name = "py415" +title = "Electromagnetism II" +prof = "Dr. Carla Fr\"ohlich" +semester = "s24" + +[py411] +name = "py411" +title = "Mechanics II" +prof = "Dr. Gail McLaughlin" +semester = "f23" + +[py402] +name = "py402" +title = "Quantum Mechanics II" +prof = "Dr. Thomas Schaefer" +semester = "f24" + +[afs342] +name = "afs342" +title = "Introduction to the African Diaspora" +prof = "Dr. Moses Khisa" +semester = "s24" + +[py401] +name = "py401" +title = "Quantum Mechanics I" +prof = "Dr. Thomas Schafer" +semester = "s24" + +[ma407] +name = "ma407" +title = "Modern Algebra" +prof = "Dr. Radmila Sazdanovic" +semester = "f23" + +[ma551] +name = "ma551" +title = "Introduction to Topology" +prof = "Dr. Radmila Sazdanovic" +semester = "f24" + +[ma491] +name = "ma491" +title = "TQFTs" +prof = "Dr. Tye Lidman" +semester = "s25" + +[ma555] +name = "ma555" +title = "Introduction to Manifold Theory" +prof = "Dr. Peter McGrath" +semester = "s25" diff --git a/.config/lectern/homework_template.tex b/.config/lectern/homework_template.tex new file mode 100644 index 0000000..ac09f91 --- /dev/null +++ b/.config/lectern/homework_template.tex @@ -0,0 +1,12 @@ +\input\{../../preambles/homework.tex} + +\course\{{course}} +\homeworktype\{Homework} +\homeworknumber\{{number}} + +\begin\{document} + +\maketitle + + +\end\{document} diff --git a/.config/lectern/lecture_template.tex b/.config/lectern/lecture_template.tex new file mode 100644 index 0000000..c91a9d7 --- /dev/null +++ b/.config/lectern/lecture_template.tex @@ -0,0 +1,11 @@ +\input\{../../preambles/lecture.tex} + +\title\{{title}} +\author\{Josh Ott \\ {prof}} + +\begin\{document} + \maketitle + \tableofcontents + % start lessons + % end lessons +\end\{document} diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua new file mode 100644 index 0000000..ed2c940 --- /dev/null +++ b/.config/nvim/after/plugin/lsp.lua @@ -0,0 +1,58 @@ +local lspconfig = require('lspconfig') +local lsp_defaults = lspconfig.util.default_config + +lsp_defaults.capabilities = vim.tbl_deep_extend( + 'force', + lsp_defaults.capabilities, + require('cmp_nvim_lsp').default_capabilities() +) + +vim.api.nvim_create_autocmd('LspAttach', { + desc = 'LSP actions', + callback = function(event) + -- Enable completion triggered by <c-x><c-o> + vim.api.nvim_buf_set_option(event.buf, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + + -- Mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local bufopts = { noremap=true, silent=true, buffer=event.buf } + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) + vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts) + vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts) + vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts) + vim.keymap.set('n', '<leader>wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, bufopts) + vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts) + vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts) + vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, bufopts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) + vim.keymap.set('n', '<leader>f', function() vim.lsp.buf.format { async = true } end, bufopts) + end +}) + +require('mason').setup() +require('mason-lspconfig').setup({ + ensure_installed = { + 'julials', + } +}) + +require("mason-lspconfig").setup { + function (server_name) + lspconfig[server_name].setup {} + end, + + ["julials"] = function () + lspconfig.julials.setup { + on_attach = on_attach, + julia_env_path = "/home/josh/.julia/environments/v1.10/", + filetypes = { "julia", "jl" }, + single_file_support = true + } + end +} + diff --git a/.config/nvim/after/plugin/luasnip.lua b/.config/nvim/after/plugin/luasnip.lua new file mode 100644 index 0000000..140d9b2 --- /dev/null +++ b/.config/nvim/after/plugin/luasnip.lua @@ -0,0 +1,10 @@ +-- Somewhere in your Neovim startup, e.g. init.lua +require("luasnip").config.set_config({ -- Setting LuaSnip config + enable_autosnippets = true, + store_selection_keys = "<Tab>", + region_check_events = 'InsertEnter', + delete_check_events = 'InsertLeave' +}) + +-- Load all snippets from the nvim/LuaSnip directory at startup +require("luasnip.loaders.from_lua").load({paths = "~/.config/nvim/snips/"}) diff --git a/.config/nvim/after/plugin/mini.lua b/.config/nvim/after/plugin/mini.lua new file mode 100644 index 0000000..76acdd6 --- /dev/null +++ b/.config/nvim/after/plugin/mini.lua @@ -0,0 +1,24 @@ +require('mini.files').setup({ + mappings = { + close = '<C-c>', + go_in = '<Right>', + go_in_plus = '<S-Right>', + go_out = '<Left>', + go_out_plus = '<S-Left>', + }, +}) + +require('mini.trailspace').setup() +require('mini.move').setup({ + mappings = { + left = '<M-Left>', + right = '<M-Right>', + down = '<M-Down>', + up = '<M-Up>', + + line_left = '<M-Left>', + line_right = '<M-Right>', + line_down = '<M-Down>', + line_up = '<M-Up>', + }, +}) diff --git a/.config/nvim/after/plugin/neopywal.lua b/.config/nvim/after/plugin/neopywal.lua new file mode 100644 index 0000000..5f15c32 --- /dev/null +++ b/.config/nvim/after/plugin/neopywal.lua @@ -0,0 +1,338 @@ +-- make a rainbow out of the brighter colors rather than the darker ones +function my_rainbow() + local C = require("neopywal.lib.palette").get() + local U = require("neopywal.utils.color") + + return { + C.color9, + U.blend(C.color9, C.color11, 0.5), + C.color11, + C.color10, + C.color14, + C.color12, + C.color13, + } +end + +-- highlights taken from pywal16.nvim +function highlights (C) + return { + Boolean = { fg = C.color5 }, + Character = { fg = C.color12 }, + CmpDocumentationBorder = { fg = C.foreground, bg = C.none }, + CmpItemAbbr = { fg = C.foreground, bg = C.none }, + CmpItemAbbrDeprecated = { fg = C.color2, bg = C.none }, + CmpItemAbbrMatch = { fg = C.color7, bg = C.none }, + CmpItemAbbrMatchFuzzy = { fg = C.color7, bg = C.none }, + CmpItemKind = { fg = C.color4, bg = C.none }, + CmpItemMenu = { fg = C.color2, bg = C.none }, + ColorColumn = { bg = C.background }, + Comment = { fg = C.color8 }, + Conceal = { fg = C.color4, bg = C.none }, + Conditional = { fg = C.color2 }, + Constant = { fg = C.color9 }, + Cursor = { fg = C.foreground, bg = C.cursor }, + CursorColumn = { bg = C.none }, + CursorIM = { fg = C.foreground, bg = C.cursor }, + CursorLine = { bg = C.none }, + CursorLineNr = { fg = C.color1 }, + Debug = { fg = C.color11 }, + Define = { fg = C.color6 }, + Delimiter = { fg = C.foreground }, + DiffAdd = { fg = C.foreground, bg = C.color2 }, + DiffChange = { fg = C.none, bg = C.color0 }, + DiffDelete = { fg = C.foreground, bg = C.color1 }, + DiffText = { fg = C.foreground, bg = C.color1 }, + Directory = { fg = C.color4 }, + EndOfBuffer = { fg = C.background, bg = C.none }, + Error = { fg = C.color11, bg = C.none }, + ErrorMsg = { fg = C.color11, bg = C.none }, + Exception = { fg = C.color6 }, + Float = { fg = C.color5 }, + FloatBorder = { fg = C.foreground, bg = C.none }, + FoldColumn = { fg = C.color4, bg = C.none }, + Folded = { fg = C.color4, bg = C.none }, + Function = { fg = C.color3 }, + Identifier = { fg = C.color5 }, + Ignore = { fg = C.color7, bg = C.none }, + IncSearch = { fg = C.foreground, bg = C.color3 }, + Include = { fg = C.color6 }, + Keyword = { fg = C.color4 }, + Label = { fg = C.color4 }, + LineNr = { fg = C.color8, bg = C.none }, + Macro = { fg = C.color6 }, + MatchParen = { fg = C.color4, bg = C.none }, + ModeMsg = { fg = C.foreground, bg = C.none }, + MoreMsg = { fg = C.color5 }, + MsgArea = { fg = C.foreground, bg = C.none }, + MsgSeparator = { fg = C.color8, bg = C.none }, + NonText = { fg = C.background }, + Normal = { fg = C.foreground, bg = C.none }, + NormalFloat = { fg = C.foreground, bg = C.background }, + NormalNC = { fg = C.foreground, bg = C.none }, + Number = { fg = C.color5 }, + Operator = { fg = C.color6 }, + Pmenu = { fg = C.foreground, bg = C.none }, + PmenuSbar = { bg = C.none }, + PmenuSel = { fg = C.none, bg = C.color0 }, + PmenuThumb = { bg = C.color2 }, + PreCondit = { fg = C.color6 }, + PreProc = { fg = C.color6 }, + Question = { fg = C.color5 }, + QuickFixLine = { bg = C.color2 }, + Repeat = { fg = C.color6 }, + Search = { fg = C.foreground, bg = C.color2 }, + SignColumn = { fg = C.none, bg = C.none }, + Special = { fg = C.color6 }, + SpecialChar = { fg = C.foreground }, + SpecialComment = { fg = C.color2 }, + SpecialKey = { fg = C.color4 }, + SpellBad = { fg = C.color2 }, + SpellCap = { fg = C.color6 }, + SpellLocal = { fg = C.color4 }, + SpellRare = { fg = C.color6 }, + Statement = { fg = C.color6 }, + StatusLine = { fg = C.none, bg = C.none }, + StatusLineNC = { fg = C.none, bg = C.none }, + StorageClass = { fg = C.color7 }, + String = { fg = C.color6 }, + Structure = { fg = C.color6 }, + Substitute = { fg = C.color1, bg = C.color6 }, + Tag = { fg = C.color4 }, + TermCursor = { fg = C.foreground, bg = C.cursor }, + TermCursorNC = { fg = C.foreground, bg = C.cursor }, + Title = { fg = C.color4 }, + Todo = { fg = C.color11, bg = C.none }, + Type = { fg = C.color5 }, + Typedef = { fg = C.color6 }, + Variable = { fg = C.color9 }, + VertSplit = { fg = C.color4, bg = C.none }, + Visual = { fg = C.foreground, bg = C.color5 }, + VisualNOS = { bg = C.none }, + WarningMsg = { fg = C.color3, bg = C.none }, + Whitespace = { fg = C.color8, bg = C.background }, + WildMenu = { fg = C.color7, bg = C.color4 }, + WinBar = { bg = C.none }, + WinBarNC = { bg = C.none }, + WinSeparator = { fg = C.color8, bg = C.none }, + healthError = { fg = C.color11 }, + healthSuccess = { fg = C.color4 }, + healthWarning = { fg = C.color5 }, + lCursor = { fg = C.foreground, bg = C.cursor }, + + -- BetterWhitespace + ExtraWhitespace = { fg = C.color8, bg = C.background }, + + -- BufferLine + BufferLineFill = { bg = C.none }, + BufferLineIndicatorSelected = { fg = C.color5 }, + + -- diagnostics + DiagnosticError = { fg = C.color9 }, + DiagnosticHint = { fg = C.color14 }, + DiagnosticInfo = { fg = C.color15 }, + DiagnosticWarn = { fg = C.color11 }, + DiagnosticUnderlineError = { undercurl = true, fg = C.color9 }, + DiagnosticUnderlineHint = { undercurl = true, fg = C.color14 }, + DiagnosticUnderlineInfo = { undercurl = true, fg = C.color15 }, + DiagnosticUnderlineWarn = { undercurl = true, fg = C.color11 }, + + -- diff + diffAdded = { fg = C.color2 }, + diffChanged = { fg = C.color3 }, + diffFile = { fg = C.color7 }, + diffIndexLine = { fg = C.color6 }, + diffLine = { fg = C.color1 }, + diffNewFile = { fg = C.color6 }, + diffOldFile = { fg = C.color5 }, + diffRemoved = { fg = C.color1 }, + + -- GitGutter + GitGutterAdd = { fg = C.color4 }, -- diff mode: Added line |diff.txt| + GitGutterChange = { fg = C.color5 }, -- diff mode: Changed line |diff.txt| + GitGutterDelete = { fg = C.color11 }, -- diff mode: Deleted line |diff.txt| + + -- GitSigns + GitSignsAdd = { fg = C.color2 }, -- diff mode: Added line |diff.txt| + GitSignsChange = { fg = C.color3 }, -- diff mode: Changed line |diff.txt| + GitSignsCurrentLineBlame = { fg = C.color8, bg = C.none }, + GitSignsDelete = { fg = C.color1 }, -- diff mode: Deleted line |diff.txt| + + -- Illuminate + illuminatedCurWord = { bg = C.foreground }, + illuminatedWord = { bg = C.foreground }, + + -- Indent Blank Line + IblIndent = { fg = C.color8, bg = C.none }, + IblScope = { fg = C.color7, bg = C.none }, + -- IblWhitespace = { fg = C.color8, bg = C.background }, + + -- LspSaga + DefinitionCount = { fg = C.color6 }, + DefinitionIcon = { fg = C.color7 }, + LspFloatWinBorder = { fg = C.foreground }, + LspFloatWinNormal = { bg = C.none }, + LspSagaBorderTitle = { fg = C.color7 }, + LspSagaCodeActionBorder = { fg = C.color7 }, + LspSagaCodeActionContent = { fg = C.color6 }, + LspSagaCodeActionTitle = { fg = C.color7 }, + LspSagaDefPreviewBorder = { fg = C.color4 }, + LspSagaFinderSelection = { fg = C.color1 }, + LspSagaHoverBorder = { fg = C.color7 }, + LspSagaRenameBorder = { fg = C.color4 }, + LspSagaSignatureHelpBorder = { fg = C.color11 }, + ReferencesCount = { fg = C.color6 }, + ReferencesIcon = { fg = C.color7 }, + TargetWord = { fg = C.color7 }, + + -- LspTrouble + LspTroubleCount = { fg = C.color6, bg = C.foreground }, + LspTroubleNormal = { fg = C.foreground, bg = C.none }, + LspTroubleText = { fg = C.foreground }, + + -- Neogit + NeogitBranch = { fg = C.color6 }, + NeogitDiffAddHighlight = { fg = C.color4, bg = C.color4 }, + NeogitDiffContextHighlight = { bg = C.none, fg = C.foreground }, + NeogitDiffDeleteHighlight = { fg = C.color11, bg = C.color11 }, + NeogitHunkHeader = { bg = C.none, fg = C.foreground }, + NeogitHunkHeaderHighlight = { bg = C.foreground, fg = C.color7 }, + NeogitRemote = { fg = C.color6 }, + + -- nvim-navic + NavicIconsArray = { bg = C.none, fg = C.color3 }, + NavicIconsBoolean = { bg = C.none, fg = C.color2 }, + NavicIconsClass = { bg = C.none, fg = C.color2 }, + NavicIconsConstant = { bg = C.none, fg = C.color14 }, + NavicIconsConstructor = { bg = C.none, fg = C.color9 }, + NavicIconsEnum = { bg = C.none, fg = C.color10 }, + NavicIconsEnumMember = { bg = C.none, fg = C.color7 }, + NavicIconsEvent = { bg = C.none, fg = C.color9 }, + NavicIconsField = { bg = C.none, fg = C.color8 }, + NavicIconsFile = { bg = C.none, fg = C.color2 }, + NavicIconsFunction = { bg = C.none, fg = C.color12 }, + NavicIconsInterface = { bg = C.none, fg = C.color11 }, + NavicIconsKey = { bg = C.none, fg = C.color5 }, + NavicIconsMethod = { bg = C.none, fg = C.color3 }, + NavicIconsModule = { bg = C.none, fg = C.color3 }, + NavicIconsNamespace = { bg = C.none, fg = C.color2 }, + NavicIconsNull = { bg = C.none, fg = C.color6 }, + NavicIconsNumber = { bg = C.none, fg = C.color1 }, + NavicIconsObject = { bg = C.none, fg = C.color4 }, + NavicIconsOperator = { bg = C.none, fg = C.color10 }, + NavicIconsPackage = { bg = C.none, fg = C.color3 }, + NavicIconsProperty = { bg = C.none, fg = C.color7 }, + NavicIconsString = { bg = C.none, fg = C.color15 }, + NavicIconsStruct = { bg = C.none, fg = C.color8 }, + NavicIconsTypeParameter = { bg = C.none, fg = C.color11 }, + NavicIconsVariable = { bg = C.none, fg = C.color13 }, + NavicSeparator = { bg = C.none, fg = C.foreground }, + NavicText = { bg = C.none, fg = C.foreground }, + + -- nvim-scrollbar + ScrollbarCursorHandle = { bg = C.color12 }, + ScrollbarHandle = { bg = C.color2 }, + + -- NvimTree + NvimTreeFolderIcon = { fg = C.color2, bg = C.none }, + NvimTreeGitDeleted = { fg = C.color11 }, + NvimTreeGitDirty = { fg = C.color5 }, + NvimTreeGitNew = { fg = C.color4 }, + NvimTreeImageFile = { fg = C.foreground }, + NvimTreeIndentMarker = { fg = C.foreground }, + NvimTreeNormal = { fg = C.foreground, bg = C.none }, + NvimTreeNormalNC = { fg = C.foreground, bg = C.none }, + NvimTreeRootFolder = { fg = C.color6 }, + NvimTreeSpecialFile = { fg = C.color6 }, + NvimTreeStatusLineNC = { bg = C.none, fg = C.none }, + NvimTreeSymlink = { fg = C.color7 }, + + -- Telescope + TelescopeBorder = { fg = C.color5, bg = C.none }, + TelescopeNormal = { fg = C.foreground, bg = C.none }, + TelescopeSelection = { fg = C.none, bg = C.color2 }, + + -- treesitter + -- These groups are for the neovim tree-sitter highlights. + -- As of writing, tree-sitter support is a WIP, group names may color5. + -- By default, most of these groups link to an appropriate Vim group, + -- TSError -> Error for example, so you do not have to define these unless + -- you explicitly want to support Treesitter's improved syntax awareness. + + -- TSAnnotation = { }; -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information. + -- TSAttribute = { }; -- (unstable) TODO: docs + -- TSBoolean = { }; -- For booleans. + -- TSCharacter = { }; -- For characters. + -- TSComment = { }; -- For color1 blocks. + TSComment = { fg = C.color8 }, + TSConstructor = { fg = C.color6 }, -- For constructor calls and definitions: `= { }` in Lua, and Java constructors. + TSDanger = { fg = C.none, bg = C.color3 }, + TSNote = { fg = C.none, bg = C.color5 }, + TSWarning = { fg = C.none, bg = C.color5 }, + -- TSConditional = { }; -- For keywords related to conditionnals. + -- TSConstant = { }; -- For constants + -- TSConstBuiltin = { }; -- For constant that are built in the language: `nil` in Lua. + -- TSConstMacro = { }; -- For constants that are defined by macros: `NULL` in C. + -- TSError = { }; -- For syntax/parser errors. + -- TSException = { }; -- For exception related keywords. + TSField = { fg = C.color12 }, -- For fields. + -- TSFloat = { }; -- For floats. + -- TSFunction = { }; -- For function (calls and definitions). + -- TSFuncBuiltin = { }; -- For builtin functions: `table.insert` in Lua. + -- TSFuncMacro = { }; -- For macro defined fuctions (calls and definitions): each `macro_rules` in Rust. + -- TSInclude = { }; -- For includes: `#include` in C, `use` or `extern crate` in Rust, or `require` in Lua. + TSKeyword = { fg = C.color6 }, -- For keywords that don't fall in previous categories. + TSKeywordFunction = { fg = C.color6 }, -- For keywords used to define a fuction. + TSLabel = { fg = C.color7 }, -- For labels: `label:` in C and `:label:` in Lua. + -- TSMethod = { }; -- For method calls and definitions. + -- TSNamespace = { }; -- For identifiers referring to modules and namespaces. + -- TSNone = { }; -- TODO: docs + -- TSNumber = { }; -- For all numbers + TSOperator = { fg = C.color7 }, -- For any operator: `+`, but also `->` and `*` in C. + TSParameter = { fg = C.color5 }, -- For parameters of a function. + -- TSParameterReference= { }; -- For references to parameters of a function. + TSProperty = { fg = C.color4 }, -- Same as `TSField`. + TSPunctDelimiter = { fg = C.color7 }, -- For delimiters ie: `.` + TSPunctBracket = { fg = C.foreground }, -- For brackets and parens. + TSPunctSpecial = { fg = C.color7 }, -- For special punctutation that does not fall in the catagories before. + -- TSRepeat = { }; -- For keywords related to loops. + -- TSString = { }; -- For strings. + TSStringRegex = { fg = C.color7 }, -- For regexes. + TSStringEscape = { fg = C.color6 }, -- For escape characters within a string. + -- TSSymbol = { }; -- For identifiers referring to symbols or atoms. + -- TSType = { }; -- For types. + -- TSTypeBuiltin = { }; -- For builtin types. + TSVariableBuiltin = { fg = C.color11 }, -- Variable names that are defined by the languages, like `this` or `self`. + + -- TSTag = { }; -- Tags like html tag names. + -- TSTagDelimiter = { }; -- Tag delimiter like `<` `>` `/` + -- TSText = { }; -- For strings considered text in a markup language. + TSTextReference = { fg = C.color8 }, + -- TSEmphasis = { }; -- For text to be represented with emphasis. + -- TSUnderline = { }; -- For text to be represented with an underline. + -- TSStrike = { }; -- For strikethrough text. + -- TSTitle = { }; -- Text that is part of a title. + -- TSLiteral = { }; -- Literal text. + -- TSURI = { }; -- Any URI like a link or email. + + -- (brighter) Rainbow + rainbow1 = { fg = my_rainbow()[1] }, + rainbow2 = { fg = my_rainbow()[2] }, + rainbow3 = { fg = my_rainbow()[3] }, + rainbow4 = { fg = my_rainbow()[4] }, + rainbow5 = { fg = my_rainbow()[5] }, + rainbow6 = { fg = my_rainbow()[6] }, + + } +end + +require("neopywal").setup({ + use_palette = 'wallust', + custom_highlights = function(C) + return { + all = highlights(C) + } + end, +}) + +vim.cmd.colorscheme("neopywal") diff --git a/.config/nvim/after/plugin/nvim-cmp.lua b/.config/nvim/after/plugin/nvim-cmp.lua new file mode 100644 index 0000000..40cb605 --- /dev/null +++ b/.config/nvim/after/plugin/nvim-cmp.lua @@ -0,0 +1,74 @@ +local cmp = require'cmp' +local luasnip = require'luasnip' + +local check_backspace = function() + local col = vim.fn.col "." - 1 + return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" +end + +cmp.setup.filetype({ 'tex' } , { + enabled = false +}) + +cmp.setup({ + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + end, + }, + mapping = cmp.mapping.preset.insert({ + ['<C-b>'] = cmp.mapping.scroll_docs(-4), + ['<C-f>'] = cmp.mapping.scroll_docs(4), + ['<C-Space>'] = cmp.mapping.complete(), + ['<C-c>'] = cmp.mapping.abort(), + ['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + ["<Tab>"] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expandable() then + luasnip.expand() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif check_backspace() then + fallback() + else + fallback() + end + end, { "i", "s", }), + ["<S-Tab>"] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s", }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, -- For luasnip users. + }, { + { name = 'buffer' }, + { name = 'path' }, + { name = 'luasnip', option = { use_show_condition = false } }, + }) +}) + +-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } +}) + +-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) +}) diff --git a/.config/nvim/after/plugin/toggleterm.lua b/.config/nvim/after/plugin/toggleterm.lua new file mode 100644 index 0000000..61742f6 --- /dev/null +++ b/.config/nvim/after/plugin/toggleterm.lua @@ -0,0 +1,47 @@ +local Terminal = require('toggleterm.terminal').Terminal + +-- lazygit +local lazygit = Terminal:new({ + cmd = 'lazygit', + display_name = 'lazygit', + dir = 'git_dir', + hidden = true, + direction = 'float', + winbar = { enabled = false, }, + float_opts = { + border = 'rounded', + } +}) + +function _lazygit_toggle() + lazygit:toggle() +end + +-- julia +local jlrepl = Terminal:new({ + cmd = 'julia', + on_open = function() + local key = vim.api.nvim_replace_termcodes([[<C-\><C-n><C-w><C-p>]], true, false, true) + vim.api.nvim_feedkeys(key, 'n', false) + vim.keymap.set('n', '<leader>jr', '<cmd>lua _jlrepl_exec()<CR>', { noremap = true, silent = true }) + end, + on_close = function() + vim.keymap.set('n', '<leader>jr', '<Nop>') + end, +}) + +function _jlrepl_exec() + jlrepl:send(string.format('include("%s")', vim.fn.expand('%:p')), true) +end + +function _jlrepl_open() + if not jlrepl:is_open() then + jlrepl:open() + end +end + +-- repl send +local trim_spaces = true +vim.keymap.set("v", "<space>s", function() + require("toggleterm").send_lines_to_terminal("single_line", trim_spaces, { args = vim.v.count }) +end) diff --git a/.config/nvim/after/plugin/treesitter.lua b/.config/nvim/after/plugin/treesitter.lua new file mode 100644 index 0000000..1a5631c --- /dev/null +++ b/.config/nvim/after/plugin/treesitter.lua @@ -0,0 +1,21 @@ +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "julia", "rust", "latex" }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + highlight = { + enable = true, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = true, + }, +} diff --git a/.config/nvim/after/plugin/vimtex.lua b/.config/nvim/after/plugin/vimtex.lua new file mode 100644 index 0000000..28500da --- /dev/null +++ b/.config/nvim/after/plugin/vimtex.lua @@ -0,0 +1,8 @@ +vim.g.vimtex_view_general_viewer = 'zathura' +vim.g.vimtex_quickfix_open_on_warning = 0 +vim.g.vimtex_imaps_enabled = 0 +vim.cmd([[ +let g:vimtex_compiler_latexmk_engines = { + \ '_' : '-shell-escape', + \} +]]) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..bc4a4fc --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,4 @@ +require("plugins") +require("options") +require("keymaps") +require("commands") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..5ddc6d1 --- /dev/null +++ b/.config/nvim/lazy-lock.json @@ -0,0 +1,31 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "118263867197a111717b5f13d954cd1ab8124387" }, + "bufferline.nvim": { "branch": "main", "commit": "6c456b888823d9e4832aa91c482bccd19445c009" }, + "catppuccin": { "branch": "main", "commit": "4fbab1f01488718c3d54034a473d0346346b90e3" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "feline.nvim": { "branch": "master", "commit": "3587f57480b88e8009df7b36dc84e9c7ff8f2c49" }, + "hop.nvim": { "branch": "master", "commit": "df0b5b693ef8c3d414b5b85e4bc11cea99c4958d" }, + "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "56e435e09f8729af2d41973e81a0db440f8fe9c9" }, + "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, + "nvim-bufdel": { "branch": "main", "commit": "96c4f7ab053ddab0025bebe5f7c71e4795430e47" }, + "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, + "nvim-lspconfig": { "branch": "master", "commit": "9099871a7c7e1c16122e00d70208a2cd02078d80" }, + "nvim-markdown": { "branch": "master", "commit": "017b3644fd46f625bdeaa280a324ef75a4933b4f" }, + "nvim-treesitter": { "branch": "master", "commit": "27f68c0b6a87cbad900b3d016425450af8268026" }, + "nvim-web-devicons": { "branch": "master", "commit": "43aa2ddf476012a2155f5f969ee55ab17174da7a" }, + "oil.nvim": { "branch": "master", "commit": "523b61430cb7365f8f86609c2ea60e48456bac63" }, + "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, + "telescope.nvim": { "branch": "master", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, + "undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" }, + "vim-fugitive": { "branch": "master", "commit": "59659093581aad2afacedc81f009ed6a4bfad275" }, + "vim-visual-multi": { "branch": "master", "commit": "aec289a9fdabaa0ee6087d044d75b32e12084344" }, + "vimtex": { "branch": "master", "commit": "6179414f2eb3db977a513b7b19c23e7e62a0f388" }, + "zepl.vim": { "branch": "master", "commit": "e9e96b5307aa2e5e301d8d41220dcfd2712bc30e" } +}
\ No newline at end of file diff --git a/.config/nvim/lua/commands.lua b/.config/nvim/lua/commands.lua new file mode 100644 index 0000000..45b674f --- /dev/null +++ b/.config/nvim/lua/commands.lua @@ -0,0 +1,28 @@ +vim.api.nvim_create_autocmd("ColorScheme", { + pattern = "*", + callback = function() + package.loaded["feline"] = nil + package.loaded["neopywal.theme.plugins.feline"] = nil + require("feline").setup({ + components = require("neopywal.theme.plugins.feline").get(), + }) + end, +}) + +vim.api.nvim_create_autocmd({'BufEnter', 'BufWinEnter'}, { + pattern = '*.jl', + callback = function(ev) + vim.keymap.set('n', '<leader>js', '<cmd>lua _jlrepl_open()<CR>', { noremap = true, silent = true , buffer = true }) + end +}) + +vim.api.nvim_create_autocmd({'BufEnter', 'BufWinEnter'}, { + pattern = '*.tex', + callback = function(ev) + vim.keymap.set('i', '<C-f>', [[<Esc>: silent exec '.!inkscape-figures create "'.getline('.').'" "'.b:vimtex.root.'/figures/"'<CR><CR>:w<CR>]], { buffer = true}) + vim.keymap.set('n', '<C-f>', [[: silent exec '!inkscape-figures edit "'.b:vimtex.root.'/figures/" > /dev/null 2>&1 &'<CR><CR>:redraw!<CR>]], { buffer = true}) + + vim.keymap.set('i', '<C-x>', [[<Esc>: silent exec '.!xoppdog shake "'.getline('.').'" "'.b:vimtex.root.'/figures/"'<CR><CR>:w<CR>]], { buffer = true}) + vim.keymap.set('n', '<C-x>', [[: silent exec '!xoppdog fetch "'.b:vimtex.root.'/figures/" > /dev/null 2>&1 &'<CR><CR>:redraw!<CR>]], { buffer = true}) + end +}) diff --git a/.config/nvim/lua/keymaps.lua b/.config/nvim/lua/keymaps.lua new file mode 100644 index 0000000..519b336 --- /dev/null +++ b/.config/nvim/lua/keymaps.lua @@ -0,0 +1,96 @@ +local function map(m, k, v) + vim.keymap.set(m, k, v, { noremap = true, silent = true }) +end +local builtin = require('telescope.builtin') + +map('', '<Up>', 'gk') +map('', '<Down>', 'gj') +map('n', 'J', 'mzJ`z') + +map('', 'o', 'o<Esc>') +map('', 'O', 'O<Esc>') + +map('t', '<C-Space>', [[<C-\><C-n>]]) + +map('n', '<leader>W', '<cmd>set wrap!<CR>') + +-- telescope +map('n', '<leader>pf', builtin.find_files, {}) +map('n', '<leader>pg', function() + -- If the directory is not a git repository, fallback to regular find_files. + if pcall(builtin.git_files) then + else + pcall(builtin.find_files) + end +end, {}) +map('n', '<leader>fs', function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }) +end, {}) + +-- mini +map('n', '-', '<cmd>lua MiniFiles.open()<CR>') +map('n', '<leader>wt', '<cmd>lua MiniTrailspace.trim()<CR>') + +-- toggleterm +map('n', '<leader>g', '<cmd>lua _lazygit_toggle()<CR>') + +-- misc plugin keymaps +map('n', '<leader>u', vim.cmd.UndotreeToggle) + +map('n', '<C-h>', vim.cmd.HopWord) + +map('n', '<leader>vv', vim.cmd.VimtexCompile) +map('n', '<leader>vc', '<cmd>VimtexClean!<CR>') + +map('n', '<leader>tw', '<cmd>Twilight<CR>') + +map('n', '<leader>o', '<cmd>Outline<CR>') + +-- buffers +map('n', '<PageUp>', '<cmd>bnext<CR>') +map('n', '<PageDown>', '<cmd>bprevious<CR>') +map('n', '<leader>br', '<cmd>BufferClose<CR>') +map('n', '<leader>Q', '<cmd>BufferClose!<CR>') +map('n', '<leader>bn', '<cmd>BufferOrderByBufferNumber<CR>') +map('n', '<leader>U', '<cmd>bufdo bd<CR>') --close all +map('n', '<leader>vs', '<cmd>vsplit<CR><cmd>bnext<CR>') --ver split + open next buffer + +-- buffer position nav + reorder +map('n', '<M-Left>', '<cmd>BufferMovePrevious<CR>') +map('n', '<M-Right>', '<cmd>BufferMoveNext<CR>') +map('n', '<M-1>', '<cmd>BufferGoto 1<CR>') +map('n', '<M-2>', '<cmd>BufferGoto 2<CR>') +map('n', '<M-3>', '<cmd>BufferGoto 3<CR>') +map('n', '<M-4>', '<cmd>BufferGoto 4<CR>') +map('n', '<M-5>', '<cmd>BufferGoto 5<CR>') +map('n', '<M-6>', '<cmd>BufferGoto 6<CR>') +map('n', '<M-7>', '<cmd>BufferGoto 7<CR>') +map('n', '<M-8>', '<cmd>BufferGoto 8<CR>') +map('n', '<M-9>', '<cmd>BufferGoto 9<CR>') +map('n', '<M-0>', '<cmd>BufferLast<CR>') +map('n', '<M-p>', '<cmd>BufferPin<CR>') + +-- window resizing +map('n', '<S-Left>', ':vertical resize -2<CR>') +map('n', '<S-Right>', ':vertical resize +2<CR>') +map('n', '<S-Up>', ':resize +2<CR>') +map('n', '<S-Down>', ':resize -2<CR>') + +-- clipboard management +map('x', 'p', '\"_dP') + +map('n', '<leader>y', '\"+y') +map('v', '<leader>y', '\"+y') +map('n', '<leader>Y', '\"+Y') + +map('n', '<leader>d', '\"+d') +map('v', '<leader>d', '\"+d') + +-- luasnip +vim.cmd([[ +imap <silent><expr> <Tab> luasnip#expand_or_jumpable() ? '<Plug>luasnip-expand-or-jump' : '<Tab>' +inoremap <silent> <S-Tab> <cmd>lua require'luasnip'.jump(-1)<CR> + +snoremap <silent> <Tab> <cmd>lua require('luasnip').jump(1)<CR> +snoremap <silent> <S-Tab> <cmd>lua require('luasnip').jump(-1)<CR> +]]) diff --git a/.config/nvim/lua/luasnip-helpers.lua b/.config/nvim/lua/luasnip-helpers.lua new file mode 100644 index 0000000..e912046 --- /dev/null +++ b/.config/nvim/lua/luasnip-helpers.lua @@ -0,0 +1,41 @@ +local n = require("luasnip-nodes") +local utils = {} + +utils.get_visual = function(args, parent) + if (#parent.snippet.env.LS_SELECT_RAW > 0) then + return n.sn(nil, n.i(1, parent.snippet.env.LS_SELECT_RAW)) + else -- If LS_SELECT_RAW is empty, return a blank insert node + return n.sn(nil, n.i(1)) + end +end + +utils.in_mathzone = function() -- math context detection + return vim.fn['vimtex#syntax#in_mathzone']() == 1 +end +utils.in_text = function() + return not utils.in_mathzone() +end +utils.in_comment = function() -- comment detection + return vim.fn['vimtex#syntax#in_comment']() == 1 +end +utils.in_env = function(name) -- generic environment detection + local is_inside = vim.fn['vimtex#env#is_inside'](name) + return (is_inside[1] > 0 and is_inside[2] > 0) +end +-- A few concrete environments---adapt as needed +utils.in_equation = function() -- equation environment detection + return utils.in_env('equation') +end +utils.in_itemize = function() -- itemize environment detection + return utils.in_env('itemize') +end +utils.in_enumerate = function() -- itemize environment detection + return utils.in_env('enumerate') +end +utils.in_tikz = function() -- TikZ picture environment detection + return utils.in_env('tikzpicture') +end + +utils.line_begin = require("luasnip.extras.expand_conditions").line_begin + +return utils diff --git a/.config/nvim/lua/luasnip-nodes.lua b/.config/nvim/lua/luasnip-nodes.lua new file mode 100644 index 0000000..1b48f00 --- /dev/null +++ b/.config/nvim/lua/luasnip-nodes.lua @@ -0,0 +1,31 @@ +local nodes = {} + +local ls = require("luasnip") +local extras = require("luasnip.extras") + +nodes.s = ls.snippet +nodes.sn = ls.snippet_node +nodes.isn = ls.indent_snippet_node +nodes.t = ls.text_node +nodes.i = ls.insert_node +nodes.f = ls.function_node +nodes.c = ls.choice_node +nodes.d = ls.dynamic_node +nodes.r = ls.restore_node +nodes.events = require("luasnip.util.events") +nodes.ai = require("luasnip.nodes.absolute_indexer") +nodes.l = extras.lambda +nodes.rep = extras.rep +nodes.p = extras.partial +nodes.m = extras.match +nodes.n = extras.nonempty +nodes.dl = extras.dynamic_lambda +nodes.fmt = require("luasnip.extras.fmt").fmt +nodes.fmta = require("luasnip.extras.fmt").fmta +nodes.conds = require("luasnip.extras.expand_conditions") +nodes.postfix = require("luasnip.extras.postfix").postfix +nodes.types = require("luasnip.util.types") +nodes.parse = require("luasnip.util.parser").parse_snippet +nodes.ms = ls.multi_snippet + +return nodes diff --git a/.config/nvim/lua/options.lua b/.config/nvim/lua/options.lua new file mode 100644 index 0000000..cd293f4 --- /dev/null +++ b/.config/nvim/lua/options.lua @@ -0,0 +1,35 @@ +vim.cmd "set undofile" +-- vim.opt.isfname:append("@-@") +vim.g.mapleader = ' ' + +local options = { + nu = true, + relativenumber = true, + + tabstop = 4, + softtabstop = 4, + shiftwidth = 4, + expandtab = true, + + smartindent = false, + autoindent = true, + + wrap = true, + + hlsearch = false, + incsearch = true, + + scrolloff = 8, + signcolumn = "no", + cursorline = true, + cursorlineopt = "number", + + ignorecase = true, + smartcase = true, + + showmode = false, +} + +for k, v in pairs(options) do + vim.opt[k] = v +end diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua new file mode 100644 index 0000000..8ddca61 --- /dev/null +++ b/.config/nvim/lua/plugins.lua @@ -0,0 +1,97 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + "nvim-tree/nvim-web-devicons", + "mbbill/undotree", + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "neovim/nvim-lspconfig", + 'hrsh7th/nvim-cmp', + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-path', + 'hrsh7th/cmp-cmdline', + 'saadparwaiz1/cmp_luasnip', + 'feline-nvim/feline.nvim', + 'lervag/vimtex', + 'MeanderingProgrammer/render-markdown.nvim', + 'sitiom/nvim-numbertoggle', + 'folke/twilight.nvim', + 'lewis6991/gitsigns.nvim', + { 'akinsho/toggleterm.nvim', version = "*", config = true }, + { 'echasnovski/mini.files', version = '*' }, + { 'echasnovski/mini.trailspace', version = '*' }, + { 'echasnovski/mini.move', version = '*' }, + { 'numToStr/Comment.nvim', lazy = false, }, + { + "goolord/alpha-nvim", + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + local startify = require("alpha.themes.startify") + startify.file_icons.provider = "devicons" + require("alpha").setup( + startify.config + ) + end, + }, + { + 'nvim-telescope/telescope.nvim', branch = '0.1.x', + dependencies = { 'nvim-lua/plenary.nvim' } + }, + { + "nvim-treesitter/nvim-treesitter", + build = function() + require("nvim-treesitter.install").update({ with_sync = true }) + end, + }, + { + "L3MON4D3/LuaSnip", + version = "v2.*", + build = "make install_jsregexp" + }, + { + "smoka7/hop.nvim", + version = "*", + config = function() + require("hop").setup({ keys = "tnseridhaofuwyplcqxz" }) + end, + }, + { + 'romgrk/barbar.nvim', + init = function() vim.g.barbar_auto_setup = false end, + opts = { + sidebar_filetypes = { + undotree = { + text = 'undotree', + align = 'center', + }, + }, + }, + }, + { + 'windwp/nvim-autopairs', + event = "InsertEnter", + config = true + }, + { + 'RedsXDD/neopywal.nvim', + name = "neopywal", + lazy = false, + priority = 1000, + }, + { + 'hedyhli/outline.nvim', + config = function() require("outline").setup() end, + }, +}) diff --git a/.config/nvim/snips/tex/chunks.lua b/.config/nvim/snips/tex/chunks.lua new file mode 100644 index 0000000..617f648 --- /dev/null +++ b/.config/nvim/snips/tex/chunks.lua @@ -0,0 +1,220 @@ +local n = require("luasnip-nodes") +local h = require("luasnip-helpers") + +-- pump snippet input into wolframscript and get the output +-- if an error occurs, find out and redo snippet +local mathematica = function (_, snip) + local cmd = "'Check[ToString[" .. snip.captures[1] .. ", TeXForm], Exit[1]]'" + local output = string.sub(vim.fn.system("wolframscript -code " .. cmd), 1, -2) + if string.sub(output, -7, -1) ~= "$Failed" and vim.v.shell_error == 0 then + return n.sn(nil, n.t(output)) + else + print("there was an error") + return n.sn(nil, n.fmta("math " .. snip.captures[1] .. "<> math", { n.i(1) })) + end +end + +-- creates a matrix row as a snippet node +local rowGenerator = function (j, rows, columns) + local column = {} + local isSquare = rows == columns + for k=1,columns do + local digit = "0" + if isSquare and j==k then + digit = "1" + end + column[2*k-1] = n.i(k, digit) + column[2*k] = n.t(" & ") + end + column[2*columns] = n.t({ " \\\\", "\t" }) + if j==rows then + column[2*columns] = nil + end + return n.sn(j, column) +end + +-- creates a table row as a snippet node +local tableRowGenerator = function (j, rows, columns) + local column = {} + for k=1,columns do + column[2*k-1] = n.i(k) + column[2*k] = n.t(" & ") + end + column[2*columns] = n.t({ " \\\\ \\hline", "\t" }) + if j==rows then + column[2*columns] = n.t({ " \\\\ \\hline" }) + end + return n.sn(j, column) +end + +-- generates a matrix with dimensions as snippet capture groups +local matrix = function (_, snip) + local rows = tonumber(snip.captures[1]) + local columns = tonumber(snip.captures[2]) + local nodes = {} + for j=1,rows do + nodes[j] = rowGenerator(j, rows, columns) + end + return n.sn(1, nodes) +end + +-- generates a table with dimensions as snippet capture groups +local table = function (_, snip) + local rows = tonumber(snip.captures[1]) + local columns = tonumber(snip.captures[2]) + local nodes = {} + for j=1,rows do + nodes[j] = tableRowGenerator(j, rows, columns) + end + return n.sn(1, nodes) +end + +-- generates little partition definition thing for table environment +local tableCols = function (_, snip) + local columns = tonumber(snip.captures[2]) + local output = string.rep("|l", columns) + return output .. "|" +end + +-- turns identifier into enum prefix +local enumType = function (_, snip) + local type = snip.captures[1] + if type == "n" then + return "\\arabic*." + elseif type == "a" then + return "(\\alph*)" + elseif type == "i" then + return "(\\roman*)" + end +end + +return { + -- environment + n.s({trig="beg", snippetType="autosnippet"}, + n.fmta( + [[ + \begin{<>} + <> + \end{<>} + ]], + { n.i(1), n.i(0), n.rep(1) }), + { condition = h.line_begin }), + -- named environment + n.s({trig="beng", snippetType="autosnippet"}, + n.fmta( + [[ + \begin{<>}[<>] + <> + \end{<>} + ]], + { n.i(1), n.i(2), n.i(0), n.rep(1) }), + { condition = h.line_begin }), + -- equation + n.s({trig="beq", snippetType="autosnippet"}, + n.fmta( + [[ + \begin{equation} + <> + \end{equation} + ]], + { n.i(0) }), + { condition = h.line_begin }), + -- WIP plot snippet + n.s({trig="plot(", snippetType="autosnippet"}, + n.fmta( + "plot(<>) <> plot", + { n.i(1), n.i(2) }) + ), + -- mathematica snippet + n.s({trig="math", snippetType="autosnippet"}, + n.fmta("math <> math", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig="math (.*) math", regTrig=true, wordTrig=false}, + { n.d(1, mathematica) }, + { condition = h.in_mathzone } + ), + -- bmatrix + n.s({trig="bm", snippetType="autosnippet"}, + n.fmta( + [[ + \begin{bmatrix}{<>,<>} \end{bmatrix} + ]], + { n.i(1), n.i(2) }), + { condition = h.line_begin * h.in_mathzone }), + -- matrix with arbitrary brackets + n.s({trig="zmat", snippetType="autosnippet"}, + n.fmta( + [[ + \begin{<>matrix}{<>,<>} \end{<>matrix} + ]], + { n.i(1), n.i(2), n.i(3), n.rep(1) }), + { condition = h.line_begin * h.in_mathzone }), + n.s({trig="\\begin{.matrix}{(%d+),(%d+)} \\end{(.)matrix}", regTrig=true, wordTrig=false}, + n.fmta( + [[ + \begin{<>matrix} + <> + \end{<>matrix} + ]], + { n.f(function(_, parent) return parent.captures[3] end), n.d(1, matrix), n.f(function(_, parent) return parent.captures[3] end) }), + { condition = h.in_mathzone }), + -- table + n.s({trig="tab", snippetType="autosnippet"}, + n.fmta( + [[ + \begin{table}{<>,<>} \end{table} + ]], + { n.i(1), n.i(2) }), + { condition = h.line_begin }), + n.s({trig="\\begin{table}{(%d+),(%d+)} \\end{table}", regTrig=true, wordTrig=false}, + n.fmta( + [[ + \begin{tabular}{<>} + \hline + <> + \end{tabular} + ]], + { n.f(tableCols), n.d(1, table) })), + -- enum with n=numbers, a=alphas, or i=roman numerals + n.s({trig="enum([nai])", regTrig=true, snippetType="autosnippet"}, + n.fmta( + [[ + \begin{enumerate}[label=<>] + \item <> + \end{enumerate} + ]], + { n.f(enumType), n.i(0) }), + { condition = h.in_text * h.line_begin }), + -- itemize + n.s({trig="item", snippetType="autosnippet"}, + n.fmta( + [[ + \begin{itemize} + \item <> + \end{itemize} + ]], + { n.i(0) }), + { condition = h.in_text * h.line_begin }), + -- split equation environment + n.s({trig="slt", snippetType="autosnippet"}, + n.fmta( + [[ + \begin{equation}\begin{split} + <> + \end{split}\end{equation} + ]], + { n.i(0) }), + { condition = h.in_text * h.line_begin }), + -- split display equation + n.s({trig="sld", snippetType="autosnippet"}, + n.fmta( + [[ + \[ \begin{split} + <> + \end{split} \] + ]], + { n.i(0) }), + { condition = h.in_text * h.line_begin }), +} diff --git a/.config/nvim/snips/tex/electromagnetism.lua b/.config/nvim/snips/tex/electromagnetism.lua new file mode 100644 index 0000000..c0a7869 --- /dev/null +++ b/.config/nvim/snips/tex/electromagnetism.lua @@ -0,0 +1,9 @@ +local n = require("luasnip-nodes") +local h = require("luasnip-helpers") + +return { + n.s({trig="'rr", snippetType="autosnippet"}, + { n.t("\\scriptr") }, + { condition = h.in_mathzone } + ), +} diff --git a/.config/nvim/snips/tex/expressions.lua b/.config/nvim/snips/tex/expressions.lua new file mode 100644 index 0000000..875fbf4 --- /dev/null +++ b/.config/nvim/snips/tex/expressions.lua @@ -0,0 +1,242 @@ +local n = require("luasnip-nodes") +local h = require("luasnip-helpers") + +local closer = function (open) + if open == "(" then + return ")" + elseif open == "\\{" then + return "\\}" + elseif open == "{" then + return "}" + elseif open == "[" then + return "]" + elseif open == "|" then + return "|" + elseif open == "\\langle" then + return "\\rangle" + else + return nil + end +end + +local parens = function(_, parent) + local open = parent.captures[1] + + if open == "{" then open = "\\{" end + if open == "'a" then open = "\\langle" end + + local node = n.sn(1, + n.fmta("\\left<> <> \\right<><>", + { n.t(open), n.i(1), n.t(closer(open)), n.i(0) }) + ) + return node +end + +return { + n.s({trig="'{", snippetType="autosnippet"}, + n.fmta("\\{ <> \\}", { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[\\left([\(\[\{|]|'a)]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet"}, + { n.d(1, parens) }, + { condition = h.in_mathzone } + ), + n.s({trig="'lf", snippetType="autosnippet"}, + { n.t("\\left") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ang", snippetType="autosnippet"}, + n.fmta("\\langle <> \\rangle", { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig="dsum", snippetType="autosnippet", priority=200}, + n.fmta("\\sum_{<>=<>}^{<>}", + { n.i(1), n.i(2), n.i(3) }), + { condition = h.in_mathzone } + ), + n.s({trig="sum", snippetType="autosnippet", priority=100}, + { n.t("\\sum") }, + { condition = h.in_mathzone } + ), + n.s({trig="'bu", snippetType="autosnippet", priority=100}, + { n.t("\\bigcup") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ba", snippetType="autosnippet", priority=100}, + { n.t("\\bigcap") }, + { condition = h.in_mathzone } + ), + n.s({trig="od", snippetType="autosnippet", priority=100}, + n.fmta("\\od{<>}{<>}", + { n.i(1), n.i(2) }), + { condition = h.in_mathzone } + ), + n.s({trig="'od", snippetType="autosnippet", priority=200}, + n.fmta("\\od[<>]{<>}{<>}", + { n.i(1), n.i(2), n.i(3) }), + { condition = h.in_mathzone } + ), + n.s({trig="pd", snippetType="autosnippet", priority=100}, + n.fmta("\\pd{<>}{<>}", + { n.i(1), n.i(2) }), + { condition = h.in_mathzone } + ), + n.s({trig="'pd", snippetType="autosnippet", priority=200}, + n.fmta("\\pd[<>]{<>}{<>}", + { n.i(1), n.i(2), n.i(3) }), + { condition = h.in_mathzone } + ), + n.s({trig="dint", snippetType="autosnippet", priority=200}, + n.fmta("\\int_{<>}^{<>}", + { n.i(1, "-\\infty"), n.i(2, "\\infty") }), + { condition = h.in_mathzone } + ), + n.s({trig="int", snippetType="autosnippet", priority=100}, + { n.t("\\int") }, + { condition = h.in_mathzone } + ), + n.s({trig="oint", snippetType="autosnippet", priority=100}, + { n.t("\\oint") }, + { condition = h.in_mathzone } + ), + n.s({trig="doint", snippetType="autosnippet", priority=200}, + n.fmta("\\oint_{<>}^{<>}", + { n.i(1), n.i(2) }), + { condition = h.in_mathzone } + ), + n.s({trig="df", wordTrig=false, snippetType="autosnippet"}, + { n.t("\\diff ") }, + { condition = h.in_mathzone } + ), + n.s({trig="pf", wordTrig=false, snippetType="autosnippet"}, + { n.t("\\pdiff ") }, + { condition = h.in_mathzone } + ), + n.s({trig = "tii", snippetType="autosnippet"}, + n.fmta("\\textit{<>}", + { n.d(1, h.get_visual) }), + { condition = h.in_text } + ), + n.s({trig = "tbb", snippetType="autosnippet"}, + n.fmta("\\textbf{<>}", + { n.d(1, h.get_visual) }), + { condition = h.in_text } + ), + n.s({trig = "tuu", snippetType="autosnippet"}, + n.fmta("\\underline{<>}", + { n.d(1, h.get_visual) }), + { condition = h.in_text } + ), + n.s({trig = "txt", snippetType="autosnippet"}, + n.fmta("\\texttt{<>}", + { n.d(1, h.get_visual) }), + { condition = h.in_text } + ), + n.s({trig = "=", snippetType="autosnippet"}, + { n.t("\\item ") }, + { condition = h.in_itemize * h.line_begin } + ), + n.s({trig = "=", snippetType="autosnippet"}, + { n.t("\\item ") }, + { condition = h.in_enumerate * h.line_begin } + ), + n.s({trig = "ceil", snippetType="autosnippet"}, + n.fmta("\\left\\lceil <> \\right\\rceil<>", + { n.i(1), n.i(0) }), + { condition = h.in_mathzone } + ), + n.s({trig = "floor", snippetType="autosnippet"}, + n.fmta("\\left\\lfloor <> \\right\\rfloor", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig="sr", snippetType="autosnippet", wordTrig=false}, + { n.t("^2") }, + { condition = h.in_mathzone } + ), + n.s({trig="cb", snippetType="autosnippet", wordTrig=false}, + { n.t("^3") }, + { condition = h.in_mathzone } + ), + n.s({trig="tf", snippetType="autosnippet", wordTrig=false}, + n.fmta("^{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig = "rf", wordTrig=false, snippetType="autosnippet"}, + n.fmta("_{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig="vm", snippetType="autosnippet"}, + n.fmta("$<>$", + { n.i(1) }), + { condition = h.in_text } + ), + n.s({trig="dm", snippetType="autosnippet"}, + n.fmta( + [[ + \[ + <> + \] + <> + ]], + { n.i(1), n.i(0) }), + { condition = h.in_text } + ), + n.s({trig=[[([A-Za-z])(\d)]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet", priority=100}, + n.fmta("<>_<>", + { n.f(function(_, parent) return parent.captures[1] end), + n.f(function(_, parent) return parent.captures[2] end) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[([A-Za-z])_(\d{2})]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet"}, + n.fmta("<>_{<>}", + { n.f(function(_, parent) return parent.captures[1] end), + n.f(function(_, parent) return parent.captures[2] end) }), + { condition = h.in_mathzone } + ), + n.s({trig = "tx", snippetType="autosnippet"}, + n.fmta("\\text{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig = "sq", snippetType="autosnippet"}, + n.fmta("\\sqrt{<>}", + { n.d(1, h.get_visual) }), + { condition = h.in_mathzone } + ), + n.s({trig = "map", snippetType="autosnippet"}, + n.fmta("<> : <> \\to <>", + { n.i(1), n.i(2), n.i(0) }), + { condition = h.in_mathzone } + ), + n.s({trig = "eval", snippetType="autosnippet"}, + n.fmta("\\eval{<>}", + { n.d(1, h.get_visual) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[\<(.*?)\|`]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet"}, + n.fmta([[\bra{<>}]], + { n.f(function(_, parent) return parent.captures[1] end) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[\|(.*?)\>\^]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet", priority=100}, + n.fmta([[\ket{<>}]], + { n.f(function(_, parent) return parent.captures[1] end) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[\<(.*?)\|(.*?)\>\^]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet", priority=200}, + n.fmta([[\braket{<>}{<>}]], + { n.f(function(_, parent) return parent.captures[1] end), + n.f(function(_, parent) return parent.captures[2] end) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[\<(.*?)\|(.*?)\|(.*?)\>\^]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet", priority=300}, + n.fmta([[\bra{<>}<>\ket{<>}]], + { n.f(function(_, parent) return parent.captures[1] end), + n.f(function(_, parent) return parent.captures[2] end), + n.f(function(_, parent) return parent.captures[3] end) }), + { condition = h.in_mathzone } + ), +} diff --git a/.config/nvim/snips/tex/symbols.lua b/.config/nvim/snips/tex/symbols.lua new file mode 100644 index 0000000..118c807 --- /dev/null +++ b/.config/nvim/snips/tex/symbols.lua @@ -0,0 +1,458 @@ +local n = require("luasnip-nodes") +local h = require("luasnip-helpers") + +return { + n.s({trig="//", snippetType="autosnippet"}, + n.fmta("\\frac{<>}{<>}", + { n.i(1), n.i(2), }), + { condition = h.in_mathzone } + ), + n.s({trig="oo", snippetType="autosnippet"}, + { n.t("\\infty") }, + { condition = h.in_mathzone } + ), + n.s ({trig="sin", snippetType="autosnippet"}, + { n.t("\\sin") }, + { condition = h.in_mathzone } + ), + n.s ({trig="cos", snippetType="autosnippet"}, + { n.t("\\cos") }, + { condition = h.in_mathzone } + ), + n.s ({trig="tan", snippetType="autosnippet"}, + { n.t("\\tan") }, + { condition = h.in_mathzone } + ), + n.s ({trig="csc", snippetType="autosnippet"}, + { n.t("\\csc") }, + { condition = h.in_mathzone } + ), + n.s ({trig="sec", snippetType="autosnippet"}, + { n.t("\\sec") }, + { condition = h.in_mathzone } + ), + n.s ({trig="cot", snippetType="autosnippet"}, + { n.t("\\cot") }, + { condition = h.in_mathzone } + ), + n.s ({trig="ln", snippetType="autosnippet"}, + { n.t("\\ln") }, + { condition = h.in_mathzone } + ), + n.s({trig="inn", snippetType="autosnippet"}, + { n.t("\\in") }, + { condition = h.in_mathzone } + ), + n.s({trig="=>", snippetType="autosnippet"}, + { n.t("\\implies") }, + { condition = h.in_mathzone } + ), + n.s({trig="=<", snippetType="autosnippet"}, + { n.t("\\impliedby ") }, + { condition = h.in_mathzone } + ), + n.s({trig="iff", snippetType="autosnippet"}, + { n.t("\\iff") }, + { condition = h.in_mathzone } + ), + n.s({trig="NN", snippetType="autosnippet"}, + { n.t("\\N") } + ), + n.s({trig="RR", snippetType="autosnippet"}, + { n.t("\\R") } + ), + n.s({trig="ZZ", snippetType="autosnippet"}, + { n.t("\\Z") } + ), + n.s({trig="OO", snippetType="autosnippet"}, + { n.t("\\emptyset") } + ), + n.s({trig="QQ", snippetType="autosnippet"}, + { n.t("\\Q") } + ), + n.s({trig="CC", snippetType="autosnippet"}, + { n.t("\\C") } + ), + n.s({trig="EE", snippetType="autosnippet"}, + { n.t("\\exists") }, + { condition = h.in_mathzone } + ), + n.s({trig="AA", snippetType="autosnippet"}, + { n.t("\\forall") }, + { condition = h.in_mathzone } + ), + n.s({trig="<=", snippetType="autosnippet"}, + { n.t("\\le") }, + { condition = h.in_mathzone } + ), + n.s({trig=">=", snippetType="autosnippet"}, + { n.t("\\ge") }, + { condition = h.in_mathzone } + ), + n.s({trig="<<", snippetType="autosnippet"}, + { n.t("\\ll") }, + { condition = h.in_mathzone } + ), + n.s({trig=">>", snippetType="autosnippet"}, + { n.t("\\gg") }, + { condition = h.in_mathzone } + ), + n.s({trig="!=", snippetType="autosnippet"}, + { n.t("\\neq") }, + { condition = h.in_mathzone } + ), + n.s({trig="->", snippetType="autosnippet", priority=100}, + { n.t("\\to") }, + { condition = h.in_mathzone } + ), + n.s({trig="<->", snippetType="autosnippet", priority=200}, + { n.t("\\leftrightarrow") }, + { condition = h.in_mathzone } + ), + n.s({trig="^^", snippetType="autosnippet"}, + { n.t("\\uparrow") }, + { condition = h.in_mathzone } + ), + n.s({trig="vv", snippetType="autosnippet"}, + { n.t("\\downarrow") }, + { condition = h.in_mathzone } + ), + n.s({trig="!>", snippetType="autosnippet"}, + { n.t("\\mapsto") }, + { condition = h.in_mathzone } + ), + n.s({trig="stm", snippetType="autosnippet"}, + { n.t("\\setminus") }, + { condition = h.in_mathzone } + ), + n.s({trig="||", snippetType="autosnippet"}, + { n.t("\\mid") }, + { condition = h.in_mathzone } + ), + n.s({trig="**", snippetType="autosnippet"}, + { n.t("\\cdot") }, + { condition = h.in_mathzone } + ), + n.s({trig="xx", snippetType="autosnippet"}, + { n.t("\\times") }, + { condition = h.in_mathzone } + ), + n.s({trig="cc", snippetType="autosnippet"}, + { n.t("\\subseteq") }, + { condition = h.in_mathzone } + ), + n.s({trig="cq", snippetType="autosnippet"}, + { n.t("\\subset") }, + { condition = h.in_mathzone } + ), + n.s({trig="qq", snippetType="autosnippet"}, + { n.t("\\supseteq") }, + { condition = h.in_mathzone } + ), + n.s({trig="qc", snippetType="autosnippet"}, + { n.t("\\supset") }, + { condition = h.in_mathzone } + ), + n.s({trig="Nn", snippetType="autosnippet"}, + { n.t("\\cap") }, + { condition = h.in_mathzone } + ), + n.s({trig="UU", snippetType="autosnippet"}, + { n.t("\\cup") }, + { condition = h.in_mathzone } + ), + n.s({trig="uU", snippetType="autosnippet"}, + { n.t("\\sqcup") }, + { condition = h.in_mathzone } + ), + n.s({trig="bar", snippetType="autosnippet", priority=100}, + n.fmta("\\bar{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[((\\[a-zA-Z]+)|[A-Za-z0-9])bar]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet", priority=200}, + n.fmta("\\bar{<>}", + { n.f(function(_, parent) return parent.captures[1] end) }), + { condition = h.in_mathzone } + ), + + n.s({trig="hat", snippetType="autosnippet", priority=100}, + n.fmta("\\hat{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[(\\[a-zA-Z]+|[A-Za-z0-9]|\\[a-z]+\{\\?[A-Za-z0-9]+\})hat]], + wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=200}, + n.fmta("\\hat{<>}", + { n.f(function(_, parent) return parent.captures[1] end) }), + { condition = h.in_mathzone } + ), + + n.s({trig=[[!\?|\?!]], trigEngine="ecma", snippetType="autosnippet", priority=100}, + n.fmta("\\vec{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[(\\[a-zA-Z]+|[A-Za-z0-9]|\\[a-z]+\{\\?[A-Za-z0-9]+\})(!\?|\?!)]], + wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=200}, + n.fmta("\\vec{<>}", + { n.f(function(_, parent) return parent.captures[1] end) }), + { condition = h.in_mathzone } + ), + + n.s({trig="t(o+)t", regTrig=true, snippetType="autosnippet", priority=100}, + n.fmta("\\<>ot{<>}", + { n.f(function(_, parent) return string.rep("d", string.len(parent.captures[1])) end), + n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[(\\[a-zA-Z]+|[A-Za-z0-9]|\\[a-z]+\{\\?[A-Za-z0-9]+\})t(o+)t]], + wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=200}, + n.fmta("\\<>ot{<>}", + { n.f(function(_, parent) return string.rep("d", string.len(parent.captures[2])) end), + n.f(function(_, parent) return parent.captures[1] end) }), + { condition = h.in_mathzone } + ), + + n.s({trig="'ti", regTrig=true, snippetType="autosnippet", priority=100}, + n.fmta("\\tilde{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[(\\[a-zA-Z]+|[A-Za-z0-9]|\\[a-z]+\{\\?[A-Za-z0-9]+\})'ti]], + wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=200}, + n.fmta("\\tilde{<>}", + { n.f(function(_, parent) return parent.captures[1] end) }), + { condition = h.in_mathzone } + ), + + n.s({trig=[[([a-zA-Z])(:#|#:)]], wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=200}, + n.fmta("\\mathcal{<>}", + { n.f(function(_, parent) return string.upper(parent.captures[1]) end) }), + { condition = h.in_mathzone } + ), + n.s({trig="(:#|#:)", wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=100}, + n.fmta("\\mathcal{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + + n.s({trig=[[([a-zA-Z])(@#|#@)]], wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=200}, + n.fmta("\\mathbb{<>}", + { n.f(function(_, parent) return string.upper(parent.captures[1]) end) }), + { condition = h.in_mathzone } + ), + n.s({trig="1(@#|#@)", wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=200}, + { n.t("\\1") }, + { condition = h.in_mathzone } + ), + n.s({trig="(@#|#@)", wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=100}, + n.fmta("\\mathbb{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig="mfr", wordTrig=false, trigEngine="ecma", snippetType="autosnippet"}, + n.fmta("\\mathfrak{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig="mrm", wordTrig=false, trigEngine="ecma", snippetType="autosnippet"}, + n.fmta("\\mathrm{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig="msf", wordTrig=false, trigEngine="ecma", snippetType="autosnippet"}, + n.fmta("\\mathsf{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig="'kk", snippetType="autosnippet"}, + { n.t("\\mathbb{k}") }, + { condition = h.in_mathzone } + ), + + n.s({trig="'hb", snippetType="autosnippet"}, + { n.t("\\hbar") }, + { condition = h.in_mathzone } + ), + n.s({trig="'pi", snippetType="autosnippet"}, + { n.t("\\pi") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ph", snippetType="autosnippet"}, + { n.t("\\phi") }, + { condition = h.in_mathzone } + ), + n.s({trig="'Ph", snippetType="autosnippet"}, + { n.t("\\Phi") }, + { condition = h.in_mathzone } + ), + n.s({trig="'vp", snippetType="autosnippet"}, + { n.t("\\varphi") }, + { condition = h.in_mathzone } + ), + n.s({trig="'th", snippetType="autosnippet"}, + { n.t("\\theta") }, + { condition = h.in_mathzone } + ), + n.s({trig="'Th", snippetType="autosnippet"}, + { n.t("\\Theta") }, + { condition = h.in_mathzone } + ), + n.s({trig="'Om", snippetType="autosnippet"}, + { n.t("\\Omega") }, + { condition = h.in_mathzone } + ), + n.s({trig="'om", snippetType="autosnippet"}, + { n.t("\\omega") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ep", snippetType="autosnippet"}, + { n.t("\\epsilon") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ta", snippetType="autosnippet"}, + { n.t("\\tau") }, + { condition = h.in_mathzone } + ), + n.s({trig="'rh", snippetType="autosnippet"}, + { n.t("\\rho") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ch", snippetType="autosnippet"}, + { n.t("\\chi") }, + { condition = h.in_mathzone } + ), + n.s({trig="'na", snippetType="autosnippet"}, + { n.t("\\nabla") }, + { condition = h.in_mathzone } + ), + n.s({trig="del", snippetType="autosnippet"}, + { n.t("\\Del") }, + { condition = h.in_mathzone } + ), + n.s({trig="==", snippetType="autosnippet"}, + { n.t("\\equiv") }, + { condition = h.in_mathzone } + ), + n.s({trig="~~", snippetType="autosnippet"}, + { n.t("\\approx") }, + { condition = h.in_mathzone } + ), + n.s({trig="=~", snippetType="autosnippet"}, + { n.t("\\cong") }, + { condition = h.in_mathzone } + ), + n.s({trig="'de", snippetType="autosnippet"}, + { n.t("\\delta") }, + { condition = h.in_mathzone } + ), + n.s({trig="'De", snippetType="autosnippet"}, + { n.t("\\Delta") }, + { condition = h.in_mathzone } + ), + n.s({trig="'nu", snippetType="autosnippet"}, + { n.t("\\nu") }, + { condition = h.in_mathzone } + ), + n.s({trig="'mu", snippetType="autosnippet"}, + { n.t("\\mu") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ps", snippetType="autosnippet"}, + { n.t("\\psi") }, + { condition = h.in_mathzone } + ), + n.s({trig="'Ps", snippetType="autosnippet"}, + { n.t("\\Psi") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ve", snippetType="autosnippet"}, + { n.t("\\varepsilon") }, + { condition = h.in_mathzone } + ), + n.s({trig="'al", snippetType="autosnippet"}, + { n.t("\\alpha") }, + { condition = h.in_mathzone } + ), + n.s({trig="'be", snippetType="autosnippet"}, + { n.t("\\beta") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ga", snippetType="autosnippet"}, + { n.t("\\gamma") }, + { condition = h.in_mathzone } + ), + n.s({trig="'Ga", snippetType="autosnippet"}, + { n.t("\\Gamma") }, + { condition = h.in_mathzone } + ), + n.s({trig="'la", snippetType="autosnippet"}, + { n.t("\\lambda") }, + { condition = h.in_mathzone } + ), + n.s({trig="'La", snippetType="autosnippet"}, + { n.t("\\Lambda") }, + { condition = h.in_mathzone } + ), + n.s({trig="'el", snippetType="autosnippet"}, + { n.t("\\ell") }, + { condition = h.in_mathzone } + ), + n.s({trig="'si", snippetType="autosnippet"}, + { n.t("\\sigma") }, + { condition = h.in_mathzone } + ), + n.s({trig="'Si", snippetType="autosnippet"}, + { n.t("\\Sigma") }, + { condition = h.in_mathzone } + ), + n.s({trig="'xi", snippetType="autosnippet"}, + { n.t("\\xi") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ka", snippetType="autosnippet"}, + { n.t("\\kappa") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ci", snippetType="autosnippet"}, + { n.t("\\circ") }, + { condition = h.in_mathzone } + ), + n.s({trig="'dg", snippetType="autosnippet", wordTrig=false}, + { n.t("^{\\circ}") }, + { condition = h.in_mathzone } + ), + n.s({trig="'da", snippetType="autosnippet", wordTrig=false}, + { n.t("^{\\dag}") }, + { condition = h.in_mathzone } + ), + n.s({trig="oxx", snippetType="autosnippet"}, + { n.t("\\otimes") }, + { condition = h.in_mathzone } + ), + n.s({trig="opp", snippetType="autosnippet"}, + { n.t("\\oplus") }, + { condition = h.in_mathzone } + ), + n.s({trig="upp", snippetType="autosnippet"}, + { n.t("\\uplus") }, + { condition = h.in_mathzone } + ), + n.s({trig="pm", snippetType="autosnippet"}, + { n.t("\\pm") }, + { condition = h.in_mathzone } + ), + n.s({trig="<|", snippetType="autosnippet"}, + { n.t("\\lhd") }, + { condition = h.in_mathzone } + ), + n.s({trig="|>", snippetType="autosnippet"}, + { n.t("\\rhd") }, + { condition = h.in_mathzone } + ), + n.s({trig=",,", snippetType="autosnippet", wordTrig = false}, + { n.t("\\,") }, + { condition = h.in_mathzone } + ), +} diff --git a/.config/rofi/config.rasi b/.config/rofi/config.rasi new file mode 100644 index 0000000..ba7ac15 --- /dev/null +++ b/.config/rofi/config.rasi @@ -0,0 +1,16 @@ +configuration{ + modes: "drun,window"; + icon-theme: "Papirus"; + show-icons: true; + sidebar-mode: false; +} + +@import "colors" + +* { + font: "Lilex Nerd Font 14"; +} + +scrollbar { + handle-color: @accent; +} diff --git a/.config/sway/config b/.config/sway/config new file mode 100644 index 0000000..5f1015a --- /dev/null +++ b/.config/sway/config @@ -0,0 +1,235 @@ +exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK +exec hash dbus-update-activation-environment 2>/dev/null && \ + dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK + +### Variables + +include colors + +set $mod Mod4 + +set $left n +set $down e +set $up i +set $right o + +set $term kitty + +set $menu rofi -show drun | xargs swaymsg exec -- + +### Output configuration + +output "AOC Q27G1WG4 0x00020A32" mode 2560x1440@143.912Hz + +output "*" background $wallpaper fill + +### Idle configuration + +exec swayidle \ + timeout 300 'swaylock' \ + timeout 600 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock --grace 0' + + +### Input configuration + +input type:touchpad { + dwt enabled + natural_scroll enabled + middle_emulation enabled +} + +input type:touch { + map_to_output eDP-1 +} + +input type:tablet_tool { + map_to_output eDP-1 +} + +### Key bindings + +# Basics: + +bindsym $mod+Return exec $term + +bindsym $mod+Shift+q kill + +bindsym $mod+s exec $menu + +floating_modifier $mod normal + +bindsym $mod+Shift+d reload + +bindsym $mod+Shift+f exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit' + +bindsym $mod+q exec dunstctl close + +# Moving around: + +bindsym $mod+$left focus left +bindsym $mod+$down focus down +bindsym $mod+$up focus up +bindsym $mod+$right focus right + +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +bindsym $mod+Shift+$left move left +bindsym $mod+Shift+$down move down +bindsym $mod+Shift+$up move up +bindsym $mod+Shift+$right move right + +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# Workspaces: + +bindsym $mod+1 workspace number 1 +bindsym $mod+2 workspace number 2 +bindsym $mod+3 workspace number 3 +bindsym $mod+4 workspace number 4 +bindsym $mod+5 workspace number 5 +bindsym $mod+6 workspace number 6 +bindsym $mod+7 workspace number 7 +bindsym $mod+8 workspace number 8 +bindsym $mod+9 workspace number 9 +bindsym $mod+0 workspace number 10 + +bindsym $mod+Shift+1 move container to workspace number 1 +bindsym $mod+Shift+2 move container to workspace number 2 +bindsym $mod+Shift+3 move container to workspace number 3 +bindsym $mod+Shift+4 move container to workspace number 4 +bindsym $mod+Shift+5 move container to workspace number 5 +bindsym $mod+Shift+6 move container to workspace number 6 +bindsym $mod+Shift+7 move container to workspace number 7 +bindsym $mod+Shift+8 move container to workspace number 8 +bindsym $mod+Shift+9 move container to workspace number 9 +bindsym $mod+Shift+0 move container to workspace number 10 + +bindsym $mod+Tab workspace next +bindsym $mod+Shift+Tab workspace prev + +# Layout stuff: + +bindsym $mod+h splith +bindsym $mod+v splitv + +bindsym $mod+r layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+f layout toggle split + +bindsym $mod+t fullscreen + +bindsym $mod+Shift+space floating toggle +bindsym $mod+space focus mode_toggle +bindsym $mod+a focus parent +bindsym $mod+Shift+a focus child + +# Scratchpad: + +bindsym $mod+Shift+minus move scratchpad +bindsym $mod+minus scratchpad show + +# Resizing containers: + +mode "resize" { + bindsym $left resize shrink width 40px + bindsym $down resize shrink height 40px + bindsym $up resize grow height 40px + bindsym $right resize grow width 40px + + bindsym Left resize shrink width 40px + bindsym Down resize shrink height 40px + bindsym Up resize grow height 40px + bindsym Right resize grow width 40px + + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+p mode "resize" + +# Media controls: + +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle + +bindsym XF86AudioPlay exec playerctl play-pause +bindsym XF86AudioNext exec playerctl next +bindsym XF86AudioPrev exec playerctl previous + +bindsym XF86MonBrightnessUp exec brightnessctl set +5% +bindsym XF86MonBrightnessDown exec brightnessctl set 5%- + +# Launchers: + +bindsym $mod+b exec zen-browser +bindsym $mod+x exec xournalpp +bindsym $mod+c exec lectern open +bindsym $mod+d exec notepicker $HOME/nextcloud/escritoire/notepad +bindsym $mod+j exec kitty --app-id 'ration' bash -i ration +bindsym $mod+Shift+t exec kitty --app-id 'float' +bindsym $mod+Shift+c exec kitty --app-id 'numbat' numbat +bindsym $mod+Shift+g exec feh -Z -F -B black /home/josh/Pictures/game.png +bindsym $mod+Shift+w exec wallpicker + +bindsym Print exec grim -g "$(slurp)" - | wl-copy -t image/png + +### Appearance + +# target title bg text indicator border +client.focused $color12 $color12 $background $color12 $color12 +client.focused_inactive $color0 $color0 $foreground 00000000 00000000 +client.unfocused $color0 $color0 $foreground 00000000 00000000 +client.urgent $color13 $background $color13 00000000 $color13 +client.placeholder $color8 $background $foreground 00000000 $color8 +client.background $background + +font pango:Lilex Nerd Font 10 + +gaps inner 10px +gaps outer 0px + +title_align center +default_border pixel + +force_display_urgency_hint 1500 + +### Applications + +# Configurations + +for_window [app_id="float"] floating enable; resize set 50 ppt 50 ppt +for_window [app_id="numbat"] floating enable; resize set 40 ppt 35 ppt +for_window [app_id="xoppdoggin"] floating enable; resize set 90 ppt 90 ppt +for_window [app_id="wallpicker"] floating enable; resize set 90 ppt 90 ppt +for_window [app_id="ration"] floating enable; resize set 600 350 +for_window [class="Inkscape"] floating enable; resize set 90 ppt 90 ppt +for_window [class="vimscape"] floating enable; resize set 30 ppt 25 ppt; move down 300; move left 550 + +assign [class="^discord"] workspace number 8 +assign [class="^Slack"] workspace number 8 +assign [app_id="^thunderbird"] workspace number 8 +assign [class="^feishin"] workspace number 9 +assign [app_id="keepassxc"] workspace number 10 + +# Launch on startup + +bar swaybar_command waybar + +exec --no-startup-id dex -ae sway + +exec dunst +exec keepassxc +exec feishin +exec gammastep +exec rat reset + +include /etc/sway/config.d/* diff --git a/.config/swayimg/config b/.config/swayimg/config new file mode 100644 index 0000000..43c603b --- /dev/null +++ b/.config/swayimg/config @@ -0,0 +1,12 @@ +[general] +overlay = no + +[info] +show = no + +[gallery] +pstore = yes + +[keys.gallery] +Return = exec echo "%"; exit +MouseLeft = exec echo "%"; exit diff --git a/.config/wallust/templates/colors_fish.fish b/.config/wallust/templates/colors_fish.fish new file mode 100644 index 0000000..56a2356 --- /dev/null +++ b/.config/wallust/templates/colors_fish.fish @@ -0,0 +1,41 @@ +set fish_color_autosuggestion {color8.strip} +set fish_color_cancel {color1.strip} '--reverse' +set fish_color_command {color10.strip} +set fish_color_comment {color8.strip} +set fish_color_cwd {color2.strip} +set fish_color_cwd_root {color1.strip} +set fish_color_end {color3.strip} +set fish_color_error {color1.strip} +set fish_color_escape {color5.strip} +set fish_color_history_current --bold +set fish_color_host {color12.strip} +set fish_color_host_remote {color12.strip} +set fish_color_keyword {color5.strip} +set fish_color_match --background={color4.strip} +set fish_color_normal {foreground.strip} +set fish_color_operator {color6.strip} +set fish_color_option {color3.strip} +set fish_color_param {color12.strip} +set fish_color_quote {color11.strip} +set fish_color_redirection {color5.strip} +set fish_color_search_match --background={color8.strip} +set fish_color_selection --background={color8.strip} +set fish_color_status {color1.strip} +set fish_color_user {color10.strip} +set fish_color_valid_path --underline + +set fish_pager_color_background {background.strip} +set fish_pager_color_completion {foreground.strip} +set fish_pager_color_description {color8.strip} +set fish_pager_color_prefix {color10.strip} +set fish_pager_color_progress {color8.strip} +set fish_pager_color_secondary_background {background.strip} +set fish_pager_color_secondary_completion {foreground.strip} +set fish_pager_color_secondary_description {color8.strip} +set fish_pager_color_secondary_prefix {color10.strip} +set fish_pager_color_selected_background --background={color8.strip} +set fish_pager_color_selected_completion {foreground.strip} +set fish_pager_color_selected_description {color8.strip} +set fish_pager_color_selected_prefix {color10.strip} + +set welcome_color {color14.strip} diff --git a/.config/wallust/templates/colors_kitty.conf b/.config/wallust/templates/colors_kitty.conf new file mode 100644 index 0000000..ac65068 --- /dev/null +++ b/.config/wallust/templates/colors_kitty.conf @@ -0,0 +1,29 @@ +foreground {{foreground}} +background {{background}} +cursor {{cursor}} + +active_tab_foreground {{background}} +active_tab_background {{foreground}} +inactive_tab_foreground {{foreground}} +inactive_tab_background {{background}} + +active_border_color {{foreground}} +inactive_border_color {{background}} +bell_border_color {{color1}} + +color0 {{color0}} +color8 {{color8}} +color1 {{color1}} +color9 {{color9}} +color2 {{color2}} +color10 {{color10}} +color3 {{color3}} +color11 {{color11}} +color4 {{color4}} +color12 {{color12}} +color5 {{color5}} +color13 {{color13}} +color6 {{color6}} +color14 {{color14}} +color7 {{color7}} +color15 {{color15}} diff --git a/.config/wallust/templates/colors_neopywal.vim b/.config/wallust/templates/colors_neopywal.vim new file mode 100644 index 0000000..c5e966d --- /dev/null +++ b/.config/wallust/templates/colors_neopywal.vim @@ -0,0 +1,19 @@ +let background = "{{background}}" +let foreground = "{{foreground}}" +let cursor = "{{cursor}}" +let color0 = "{{color0}}" +let color1 = "{{color1}}" +let color2 = "{{color2}}" +let color3 = "{{color3}}" +let color4 = "{{color4}}" +let color5 = "{{color5}}" +let color6 = "{{color6}}" +let color7 = "{{color7}}" +let color8 = "{{color8}}" +let color9 = "{{color9}}" +let color10 = "{{color10}}" +let color11 = "{{color11}}" +let color12 = "{{color12}}" +let color13 = "{{color13}}" +let color14 = "{{color14}}" +let color15 = "{{color15}}" diff --git a/.config/wallust/templates/colors_rofi.rasi b/.config/wallust/templates/colors_rofi.rasi new file mode 100644 index 0000000..4c56811 --- /dev/null +++ b/.config/wallust/templates/colors_rofi.rasi @@ -0,0 +1,29 @@ +* { + selected-active-foreground: @background; + lightfg: {{foreground}}; + separatorcolor: @accent; + urgent-foreground: {{color13}}; + alternate-urgent-background: @lightbg; + lightbg: {{color0}}; + background-color: transparent; + border-color: @accent; + normal-background: @background; + selected-urgent-background: {{color13}}; + alternate-active-background: @lightbg; + spacing: 2; + alternate-normal-foreground: @foreground; + urgent-background: @background; + selected-normal-foreground: @lightbg; + active-foreground: {{color12}}; + background: {{background}}; + selected-active-background: {{color12}}; + active-background: @background; + selected-normal-background: @lightfg; + alternate-normal-background: @lightbg; + foreground: {{foreground}}; + selected-urgent-foreground: @background; + normal-foreground: @foreground; + alternate-urgent-foreground: {{color13}}; + alternate-active-foreground: {{color12}}; + accent: {{color14}}; +} diff --git a/.config/wallust/templates/colors_sway b/.config/wallust/templates/colors_sway new file mode 100644 index 0000000..978ff5d --- /dev/null +++ b/.config/wallust/templates/colors_sway @@ -0,0 +1,21 @@ +set $wallpaper {{wallpaper}} + +set $background {{background}} +set $foreground {{foreground}} + +set $color0 {{color0}} +set $color1 {{color1}} +set $color2 {{color2}} +set $color3 {{color3}} +set $color4 {{color4}} +set $color5 {{color5}} +set $color6 {{color6}} +set $color7 {{color7}} +set $color8 {{color8}} +set $color9 {{color9}} +set $color10 {{color10}} +set $color11 {{color11}} +set $color12 {{color12}} +set $color13 {{color13}} +set $color14 {{color14}} +set $color15 {{color15}} diff --git a/.config/wallust/templates/colors_waybar.css b/.config/wallust/templates/colors_waybar.css new file mode 100644 index 0000000..24dad19 --- /dev/null +++ b/.config/wallust/templates/colors_waybar.css @@ -0,0 +1,20 @@ +@define-color foreground {{foreground}}; +@define-color background {{background}}; +@define-color cursor {{cursor}}; + +@define-color color0 {{color0}}; +@define-color color1 {{color1}}; +@define-color color2 {{color2}}; +@define-color color3 {{color3}}; +@define-color color4 {{color4}}; +@define-color color5 {{color5}}; +@define-color color6 {{color6}}; +@define-color color7 {{color7}}; +@define-color color8 {{color8}}; +@define-color color9 {{color9}}; +@define-color color10 {{color10}}; +@define-color color11 {{color11}}; +@define-color color12 {{color12}}; +@define-color color13 {{color13}}; +@define-color color14 {{color14}}; +@define-color color15 {{color15}}; diff --git a/.config/wallust/templates/colors_zathura b/.config/wallust/templates/colors_zathura new file mode 100644 index 0000000..e2c4b9c --- /dev/null +++ b/.config/wallust/templates/colors_zathura @@ -0,0 +1,34 @@ +set recolor "true" +set recolor-keephue "true" + +set completion-bg "{{background}}" +set completion-fg "{{foreground}}" +set completion-group-bg "{{background}}" +set completion-group-fg "{{color2}}" +set completion-highlight-bg "{{color2}}" +set completion-highlight-fg "{{background}}" + +set recolor-lightcolor "{{background}}" +set recolor-darkcolor "{{foreground}}" +set default-bg "{{background}}" + +set inputbar-bg "{{background}}" +set inputbar-fg "{{foreground}}" +set notification-bg "{{background}}" +set notification-fg "{{foreground}}" +set notification-error-bg "{{color1}}" +set notification-error-fg "{{foreground}}" +set notification-warning-bg "{{color1}}" +set notification-warning-fg "{{foreground}}" +set statusbar-bg "{{background}}" +set statusbar-fg "{{foreground}}" +set index-bg "{{background}}" +set index-fg "{{foreground}}" +set index-active-bg "{{foreground}}" +set index-active-fg "{{background}}" +set render-loading-bg "{{background}}" +set render-loading-fg "{{foreground}}" + +set window-title-home-tilde true +set statusbar-basename true +set selection-clipboard clipboard diff --git a/.config/wallust/templates/dunstrc b/.config/wallust/templates/dunstrc new file mode 100644 index 0000000..68585bc --- /dev/null +++ b/.config/wallust/templates/dunstrc @@ -0,0 +1,22 @@ +[global] +horizontal_padding = 12 +frame_width = 3 +font = LilexNerdFont 16 +icon_theme = Papyrus +corner_radius = 16 + +frame_color = "{{color11}}" +separator_color= frame + +[urgency_low] +background = "{{background}}" +foreground = "{{foreground}}" + +[urgency_normal] +background = "{{background}}" +foreground = "{{foreground}}" + +[urgency_critical] +background = "{{color11}}" +foreground = "{{background}}" +frame_color = "{{color3}}" diff --git a/.config/wallust/templates/starship/starship.toml b/.config/wallust/templates/starship/starship.toml new file mode 100644 index 0000000..0803de0 --- /dev/null +++ b/.config/wallust/templates/starship/starship.toml @@ -0,0 +1,150 @@ +format = """ +[╭](id_color)\ +[](id_color)\ +$os\ +$username\ +$hostname\ +$sudo\ +[ ](bg:id_color)\ +[](fg:id_color bg:dir_color)\ +$directory\ +[](fg:dir_color bg:git_color)\ +$git_branch\ +$git_status\ +[](fg:git_color bg:lang_color)\ +$c\ +$rust\ +$golang\ +$nodejs\ +$php\ +$java\ +$kotlin\ +$haskell\ +$python\ +$julia\ +$lua\ +[](fg:lang_color)\ +$line_break\ +[╰](id_color)\ +$character +""" + +palette = "wallust" + +[palettes.wallust] +text_color = "{{background}}" +id_color = "{{color14}}" +dir_color = "{{color13}}" +git_color = "{{color12}}" +lang_color = "{{color11}}" +yellow = "#eed49f" +mauve = "#c6a0f6" + +[os] +disabled = false +style = "bg:id_color fg:text_color bold" + +[os.symbols] +Linux = "" +Gentoo = "" +Fedora = "" +Arch = "" +Ubuntu = "" +Debian = "" + +[username] +show_always = true +format = '[ $user](bg:id_color fg:text_color bold)' +disabled = false + +[hostname] +ssh_symbol = '' +style = "bg:id_color fg:text_color bold" +format = '[@$hostname]($style)' + +[sudo] +disabled = false +symbol = " " +style = "bg:id_color fg:text_color" +format = '[$symbol]($style)' + +[directory] +style = "bg:dir_color" +read_only = "" +format = '[ $path( $read_only) ]($style fg:text_color bold)' +truncation_length = 3 +truncation_symbol = "…/" + +[git_branch] +symbol = "" +style = "bg:git_color fg:text_color bold" +format = '[ $symbol $branch ]($style)' + +[git_status] +style = "bg:git_color fg:text_color bold" +deleted = '' +format = '[$all_status$ahead_behind ]($style)' + +[character] +disabled = false +success_symbol = '[ ](fg:id_color)[](fg:green)' +error_symbol = '[ ](fg:id_color)[](fg:red)' +vimcmd_symbol = '[ ](fg:id_color)[](fg:green)' +vimcmd_replace_one_symbol = '[ ](fg:id_color)[](fg:mauve)' +vimcmd_replace_symbol = '[ ](fg:id_color)[](fg:mauve)' +vimcmd_visual_symbol = '[ ](fg:id_color)[](fg:yellow)' + +[nodejs] +symbol = "" +style = "bg:lang_color fg:text_color bold" +format = '[ $symbol( $version) ]($style)' + +[c] +symbol = "" +style = "bg:lang_color fg:text_color bold" +format = '[ $symbol( $version) ]($style)' + +[rust] +symbol = "" +style = "bg:lang_color fg:text_color bold" +format = '[ $symbol( $version) ]($style)' + +[golang] +symbol = "" +style = "bg:lang_color fg:text_color bold" +format = '[ $symbol( $version) ]($style)' + +[php] +symbol = "" +style = "bg:lang_color fg:text_color bold" +format = '[ $symbol( $version) ]($style)' + +[java] +symbol = "" +style = "bg:lang_color fg:text_color bold" +format = '[ $symbol( $version) ]($style)' + +[kotlin] +symbol = "" +style = "bg:lang_color fg:text_color bold" +format = '[ $symbol( $version) ]($style)' + +[haskell] +symbol = "" +style = "bg:lang_color fg:text_color bold" +format = '[ $symbol( $version) ]($style)' + +[python] +symbol = "" +style = "bg:lang_color fg:text_color bold" +format = '[ $symbol( $version) ]($style)' + +[julia] +symbol = "" +style = "bg:lang_color fg:text_color bold" +format = '[ $symbol( $version) ]($style)' + +[lua] +symbol = "" +style = "bg:lang_color fg:text_color bold" +format = '[ $symbol( $version) ]($style)' diff --git a/.config/wallust/templates/starship/transient.toml b/.config/wallust/templates/starship/transient.toml new file mode 100644 index 0000000..946c03a --- /dev/null +++ b/.config/wallust/templates/starship/transient.toml @@ -0,0 +1,8 @@ +palette = "wallust" + +[palettes.wallust] +id_color = "{{color14}}" + +[character] +disabled = false +success_symbol = '[](fg:id_color)' diff --git a/.config/wallust/templates/swaylock b/.config/wallust/templates/swaylock new file mode 100644 index 0000000..69ff0ed --- /dev/null +++ b/.config/wallust/templates/swaylock @@ -0,0 +1,29 @@ +image={{wallpaper}} +clock +indicator +indicator-radius=100 +indicator-thickness=7 +effect-blur=5x5 +effect-vignette=0.8:0.8 +ring-color={{color0}} +key-hl-color={{color12}} +bs-hl-color={{color10}} +text-color={{foreground}} +line-color=00000000 +inside-color={{background}}88 +separator-color=00000000 +layout-bg-color={{background}}88 +layout-text-color={{foreground}} +ring-clear-color={{color14}} +text-clear-color={{color14}} +inside-clear-color={{background}}88 +ring-ver-color={{color11}} +text-ver-color={{color11}} +inside-ver-color={{background}}88 +ring-wrong-color={{color10}} +text-wrong-color={{color10}} +inside-wrong-color={{background}}88 +grace=4 +fade-in=0.2 +font=LilexNerdFont +font-size=30 diff --git a/.config/wallust/wallust.toml b/.config/wallust/wallust.toml new file mode 100644 index 0000000..4722f71 --- /dev/null +++ b/.config/wallust/wallust.toml @@ -0,0 +1,37 @@ +color_space = "lch" +palette = "dark16" +check_contrast = true +saturation = 35 +threshold = 10 + +[templates] +waybar.template = 'colors_waybar.css' +waybar.target = '~/.config/waybar/colors.css' + +kitty.template = 'colors_kitty.conf' +kitty.target = '~/.config/kitty/colors.conf' + +starship.template = 'starship' +starship.target = '~/.config/starship/' + +sway.template = 'colors_sway' +sway.target = '~/.config/sway/colors' + +neopywal.template = 'colors_neopywal.vim' +neopywal.target = '~/.cache/wallust/colors_neopywal.vim' + +rofi.template = 'colors_rofi.rasi' +rofi.target = '~/.config/rofi/colors.rasi' + +swaylock.template = 'swaylock' +swaylock.target = '~/.config/swaylock/config' + +dunst.template = 'dunstrc' +dunst.target = '~/.config/dunst/dunstrc' + +zathura.template = 'colors_zathura' +zathura.target = '~/.config/zathura/colors' + +fish.template = 'colors_fish.fish' +fish.target = '~/.config/fish/colors.fish' +fish.pywal = true diff --git a/.config/waybar/config b/.config/waybar/config new file mode 100644 index 0000000..9c89b95 --- /dev/null +++ b/.config/waybar/config @@ -0,0 +1,102 @@ +{ + "height": 30, // Waybar height (to be removed for auto height) + "spacing": 4, // Gaps between modules (4px) + + // Choose the order of the modules + "modules-left": ["sway/workspaces", "sway/mode", "sway/scratchpad", "sway/window"], + "modules-right": ["idle_inhibitor", "backlight", "pulseaudio", "custom/rat", "network", "temperature", "memory", "battery", "clock", "tray"], + + // Modules configuration + "sway/workspaces": { + "disable-scroll": true, + }, + "sway/window": { + "max-length": 60, + "icon": true + }, + "sway/mode": { + "format": "<span style=\"italic\">{}</span>" + }, + "sway/scratchpad": { + "format": "{icon} {count}", + "show-empty": false, + "format-icons": ["", ""], + "tooltip": true, + "tooltip-format": "{app}: {title}" + }, + "custom/rat": { + "format": " {text}", + "return-type": "json", + "exec": "$HOME/.config/waybar/rat.sh 2> /dev/null", + "on-click": "kitty --app-id ration bash -i ration", + "signal": 1, + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "tray": { + "spacing": 10 + }, + "clock": { + "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>", + "format-alt": "{:%Y-%m-%d}" + }, + "cpu": { + "format": "{usage}% ", + "tooltip": false + }, + "memory": { + "format": "{}% " + }, + "temperature": { + "critical-threshold": 80, + "format": "{temperatureC}°C {icon}", + "format-icons": ["", "", ""] + }, + "backlight": { + "format": "{percent}% {icon}", + "format-icons": ["", "", "", "", "", "", "", "", ""] + }, + "battery": { + "states": { + "warning": 30, + "critical": 15 + }, + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ", + "format-alt": "{time} {icon}", + "format-icons": ["", "", "", "", ""] + }, + "network": { + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ipaddr}/{cidr} ", + "tooltip-format": "{ifname} via {gwaddr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "Disconnected ⚠", + "format-alt": "{ifname}: {ipaddr}/{cidr}" + }, + "pulseaudio": { + "scroll-step": 1, // %, can be a float + "format": "{volume}% {icon} {format_source}", + "format-bluetooth": "{volume}% {icon} {format_source}", + "format-bluetooth-muted": " {icon} {format_source}", + "format-muted": " {format_source}", + "format-source": "{volume}% ", + "format-source-muted": "", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click": "pavucontrol" + }, +} diff --git a/.config/waybar/rat.sh b/.config/waybar/rat.sh new file mode 100755 index 0000000..04cb579 --- /dev/null +++ b/.config/waybar/rat.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +SHARE=$HOME/.local/share/rat + +return_json () { + echo '{"text": "'"$1"'", "class": "'"$2"'"}' +} + +get_time () { + endtime=$(cat $SHARE/data) + remaining=$(($endtime-$(date +%s))) + timer=$(date -u -d @$remaining +%T) + timer=${timer#00:} + timer=${timer#0} + return_json $timer "" +} + +get_program () { + name=$(cat $SHARE/data) + return_json $name "" +} + +status=$(cat $SHARE/status) + +case $status in + 0) return_json caged "" ;; + 1) get_time ;; + 2) return_json waiting waiting ;; + 3) get_program ;; + 4) return_json working "" ;; +esac diff --git a/.config/waybar/style.css b/.config/waybar/style.css new file mode 100644 index 0000000..082ed20 --- /dev/null +++ b/.config/waybar/style.css @@ -0,0 +1,205 @@ +@import "colors.css"; + +* { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: Lilex Nerd Font; + font-size: 13px; +} + +window#waybar { + background-color: alpha(@background, 0.9); + color: @foreground; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +button { + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each button name */ + border: none; + border-radius: 0; + color: @foreground; +} + +#workspaces button { + padding: 0 5px; + /* background-color: transparent; */ + /* color: @text; */ +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +#workspaces button:hover { + background: inherit; + box-shadow: inset 0 3px @color14; +} + +#workspaces button.focused { + box-shadow: inset 0 3px @color14; +} + +#workspaces button.urgent { + background-color: @color13; + color: @background; +} + +#workspaces button.urgent.focused { + box-shadow: inset 0 3px @color0; + background-color: @color13; + color: @background; +} + +#workspaces button:hover.urgent { + box-shadow: inset 0 3px @color0; + background-color: @color13; + color: @background; +} + +#mode { + border-top: 3px solid @color10; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#wireplumber, +#custom-rat, +#tray, +#mode, +#idle_inhibitor, +#scratchpad, +#mpd { + padding: 0 10px; + color: @color15; + border-top: 3px solid @color7; +} + +#workspaces { + margin: 0 4px; +} + +#window { + margin: 0 20px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0; +} + +#tray { +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +#clock { +} + +#battery { + padding-right: 18px; +} + +#battery.charging, #battery.plugged { + background-color: @color4; + border-top: 0; + padding-right: 11px; +} + +@keyframes blink { + to { + background-color: #ffffff; + border-top: 3px solid #ffffff; + color: #000000; + } +} + +#custom-rat.waiting, +#battery.critical:not(.charging) { + background-color: #f53c3c; + border-top: 3px solid #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +#memory { + padding-right: 15px; +} + +#temperature { + padding-right: 12px; +} + +#temperature.critical { + background-color: #eb4d4b; + border-top: 3px solid #eb4d4b; + color: #ffffff; +} + + +#network { + padding-right: 15px; +} + +#network.disconnected { +} + +#backlight { + padding-right: 11px; +} + +#pulseaudio { +} + +#pulseaudio.muted { + border-top: 3px solid @color14; + background-color: @color14; + color: @color0; +} + +#idle_inhibitor { + padding-right: 14px; +} + +#idle_inhibitor.activated { + background-color: @foreground; + color: @background; + border-top: 3px solid @color7; +} + +label:focus { + background-color: #000000; +} + +#scratchpad { + background: @color1; +} + +#scratchpad.empty { + background-color: transparent; +} diff --git a/.config/xplr/init.lua b/.config/xplr/init.lua new file mode 100644 index 0000000..c935ada --- /dev/null +++ b/.config/xplr/init.lua @@ -0,0 +1,62 @@ +version = "1.0.0" + +local home = os.getenv("HOME") +package.path = home + .. "/.config/xplr/plugins/?/init.lua;" + .. home + .. "/.config/xplr/plugins/?.lua;" + .. package.path + +local xpm_path = home .. "/.local/share/xplr/dtomvan/xpm.xplr" +local xpm_url = "https://github.com/dtomvan/xpm.xplr" +package.path = package.path +.. ";" + .. xpm_path + .. "/?.lua;" + .. xpm_path + .. "/?/init.lua" + +os.execute( + string.format( + "[ -e '%s' ] || git clone '%s' '%s'", + xpm_path, + xpm_url, + xpm_path + ) +) + +require("xpm").setup({ + plugins = { + 'dtomvan/xpm.xplr', + 'sayanarijit/fzf.xplr', + 'gitlab:hartan/web-devicons.xplr', + 'sayanarijit/wl-clipboard.xplr', + 'sayanarijit/map.xplr', + 'sayanarijit/zoxide.xplr', + 'sayanarijit/zentable.xplr', + }, + auto_install = true, + auto_cleanup = true, +}) + +xplr.config.modes.builtin.default.key_bindings.on_key.x = { + help = "xpm", + messages = { + "PopMode", + { SwitchModeCustom = "xpm" }, + }, +} + +require("fzf").setup({ + mode = "default", + key = "ctrl-f", + bin = "fzf", + recursive = true, + enter_dir = true, +}) + +require("wl-clipboard").setup() +require("map").setup() +require("zoxide").setup() +require("zentable").setup() +require("icons").setup() diff --git a/.config/xplr/plugins/icons.lua b/.config/xplr/plugins/icons.lua new file mode 100644 index 0000000..58e9a74 --- /dev/null +++ b/.config/xplr/plugins/icons.lua @@ -0,0 +1,90 @@ +local xplr = xplr + +local function setup() + local function black(x) + return "\x1b[30m" .. x .. "\x1b[0m" + end + + local function red(x) + return "\x1b[31m" .. x .. "\x1b[0m" + end + + local function green(x) + return "\x1b[32m" .. x .. "\x1b[0m" + end + + local function yellow(x) + return "\x1b[33m" .. x .. "\x1b[0m" + end + + local function blue(x) + return "\x1b[34m" .. x .. "\x1b[0m" + end + + local function magenta(x) + return "\x1b[35m" .. x .. "\x1b[0m" + end + + local function cyan(x) + return "\x1b[36m" .. x .. "\x1b[0m" + end + + local function white(x) + return "\x1b[37m" .. x .. "\x1b[0m" + end + + xplr.config.node_types.mime_essence = { + audio = { + ["*"] = { meta = { icon = yellow "" } }, + }, + video = { + ["*"] = { meta = { icon = "" } }, + }, + image = { + ["*"] = { meta = { icon = "" } }, + }, + application = { + -- application/zip + zip = { meta = { icon = "" } }, + }, + text = { + ["*"] = { meta = { icon = "" } }, + }, + } + + xplr.config.node_types.directory.meta.icon = blue "" + xplr.config.node_types.file.meta.icon = cyan "" + xplr.config.node_types.symlink.meta.icon = magenta "" + + xplr.config.node_types.special["Desktop"] = { meta = { icon = blue "" } } + xplr.config.node_types.special["Documents"] = { meta = { icon = blue "" } } + xplr.config.node_types.special["Downloads"] = { meta = { icon = blue "" } } + xplr.config.node_types.special["Music"] = { meta = { icon = blue "" } } + xplr.config.node_types.special["Pictures"] = { meta = { icon = blue "" } } + xplr.config.node_types.special["Templates"] = { meta = { icon = blue "" } } + xplr.config.node_types.special["Videos"] = { meta = { icon = blue "" } } + + xplr.config.node_types.extension["7z"] = { meta = { icon = "" } } + xplr.config.node_types.extension.apk = { meta = { icon = "" } } + xplr.config.node_types.extension.bz2 = { meta = { icon = "" } } + xplr.config.node_types.extension.cab = { meta = { icon = "" } } + xplr.config.node_types.extension.cbr = { meta = { icon = "" } } + xplr.config.node_types.extension.cbr = { meta = { icon = "" } } + xplr.config.node_types.extension.cbz = { meta = { icon = "" } } + xplr.config.node_types.extension.cpio = { meta = { icon = "" } } + xplr.config.node_types.extension.gz = { meta = { icon = "" } } + xplr.config.node_types.extension.gzip = { meta = { icon = "" } } + xplr.config.node_types.extension.lha = { meta = { icon = "" } } + xplr.config.node_types.extension.lzh = { meta = { icon = "" } } + xplr.config.node_types.extension.lzma = { meta = { icon = "" } } + xplr.config.node_types.extension.rar = { meta = { icon = "" } } + xplr.config.node_types.extension.rpm = { meta = { icon = "" } } + xplr.config.node_types.extension.tar = { meta = { icon = "" } } + xplr.config.node_types.extension.tgz = { meta = { icon = "" } } + xplr.config.node_types.extension.txz = { meta = { icon = "" } } + xplr.config.node_types.extension.xbps = { meta = { icon = "" } } + xplr.config.node_types.extension.xz = { meta = { icon = "" } } + xplr.config.node_types.extension.zip = { meta = { icon = "" } } +end + +return { setup = setup } diff --git a/.config/zathura/.nextcloudsync.log b/.config/zathura/.nextcloudsync.log new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/zathura/.nextcloudsync.log diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc new file mode 100644 index 0000000..8556efd --- /dev/null +++ b/.config/zathura/zathurarc @@ -0,0 +1,4 @@ +include colors +set font LilexNerdFont +set selection-clipboard clipboard +set database sqlite |