1
Fork 0

Started rewriting my nixos config

This commit is contained in:
Matei Adriel 2022-12-28 13:27:18 +01:00
parent f9f3b19299
commit 1b17dc6cf3
186 changed files with 135 additions and 7404 deletions

View file

@ -1,5 +0,0 @@
indent_width: 2
column_limit: 100
keep_simple_function_one_line: false
spaces_inside_table_braces: true
chop_down_table: true

21
LICENSE
View file

@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2015 Joe Martella
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -1,19 +0,0 @@
# Nixos-config
My flake based nixos configuration. To use this, just rebuild your system using `sudo nixos-rebuild switch --flake .` while in the project directory.
## Neovim config
Check out my neovim config in [this directory](./dotfiles/neovim)
<!-- Drew this using venn.nvim
┌┬┬┬┬┬─┬─┬─┬──┬──┬───┬─────┐┌─────┐
├┼┼┼┼┼┬┴┬┴┬┴─┬┴─┬┴─┬─┴──┬──┘│START│ ┌┐
├┼┼┼┼┼┴┬┴┬┴──┴──┴──┴────┘ └─┬┬┬─┘ ││┌┐ ┌───────────┐
├┼┼┼┼┼┬┴┬┘ │││ ││││┌┐┌──────────────────►│ │
└┴┴┴┴┴┴─┘┌──────────────┐ │││ │││││││ ┌───────┐ │ hmmmm ┌─ │ ───────┐
│SOMETHING ELSE├─────┴┴┴───┬┼┼┼┼┼┼┼─│HMMMMMM│ │ │ │ │
└──────────────┘ ││││││└┘ └───────┘ └─────── │ ─┘ │
││││└┘ └───────────┘
└┘└┘
-->

View file

@ -1,77 +0,0 @@
{ pkgs, lib, ... }:
let
theme = pkgs.myThemes.current;
in
{
imports = [ ./modules ];
boot.tmpOnTmpfs = false;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
services.xserver.videoDrivers = [
# "displaylink"
"modesetting"
];
hardware.pulseaudio.enable = lib.mkForce false;
# rtkit is optional but recommended
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
boot.loader = {
# systemd-boot.enable = true;
efi = {
canTouchEfiVariables = true;
# assuming /boot is the mount point of the EFI partition in NixOS (as the installation section recommends).
efiSysMountPoint = "/boot";
};
grub = {
# despite what the configuration.nix manpage seems to indicate,
# as of release 17.09, setting device to "nodev" will still call
# `grub-install` if efiSupport is true
# (the devices list is not used by the EFI grub install,
# but must be set to some value in order to pass an assert in grub.nix)
devices = [ "nodev" ];
efiSupport = true;
enable = true;
# set $FS_UUID to the UUID of the EFI partition
extraEntries = ''
menuentry "Windows" {
insmod part_gpt
insmod fat
insmod search_fs_uuid
insmod chain
search --fs-uuid --set=root $FS_UUID
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
'';
# theme = theme.grub.path;
version = 2;
};
};
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Enable sound.
sound.enable = true;
system.stateVersion = "19.03";
home-manager.users.adrielus.home.stateVersion = "19.03";
# TODO: put nixpkgs stuff inside their own file
nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowBroken = true;
}

View file

@ -1,28 +0,0 @@
if status is-interactive
and not set -q TMUX
exec tmux attach -t Welcome || tmux || echo "Something went wrong trying to start tmux"
end
set fish_cursor_default block # Set the normal and visual mode cursors to a block
set fish_cursor_insert line # Set the insert mode cursor to a line
set fish_cursor_replace_one underscore # Set the replace mode cursor to an underscore
# Force fish to skip some checks (I think)
set fish_vi_force_cursor
function fish_user_key_bindings
# Use the vim keybinds
fish_vi_key_bindings
# Use jj to exit insert mode
bind -e -M insert \e # unbinds esc
bind -M insert -m default jk 'commandline -f repaint'
bind -M insert -m default kj 'commandline -f repaint'
end
# direnv hook, aparently
# https://direnv.net/docs/hook.html
direnv hook fish | source
# allow using packages installed by pnpm
fish_add_path $HOME/.PNPM_HOME

View file

@ -1,6 +0,0 @@
# KMonad config
## Useful links
- [Config tutorial](https://github.com/kmonad/kmonad/blob/master/keymap/tutorial.kbd)
- [Homerow mod stuff](https://precondition.github.io/home-row-mods#using-home-row-mods-with-kmonad)

View file

@ -1,155 +0,0 @@
(defcfg
;; For Linux
;; input (device-file "$DEVICE") ;; gets dynamically replaced by nix
;; input (device-file "/dev/input/by-path/pci-0000:00:14.0-usb-0:5:1.0-event-kbd")
input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd")
output (uinput-sink "My KMonad output"
;; To understand the importance of the following line, see the section on
;; Compose-key sequences at the near-bottom of this file.
"/run/current-system/sw/bin/sleep 1 && /run/current-system/sw/bin/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
;; Comment this is you want unhandled events not to be emitted
fallthrough true
;; Set this to false to disable any command-execution in KMonad
allow-cmd false
)
;; Layer template:
#|
(deflayer qwerty
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _
)
|#
(defalias
ga #(ralt a h) ;; alpha
gb #(ralt b h) ;; beta
gg #(ralt g h) ;; gamma
ge #(ralt e h) ;; epsilon
gt #(ralt t h) ;; tau
gl #(ralt l h) ;; lambda
gm #(ralt m h) ;; miu
gp #(ralt p h) ;; pi
gx #(ralt x h) ;; xi
gs #(ralt s h) ;; sigma
go #(ralt o h) ;; omega
gu #(ralt u h) ;; uspilon
gd #(ralt d h) ;; delta
gph #(ralt l p h h) ;; phi
gth #(ralt l t h h) ;; theta
gps #(ralt l p s h) ;; psi
Gu #(ralt u j) ;; UPSILON
Gg #(ralt g j) ;; GAMMA
Gd #(ralt d j) ;; DELTAJ
Gp #(ralt p j) ;; PI
Gs #(ralt s j) ;; SIGMA
Go #(ralt o j) ;; OMEGA
Gx #(ralt x j) ;; XI
neg #(ralt l -) ;; ¬
fal #(ralt l v) ;; ∀
ex #(ralt l e) ;; ∃
lar #(ralt < -) ;; ←
rar #(ralt - >) ;; →
and #(ralt l c) ;; and symbol
or #(ralt l d) ;; or symbol
eq #(ralt e q) ;; Equivalence
alp #(ralt f \( ) ;; angled left parenthesis
arp #(ralt f \) ) ;; angled right parenthesis
shrugFace #(ralt l s h r) ;; shrug face
topBar #(ralt t -) ;; ¯
)
;; layers
(defalias
mth (layer-toggle math)
Mth (layer-toggle capital-math)
mov (layer-toggle movement)
mathExtra (layer-toggle math-extra)
sft (tap-macro lsft (layer-toggle shiftedQwerty)) ;; make this work differently based on the next key pressed
j (tap-macro 7 lsft)
;; spc (spc) ;; (tap-hold-next-release 130 spc lsft)
tab (tap-hold-next 150 tab rctl)
)
;; more "special" stuff
(defalias
shr #(@topBar \ \_ \_ \( @shrugFace \) \_ / @topBar) ;; ¯\_(ツ)_/¯
ml @gl
)
(defsrc
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 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
lctl lsgt lmet lalt spc ralt rctl
)
(deflayer qwerty
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
@tab q w e r t y u i o p [ ] \
@mth a s d f g h j k l ; ' ret
@sft z x c v b n m , . / rsft
@mov lsgt lmet lalt spc ralt rctl
)
(deflayer shiftedQwerty
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ ! @ # $ % ^ & 8 \( \) _ + S-bspc
S-tab Q W E R T Y U I O P { } |
@Mth A S D F G H J K L : " S-ret
XX Z X C V B N M < > ? _
_ _ _ _ spc S-ralt S-rctl
)
(deflayer movement
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ lft down up rght _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _
)
(deflayer math-extra
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ @eq _ _ _ _ _ @or _ _ _ _
_ @and _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _
)
(deflayer math
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ @ex _ _ _ _ _ @alp @arp @neg _ _
_ @shr @go @ge _ @gt _ @gu _ @go @gp _ _ _
_ @ga @gs @gd _ @gg @gth @gps @gph @ml _ _ _
@Mth _ @gx _ @fal @gb _ @gm @lar @rar _ _
_ _ _ _ @mathExtra _ _
)
(deflayer capital-math
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ @Gu _ @Go @Gp _ _ _
_ _ @Gs @Gd _ @Gg _ _ _ _ _ _ _
_ _ @Gx _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _
)

View file

@ -1,2 +0,0 @@
#!/run/current-system/sw/bin/bash
kmonad -d "`dirname "$0"`/keymap.kbd"

View file

@ -1,46 +0,0 @@
# -*- coding: utf-8; mode: conf -*- include "%L"
<Multi_key> <a> <h> : "ɑ" U0251 # LATIN SMALL LETTER ALPHA
<Multi_key> <b> <h> : "β" U0252 # LATIN SMALL LETTER BETA
<Multi_key> <g> <h> : "γ" U0253 # LATIN SMALL LETTER GAMMA
<Multi_key> <e> <h> : "ϵ" U0254 # LATIN SMALL LETTER EPSILON
<Multi_key> <l> <h> : "λ" U0255 # LATIN SMALL LETTER LAMBDA
<Multi_key> <m> <h> : "μ" U0256 # LATIN SMALL LETTER MU
<Multi_key> <p> <h> : "π" U0257 # LATIN SMALL LETTER PI
<Multi_key> <t> <h> : "τ" U0258 # LATIN SMALL LETTER TAU
<Multi_key> <x> <h> : "ξ" U0259 # LATIN SMALL LETTER XI
<Multi_key> <s> <h> : "σ" U0260 # LATIN SMALL LETTER SIGMA
<Multi_key> <o> <h> : "ω" U0261 # LATIN SMALL LETTER OMEGA
<Multi_key> <u> <h> : "υ" U0262 # LATIN SMALL LETTER UPSILON
<Multi_key> <d> <h> : "δ" U0263 # LATIN SMALL LETTER DELTA
<Multi_key> <l> <p> <h> <h> : "ϕ" U0270 # LATIN SMALL LETTER PHI
<Multi_key> <l> <t> <h> <h> : "θ" U0271 # LATIN SMALL LETTER THETA
<Multi_key> <l> <p> <s> <h> : "ψ" U0272 # LATIN SMALL LETTER PSI
<Multi_key> <u> <j> : "ϒ" U0280 # LATIN CAPITAL LETTER UPSILON
<Multi_key> <g> <j> : "Γ" U0281 # LATIN CAPITAL LETTER GAMMA
<Multi_key> <d> <j> : "Δ" U0282 # LATIN CAPITAL LETTER DELTA
<Multi_key> <p> <j> : "Π" U0283 # LATIN CAPITAL LETTER PI
<Multi_key> <s> <j> : "Σ" U0284 # LATIN CAPITAL LETTER SIGMA
<Multi_key> <o> <j> : "Ω" U0285 # LATIN CAPITAL LETTER OMEGA
<Multi_key> <x> <j> : "Ξ" U0286 # LATIN CAPITAL LETTER XI
<Multi_key> <l> <t> <h> <j> : "Θ" U0300 # LATIN CAPITAL LETTER OMEGA
<Multi_key> <l> <s> <h> <r> : "ツ" U0350 # SHRUG FACE
<Multi_key> <t> <minus> : "¯" U0351 # TOP BAR
<Multi_key> <l> <minus> : "¬" U0352 # LOGICAL NEGATION
<Multi_key> <minus> <greater> : "→" U0353 # ARROW RIGHT
<Multi_key> <less> <minus> : "←" U0354 # ARROW LEFT
<Multi_key> <l> <v> : "∀" U0355 # LOGICAL FORALL
<Multi_key> <l> <e> : "∃" U0356 # LOGICAL EXISTS
<Multi_key> <f> <parenleft> : "⟨" U0357 # FANCY LEFT PAREN
<Multi_key> <f> <parenright> : "⟩" U0358 # FANCY RIGHT PAREN
<Multi_key> <e> <q> : "⟷" U0359 # LOGICAL EQUIVALENCE
<Multi_key> <l> <c> : "∧" U0360 # LOGICAL CONJUNCTION
<Multi_key> <l> <d> : "" U0361 # LOGICAL DISJUNCTION

View file

@ -1,17 +0,0 @@
{
"neoconf": {
"plugins": {
"sumneko_lua": {
"enabled": true
}
}
},
"neodev": {
"library": {
"enabled": true,
"types": true,
"plugins": false,
"runtime": true
}
}
}

View file

@ -1,128 +0,0 @@
# Neovim config
## Articles
- [Textobjects](https://blog.carbonfive.com/vim-text-objects-the-definitive-guide/)
- [Registers](https://www.brianstorti.com/vim-registers/)
- [Markers](https://vim.fandom.com/wiki/Using_marks)
## Keybinds
Table of my own keybinds. Here as documentation for myself. I am yet to include any of the keybinds for cmp here.
> Things written using italics are chords
> (aka all the keys need to be pressed at the same time)
| Keybind | Description | Plugins |
| ------------ | ----------------------------------- | ------------------ |
| _vs_ | Create vertical split | |
| _cp_ | Use system clipboard | |
| _jl_ | Save | |
| _jk_ | Exit insert mode | |
| _rw_ | Rename word under cursor | |
| _\<leader>k_ | Insert digraph | |
| _\<leader>a_ | Swap last 2 used buffers | |
| C-n | Open tree | nvim-tree |
| _vc_ | Clear vimux window | vimux |
| _vl_ | Rerun last vimux command | vimux |
| _vp_ | Run command in another tmux pane | vimux |
| C-hjkl | Navigation between vim & tmux panes | vim-tmux-navigator |
| J | Show line diagnostics | lspconfig |
| K | Show hover info | lspconfig |
| L | Signature help (?) | lspconfig |
| gD | Go to declaration | lspconfig |
| gd | Go to definition | lspconfig |
| gi | Go to implementation | lspconfig |
| \<leader>rn | Rename | lspconfig |
| \<leader>f | format | lspconfig |
| \<leader>ca | code actions | lspconfig |
### Telescope
| Keybind | Description | Plugins |
| ----------- | ------------------------------ | ---------------------- |
| Ctrl-P | Find files | |
| Ctrl-F | Grep in project | |
| \<leader>d | Diagnostics | lspconfig |
| \<leader>ca | Code actions | lspconfig |
| \<leader>t | Show builtin pickers | |
| \<leader>s | Show symbols using tree-sitter | |
| \<leader>gj | List git commits | |
| \<leader>gk | List git branches | |
| _jp_ | Interactive file broswer | telescope-file-browser |
| _ui_ | Insert unicode char | |
### Idris
> The idris and arpeggio plugins are implicit here
| Keybind | Description |
| ------- | ------------------- |
| _isc_ | Case split |
| _imc_ | Make case |
| _iml_ | Make lemma |
| _ies_ | Expression search |
| _igd_ | Generate definition |
| _irh_ | Refine hole |
| _iac_ | Add clause |
### Purescript
| Keybind | Description |
| ------- | ------------------------------------------- |
| _vb_ | Make tmux run spago build in sepearate pane |
| _vt_ | Make tmux run spago test in separate pane |
### Nix
| Keybind | Description |
| ------- | ------------------------------------ |
| _ug_ | Run nix-fetchgit on the current file |
### Lean
- Extra brackets: ⟨⟩
## Some cool vim keybinds I sometimes forget about
Documentation for myself
| Keybind | Description | Plugins |
| ------- | ----------------------- | ------- |
| zz | Center the current line | |
## Important plugins I use the default mappins of
- paperplanes
| Keybind | Description |
| ------- | ------------------------- |
| :PP | Create pastebin-like link |
- nvim-comment
| Keybind | Description |
| ------- | ----------------- |
| gcc | Comment line |
| gc | Comment selection |
- neogit
| Keybind | Description |
| ------- | ----------- |
| C-g | Open neogit |
- gitlinker
| Keybind | Description |
| ---------- | ------------------ |
| <leader>gy | Create remote link |
- nvim-surround
| Keybind | Description | Mode |
| -------- | ----------------------------------- | ---- |
| cs[a][b] | Change surrounding pair from a to b | n |
| ds[a] | Delete surrounding pair of a | n |
| ys[m][a] | Surround the motion m with a | n |
| S[a] | Surround selected code with a | v |

View file

@ -1,7 +0,0 @@
vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
group = vim.api.nvim_create_augroup("Detect hkf", {}),
pattern = "*.hkf",
callback = function()
vim.opt.filetype = "hkf"
end
})

View file

@ -1 +0,0 @@
vim.api.nvim_buf_set_option(0, "commentstring", "-- %s")

View file

@ -1,25 +0,0 @@
local opts = function(desc)
return { desc = desc, buffer = true }
end
vim.keymap.set("n", "<leader>lf", ":source %<cr>", opts("Run [l]ua [f]ile "))
vim.keymap.set("n", "<leader>ls", function()
local path = vim.api.nvim_buf_get_name(0)
local status, M = pcall(dofile, path)
if status then
if M ~= nil then
if type(M.setup) == "function" then
M.setup()
print("M.setup() executed succesfully!")
else
print("Module does not return a setup function")
end
else
print("Module returned nil")
end
else
print("Cannot import current file :(")
end
end, opts("Run .setup() in current file"))

View file

@ -1,9 +0,0 @@
-- Use _<leader>lg_ to fetchgit stuff
vim.keymap.set("n", "<leader>lg", function()
require("my.helpers").saveCursor(function()
vim.cmd(":%!update-nix-fetchgit")
end)
end, { buffer = true, desc = "Update all fetchgit calls" })
-- Idk why this isn't here by default
vim.api.nvim_buf_set_option(0, "commentstring", "# %s")

View file

@ -1,32 +0,0 @@
local A = require("my.abbreviations")
-- Use vt to test
vim.keymap.set(
"n",
"<leader>vt",
':VimuxRunCommand "clear && spago test"<CR>',
{ desc = "[V]imtex run [t]ests", buffer = true }
)
-- Use vb to build
vim.keymap.set(
"n",
"<leader>vb",
':VimuxRunCommand "clear && spago build"<CR>',
{ desc = "[V]imtex [b]uild", buffer = true }
)
vim.opt.expandtab = true -- Use spaces for the tab char
local abbreviations = {
{ "land", "/\\" },
{ "lor", "\\/" },
{ "tto", "->" },
{ "iip", "=>" },
{ "frl", "forall" },
{ "ott", "<-" }, -- opposite of tto
}
A.manyLocalAbbr(abbreviations)

View file

@ -1,170 +0,0 @@
local A = require("my.abbreviations")
local scrap = require("scrap")
require("my.helpers.wrapMovement").setup()
vim.opt.conceallevel = 0
vim.opt.wrap = true
vim.keymap.set("n", "<leader>lg", function()
if not pcall(function()
local a = tonumber(vim.fn.input("A: "))
local b = tonumber(vim.fn.input("B: "))
local g, x, y = require("my.helpers.math.mod").gcd(a, b)
vim.fn.input("Result: " .. g .. " " .. x .. " " .. y)
end) then vim.fn.input("No results exist") end
end, { buffer = true, desc = "Gcd calculator" })
vim.keymap.set("n", "<leader>li", function()
if not pcall(function()
local class = tonumber(vim.fn.input("Mod class: "))
local num = tonumber(vim.fn.input("Number: "))
vim.fn.input("Result: " .. require("my.helpers.math.mod").modinverse(num, class))
end) then vim.fn.input("No results exist") end
end, { buffer = true, desc = "Mod inverse calculator" })
local abbreviations = {
-- Greek chars
{ "eps", "\\epsilon" },
{ "delta", "\\delta" },
{ "Delta", "\\Delta" },
{ "pi", "\\pi" },
{ "psi", "\\psi" },
{ "alpha", "\\alpha" },
{ "beta", "\\beta" },
{ "theta", "\\theta" },
{ "gamma", "\\gamma" },
{ "lam", "\\lambda" },
{ "nuls", "\\varnothing" }, -- Other fancy symvols
{ "tmat", "^T" }, -- Tranpose of a matrix
{ "cmat", "^*" }, -- Conjugate of a matrix
{ "ortco", "^{\\bot}" }, -- Orthogonal complement
{ "sinter", "^{\\circ}" }, -- Interior of a set
-- Basic commands
{ "mangle", "\\measuredangle" },
{ "aangle", "\\angle" },
{ "sdiff", "\\setminus" },
{ "sst", "\\subset" },
{ "sseq", "\\subseteq" },
{ "nin", "\\not\\in" },
{ "iin", "\\in" },
{ "tto", "\\to" },
{ "iip", "\\implies" },
{ "iff", "\\iff" },
{ "land", "\\land" },
{ "lor", "\\lor" },
{ "ssin", "\\sin" },
{ "ccos", "\\cos" },
{ "ttan", "\\ttan" },
{ "ssec", "\\sec" },
{ "lln", "\\ln" },
{ "frl", "\\forall" },
{ "exs", "\\exists" },
{ "iinf", "\\infty" },
{ "ninf", "-\\infty" },
{ "nlnl", "\\pm" }, -- had this as npnp first but it was hard-ish to type
{ "ccup", "\\cup" },
{ "ccap", "\\cap" },
{ "nope", "\\bot" },
{ "yee", "\\top" },
{ "ccan", "\\cancel" },
{ "comp", "\\circ" },
{ "mul", "\\cdot" },
{ "smul", "\\times" },
{ "card", "\\#" },
{ "div", "\\|" },
{ "ndiv", "\\not\\|\\:" },
-- words
{ "rref", "reduced row echalon form" }
}
---@type ExpansionOptions
local no_capitalization = { capitalized = false }
-- Todo: convert exponents and subscripts
-- to use this more concise notation.
---@type ExpansionInput[]
local abolishAbbreviations = {
-- General phrases
{ "thrf", "therefore" },
{ "bcla", "by contradiction let's assume" },
{ "wlg", "without loss of generality" },
-- Calculus
{ "ib{p,s}", "integration by {parts,substitution}" },
-- Linear algebra
{ "eg{va,ve,p}{,s}", "eigen{value,vector,pair}{}" },
{ "mx{,s}", "matri{x,ces}" },
{ "dete{,s}", "determinant{}" },
{ "ort{n,g}", "orto{normal,gonal}" },
{ "l{in,de}", "linearly {independent,dependent}" },
-- My own operator syntax:
-- - Any operator can be prefixed with "a" to
-- align in aligned mode
-- - Any operator can be prefixed with cr to
-- start a new line and align in aligned mode
{
"{cr,a,}{eq,neq,leq,geq,lt,gt}",
"{\\\\\\&,&,}{=,\\neq,\\leq,\\geq,<,>}",
options = no_capitalization
},
-- Exponents and subscripts:
-- {operation}{argument}
-- - operation = e (exponent) | s (subscript)
-- - argument = t{special} | {basic}
-- - basic = 0-9|n|i|t|k
-- - special =
-- - "p" => +
-- - "m" => -
-- - "i" => -1
{
"{e,s}{{0,1,2,3,4,5,6,7,8,9,n,i,t,k},t{i,m,p}}",
"{^,_}{{},{\\{-1\\},-,+}}",
options = no_capitalization
},
-- Set symbols
-- - nats => naturals
-- - ints => integers
-- - rats => rationals
-- - irats => irationals
-- - rrea => reals
-- - comp => complex
-- - ppri => primes
-- - ffie => fields
{
"{nats,ints,rats,irats,rrea,comp,ppri,ffie}",
"\\mathbb\\{{N,Z,Q,I,R,C,P,F}\\}",
options = no_capitalization
},
-- Function calls:
-- {function-name}{modifier?}{argument}
--
-- - function-name = f/g/h/P
-- - modifier:
-- - d => derivative
-- - 2 => squared
-- - 3 => cubed
-- - i => inverse
-- - argument = x/a/t/i/n/k
{ "{f,g,h,P}{d,2,3,i,}{x,a,t,i,n,k}", "{}{',^2,^3,^\\{-1\\},}({})" }
}
local expanded = scrap.expand_many(abolishAbbreviations)
A.manyLocalAbbr(abbreviations)
A.manyLocalAbbr(expanded)
vim.keymap.set("n", "<leader>lc", "<cmd>VimtexCompile<cr>",
{ desc = "Compile current buffer using vimtex", buffer = true })

View file

@ -1,17 +0,0 @@
-- bootstrap from github
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",
"--single-branch",
"git@github.com:folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
require("my.init").setup()

View file

@ -1,66 +0,0 @@
{
"LuaSnip": { "branch": "master", "commit": "5570fd797eae0790affb54ea669a150cad76db5d" },
"abbreinder.nvim": { "branch": "main", "commit": "5b2b5ff08a9ada42238d733aeebc6d3d96314d77" },
"abbremand.nvim": { "branch": "main", "commit": "d633341f632b0b2666dfc6dfe6b9842ba1610a1d" },
"catppuccin": { "branch": "main", "commit": "55f43a952856bc0029e6cef066297c6cfab3451d" },
"clipboard-image.nvim": { "branch": "main", "commit": "d1550dc26729b7954f95269952e90471b838fa25" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" },
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
"cmp-nvim-lsp": { "branch": "main", "commit": "59224771f91b86d1de12570b4070fe4ad7cd1eeb" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"dashboard-nvim": { "branch": "master", "commit": "115b9f9cec10e31aff39c077bf5a4881bc840916" },
"dhall-vim": { "branch": "master", "commit": "68500ef46ff3706f46c99db3be7a0c8abcf6a3ae" },
"dressing.nvim": { "branch": "master", "commit": "4436d6f41e2f6b8ada57588acd1a9f8b3d21453c" },
"fidget.nvim": { "branch": "main", "commit": "44585a0c0085765195e6961c15529ba6c5a2a13b" },
"firenvim": { "branch": "master", "commit": "17a189f0f1e2d4197e00cd56dbeaed8c268bac8c" },
"gitlinker.nvim": { "branch": "master", "commit": "c68d4873a14d2ae614875685ccca2e49472989e8" },
"glow.nvim": { "branch": "main", "commit": "20d1cd087f8728f21a048a3b6259f6177237b39e" },
"hydra.nvim": { "branch": "master", "commit": "7e2aa29f88d534371c6b0263d3abbfac7c2376ce" },
"idris2-nvim": { "branch": "main", "commit": "dd850c1c67bcacd2395121b0898374fe9cdd228f" },
"inc-rename.nvim": { "branch": "main", "commit": "48c4aa2be19f79e79b465a9bb37ee9fbe6c606f5" },
"iron.nvim": { "branch": "master", "commit": "bd5ad2a04195fb7a739eb973fa2d9f7ccc35ab4b" },
"kmonad-vim": { "branch": "master", "commit": "37978445197ab00edeb5b731e9ca90c2b141723f" },
"knap": { "branch": "main", "commit": "62eae7803d9d87d33513b3b565c6f5791f1de1ea" },
"kotlin-vim": { "branch": "master", "commit": "1261f851e5fb2192b3a5e1691650597c71dfce2f" },
"lazy.nvim": { "branch": "main", "commit": "0d0d11acb2547ea65e0eba4fb6855f0954ed0239" },
"leap": { "branch": "main", "commit": "a5c9504290832e6bdbbb6265fd1ff02fc6485d20" },
"lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" },
"lualine.nvim": { "branch": "master", "commit": "fffbcb829288c3ca366f17cdb8d46aefb5c1d6f3" },
"mind.nvim": { "branch": "master", "commit": "5aa39d57d1091999ca5bdcdd056a27a032156c2d" },
"neoconf.nvim": { "branch": "main", "commit": "71e86dc9324069807c1135c46c0c9f6eb793966b" },
"neodev.nvim": { "branch": "main", "commit": "f6ee1a7651280ac476403c0b70bbfb419fa720ab" },
"neogit": { "branch": "master", "commit": "0d6002c6af432343937283fb70791fc76fa7227c" },
"nui.nvim": { "branch": "main", "commit": "4939282919885e1c83aff68ecb35b3cadf6015a9" },
"null-ls.nvim": { "branch": "main", "commit": "eaacba0b93c416252894f8bdc68e6b50b4e4c3b4" },
"nvim-autopairs": { "branch": "master", "commit": "03580d758231956d33c8dd91e2be195106a79fa4" },
"nvim-cmp": { "branch": "main", "commit": "e55033fce468c9c578b946948807f2ac48a6ee08" },
"nvim-comment": { "branch": "main", "commit": "e9ac16ab056695cad6461173693069ec070d2b23" },
"nvim-lspconfig": { "branch": "master", "commit": "42ca8ce0f2252be795da4789fadfa91f6c3f7464" },
"nvim-tree.lua": { "branch": "master", "commit": "9e4c39572f631bb60ee15cb9d46e1daa9927a45e" },
"nvim-treesitter": { "branch": "master", "commit": "fb36ed4c9e962d9fbfa608cd4a5d9313b1e8a8b1" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "83a494a6f93675beff7bbd320c04c87433b1462f" },
"nvim-web-devicons": { "branch": "master", "commit": "05e1072f63f6c194ac6e867b567e6b437d3d4622" },
"nvim_context_vt": { "branch": "master", "commit": "31436f34f3f95e4e70853cd653fdf78246cb0e85" },
"paperplanes.nvim": { "branch": "master", "commit": "d704b2e1e594b32d454cc7e0c5f2cf9b391e3cc1" },
"plenary.nvim": { "branch": "master", "commit": "4b7e52044bbb84242158d977a50c4cbcd85070c7" },
"presence.nvim": { "branch": "main", "commit": "c1c54758824cbecd4e18065d37191f7666fdd097" },
"purescript-vim": { "branch": "main", "commit": "7af25a840d38dc6767c85edd1f35c1f835618071" },
"scrap.nvim": { "branch": "main", "commit": "16db44ae9403ec9c4b140394f294475d1af80a18" },
"smart-splits.nvim": { "branch": "master", "commit": "fdd158ce7554dc830fb86e0fe952cd9476cdf726" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "b8581d00afa02c6bb4c947348e3cee62db65b119" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "fab3e2212e206f4f8b3bbaa656e129443c9b802e" },
"telescope.nvim": { "branch": "master", "commit": "e960efa60e97df58e089b00270f09d60f27202c8" },
"venn.nvim": { "branch": "main", "commit": "c114563960b8fb1197695d42798d1f3e7190b798" },
"vim-abolish": { "branch": "master", "commit": "3f0c8faadf0c5b68bcf40785c1c42e3731bfa522" },
"vim-arpeggio": { "branch": "master", "commit": "01c8fc1a72ef58e490ee0490c65ee313b1b6e843" },
"vim-sleuth": { "branch": "master", "commit": "8332f123a63c739c870c96907d987cc3ff719d24" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
"vim-teal": { "branch": "master", "commit": "d2aa107b257879e774680792a2aebaf9cd5742e0" },
"vim-tmux-navigator": { "branch": "master", "commit": "41ea9d23b814014c8d8daf8b44fa0cd827a0e5f4" },
"vim-wakatime": { "branch": "master", "commit": "8c7f33b43a56f89285de0da77ee6ec7e4af1f835" },
"vimtex": { "branch": "master", "commit": "5e03d9052de30c8e4c2f4907600783112454028a" },
"vimux": { "branch": "master", "commit": "616fcb4799674a7a809b14ca2dc155bb6ba25788" },
"which-key.nvim": { "branch": "main", "commit": "8682d3003595017cd8ffb4c860a07576647cc6f8" }
}

View file

@ -1,4 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"Lua.workspace.checkThirdParty": false
}

View file

@ -1,19 +0,0 @@
local M = {}
function M.localAbbr(lhs, rhs)
-- Create abbreviation
vim.cmd(":iabbrev <buffer> " .. lhs .. " " .. rhs)
end
function M.manyLocalAbbr(abbreviations)
for _, value in pairs(abbreviations) do
M.localAbbr(value[1], value[2])
end
end
function M.abbr(lhs, rhs)
-- Create abbreviation
vim.cmd(":iabbrev " .. lhs .. " " .. rhs)
end
return M

View file

@ -1,19 +0,0 @@
local M = {}
function M.mergeTables(t1, t2)
local t3 = {}
if t1 ~= nil then for k, v in pairs(t1) do t3[k] = v end end
if t2 ~= nil then for k, v in pairs(t2) do t3[k] = v end end
return t3
end
function M.saveCursor(callback)
local cursor = vim.api.nvim_win_get_cursor(0)
callback()
vim.api.nvim_win_set_cursor(0, cursor)
end
return M

View file

@ -1,40 +0,0 @@
local function makeEnv(cond)
return {
active = cond,
not_active = function()
return not cond()
end,
unless = function(f)
if not cond() then
f()
end
end,
when = function(f)
if cond() then
f()
end
end,
}
end
return {
vscode = makeEnv(function()
return vim.g.vscode ~= nil
end),
neovide = makeEnv(function()
return vim.g.neovide ~= nil or os.getenv("INSIDE_NEOVIDE") == "1"
end),
firenvim = makeEnv(function()
return vim.g.started_by_firenvim ~= nil
end),
_and = function(a, b)
return makeEnv(function()
return a.active() and b.active()
end)
end,
_or = function(a, b)
return makeEnv(function()
return a.active() or b.active()
end)
end
}

View file

@ -1,15 +0,0 @@
local M = {}
function M.modinverse(b, m)
local g, x, _ = M.gcd(b, m)
if g ~= 1 then return nil end
return x % m
end
function M.gcd(a, b)
if a == 0 then return b, 0, 1 end
local g, x1, y1 = M.gcd(b % a, a)
return g, y1 - (math.floor(b / a)) * x1, x1
end
return M

View file

@ -1,22 +0,0 @@
local M = {}
local function swap(key)
vim.keymap.set({ "n", "v" }, key, "g" .. key, { buffer = true })
vim.keymap.set({ "n", "v" }, "g" .. key, key, { buffer = true })
end
-- Same as swap, but the key is aprt of an arpeggio chord
local function swapArpeggio(key)
vim.keymap.set({ "n", "v" }, "<Plug>(arpeggio-default:" .. key .. ")", "g" .. key,
{ buffer = true })
vim.keymap.set({ "n", "v" }, "g" .. key, key, { buffer = true })
end
function M.setup()
swapArpeggio("j")
swap("k")
swap("0")
swap("$")
end
return M

View file

@ -1,10 +0,0 @@
local M = {}
function M.setup()
-- Import my other files
require("my.options").setup()
require('my.keymaps').setup()
require('my.lazy').setup()
end
return M

View file

@ -1,98 +0,0 @@
local helpers = require("my.helpers")
local M = {}
-- {{{ Helpers
---Performs a basic move operation
---Moves a keybind to a different set of keys.
---Useful for moving built in keybinds out of the way.
---@param from string
---@param to string
---@param opts table|nil
function M.move(from, to, opts)
vim.keymap.set("n", to, from, opts)
vim.keymap.set("n", from, "<Nop>")
end
---Create a textobject defined by some delimiters
---@param from string
---@param to string
---@param name string
---@param perhapsOpts table|nil
function M.delimitedTextobject(from, to, name, perhapsOpts)
local opts = helpers.mergeTables(perhapsOpts or {}, { desc = name })
vim.keymap.set({ "v", "o" }, "i" .. from, "i" .. to, opts)
vim.keymap.set({ "v", "o" }, "a" .. from, "a" .. to, opts)
end
---Helper to create a normal mode mapping and give it some description.
---@param from string
---@param to string|function
---@param desc string
---@param silent boolean|nil
function M.nmap(from, to, desc, silent)
if silent == nil then
silent = true
end
vim.keymap.set("n", from, to, { desc = desc })
end
-- }}}
function M.setup()
-- {{{ Free up q and Q
M.move("q", "yq", { desc = "Record macro" })
M.move("Q", "yQ")
-- }}}
-- {{{ Easier access to <C-^>
M.move("<C-^>", "<Leader>a", { desc = "[A]lternate file" })
-- }}}
-- {{{ Quit current buffer / all buffers
vim.keymap.set({ "n", "v" }, "<leader>q", function()
local buf = vim.api.nvim_win_get_buf(0)
-- Only save if file is writable
if vim.bo[buf].modifiable and not vim.bo[buf].readonly then
vim.cmd([[write]])
end
vim.cmd("q")
end, { desc = "[Q]uit current buffer" })
M.nmap("Q", ":wqa<cr>", "Save all files and [q]uit")
-- }}}
-- {{{ Replace word in file
M.nmap("<leader>rw", ":%s/<C-r><C-w>/", "[R]eplace [w]ord in file")
-- }}}
-- {{{ Text objects
M.delimitedTextobject("q", '"', "[q]uotes")
M.delimitedTextobject("a", "'", "[a]postrophes")
M.delimitedTextobject("r", "[", "squa[r]e brackets")
-- }}}
-- {{{Diagnostic keymaps
M.nmap("[d", vim.diagnostic.goto_prev, "Goto previous [d]iagnostic")
M.nmap("]d", vim.diagnostic.goto_next, "Goto next [d]iagnostic")
M.nmap("J", vim.diagnostic.open_float, "Open current diagnostic")
M.nmap("<leader>D", vim.diagnostic.setloclist, "[D]iagnostic loclist")
-- }}}
-- {{{ Chords (exit insert mode, save, clipboard)
-- }}}
-- {{{ Allow quiting basic buffers with "q"
vim.api.nvim_create_autocmd("FileType", {
pattern = { "help" },
callback = function(event)
vim.keymap.set(
"n",
"q",
"<cmd>close<cr>",
{ buffer = event.buf, silent = true, desc = "[q]uit current buffer" }
)
end,
})
-- }}}
return M
end
return M

View file

@ -1,31 +0,0 @@
local M = {}
function M.setup()
require("lazy").setup("my.plugins", {
defaults = { lazy = true },
disabled_plugins = {
"gzip",
"matchit",
"matchparen",
"netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
install = {
-- install missing plugins on startup. This doesn't increase startup time.
missing = true,
-- try to load one of these colorschemes when starting an installation during startup
colorscheme = { "catpuccin" },
},
change_detection = {
enabled = false,
notify = false,
},
})
end
vim.keymap.set("n", "<leader>L", "<cmd>Lazy<cr>", { desc = "[L]azy ui" })
return M

View file

@ -1,22 +0,0 @@
local M = {}
function M.setup()
local default_length = 0.04
vim.g.neovide_floating_blur_amount_x = 3.0
vim.g.neovide_floating_blur_amount_y = 3.0
vim.g.neovide_transparency = 1.0
vim.g.pumblend = 30
vim.g.neovide_cursor_animation_length = default_length
vim.api.nvim_create_autocmd("WinEnter", {
group = vim.api.nvim_create_augroup("Setup transparency", {}),
pattern = "*",
callback = function()
vim.wo.winblend = 30
end,
})
vim.g.neovide_cursor_animate_in_insert_mode = false
end
return M

View file

@ -1,44 +0,0 @@
local M = {}
function M.setup()
-- Disable filetype.vim
vim.g.do_filetype_lua = true
vim.g.did_load_filetypes = false
-- Basic options
vim.opt.joinspaces = false -- No double spaces with join
vim.opt.list = true -- Show some invisible characters
vim.opt.cmdheight = 0 -- Hide command line when it's not getting used
-- Line numbers
vim.opt.number = true -- Show line numbers
vim.opt.relativenumber = true -- Relative line numbers
-- TODO: only do this for specific filestypes
vim.opt.expandtab = true -- Use spaces for the tab char
vim.opt.scrolloff = 4 -- Lines of context
vim.opt.shiftround = true -- Round indent
vim.opt.shiftwidth = 2 -- Size of an indent
vim.opt.termguicolors = true -- True color support
vim.opt.ignorecase = true -- Ignore case
vim.opt.smartcase = true -- Do not ignore case with capitals
vim.opt.smartindent = true -- Insert indents automatically
vim.opt.splitbelow = true -- Put new windows below current
vim.opt.splitright = true -- Put new windows right of current
vim.opt.wrap = false -- Disable line wrap (by default)
vim.opt.wildmode = { 'list', 'longest' } -- Command-line completion mode
vim.opt.completeopt = { "menu", "menuone", "noselect" }
-- Set leader
vim.g.mapleader = " "
-- Folding
vim.o.foldmethod = "marker"
end
return M

View file

@ -1,50 +0,0 @@
local helpers = require("my.helpers")
local M = {
-- chord support, let"s fucking goooo
"kana/vim-arpeggio",
event = "VeryLazy",
}
---Create an arpeggio mapping
---@param mode string
---@param lhs string
---@param rhs string
---@param opts table|nil
local function chord(mode, lhs, rhs, opts)
local arpeggio = vim.fn["arpeggio#map"]
if string.len(mode) > 1 then
for i = 1, #mode do
local c = mode:sub(i, i)
chord(c, lhs, rhs, opts)
end
else
local options = helpers.mergeTables(opts or {}, { noremap = true })
local settings = options.settings or ""
if options.silent then
settings = settings .. "s"
end
arpeggio(mode, settings, not options.noremap, lhs, rhs)
end
end
---Create a silent arpeggio mapping
---@param mode string
---@param lhs string
---@param rhs string
---@param opts table|nil
local function chordSilent(mode, lhs, rhs, opts)
local options = helpers.mergeTables(opts or {}, { silent = true })
chord(mode, lhs, rhs, options)
end
function M.config()
chordSilent("n", "ji", ":silent :write<cr>") -- Saving
chord("i", "jk", "<Esc>") -- Remap Esc to jk
chord("nv", "cp", '"+') -- Press cp to use the global clipboard
end
return M

View file

@ -1,18 +0,0 @@
local M = {
"catppuccin/nvim", name = "catppuccin",
lazy = false
}
function M.config()
local catppuccin = require("catppuccin")
vim.g.catppuccin_flavour = os.getenv("CATPPUCCIN_FLAVOUR")
catppuccin.setup({ transparent_background = false, integrations = { nvimtree = true } })
vim.cmd [[highlight NotifyINFOIcon guifg=#d6b20f]]
vim.cmd [[highlight NotifyINFOTitle guifg=#d6b20f]]
vim.cmd [[colorscheme catppuccin]]
end
return M

View file

@ -1,39 +0,0 @@
local M = {
-- paste images from clipbaord
"ekickx/clipboard-image.nvim",
cmd = "PasteImg",
}
local function img_name()
vim.fn.inputsave()
local name = vim.fn.input("Name: ")
vim.fn.inputrestore()
if name == nil or name == "" then
return os.date("%y-%m-%d-%H-%M-%S")
end
return name
end
function M.init()
vim.keymap.set(
"n",
"<leader>p",
":PasteImg<cr>",
{ desc = "[P]aste image from clipboard" }
)
end
function M.config()
require("clipboard-image").setup({
default = {
img_name = img_name,
},
tex = {
img_dir = { "%:p:h", "img" },
affix = "\\includegraphics[width=\\textwidth]{%s}",
},
})
end
return M

View file

@ -1,112 +0,0 @@
local env = require("my.helpers.env")
local M = {
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"onsails/lspkind.nvim", -- show icons in lsp completion menus
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-emoji",
"hrsh7th/cmp-cmdline",
"hrsh7th/cmp-path",
"saadparwaiz1/cmp_luasnip",
},
cond = env.vscode.not_active()
}
local function has_words_before()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and
vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col,
col)
:match('%s') == nil
end
function M.config()
vim.o.completeopt = "menuone,noselect"
local cmp = require("cmp")
local lspkind = require('lspkind')
local options = {
window = {
completion = {
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
col_offset = -3,
side_padding = 0,
completeopt = "menu,menuone,noinsert",
},
},
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
local kind = lspkind.cmp_format({ mode = "symbol", maxwidth = 50
, symbol_map = {
Text = "."
}
})(entry, vim_item)
local strings = vim.split(kind.kind, "%s", { trimempty = true })
kind.kind = " " .. strings[1] .. " "
kind.menu = ""
return kind
end,
},
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
require('luasnip').lsp_expand(args.body)
end
},
mapping = {
["<C-d>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<C-s>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { "i", "s" }),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'buffers' },
{ name = 'emoji' },
{ name = 'path' },
-- { name = 'omni' },
})
}
cmp.setup(options)
-- Use buffer source for `/`
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':'
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' },
{ name = 'cmdline' }
})
})
end
return M

View file

@ -1,14 +0,0 @@
local env = require("my.helpers.env")
local M = {
"glepnir/dashboard-nvim",
lazy = false,
cond = env.vscode.not_active() and env.firenvim.not_active(),
}
function M.config()
local db = require("dashboard")
db.custom_header = {}
end
return M

View file

@ -1,19 +0,0 @@
local env = require("my.helpers.env")
local M = {
"glacambre/firenvim", -- vim inside chrome
lazy = false,
cond = env.firenvim.active(),
}
function M.setup()
vim.g.firenvim_config = {
localSettings = {
[".*"] = {
filename = "/tmp/firenvim_{hostname}_{pathname%10}_{timestamp%32}.{extension}",
},
},
}
end
return M

View file

@ -1,127 +0,0 @@
local M = {
-- keybinds where you only hit the head once
"anuvyklack/hydra.nvim",
dependencies = {
"jbyuki/venn.nvim", -- draw ascii diagrams
"mrjones2014/smart-splits.nvim", -- the name says it all
},
keys = { "<C-w>", "<leader>v" },
}
local venn_hint = [[
Arrow^^^^^^ Select region with <C-v>
^ ^ _K_ ^ ^ _f_: surround it with box
_H_ ^ ^ _L_
^ ^ _J_ ^ ^ _<Esc>_
]]
local window_hint = [[
^^^^^^^^^^^^ Move ^^ Size ^^ ^^ Split
^^^^^^^^^^^^------------- ^^-----------^^ ^^---------------
^ ^ _k_ ^ ^ ^ ^ _K_ ^ ^ ^ _<C-k>_ ^ _s_: horizontally
_h_ ^ ^ _l_ _H_ ^ ^ _L_ _<C-h>_ _<C-l>_ _v_: vertically
^ ^ _j_ ^ ^ ^ ^ _J_ ^ ^ ^ _<C-j>_ ^ _q_: close
focus^^^^^^ window^^^^^^ ^_=_: equalize^ _o_: close remaining
]]
function M.config()
local Hydra = require("hydra")
local pcmd = require("hydra.keymap-util").pcmd
local splits = require("smart-splits")
Hydra({
name = "Draw Diagram",
hint = venn_hint,
config = {
color = "pink",
invoke_on_body = true,
hint = {
border = "rounded",
},
on_enter = function()
vim.o.virtualedit = "all"
end,
},
mode = "n",
body = "<leader>v",
heads = {
{ "H", "<C-v>h:VBox<CR>" },
{ "J", "<C-v>j:VBox<CR>" },
{ "K", "<C-v>k:VBox<CR>" },
{ "L", "<C-v>l:VBox<CR>" },
{ "f", ":VBox<CR>", { mode = "v" } },
{ "<Esc>", nil, { exit = true } },
},
})
vim.keymap.set("n", "<C-w>", "<Nop>")
Hydra({
name = "Windows",
hint = window_hint,
config = {
invoke_on_body = true,
hint = {
border = "rounded",
offset = -1,
},
},
mode = "n",
body = "<C-w>",
heads = {
{ "h", "<C-w>h" },
{ "j", "<C-w>j" },
{ "k", "<C-w>k" },
{ "l", "<C-w>l" },
{ "H", "<C-w>H" },
{ "J", "<C-w>J" },
{ "K", "<C-w>K" },
{ "L", "<C-w>L" },
{
"<C-h>",
function()
splits.resize_left(2)
end,
},
{
"<C-j>",
function()
splits.resize_down(2)
end,
},
{
"<C-k>",
function()
splits.resize_up(2)
end,
},
{
"<C-l>",
function()
splits.resize_right(2)
end,
},
{ "=", "<C-w>=", { desc = "equalize" } },
{ "s", pcmd("split", "E36") },
{ "<C-s>", pcmd("split", "E36"), { desc = false } },
{ "v", pcmd("vsplit", "E36") },
{ "<C-v>", pcmd("vsplit", "E36"), { desc = false } },
{ "w", "<C-w>w", { exit = true, desc = false } },
{ "<C-w>", "<C-w>w", { exit = true, desc = false } },
{ "o", "<C-w>o", { exit = true, desc = "remain only" } },
{ "<C-o>", "<C-w>o", { exit = true, desc = false } },
{ "q", pcmd("close", "E444"), { desc = "close window" } },
{ "<C-q>", pcmd("close", "E444"), { desc = false } },
{ "<Esc>", nil, { exit = true, desc = false } },
},
})
end
return M

View file

@ -1,44 +0,0 @@
local env = require("my.helpers.env")
local lspconfig = require("my.plugins.lspconfig")
local M = {
"ShinKage/idris2-nvim",
dependencies = {"nui.nvim", "nvim-lspconfig"},
ft = { "idris2", "lidris2", "ipkg" },
cond = env.vscode.not_active(),
}
function M.config()
local idris2 = require("idris2")
idris2.setup({
server = {
on_attach = function(client, bufnr)
lspconfig.on_attach(client, bufnr)
local function nmap(from, to, desc)
vim.keymap.set("n", "<leader>I" .. from, function()
require("idris2.code_action")[to]()
end, { desc = desc, bufnr = true })
end
nmap("C", "make_case", "Make [c]plit")
nmap("L", "make_lemma", "Make [l]emma")
nmap("c", "add_clause", "Add [c]lause")
nmap("s", "expr_search", "Expression [s]earch")
nmap("d", "generate_def", "Generate [d]efinition")
nmap("s", "case_split", "Case [s]plit")
nmap("h", "refine_hole", "Refine [h]ole")
local status, wk = pcall(require, "which-key")
if status then
wk.register({ ["<leader>I"] = { name = "[I]dris", buffer = bufnr } })
end
end,
},
client = { hover = { use_split = true } },
})
end
return M

View file

@ -1,204 +0,0 @@
local env = require("my.helpers.env")
if env.neovide.active() then
require("my.neovide").setup()
end
return {
--{{{ Language support
{
"purescript-contrib/purescript-vim",
ft = "purescript",
cond = env.vscode.not_active(),
},
{
"teal-language/vim-teal",
ft = "teal",
cond = env.vscode.not_active(),
},
{
"udalov/kotlin-vim",
ft = "kotlin",
cond = env.vscode.not_active(),
},
{
"kmonad/kmonad-vim",
ft = "kbd",
cond = env.vscode.not_active(),
},
{
"vmchale/dhall-vim",
ft = "dhall",
cond = env.vscode.not_active(),
},
--}}}
{
-- Better ui for inputs/selects
"stevearc/dressing.nvim",
config = true,
-- https://github.com/folke/dot/blob/master/config/nvim/lua/config/plugins/init.lua
init = function()
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.select = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.select(...)
end
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.input = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.input(...)
end
end,
cond = env.vscode.not_active(),
},
{
"windwp/nvim-autopairs",
event = "InsertEnter",
config = function ()
require("nvim-autopairs").setup()
end,
},
-- Helper libs
{
"nvim-lua/plenary.nvim",
},
"MunifTanjim/nui.nvim",
{
"terrortylor/nvim-comment",
keys = { "gc", "gcc", { "gc", mode = "v" } },
config = function()
require("nvim_comment").setup()
end,
},
-- nice looking icons
"kyazdani42/nvim-web-devicons",
{
-- easly switch between tmux and vim panes
"christoomey/vim-tmux-navigator",
keys = { "<C-h>", "<C-j>", "<C-k>", "<C-l>" },
cond = env.vscode.not_active()
and env.neovide.not_active()
and env.firenvim.not_active(),
},
{
-- track time usage
"wakatime/vim-wakatime",
event = "VeryLazy",
cond = env.vscode.not_active() and env.firenvim.not_active(),
},
{
-- smooth scrolling
"psliwka/vim-smoothie",
-- enabled = env.neovide.not_active(),
enabled = false,
event = "VeryLazy",
},
{
-- show context on closing parenthesis
-- TODO: move this to treesitter file
"haringsrob/nvim_context_vt",
event = "BufReadPost",
cond = env.vscode.not_active(),
},
{
-- show progress for lsp stuff
"j-hui/fidget.nvim",
event = "BufReadPre",
cond = env.vscode.not_active(),
config = true,
},
{
-- export to pastebin like services
"rktjmp/paperplanes.nvim",
config = {
provider = "paste.rs",
},
keys = { "PP" },
},
{
-- case switching + the subvert command
"tpope/vim-abolish",
event = "VeryLazy",
},
{
-- reminds you of abbreviations
"0styx0/abbreinder.nvim",
dependencies = "0styx0/abbremand.nvim",
event = "InsertEnter",
},
{
-- md preview (in terminal)
"ellisonleao/glow.nvim",
cmd = "Glow",
cond = env.vscode.not_active(),
},
{
"frabjous/knap", -- md preview
cond = env.vscode.not_active(),
},
{
-- automatically set options based on current file
"tpope/vim-sleuth",
event = "BufRead",
cond = env.vscode.not_active(),
},
-- vim-abolish rewrite
"mateiadrielrafael/scrap.nvim",
{
"ruifm/gitlinker.nvim", -- generate permalinks for code
-- dependencies = { "plenary.nvim" },
config = true,
cond = env.firenvim.not_active(),
keys = "<leader>gy",
},
{
-- magit clone
"TimUntersberger/neogit",
-- dependencies = { "plenary.nvim" },
cmd = "Neogit",
enabled = env.firenvim.not_active() and env.vscode.not_active(),
init = function()
vim.keymap.set(
"n",
"<C-g>",
"<cmd>Neogit<cr>",
{ desc = "Open neo[g]it" }
)
end,
config = true,
},
{
-- discord rich presence
"andweeb/presence.nvim",
cond = env.vscode.not_active() and env.firenvim.not_active(),
config = function()
require("presence"):setup()
end,
lazy = false
},
}

View file

@ -1,63 +0,0 @@
local env = require("my.helpers.env")
local M = {
"hkupty/iron.nvim", -- repl support
cond = env.vscode.not_active(),
cmd = "IronRepl",
}
function M.init()
-- iron also has a list of commands, see :h iron-commands for all available commands
vim.keymap.set("n", "<space>iss", "<cmd>IronRepl<cr>")
vim.keymap.set("n", "<space>ir", "<cmd>IronRestart<cr>")
vim.keymap.set("n", "<space>if", "<cmd>IronFocus<cr>")
vim.keymap.set("n", "<space>ih", "<cmd>IronHide<cr>")
local status, wk = pcall(require, "which-key")
if status then
wk.register({
["<leader>i"] = {
name = "[I]ron repl",
s = { name = "[s]end" },
m = "[m]ark",
},
})
end
end
function M.config()
local iron = require("iron.core")
iron.setup({
config = {
-- Your repl definitions come here
repl_definition = {},
-- How the repl window will be displayed
-- See below for more information
repl_open_cmd = require("iron.view").right(40),
},
-- Iron doesn't set keymaps by default anymore.
-- You can set them here or manually add keymaps to the functions in iron.core
keymaps = {
send_motion = "<space>isc",
visual_send = "<space>is",
send_file = "<space>isf",
send_line = "<space>isl",
send_mark = "<space>ism",
mark_motion = "<space>imc",
mark_visual = "<space>imc",
remove_mark = "<space>imd",
cr = "<space>is<cr>",
interrupt = "<space>is<space>",
exit = "<space>isq",
clear = "<space>isr",
},
-- If the highlight is on, you can change how it looks
-- For the available options, check nvim_set_hl
highlight = { italic = true },
ignore_blank_lines = true, -- ignore blank lines when sending visual select lines
})
end
return M

View file

@ -1,22 +0,0 @@
local env = require("my.helpers.env")
local lspconfig = require("my.plugins.lspconfig")
local M = {
"Julian/lean.nvim", -- lean support
dependencies = { "neovim/nvim-lspconfig", "nvim-lua/plenary.nvim", "hrsh7th/nvim-cmp" },
ft = "lean",
config = function()
require("lean").setup({
abbreviations = { builtin = true, cmp = true },
lsp = {
on_attach = lspconfig.on_attach,
capabilities = lspconfig.capabilities(),
},
lsp3 = false,
mappings = true,
})
end,
cond = env.vscode.not_active(),
}
return {}

View file

@ -1,15 +0,0 @@
local M = {
-- removes the need for spamming w or e
"ggandor/leap.nvim",
name = "leap",
event = "VeryLazy"
}
function M.config()
require("leap").add_default_mappings()
end
-- (something)
-- something
return M

View file

@ -1,191 +0,0 @@
local helpers = require("my.helpers")
local env = require("my.helpers.env")
local lspconfig = {
"neovim/nvim-lspconfig",
event = "BufReadPre",
dependencies = {
"folke/neoconf.nvim",
{
"folke/neodev.nvim",
config = true,
},
"hrsh7th/cmp-nvim-lsp",
},
cond = env.vscode.not_active(),
}
local M = {
lspconfig,
{
"smjonas/inc-rename.nvim",
cmd = "IncRename",
config = {
input_buffer_type = "dressing",
},
dependencies = {
"dressing.nvim",
},
cond = env.vscode.not_active(),
},
}
function M.on_attach(client, bufnr)
-- {{{ Auto format
local function format()
vim.lsp.buf.format({ async = false, bufnr = bufnr })
end
if false and client.supports_method("textDocument/formatting") then
vim.api.nvim_create_autocmd("BufWritePre", {
group = vim.api.nvim_create_augroup("LspFormatting", { clear = false }),
buffer = bufnr,
callback = format,
})
end
-- }}}
-- {{{ Keymap helpers
local opts = function(desc)
return { noremap = true, silent = true, desc = desc, buffer = bufnr }
end
local nmap = function(from, to, desc)
vim.keymap.set("n", from, to, opts(desc))
end
-- }}}
-- {{{ Go to declaration / definition / implementation
nmap("gd", vim.lsp.buf.definition, "[G]o to [d]efinition")
nmap("gi", vim.lsp.buf.implementation, "[G]o to [i]mplementation")
nmap("gr", vim.lsp.buf.references, "[G]o to [r]eferences")
-- }}}
-- {{{ Hover
-- Note: diagnostics are already covered in keymaps.lua
nmap("K", vim.lsp.buf.hover, "Hover")
nmap("L", vim.lsp.buf.signature_help, "Signature help")
-- }}}
-- {{{ Code actions
nmap("<leader>c", vim.lsp.buf.code_action, "[C]ode actions")
nmap("<leader>F", format, "[F]ormat")
nmap("<leader>li", "<cmd>LspInfo<cr>", "[L]sp [i]nfo")
vim.keymap.set("n", "<leader>rn", function()
return ":IncRename " .. vim.fn.expand("<cword>")
end, helpers.mergeTables(opts("[R]e[n]ame"), { expr = true }))
vim.keymap.set(
"v",
"<leader>c",
":'<,'> lua vim.lsp.buf.range_code_action()",
opts("[C]ode actions")
)
-- }}}
-- {{{ Workspace stuff
nmap(
"<leader>wa",
vim.lsp.buf.add_workspace_folder,
"[W]orkspace [A]dd Folder"
)
nmap(
"<leader>wr",
vim.lsp.buf.remove_workspace_folder,
"[W]orkspace [R]emove Folder"
)
nmap("<leader>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, "[W]orkspace [L]ist Folders")
-- }}}
end
-- {{{ General server config
---@type lspconfig.options
local servers = {
tsserver = {
on_attach = function(client, bufnr)
-- We handle formatting using null-ls and prettierd
client.server_capabilities.documentFormattingProvider = false
M.on_attach(client, bufnr)
end,
},
dhall_lsp_server = {},
purescriptls = {
settings = {
purescript = {
censorWarnings = { "UnusedName", "ShadowedName", "UserDefinedWarning" },
formatter = "purs-tidy",
},
},
},
hls = {
haskell = {
-- set formatter
formattingProvider = "ormolu",
},
},
rnix = {},
cssls = {},
jsonls = {},
rust_analyzer = {},
-- teal_ls = {},
sumneko_lua = {
cmd = {
"lua-language-server",
"--logpath=/home/adrielus/.local/share/lua-language-server/log",
},
},
}
-- }}}
-- {{{ Capabilities
M.capabilities = function()
-- require("lazy").load({ plugins = "hrsh7th/cmp-nvim-lsp" })
local c = require("cmp_nvim_lsp").default_capabilities()
-- Add folding capabilities
c.textDocument.foldingRange =
{ dynamicRegistration = false, lineFoldingOnly = true }
return c
end
-- }}}
-- {{{ Nice diagnostic icons
-- See https://github.com/folke/dot/blob/master/config/nvim/lua/config/plugins/lsp/diagnostics.lua
local function diagnostics_icons()
local signs = { Error = "", Warn = "", Hint = "", Info = "" }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
end
--}}}
-- {{{ Main config function
function lspconfig.config()
diagnostics_icons()
-- {{{ Change on-hover borders
vim.lsp.handlers["textDocument/hover"] =
vim.lsp.with(vim.lsp.handlers.hover, { border = "single" })
vim.lsp.handlers["textDocument/signatureHelp"] =
vim.lsp.with(vim.lsp.handlers.signature_help, { border = "single" })
-- }}}
local capabilities = M.capabilities()
-- Setup basic language servers
for lsp, details in pairs(servers) do
if details.on_attach == nil then
-- Default setting for on_attach
details.on_attach = M.on_attach
end
require("lspconfig")[lsp].setup({
on_attach = details.on_attach,
settings = details.settings, -- Specific per-language settings
flags = {
debounce_text_changes = 150, -- This will be the default in neovim 0.7+
},
cmd = details.cmd,
capabilities = capabilities,
})
end
end
--}}}
return M

View file

@ -1,29 +0,0 @@
local env = require("my.helpers.env")
local M = {
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
cond = env.vscode.not_active() and env.neovide.not_active(),
}
function M.config()
require("lualine").setup({
theme = "auto",
options = {
component_separators = "",
section_separators = { left = "", right = "" },
},
sections = {
lualine_a = { "branch" },
lualine_b = { "filename" },
lualine_c = { "filetype" },
lualine_x = { "diagnostics" },
lualine_y = {},
lualine_z = {},
},
-- Integration with other plugins
extensions = { "nvim-tree" },
})
end
return M

View file

@ -1,35 +0,0 @@
local env = require("my.helpers.env")
local M = {
"L3MON4D3/LuaSnip", -- snippeting engine
event = "InsertEnter",
cond = env.vscode.not_active()
}
local function reload()
require("luasnip.loaders.from_vscode").lazy_load()
end
function M.config()
local luasnip = require("luasnip")
vim.keymap.set("i", "<Tab>", function()
if luasnip.jumpable(1) then
return "<cmd>lua require('luasnip').jump(1)<cr>"
else
return "<Tab>"
end
end, { expr = true })
vim.keymap.set("i", "<S-Tab>", function()
luasnip.jump(-1)
end)
vim.keymap.set("n", "<leader>rs", reload, {
desc = "[R]eload [s]nippets",
})
reload()
end
return M

View file

@ -1,40 +0,0 @@
local M = {
"phaazon/mind.nvim", -- Organize shit as trees
keys = "<leader>m",
}
function M.init()
vim.keymap.set("n", "<leader>m", function()
local mind = require("mind")
local buffers = vim.api.nvim_list_bufs()
local should_open = true
for _, buf in pairs(buffers) do
if vim.api.nvim_buf_is_loaded(buf) and vim.bo[buf].filetype == "mind" then
should_open = false
vim.cmd("bd " .. buf)
end
end
if should_open then
mind.open_main()
end
end, { desc = "[M]ind panel" })
end
function M.config()
local mind = require("mind")
mind.setup({
persistence = {
state_path = "~/Mind/mind.json",
data_dir = "~/Mind/data",
},
ui = {
width = 50,
},
})
end
return M

View file

@ -1,20 +0,0 @@
local M = {}
-- function M.setup()
-- require("moonwalk").add_loader("tl", function(src, path)
-- local tl = require("tl")
-- local errs = {}
-- local _, program = tl.parse_program(tl.lex(src), errs)
--
-- if #errs > 0 then
-- error(
-- path .. ":" .. errs[1].y .. ":" .. errs[1].x .. ": " .. errs[1].msg,
-- 0
-- )
-- end
--
-- return tl.pretty_print_ast(program)
-- end)
-- end
return M

View file

@ -1,12 +0,0 @@
return {
"folke/neoconf.nvim",
cmd = "Neoconf",
config = {
-- import existing settings from other plugins
import = {
vscode = true, -- local .vscode/settings.json
coc = false, -- global/local coc-settings.json
nlsp = false, -- global/local nlsp-settings.nvim json settings
},
},
}

View file

@ -1,27 +0,0 @@
local env = require("my.helpers.env")
local M = {
"jose-elias-alvarez/null-ls.nvim", -- generic language server
event = "BufReadPre",
dependencies = "neovim/nvim-lspconfig",
cond = env.vscode.not_active(),
}
function M.config()
local lspconfig = require("my.plugins.lspconfig")
local null_ls = require("null-ls")
local sources = {
null_ls.builtins.formatting.prettierd.with({ extra_filetypes = {} }), -- format ts files
null_ls.builtins.formatting.stylua.with({}), -- format lua code
-- null_ls.builtins.formatting.lua_format.with({}), -- format lua code
}
null_ls.setup({
sources = sources,
on_attach = lspconfig.on_attach,
debug = true,
})
end
return M

View file

@ -1,20 +0,0 @@
local env = require("my.helpers.env")
local M = {
"kyazdani42/nvim-tree.lua",
cmd = "NvimTreeToggle",
config = true,
cond = env.vscode.not_active() and env.firenvim.not_active(),
}
function M.init()
-- Toggle nerdtree with Control-n
vim.keymap.set(
"n",
"<C-n>",
":NvimTreeToggle<CR>",
{ desc = "Toggle [n]vim-tree" }
)
end
return M

View file

@ -1,12 +0,0 @@
local M = {
-- work with brackets, quotes, tags, etc
"tpope/vim-surround",
event = "VeryLazy",
}
function M.config()
vim.g.surround_113 = '"\r"'
vim.g.surround_97 = "'\r'"
end
return M

View file

@ -1,76 +0,0 @@
local env = require("my.helpers.env")
local telescope = {
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
dependencies = {
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
"nvim-telescope/telescope-file-browser.nvim",
"nvim-lua/plenary.nvim"
},
version = "0.1.x",
pin = true,
cond = env.vscode.not_active(),
}
local M = telescope
local function find_files_by_extension(extension)
return "find_files find_command=rg,--files,--glob=**/*." .. extension
end
local function with_theme(base, theme)
return base .. " theme=" .. theme
end
local defaultTheme = "ivy"
local keybinds = {
{ "<C-P>", "find_files", "Find files" },
{ "<Leader>ft", find_files_by_extension("tex"), "[F]ind [t]ex files" },
{ "<Leader>fl", find_files_by_extension("lua"), "[F]ind [l]ua files" },
{
"<Leader>fp",
find_files_by_extension("purs"),
"[F]ind [p]urescript files",
},
{ "<Leader>d", "diagnostics", "[D]iagnostics" },
{ "<C-F>", "live_grep", "[F]ind in project" },
{ "<C-S-F>", "file_browser", "[F]ile browser" },
{ "<Leader>t", "builtin", "[T]elescope pickers" },
}
local function mkAction(action)
if not string.find(action, "theme=") then
action = with_theme(action, defaultTheme)
end
return "<cmd>Telescope " .. action .. "<cr>"
end
function telescope.init()
for _, mapping in pairs(keybinds) do
vim.keymap.set("n", mapping[1], mkAction(mapping[2]), { desc = mapping[3] })
end
end
function telescope.config()
local settings = {
defaults = { mappings = { i = { ["<C-h>"] = "which_key" } } },
pickers = { find_files = { hidden = true } },
extensions = {
file_browser = { path = "%:p:h" },
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
},
},
}
require("telescope").setup(settings)
require("telescope").load_extension("fzf")
require("telescope").load_extension("file_browser")
end
return M

View file

@ -1,105 +0,0 @@
local M = {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = "BufReadPost",
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
},
config = function()
require("nvim-treesitter.configs").setup({
--{{{Languages
ensure_installed = {
"bash",
"javascript",
"typescript",
"c",
"cpp",
"css",
"dockerfile",
"elixir",
"fish",
"html",
"json",
"jsonc",
"latex",
"python",
"rust",
"scss",
"toml",
"tsx",
"vim",
"yaml",
"nix",
},
sync_install = false,
--}}}
--{{{ Highlighting
highlight = {
enable = true,
disable = { "kotlin", "tex", "latex" },
additional_vim_regex_highlighting = false,
},
--}}}
--{{{ Incremental selection
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = "<C-s>",
node_decremental = "<C-b>",
},
},
--}}}
--{{{ Textsubjects
textsubjects = {
enable = true,
keymaps = {
["."] = "textsubjects-smart",
[";"] = "textsubjects-container-outer",
},
},
--}}}
textobjects = {
--{{{ Select
select = {
enable = false,
lookahead = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
--}}}
--{{{ Move
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
["]f"] = "@function.outer",
["]c"] = "@class.outer",
},
goto_next_end = {
["]F"] = "@function.outer",
["]C"] = "@class.outer",
},
goto_previous_start = {
["[f"] = "@function.outer",
["[c"] = "@class.outer",
},
goto_previous_end = {
["[F"] = "@function.outer",
["[C"] = "@class.outer",
},
},
--}}}
},
indent = { enable = true },
})
end,
}
return M

View file

@ -1,24 +0,0 @@
local M = {
"lervag/vimtex", -- latex support
ft = "tex",
}
function M.config()
vim.g.vimtex_view_method = "zathura"
vim.g.Tex_DefaultTargetFormat = "pdf"
vim.g.vimtex_fold_enabled = 0
vim.g.vimtex_imaps_enabled = 0
vim.g.vimtex_syntax_conceal_disable = 1
vim.g.vimtex_compiler_latexmk = {
options = {
"-pdf",
"-shell-escape",
"-verbose",
"-file-line-error",
"-synctex=1",
"-interaction=nonstopmode",
},
}
end
return M

View file

@ -1,40 +0,0 @@
local K = require("my.keymaps")
local env = require("my.helpers.env")
local M = {
"preservim/vimux", -- interact with tmux from within vim
cmd = { "VimuxPromptCommand", "VimuxRunCommand", "VimuxRunLastCommand" },
-- TODO: only enable when actually inside tmux
cond = env.vscode.not_active()
and env.neovide.not_active()
and env.firenvim.not_active(),
}
function M.init()
--{{{ Register keybinds
K.nmap(
"<leader>vp",
":VimuxPromptCommand<CR>",
"[V]imux: [p]rompt for command"
)
K.nmap("<leader>vc", ':VimuxRunCommand "clear"<CR>', "[V]imux: [c]lear pane")
K.nmap(
"<leader>vl",
":VimuxRunLastCommand<CR>",
"[V]imux: rerun [l]ast command"
)
--}}}
--{{{ Register which-key docs
local status, wk = pcall(require, "which-key")
if status then
wk.register({
["<leader>v"] = {
name = "[V]imux",
},
})
end
--}}}
end
return M

View file

@ -1,27 +0,0 @@
local M = {
"folke/which-key.nvim",
event = "VeryLazy",
}
function M.config()
local wk = require("which-key")
wk.setup({
triggers = { "<leader>", "d", "y", "q", "z", "g", "c" },
show_help = true,
show_keys = true,
})
wk.register({
["<leader>"] = {
f = { name = "[F]iles" },
g = { name = "[G]o to" },
r = { name = "[R]ename / [R]eplace / [R]eload" },
l = { name = "[L]ocal" },
w = { name = "[W]orkspace" },
v = "which_key_ignore",
},
})
end
return M

View file

@ -1,92 +0,0 @@
local M = {}
local pickers = require "telescope.pickers"
local finders = require "telescope.finders"
local conf = require("telescope.config").values
local actions = require "telescope.actions"
local action_state = require "telescope.actions.state"
local previewers = require "telescope.previewers"
local utils = require "telescope.utils"
local add_abbreviations = false
local unicodeChars = {
nats = "",
rationals = "",
reals = "",
integers = "",
forall = "",
lambda = "λ",
arrow = "",
compose = "",
inverse = "⁻¹",
dots = "",
alpha = "ɑ",
beta = "β",
pi = "π",
Pi = 'Π',
sigma = "σ",
Sigma = "Σ",
tau = "τ",
theta = "θ",
gamma = "γ",
Gamma = "Γ",
context = "Γ"
}
-- our picker function for unicode chars
function M.picker(opts)
opts = opts or {}
local results = {}
for key, value in pairs(unicodeChars) do
-- Name: char pair
table.insert(results, { key, value })
end
print(results)
pickers.new(opts, {
prompt_title = "Unicode characters",
finder = finders.new_table {
results = results,
entry_maker = function(entry)
return { value = entry, display = entry[1], ordinal = entry[1] }
end
},
sorter = conf.generic_sorter(opts),
previewer = previewers.new {
preview_fn = function(_, entry) return entry.value[2] end
},
attach_mappings = function(prompt_bufnr)
actions.select_default:replace(function()
actions.close(prompt_bufnr)
local selection = action_state.get_selected_entry()
if selection == nil then
utils.__warn_no_selection "my.abbreviations"
return
end
vim.api.nvim_put({ selection.value[2] }, "", false, true)
vim.cmd("startinsert")
end)
return true
end
}):find()
end
function M.setupAbbreviations(prefix, ending)
prefix = prefix or ""
ending = ending or ""
if not add_abbreviations then return end
local abbreviate = require("my.abbreviations").abbr
for key, value in pairs(unicodeChars) do
-- By default abbreviations are triggered using "_"
abbreviate(prefix .. key .. ending, value)
end
end
return M

View file

@ -1 +0,0 @@
{}

View file

@ -1,32 +0,0 @@
if exists("b:current_syntax")
finish
endif
syntax keyword kfKeyword alias template layer using path name input output assume fun as import exporting module unsafe def
syntax keyword kfFunction LayerTemplate Sequence Chord Keycode Layer Broken
syntax match kfComment "\v--.*$"
syntax match kfOperator "\v_"
syntax match kfOperator "\v\,"
syntax match kfOperator "\v\."
syntax match kfOperator "\v\:"
syntax match kfOperator "\v\|"
syntax match kfOperator "\v\="
syntax match kfOperator "\v\=\>"
syntax match kfOperator "\v\-\>"
syntax match kfOperator "\v→"
syntax match kfOperator "\v\*"
syntax match kfOperator "\v\("
syntax match kfOperator "\v\)"
syntax match kfOperator "\vλ"
syntax region kfString start=/\v"/ skip=/\v\\./ end=/\v"/
highlight link kfKeyword Keyword
highlight link kfFunction Function
highlight link kfComment Comment
highlight link kfOperator Operator
highlight link kfString String
let b:current_syntax = "hkf"

View file

@ -1,3 +0,0 @@
function hi()
print("Hello world!")
end

View file

@ -1,6 +0,0 @@
# Polybar config
## Useful links:
- [Home manager polybar docs](https://rycee.gitlab.io/home-manager/options.html#opt-services.polybar.enable)
- [General config](https://github.com/polybar/polybar/wiki/Configuration)

View file

@ -1,110 +0,0 @@
[module/battery]
type = internal/battery
; Use the following command to list batteries and adapters:
; $ ls -1 /sys/class/power_supply/
battery = BAT0
adapter = AC
format-charging = <animation-charging> <label-charging>
format-discharging = <animation-discharging> <label-discharging>
format-low = <animation-low> <label-low>
; Only applies if <animation-charging> is used
animation-charging-0 =
animation-charging-1 =
animation-charging-2 =
animation-charging-3 =
animation-charging-4 =
; Framerate in milliseconds
animation-charging-framerate = 750
; Only applies if <animation-discharging> is used
animation-discharging-0 =
animation-discharging-1 =
animation-discharging-2 =
animation-discharging-3 =
animation-discharging-4 =
; Framerate in milliseconds
animation-discharging-framerate = 500
; Only applies if <animation-low> is used
; New in version 3.6.0
animation-low-0 = !
animation-low-1 =
animation-low-framerate = 200
[module/cpu]
type = internal/cpu
[module/date]
type = internal/date
date = %d-%m-%Y%
time = %H:%M
label =  %date%  %time%
[module/wireless-network]
type = internal/network
interface = wlp0s20f3
format-connected = <label-connected>
format-packetloss = <animation-packetloss> <label-connected>
format-disconnected = <label-disconnected>
label-connected =  %essid%  %downspeed%  %upspeed%
label-disconnected =
label-packetloss = %essid%
animation-packetloss-0 =
animation-packetloss-0-foreground = #ffa64c
animation-packetloss-1 = 📶
animation-packetloss-1-foreground = #000000
animation-packetloss-framerate = 500
[module/ewmh]
type = internal/xworkspaces
icon-0 = 1:dev;
icon-1 = 2:browser;
icon-2 = 3:chat;ﭮ
icon-3 = 4:reading;
icon-default =
format = <label-state>
label-active = %icon%
label-active-background = ${colors.text}
label-active-foreground = ${colors.base}
label-active-padding = 2
label-urgent = %icon%
label-urgent-background = ${colors.peach}
label-urgent-foreground = ${colors.base}
label-urgent-padding = 2
label-occupied = %icon%
label-occupied-padding = 2
label-empty =
[bar/main]
font-0 = FiraCode Nerd Font:style=Regular
font-1 = Source Code Pro Nerd Font:style=Regular
modules-left = date battery
modules-center = ewmh
modules-right = wireless-network
padding-right = 2
padding-left = 2
padding-top = 4
module-margin = 2
height=4%
border-top-size = 1
border-top-color = ${colors.text}
background = ${colors.base}
foreground = ${colors.text}
bottom = true

View file

@ -1,85 +0,0 @@
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# Hide status bar
set -g status off
# don't rename windows automatically
set-option -g allow-rename off
# Fix slow esc
set -sg escape-time 10
# Visual stuff
set -g default-terminal "screen-256color"
# set -ga terminal-overrides ",screen-256color:Tc"
set -ga terminal-overrides ",xterm-256color:Tc"
# set -g -a terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q' # Supposedly helps with cursor shapes under vim (spoiler: it does not)
# Split panes with \ and -
bind \\ split-window -h
bind - split-window -v
unbind '"'
unbind %
# Zooming
unbind C-z
bind -n C-z resize-pane -Z
# Vim-mode
set-window-option -g mode-keys vi
# Vim like mode for leaving insert mode
unbind [ # unbind the default way to copy text
bind -T prefix j copy-mode # allow exiting insert mode with C-a j
# Vim like keybinds for copying and pasting
bind -T copy-mode-vi p paste-buffer
bind -T copy-mode-vi V send-keys -X rectangle-toggle # Check if this works
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-selection
# Pane navigation with vim support
# cmd="$(tmux display -p '#{pane_current_command}')"
# cmd="$(basename "$cmd" | tr A-Z a-z)"
# pane_count="$(tmux list-panes | wc -l)"
#
# if [ "${cmd%m}" = "vi" ] || [ "$pane_count" -eq 1 ]; then
# direction="$(echo "${1#-}" | tr 'lLDUR' '\\hjkl')"
# # forward the keystroke to Vim
# tmux send-keys "C-$direction"
# else
# tmux select-pane "$@"
# fi
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
# Also see: https://github.com/christoomey/vim-tmux-navigator/issues/264
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|\.?n?vim?x?(-wrapped)?)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
# Copy to clipboard using fastcopy
# set-option -g set-clipboard on
# set-option -g @fastcopy-action 'tmux load-buffer -w -'
# set-option -g @fastcopy-key a
# Keep state around using resurrect
# set -g @resurrect-processes '"~python3"'
# Restore on tmux start

View file

@ -1,22 +0,0 @@
" Options
set adblocker=update
set downloadmethod=confirm
set mintabwidth=250
set redirecttohttp
set tabreopenposition=previous
set windowtitle=title
set search=https://google.com/search?q=
set searchwords=w~https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s
" Mappings
nmap yy <action.pageToClipboard>
nmap v <pointer.start><pointer.startVisualSelect>
nmap O <action.openNewTab><action.toExploreMode>
nmap T <action.toCommandMode>buffer<Space>
nmap x <action.closeTab>
nmap yt <action.openNewTabWithCurrentUrl><CR>
nmap ? <:help>
vmap c <Esc><pointer.start>
" extensions

View file

@ -1,3 +0,0 @@
# Vscode snippets
These are snippets usable both in vscode and neovim, defined in vscode format.

View file

@ -1,49 +0,0 @@
{
"name": "adriels-snippets",
"engines": {
"vscode": "^1.11.0"
},
"contributes": {
"snippets": [
{
"language": [
"purs",
"purescript"
],
"path": "./snippets/purescript/other.json"
},
{
"language": [
"purs",
"purescript"
],
"path": "./snippets/purescript/imports.json"
},
{
"language": [
"purs",
"purescript"
],
"path": "./snippets/purescript/deriving.json"
},
{
"language": [
"tex"
],
"path": "./snippets/latex/core.json"
},
{
"language": [
"tex"
],
"path": "./snippets/latex/explain.json"
},
{
"language": [
"lua"
],
"path": "./snippets/lua/core.json"
}
]
}
}

View file

@ -1,300 +0,0 @@
{
"Begin": {
"prefix": "begin",
"description": "Begin anything",
"body": ["\\begin{$1}", "\t$0", "\\end{$1}"]
},
"Set": {
"prefix": "set",
"description": "Set I guess",
"body": "\\{$1\\\\}$0"
},
"Absolute value": {
"prefix": "abs",
"description": "Absolute values",
"body": "\\abs{$1}$0"
},
"Lemma": {
"prefix": "lemma",
"description": "Create a lemma",
"body": ["\\begin{lemma}[$1] \\label{lem:$1}", "\t$0", "\\end{lemma}"]
},
"Example*": {
"prefix": "example*",
"description": "Create an example*",
"body": ["\\begin{example*}", "\t$0", "\\end{example*}"]
},
"Example": {
"prefix": "example",
"description": "Create an example",
"body": ["\\begin{example}[$1] \\label{exp:$1}", "\t$0", "\\end{example}"]
},
"Theorem": {
"prefix": "theorem",
"description": "Create a theorem",
"body": ["\\begin{theorem}[$1] \\label{thm:$1}", "\t$0", "\\end{theorem}"]
},
"Exercise": {
"prefix": "exercise",
"description": "Create a exercise",
"body": ["\\begin{exercise}[$1] \\label{exe:$1}", "\t$0", "\\end{exercise}"]
},
"Definition": {
"prefix": "definition",
"description": "Create a definition",
"body": [
"\\begin{definition}[$1] \\label{def:$1}",
"\t$0",
"\\end{definition}"
]
},
"Display math": {
"prefix": "dm",
"description": "Display math section",
"body": ["\\[", "$0", "\\]"]
},
"Subscript": {
"prefix": "ss",
"description": "Subscript",
"body": "_{$1}$0"
},
"Exponent": {
"prefix": "ee",
"description": "Exponent",
"body": "^{$1}$0"
},
"Nth derivative": {
"prefix": "dd",
"description": "Nth derivative",
"body": "^{($1)}$0"
},
"Overline": {
"prefix": "ol",
"description": "Overline",
"body": "\\overline{$1}$0"
},
"Z Mod": {
"prefix": "zmod",
"description": "The set of Z/nZ",
"body": "\\mathbb{Z}/$1\\mathbb{Z}$0"
},
"Section": {
"prefix": "section",
"description": "Add section",
"body": ["\\section{$1}", "$0"]
},
"Subsection": {
"prefix": "subsection",
"description": "Add subsection",
"body": ["\\subsection{$1}", "$0"]
},
"Subsubsection": {
"prefix": "subsubsection",
"description": "Add subsubsection",
"body": ["\\subsubsection{$1}", "$0"]
},
"Chapter": {
"prefix": "chapter",
"description": "Add chapter",
"body": ["\\chapter{$1}", "$0"]
},
"Proof": {
"prefix": "proof",
"description": "Create proof",
"body": ["\\begin{proof}", "\t$0", "\\end{proof}"]
},
"Itemize": {
"prefix": "item",
"body": ["\\\\begin{itemize}", "\t\\item $0", "\\\\end{itemize}"],
"description": "Itemize env"
},
"Enumerate": {
"prefix": "enum",
"body": ["\\\\begin{enumerate}", "\t\\item $0", "\\\\end{enumerate}"],
"description": "Enumerate env"
},
"Reference definition": {
"prefix": "rdef",
"description": "Reference a definition",
"body": "\\ref{def:$1}$0"
},
"Reference lemma": {
"prefix": "rlemma",
"description": "Reference a lemma",
"body": "\\ref{lem:$1}$0"
},
"Reference theorem": {
"prefix": "rtheorem",
"description": "Reference a theorem",
"body": "\\ref{thm:$1}$0"
},
"Sigma sum": {
"prefix": "bsum",
"description": "Create a sum using sigma notation",
"body": "\\sum_{$1 = $2}^{$3}$0"
},
"Pi product": {
"prefix": "bproduct",
"description": "Create a produt using pi notation",
"body": "\\prod_{$1 = $2}^{$3}$0"
},
"Fraction": {
"prefix": "frac",
"description": "Create a fraction",
"body": "\\frac{$1}{$2}$0"
},
"Choose": {
"prefix": "binom",
"description": "Create a (n choose k) thingy",
"body": "\\binom{$1}{$2}$0"
},
"Limit": {
"prefix": "lim",
"description": "Create a limit",
"body": "\\lim _{$1 \\to $2}$0"
},
"Limit to infinity": {
"prefix": "ilim",
"description": "Create a limit as a variable goes to infinity",
"body": "\\lim _{$1 \\to \\infty}$0"
},
"Limit to negative infinity": {
"prefix": "nlim",
"description": "Create a limit as a variable goes to negative infinity",
"body": "\\lim _{$1 \\to -\\infty}$0"
},
"Limit to zero": {
"prefix": "zlim",
"description": "Create a limit as a variable goes to 0",
"body": "\\lim _{$1 \\to 0}$0"
},
"Sqrt": {
"prefix": "sqrt",
"description": "Create a sqrt",
"body": "\\sqrt[$1]{$2}$0"
},
"Sin": {
"prefix": "sin",
"description": "Create a sin call",
"body": "\\sin($1)$0"
},
"Cos": {
"prefix": "cos",
"description": "Create a cos call",
"body": "\\cos($1)$0"
},
"Ln": {
"prefix": "ln",
"description": "Create a ln call",
"body": "\\ln($1)$0"
},
"Aligned": {
"prefix": "aligned",
"description": "Create an aligned environment",
"body": ["\\begin{aligned}", "\t$0", "\\end{aligned}"]
},
"Text explanation in math mode": {
"prefix": "texpl",
"description": "Explain a step using text in math mode",
"body": "&& \\text{($1)}$0"
},
"Explanation in math mode": {
"prefix": "expl",
"description": "Explain a step in math mode",
"body": "&& ($1) $0"
},
"Let": {
"prefix": "let",
"description": "Let something equal something else",
"body": "Let $$1 = $2$. $0"
},
"Force newline": {
"prefix": "cr",
"description": "Force newline in math mode",
"body": "{\\ \\\\\\\\}"
},
"Aligned display math": {
"prefix": "maligned",
"description": "Create an aligned display math environment",
"body": ["\\[", "\t\\begin{aligned}", "\t\t$0", "\t\\end{aligned}", "\\]"]
},
"System of equations": {
"prefix": "eqsystem",
"description": "Create a system of equations",
"body": [
"\\left\\{",
"\t\\begin{array}{rl}",
"\t\t$0",
"\t\\end{array}",
"\\right\\\\\\}"
]
},
"Aligned equation": {
"prefix": "aleq",
"description": "Aligned equation",
"body": ["\\\\\\ $1 &= $2", "$0"]
},
"2x2 matrices": {
"prefix": "mat22",
"description": "Create a 2x2 matrix",
"body": [
"\\begin{bmatrix}",
" ${1:1} & ${2:0}",
"\\\\\\ ${3:0} & ${4:1}",
"\\end{bmatrix}$0"
]
},
"3x3 matrices": {
"prefix": "mat33",
"description": "Create a 3x3 matrix",
"body": [
"\\begin{bmatrix}",
" ${1:1} & ${2:0} & ${3:0}",
"\\\\\\ ${4:0} & ${5:1} & ${6:0}",
"\\\\\\ ${7:0} & ${8:0} & ${9:1}",
"\\end{bmatrix}$0"
]
},
"3x3 determinants": {
"prefix": "det33",
"description": "Create a 3x3 determinant",
"body": [
"\\begin{vmatrix}",
" $1 & $2 & $3",
"\\\\\\ $4 & $5 & $6",
"\\\\\\ $7 & $8 & $9",
"\\end{vmatrix}$0"
]
},
"2x2 determinants": {
"prefix": "det22",
"description": "Create a 2x2 determinant",
"body": [
"\\begin{vmatrix}",
" $1 & $2",
"\\\\\\ $3 & $4",
"\\end{vmatrix}$0"
]
},
"Definite integral": {
"prefix": "dintegral",
"description": "Definite integral",
"body": "\\int_{$1}^{$2} $3 d${4:x}$0"
},
"Indefinite integral": {
"prefix": "integral",
"description": "Integral",
"body": "\\int $1 d${2:x}$0"
},
"Iff cases": {
"prefix": "ciff",
"description": "Prove an equivalence in both directions",
"body": [
"\\begin{enumerate}",
"\t\\item[$\\implies$]$1",
"\t\\item[$\\impliedby$]$2",
"\\end{enumerate}",
"$0"
]
}
}

View file

@ -1,77 +0,0 @@
{
"Text explanation in math mode": {
"prefix": "texpl",
"description": "Explain a step using text in math mode",
"body": "&& \\text{($1)}$0"
},
"Explanation in math mode": {
"prefix": "expl",
"description": "Explain a step in math mode",
"body": "&& ($1) $0"
},
"Explain division": {
"prefix": "exdiv",
"description": "Explain a division inside an equation",
"body": "&& \\left(\\frac{\\square}{$1}\\right)$0"
},
"Explain fraction": {
"prefix": "exfract",
"description": "Explain a step which wraps both sides of an equation by a fraction",
"body": "&& \\left(\\frac{$1}{$2} \\right)$0"
},
"Explain right multiplication": {
"prefix": "exmul",
"description": "Explain a right multiplication inside an equation",
"body": "&& \\left(\\square \\cdot $1 \\right)$0"
},
"Explain left multiplication": {
"prefix": "exlmul",
"description": "Explain a left multiplication inside an equation",
"body": "&& \\left($1 \\cdot \\square\\right)$0"
},
"Explain differentiation": {
"prefix": "exdiff",
"description": "Explain a step which differentiates both sides of an equation",
"body": "&& \\left( \\frac{d \\square} {d $1} \\right)$0"
},
"Explain integration": {
"prefix": "exint",
"description": "Explain a step which integrates both sides of an equation",
"body": "&& \\left(\\int \\square d$1 \\right)$0"
},
"Explain definite integration": {
"prefix": "exdint",
"description": "Explain a step which applies a definite integral to both sides of an equation",
"body": "&& \\left(\\int _{$1} ^{$2} \\square d$3 \\right)$0"
},
"Explain addition": {
"prefix": "exadd",
"description": "Explain a step which adds to both sides of an equation",
"body": "&& \\left( \\square + $1 \\right)$0"
},
"Explain subtraction": {
"prefix": "exsub",
"description": "Explain a step which subtracts from both sides of an equation",
"body": "&& \\left( \\square - $1 \\right)$0"
},
"Explain negation": {
"prefix": "exneg",
"description": "Explain a step which negates both sides of an equation",
"body": "&& (- \\square )$0"
},
"Explain power": {
"prefix": "expow",
"description": "Explain a step which raises both sides of an equation to a given power",
"body": "&& \\left( \\square ^{$1} \\right)$0"
},
"Explain exponentiation": {
"prefix": "exexp",
"description": "Explain a step which raises a given value to both sides of an equation",
"body": "&& \\left( $1 ^{\\square} \\right)$0"
},
"Explain natural logarithm": {
"prefix": "exln",
"description": "Explain a step which applies the ln function to both sides of an equation",
"body": "&& \\left( \\ln $1 \\right)$0"
}
}

View file

@ -1,33 +0,0 @@
{
"Lua setup-module": {
"prefix": "msetup",
"description": "Create lua module with setup function inside",
"body": [
"local M = {}",
"",
"function M.setup()",
" $0",
"end",
"",
"return M"
]
},
"Busted describe": {
"prefix": "describe",
"description": "Create a describe call for a busted test",
"body": [
"describe(\"$1\", function ()",
"\t$0",
"end)"
]
},
"Busted it": {
"prefix": "it",
"description": "Create an it call for a busted test",
"body": [
"it(\"$1\", function ()",
"\t$0",
"end)"
]
}
}

View file

@ -1,77 +0,0 @@
{
"Derive newtype instance": {
"prefix": "gnderive",
"description": "Use newtype deriving on any typeclass",
"body": "derive newtype instance $0 $3 $2"
},
"Generate json instances": {
"prefix": "json",
"description": "Generate the deriving of the EncodeJson and DecodeJson typeclasses",
"body": [
"derive newtype instance EncodeJson $1",
"derive newtype instance DecodeJson $1"
]
},
"Generic": {
"prefix": "dgeneric",
"description": "Generate the generic instance for a type",
"body": "derive instance Generic $1 _"
},
"Generic Show": {
"prefix": "gshow",
"description": "Generate generic show instances",
"body": [
"instance Show $1 where",
" show = genericShow"
]
},
"Generic Debug": {
"prefix": "gdebug",
"description": "Generate generic debug instances",
"body": [
"instance Debug $1 where",
" debug = genericDebug"
]
},
"Generic json": {
"prefix": "gjson",
"description": "Generate generic json instances",
"body": [
"instance EncodeJson $1 where",
" encodeJson = genericEncodeJson",
"instance DecodeJson $1 where",
" decodeJson = genericDecodeJson"
]
},
"Instance": {
"prefix": "instance",
"description": "Declare typeclass instance",
"body": [
"instance $2 $3 where",
" $0"
]
},
"Functor": {
"prefix": "dfunctor",
"description": "Derive a Functor instance",
"body": "derive instance Functor $1$0"
},
"Eq": {
"prefix": "deq",
"description": "Derive an Eq instance",
"body": "derive instance Eq $1$0"
},
"Ord": {
"prefix": "dord",
"description": "Derive an Ord instance",
"body": "derive instance Ord $1$0"
},
"Eq & Ord": {
"prefix": "deqord",
"description": "Derive an Eq and an Ord instance",
"body": [
"derive instance Eq $1",
"derive instance Ord $1$0"
]
}
}

View file

@ -1,62 +0,0 @@
{
"Tuple constructors": {
"prefix": "imptuple",
"description": "Import tuple constructors",
"body": "import Data.Tuple.Nested (type (/\\), (/\\))"
},
"Map": {
"prefix": "impmap",
"description": "Import Map module",
"body": "import Data.Map as Map"
},
"HashMap": {
"prefix": "imphashmap",
"description": "Import HashMap module",
"body": "import Data.HashMap as HashMap"
},
"FRP Event": {
"prefix": "impevent",
"description": "Import FRP.Event module",
"body": "import FRP.Event as E"
},
"List": {
"prefix": "implist",
"description": "Import List module",
"body": "import Data.List as List"
},
"Array": {
"prefix": "imparray",
"description": "import Array module",
"body": "import Data.Array as Array"
},
"AVar": {
"prefix": "impavar",
"description": "import AVar module",
"body": "import Effect.Aff.AVar as AV"
},
"Object": {
"prefix": "impobject",
"description": "import Foreign.Object module",
"body": "import Foreign.Object as Object"
},
"STObject": {
"prefix": "impstobject",
"description": "import STObject module",
"body": "import Foreign.Object.ST as STObject"
},
"Ref": {
"prefix": "impref",
"description": "import Effect.Ref module",
"body": "import Effect.Ref as Ref"
},
"Int": {
"prefix": "impint",
"description": "import Data.Int module",
"body": "import Data.Int as Int"
},
"Number": {
"prefix": "impnumber",
"description": "import Data.Number module",
"body": "import Data.Number as Number"
}
}

View file

@ -1,61 +0,0 @@
{
"Definition": {
"prefix": "definition",
"description": "Basic purescript definition",
"body": ["$1 :: $2", "$1 = $3"]
},
"SProxy": {
"prefix": "sproxy",
"description": "Generate a proxy constant",
"body": ["_$1 :: Proxy \"$1\"", "_$1 = Proxy"]
},
"Proxy": {
"prefix": "proxy",
"description": "Generate a proxy constant",
"body": ["_$1 :: Proxy $1", "_$1 = Proxy"]
},
"Prop": {
"prefix": "prop",
"description": "Prop lens",
"body": ["_$1 :: Lens' $2 $3", "_$1 = prop (Proxy :: _ \"$1\")"]
},
"Variant constructor": {
"prefix": "inj",
"description": "Generate a constructor for a variant an inline sproxy",
"body": [
"$1 :: forall r a. a -> Variant ( $1 :: a | r)",
"$1 = inj (SProxy :: SProxy \"$1\")"
]
},
"Full variant constructor": {
"prefix": "injf",
"description": "Generate a constructor for a variant with an external sproxy definition",
"body": [
"$1 :: forall r a. a -> Variant ( $1 :: a | r)",
"$1 = inj _$1",
"",
"_$1 :: Proxy \"$1\"",
"_$1 = Proxy"
]
},
"Example code": {
"prefix": "ex",
"description": "Provide example usage for some piece of code",
"body": ["-- |", "-- | Ex:", "-- | ```purs", "-- | $0", "-- | ```"]
},
"Section": {
"prefix": "section",
"description": "Delimit a section using 10 dashes",
"body": "---------- $0"
},
"Typeclass instances": {
"prefix": "sinstances",
"description": "Delimit a section which declares typeclass instances",
"body": ["---------- Typeclass instances", "$0"]
},
"If": {
"prefix": "if",
"description": "If then else expression",
"body": ["if $1", "\tthen $2", "\telse $3"]
}
}

View file

@ -1,831 +0,0 @@
{
"nodes": {
"Prettier": {
"flake": false,
"locked": {
"lastModified": 1639310097,
"narHash": "sha256-+eSLEJDuy2ZRkh1h0Y5IF6RUeHEcWhAHpWhwdwW65f0=",
"owner": "Z-snails",
"repo": "prettier",
"rev": "4a90663b1d586f6d6fce25873aa0f0d7bc633b89",
"type": "github"
},
"original": {
"owner": "Z-snails",
"repo": "prettier",
"type": "github"
}
},
"base16": {
"inputs": {
"nixpkgs": [
"stylix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1658847131,
"narHash": "sha256-X6Mml7cT0YR3WCD5fkUhpRVV5ZPcwdcDsND8r8xMqTE=",
"owner": "SenchoPens",
"repo": "base16.nix",
"rev": "6b404cda2e04ca3cf5ca7b877af9c469e1386acb",
"type": "github"
},
"original": {
"owner": "SenchoPens",
"repo": "base16.nix",
"type": "github"
}
},
"collie": {
"flake": false,
"locked": {
"lastModified": 1631011321,
"narHash": "sha256-goYctB+WBoLgsbjA0DlqGjD8i9wr1K0lv0agqpuwflU=",
"owner": "ohad",
"repo": "collie",
"rev": "ed2eda5e04fbd02a7728e915d396e14cc7ec298e",
"type": "github"
},
"original": {
"owner": "ohad",
"repo": "collie",
"type": "github"
}
},
"comonad": {
"flake": false,
"locked": {
"lastModified": 1638093386,
"narHash": "sha256-kxmN6XuszFLK2i76C6LSGHe5XxAURFu9NpzJbi3nodk=",
"owner": "stefan-hoeck",
"repo": "idris2-comonad",
"rev": "06d6b551db20f1f940eb24c1dae051c957de97ad",
"type": "github"
},
"original": {
"owner": "stefan-hoeck",
"repo": "idris2-comonad",
"type": "github"
}
},
"coricamu": {
"inputs": {
"nixpkgs": [
"stylix",
"nixpkgs"
],
"utils": "utils_2"
},
"locked": {
"lastModified": 1659649195,
"narHash": "sha256-wRpMO4Mm4uizR5M71iipdi8ssSYMEPPAIwWyFYnhnco=",
"owner": "danth",
"repo": "coricamu",
"rev": "cdd2f7326efd91509caf84e69b669a7f9e6782bc",
"type": "github"
},
"original": {
"owner": "danth",
"repo": "coricamu",
"type": "github"
}
},
"dom": {
"flake": false,
"locked": {
"lastModified": 1639041519,
"narHash": "sha256-4ZYc0qaUEVARxhWuH3JgejIeT+GEDNxdS6zIGhBCk34=",
"owner": "stefan-hoeck",
"repo": "idris2-dom",
"rev": "01ab52d0ffdb3b47481413a949b8f0c0688c97e4",
"type": "github"
},
"original": {
"owner": "stefan-hoeck",
"repo": "idris2-dom",
"type": "github"
}
},
"dot-parse": {
"flake": false,
"locked": {
"lastModified": 1638264571,
"narHash": "sha256-VJQITz+vuQgl5HwR5QdUGwN8SRtGcb2/lJaAVfFbiSk=",
"owner": "CodingCellist",
"repo": "idris2-dot-parse",
"rev": "48fbda8bf8adbaf9e8ebd6ea740228e4394154d9",
"type": "github"
},
"original": {
"owner": "CodingCellist",
"repo": "idris2-dot-parse",
"type": "github"
}
},
"effect": {
"flake": false,
"locked": {
"lastModified": 1637477153,
"narHash": "sha256-Ta2Vogg/IiSBkfhhD57jjPTEf3S4DOiVRmof38hmwlM=",
"owner": "russoul",
"repo": "idris2-effect",
"rev": "ea1daf53b2d7e52f9917409f5653adc557f0ee1a",
"type": "github"
},
"original": {
"owner": "russoul",
"repo": "idris2-effect",
"type": "github"
}
},
"elab-util": {
"flake": false,
"locked": {
"lastModified": 1639041013,
"narHash": "sha256-K61s/xifFiTDXJTak5NZmZL6757CTYCY+TGywRZMD7M=",
"owner": "stefan-hoeck",
"repo": "idris2-elab-util",
"rev": "7a381c7c5dc3adb7b97c8b8be17e4fb4cc63027d",
"type": "github"
},
"original": {
"owner": "stefan-hoeck",
"repo": "idris2-elab-util",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1668681692,
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1638122382,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1631561581,
"narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"frex": {
"flake": false,
"locked": {
"lastModified": 1637410704,
"narHash": "sha256-BthU1t++n0ZvS76p0fCHsE33QSoXYxf0hMUSKajDY8w=",
"owner": "frex-project",
"repo": "idris-frex",
"rev": "22c480e879c757a5cebca7bb555ec3d21ae3ac28",
"type": "github"
},
"original": {
"owner": "frex-project",
"repo": "idris-frex",
"type": "github"
}
},
"fvect": {
"flake": false,
"locked": {
"lastModified": 1633247988,
"narHash": "sha256-zElIze03XpcrYL4H5Aj0ZGNplJGbtOx+iWnivJMzHm0=",
"owner": "mattpolzin",
"repo": "idris-fvect",
"rev": "1c5e3761e0cd83e711a3535ef9051bea45e6db3f",
"type": "github"
},
"original": {
"owner": "mattpolzin",
"repo": "idris-fvect",
"type": "github"
}
},
"hashable": {
"flake": false,
"locked": {
"lastModified": 1633965157,
"narHash": "sha256-Dggf5K//RCZ7uvtCyeiLNJS6mm+8/n0RFW3zAc7XqPg=",
"owner": "z-snails",
"repo": "idris2-hashable",
"rev": "d6fec8c878057909b67f3d4da334155de4f37907",
"type": "github"
},
"original": {
"owner": "z-snails",
"repo": "idris2-hashable",
"type": "github"
}
},
"hedgehog": {
"flake": false,
"locked": {
"lastModified": 1639041435,
"narHash": "sha256-893cPy7gGSQpVmm9co3QCpWsgjukafZHy8YFk9xts30=",
"owner": "stefan-hoeck",
"repo": "idris2-hedgehog",
"rev": "a66b1eb0bf84c4a7b743cfb217be69866bc49ad8",
"type": "github"
},
"original": {
"owner": "stefan-hoeck",
"repo": "idris2-hedgehog",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1670253003,
"narHash": "sha256-/tJIy4+FbsQyslq1ipyicZ2psOEd8dvl4OJ9lfisjd0=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "0e8125916b420e41bf0d23a0aa33fadd0328beb3",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-22.11",
"repo": "home-manager",
"type": "github"
}
},
"idrall": {
"flake": false,
"locked": {
"lastModified": 1636495701,
"narHash": "sha256-aOdCRd4XsSxwqVGta1adlZBy8TVTxTwFDnJ1dyMZK8M=",
"owner": "alexhumphreys",
"repo": "idrall",
"rev": "13ef174290169d05c9e9abcd77c53412e3e0c944",
"type": "github"
},
"original": {
"owner": "alexhumphreys",
"ref": "13ef174",
"repo": "idrall",
"type": "github"
}
},
"idris-server": {
"flake": false,
"locked": {
"lastModified": 1634507315,
"narHash": "sha256-ulo23yLJXsvImoMB/1C6yRRTqmn/Odo+aUaVi+tUhJo=",
"owner": "avidela",
"repo": "idris-server",
"rev": "661a4ecf0fadaa2bd79c8e922c2d4f79b0b7a445",
"type": "gitlab"
},
"original": {
"owner": "avidela",
"repo": "idris-server",
"type": "gitlab"
}
},
"idris2": {
"flake": false,
"locked": {
"lastModified": 1639427352,
"narHash": "sha256-C1K2FM1Kio8vi9FTrivdacYCX4cywIsLBeNCsZ6ft4g=",
"owner": "idris-lang",
"repo": "idris2",
"rev": "36918e618646177b1e0c2fd01f21cc8d04d9da30",
"type": "github"
},
"original": {
"owner": "idris-lang",
"repo": "idris2",
"type": "github"
}
},
"idris2-pkgs": {
"inputs": {
"Prettier": "Prettier",
"collie": "collie",
"comonad": "comonad",
"dom": "dom",
"dot-parse": "dot-parse",
"effect": "effect",
"elab-util": "elab-util",
"flake-utils": "flake-utils",
"frex": "frex",
"fvect": "fvect",
"hashable": "hashable",
"hedgehog": "hedgehog",
"idrall": "idrall",
"idris-server": "idris-server",
"idris2": "idris2",
"indexed": "indexed",
"inigo": "inigo",
"ipkg-to-json": "ipkg-to-json",
"json": "json",
"katla": "katla",
"lsp": "lsp",
"nixpkgs": [
"nixpkgs"
],
"odf": "odf",
"pretty-show": "pretty-show",
"python": "python",
"rhone": "rhone",
"rhone-js": "rhone-js",
"snocvect": "snocvect",
"sop": "sop",
"tailrec": "tailrec",
"xml": "xml"
},
"locked": {
"lastModified": 1642030375,
"narHash": "sha256-J1uXnpPR72mjFjLBuYcvDHStBxVya6/MjBNNwqxGeD0=",
"owner": "claymager",
"repo": "idris2-pkgs",
"rev": "ac33a49d4d4bd2b50fddb040cd889733a02c8f09",
"type": "github"
},
"original": {
"owner": "claymager",
"repo": "idris2-pkgs",
"type": "github"
}
},
"indexed": {
"flake": false,
"locked": {
"lastModified": 1638685238,
"narHash": "sha256-FceB7o88yKYzjTfRC6yfhOL6oDPMmCQAsJZu/pjE2uA=",
"owner": "mattpolzin",
"repo": "idris-indexed",
"rev": "ff3ba99b0063da6a74c96178e7f3c58a4ac1693e",
"type": "github"
},
"original": {
"owner": "mattpolzin",
"repo": "idris-indexed",
"type": "github"
}
},
"inigo": {
"flake": false,
"locked": {
"lastModified": 1637596767,
"narHash": "sha256-LNx30LO0YWDVSPTxRLWGTFL4f3d5ANG6c60WPdmiYdY=",
"owner": "idris-community",
"repo": "Inigo",
"rev": "57f5b5c051222d8c630010a0a3cf7d7138910127",
"type": "github"
},
"original": {
"owner": "idris-community",
"repo": "Inigo",
"type": "github"
}
},
"ipkg-to-json": {
"flake": false,
"locked": {
"lastModified": 1634937414,
"narHash": "sha256-LhSmWRpI7vyIQE7QTo38ZTjlqYPVSvV/DIpIxzPmqS0=",
"owner": "claymager",
"repo": "ipkg-to-json",
"rev": "2969b6b83714eeddc31e41577a565778ee5922e6",
"type": "github"
},
"original": {
"owner": "claymager",
"repo": "ipkg-to-json",
"type": "github"
}
},
"json": {
"flake": false,
"locked": {
"lastModified": 1639041459,
"narHash": "sha256-TP/V1jBBP1hFPm/cJ5O2EJiaNoZ19KvBOAI0S9lvAR4=",
"owner": "stefan-hoeck",
"repo": "idris2-json",
"rev": "7c0c028acad0ba0b63b37b92199f37e6ec73864a",
"type": "github"
},
"original": {
"owner": "stefan-hoeck",
"repo": "idris2-json",
"type": "github"
}
},
"katla": {
"flake": false,
"locked": {
"lastModified": 1636542431,
"narHash": "sha256-X83NA/P3k1iPcBa8g5z8JldEmFEz/jxVeViJX0/FikY=",
"owner": "idris-community",
"repo": "katla",
"rev": "d841ec243f96b4762074211ee81033e28884c858",
"type": "github"
},
"original": {
"owner": "idris-community",
"repo": "katla",
"type": "github"
}
},
"kmonad": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"dir": "nix",
"lastModified": 1651937557,
"narHash": "sha256-gvQsenQrEsLxLFgUGJhJBIx3+t1dtLMMTVEO/yZ8nRg=",
"owner": "kmonad",
"repo": "kmonad",
"rev": "c43a0180a3b9ca9c4ff4a283b17369fc4e8e46e2",
"type": "github"
},
"original": {
"dir": "nix",
"owner": "kmonad",
"repo": "kmonad",
"type": "github"
}
},
"lsp": {
"flake": false,
"locked": {
"lastModified": 1639486283,
"narHash": "sha256-po396FnUu8iqiipwPxqpFZEU4rtpX3jnt3cySwjLsH8=",
"owner": "idris-community",
"repo": "idris2-lsp",
"rev": "7ebb6caf6bb4b57c5107579aba2b871408e6f183",
"type": "github"
},
"original": {
"owner": "idris-community",
"repo": "idris2-lsp",
"type": "github"
}
},
"neovim-flake": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"dir": "contrib",
"lastModified": 1670899659,
"narHash": "sha256-HrEXh9qSkOb5Ke7IRoEs90lgLiUOTNWrfKJ9OLgk0uY=",
"owner": "neovim",
"repo": "neovim",
"rev": "a6b05cb75d330dd995d3ad21ee08bb0a2cfcae74",
"type": "github"
},
"original": {
"dir": "contrib",
"owner": "neovim",
"repo": "neovim",
"type": "github"
}
},
"neovim-nightly-overlay": {
"inputs": {
"flake-compat": "flake-compat",
"neovim-flake": "neovim-flake",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1670919334,
"narHash": "sha256-gLno1vCJ9zpSTeCLOP12Ja+dFu9yNTbS87ZC04H8Y9Q=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "b68451b57ce944623a6c16547bb88e3c349b6754",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"type": "github"
}
},
"nixos-unstable": {
"locked": {
"lastModified": 1669791787,
"narHash": "sha256-KBfoA2fOI5+wCrm7PR+j7jHqXeTkVRPQ0m5fcKchyuU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e76c78d20685a043d23f5f9e0ccd2203997f1fb1",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1670263920,
"narHash": "sha256-oR1rtMcWCvpGa81vvaHpONLFfZJpq1ijnHypujGA/lw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "29423d0cfac3baa05f804c399f1b043068b531f8",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-22.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1669867399,
"narHash": "sha256-Z8RXSFYOsIsTG96ROKtV0eZ8Q7u4irFWm6ELqfw7mT8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "38e591dd05ffc8bdf79dc752ba78b05e370416fa",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"odf": {
"flake": false,
"locked": {
"lastModified": 1638184051,
"narHash": "sha256-usSdPx+UqOGImHHdHcrytdzi2LXtIRZuUW0fkD/Wwnk=",
"owner": "madman-bob",
"repo": "idris2-odf",
"rev": "d2f532437321c8336f1ca786b44b6ebef4117126",
"type": "github"
},
"original": {
"owner": "madman-bob",
"repo": "idris2-odf",
"type": "github"
}
},
"pretty-show": {
"flake": false,
"locked": {
"lastModified": 1639041411,
"narHash": "sha256-BzEe1fpX+lqGEk8b1JZoQT1db5I7s7SZnLCttRVGXdY=",
"owner": "stefan-hoeck",
"repo": "idris2-pretty-show",
"rev": "a4bc6156b9dac43699f87504cbdb8dada5627863",
"type": "github"
},
"original": {
"owner": "stefan-hoeck",
"repo": "idris2-pretty-show",
"type": "github"
}
},
"python": {
"flake": false,
"locked": {
"lastModified": 1635936936,
"narHash": "sha256-c9mcMApN0qgu0AXQVu0V+NXt2poP258wCPkyvtQvv4I=",
"owner": "madman-bob",
"repo": "idris2-python",
"rev": "0eab028933c65bebe744e879881416f5136d6943",
"type": "github"
},
"original": {
"owner": "madman-bob",
"repo": "idris2-python",
"type": "github"
}
},
"rhone": {
"flake": false,
"locked": {
"lastModified": 1639041532,
"narHash": "sha256-2g43shlWQIT/1ogesUBUBV9N8YiD3RwaCbbhdKLVp1s=",
"owner": "stefan-hoeck",
"repo": "idris2-rhone",
"rev": "c4d828b0b8efea495d9a5f1e842a9c67cad57724",
"type": "github"
},
"original": {
"owner": "stefan-hoeck",
"repo": "idris2-rhone",
"type": "github"
}
},
"rhone-js": {
"flake": false,
"locked": {
"lastModified": 1639041546,
"narHash": "sha256-ddWVsSRbfA6ghmwiRMzDpHBPM+esGdutuqm1qQZgs88=",
"owner": "stefan-hoeck",
"repo": "idris2-rhone-js",
"rev": "520dd59549f5b14075045314b6805c7492ed636e",
"type": "github"
},
"original": {
"owner": "stefan-hoeck",
"repo": "idris2-rhone-js",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"idris2-pkgs": "idris2-pkgs",
"kmonad": "kmonad",
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nixos-unstable": "nixos-unstable",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable",
"stylix": "stylix"
}
},
"snocvect": {
"flake": false,
"locked": {
"lastModified": 1641633224,
"narHash": "sha256-6zTU4sDzd/R/dFCTNZaX41H4L3/USGLFghMS0Oc9liY=",
"owner": "mattpolzin",
"repo": "idris-snocvect",
"rev": "ff1e7afba360a62f7e522e9bbb856096a79702c4",
"type": "github"
},
"original": {
"owner": "mattpolzin",
"repo": "idris-snocvect",
"type": "github"
}
},
"sop": {
"flake": false,
"locked": {
"lastModified": 1639041379,
"narHash": "sha256-PDTf1Wx6EygiWszguvoVPiqIISYFLabI4e0lXHlrjcA=",
"owner": "stefan-hoeck",
"repo": "idris2-sop",
"rev": "e4354d1883cd73616019457cb9ebf864d99df6a0",
"type": "github"
},
"original": {
"owner": "stefan-hoeck",
"repo": "idris2-sop",
"type": "github"
}
},
"stylix": {
"inputs": {
"base16": "base16",
"coricamu": "coricamu",
"home-manager": [
"home-manager"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1660382154,
"narHash": "sha256-OMh2cBIm8C/rVVgSuD9Tz0+04N98u1FsGNJMuYCIMDc=",
"owner": "danth",
"repo": "stylix",
"rev": "9185529e3dbededab5f13e5305667a705ee85528",
"type": "github"
},
"original": {
"owner": "danth",
"repo": "stylix",
"type": "github"
}
},
"tailrec": {
"flake": false,
"locked": {
"lastModified": 1637146655,
"narHash": "sha256-0yi7MQIrISPvAwkgDC1M5PHDEeVyIaISF0HjKDaT0Rw=",
"owner": "stefan-hoeck",
"repo": "idris2-tailrec",
"rev": "dd0bc6381b3a2e69aa37f9a8c1b165d4b1516ad7",
"type": "github"
},
"original": {
"owner": "stefan-hoeck",
"repo": "idris2-tailrec",
"type": "github"
}
},
"utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"utils_2": {
"locked": {
"lastModified": 1642700792,
"narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "846b2ae0fc4cc943637d3d1def4454213e203cba",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"xml": {
"flake": false,
"locked": {
"lastModified": 1637939752,
"narHash": "sha256-yYJBhPfwYoi7amlHmeNGrVCOAc3BjZpKTCd9wDs3XEM=",
"owner": "madman-bob",
"repo": "idris2-xml",
"rev": "1292ccfcd58c551089ef699e4560343d5c473d64",
"type": "github"
},
"original": {
"owner": "madman-bob",
"repo": "idris2-xml",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

114
flake.nix
View file

@ -1,72 +1,70 @@
{ {
description = "NixOS configuration"; description = "Satellite";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/release-22.11"; # Nixpkgs
nixos-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
home-manager = { # Home manager
url = "github:nix-community/home-manager/release-22.11"; home-manager.url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
# keyboard layout configuration
kmonad = {
url = "github:kmonad/kmonad?dir=nix";
inputs.nixpkgs.follows = "nixpkgs";
};
idris2-pkgs = {
url = "github:claymager/idris2-pkgs";
inputs.nixpkgs.follows = "nixpkgs";
};
#### Nvim stuff
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = inputs@{ self, stylix, nixpkgs, ... }: outputs = { self, nixpkgs, home-manager, ... }@inputs:
let let
system = "x86_64-linux"; inherit (self) outputs;
provideInputs = forAllSystems = nixpkgs.lib.genAttrs [
import ./modules/overlays/flakes.nix { inherit system; } inputs; "aarch64-linux"
"i686-linux"
overlays = { ... }: { "x86_64-linux"
nix.registry.nixpkgs.flake = nixpkgs; "aarch64-darwin"
nixpkgs.overlays = [ "x86_64-darwin"
inputs.neovim-nightly-overlay.overlay ];
inputs.idris2-pkgs.overlay
provideInputs
];
};
in in
{ rec {
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { # Acessible through 'nix build', 'nix shell', etc
inherit system; packages = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./pkgs { inherit pkgs; }
);
specialArgs = { # Devshell for bootstrapping
paths = import ./paths.nix; # Acessible through 'nix develop'
inherit inputs; devShells = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./shell.nix { inherit pkgs; }
);
# Custom packages and modifications, exported as overlays
overlays = import ./overlays;
# Reusable nixos modules
nixosModules = import ./modules/nixos;
# Reusable home-manager modules
homeManagerModules = import ./modules/home-manager;
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#...
nixosConfigurations = {
tethys = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = [
./hosts/tethys
];
}; };
};
modules = [ # Standalone home-manager configuration entrypoint
inputs.home-manager.nixosModules.home-manager # Available through 'home-manager --flake .#...
inputs.kmonad.nixosModule homeConfigurations = {
stylix.nixosModules.stylix "adrielus@tethys" = home-manager.lib.homeManagerConfiguration {
overlays pkgs = nixpkgs.legacyPackages.x86_64-linux;
./hardware/laptop.nix extraSpecialArgs = { inherit inputs outputs; };
./configuration.nix modules = [
]; ./home/adrielus/tethys.nix
];
};
}; };
}; };
} }

View file

@ -1,34 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }:
{
# imports =
# [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
# ];
# Basically the content of the import above
hardware.enableRedistributableFirmware = lib.mkDefault true;
boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/57846041-f177-45eb-aff3-503006bac638";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/01E6-A013";
fsType = "vfat";
};
swapDevices = [ ];
nix.settings.max-jobs = lib.mkDefault 8;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
}

32
home/adrielus/tethys.nix Normal file
View file

@ -0,0 +1,32 @@
{ inputs, outputs, lib, config, pkgs, ... }: {
imports = [
];
nixpkgs = {
# You can add overlays here
overlays = [
];
# Configure your nixpkgs instance
config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
};
};
home = {
username = "rafael";
homeDirectory = "/home/rafael";
};
# Enable home-manager and git
programs.home-manager.enable = true;
programs.git.enable = true;
# Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
home.stateVersion = "22.11";
}

1
hosts/tethys/default.nix Normal file
View file

@ -0,0 +1 @@
{ pkgs, ... }: { }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View file

@ -1,31 +0,0 @@
{ pkgs, lib, ... }:
let
theme = pkgs.myThemes.current;
in
{
imports = [
{
# Load theme
home-manager.users.adrielus.programs.alacritty.settings = theme.alacritty.settings;
}
];
home-manager.users.adrielus = {
xdg.configFile."alacritty/extraConfig.yml".text = theme.alacritty.extraConfig or "";
programs.alacritty = {
enable = true;
settings = {
import = [ "~/.config/alacritty/extraConfig.yml" ];
window.decorations = "none";
fonts.normal.family = "Nerd Font Source Code Pro";
env = { TERM = "xterm-256color"; };
working_directory = "/home/adrielus/Projects/";
};
};
};
}

View file

@ -1,11 +0,0 @@
{ pkgs, lib, ... }:
let
theme = pkgs.myThemes.current;
extensions = theme.chromium.extensions or [ ];
in
{
home-manager.users.adrielus.programs.chromium = {
enable = true;
extensions = lib.lists.map (id: { inherit id; }) extensions;
};
}

View file

@ -1,30 +0,0 @@
{ ... }: {
imports = [
./git
./shells
# ./wakatime
./rofi
# ./xmodmap
# ./wine.nix
./kdeconnect.nix
./steam.nix
./docker.nix
./misc.nix
./zathura.nix
./discord.nix
./locale.nix
# ./memes.nix
./alacritty.nix
# ./postgres.nix
./neovim.nix
./tmux.nix
./kmonad.nix
./direnv.nix
# ./chromium.nix
./vieb.nix
./polybar.nix
./hamachi.nix
];
}

View file

@ -1,7 +0,0 @@
# https://github.com/nix-community/nix-direnv
{ pkgs, ... }: {
home-manager.users.adrielus = {
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
};
}

View file

@ -1,13 +0,0 @@
{ pkgs, ... }: {
home-manager.users.adrielus = {
xdg.configFile."discord/settings.json".text = ''
{
"BACKGROUND_COLOR": "#ffffff",
"SKIP_HOST_UPDATE": true
}
'';
home.packages = with pkgs; [
unstable.discord
];
};
}

View file

@ -1,14 +0,0 @@
{ pkgs, ... }: {
virtualisation.docker = {
enable = true;
liveRestore = false;
extraOptions = ''
--default-address-pool "base=192.168.100.0/20,size=24"
'';
};
home-manager.users.adrielus.home.packages = with pkgs; [
docker
docker-compose
docker-machine
];
}

View file

@ -1,41 +0,0 @@
# TODO: make this actually build
{ pkgs, stdenv, ... }:
let
# It's considered good practice to specify the version in the derivation name
version = "38.1.1";
# In case the name they build it into changes I can just modify this
execName = "EDOPro";
edopro = stdenv.mkDerivation rec {
name = "edopro-${version}";
src = builtins.path {
path = pkgs.fetchurl {
url =
"https://mega.nz/file/pfglCAyK#IlqEOy1kBLmFiIDu4z6afbj1wTcWTFTyvYzPW0D2m24";
sha256 =
"99be240086ccae834998b821df5abb17f7d22d26fb757fc5106b4812ca4b3f36";
};
name = "edopro-source";
};
# Add the derivation to the PATH
buildInputs = with pkgs; [
mono # this is needed for the ai support
freetype # font rendering engine
];
# This just moves the bin over and calls it a day
installPhase = ''
# Make the output directory
mkdir -p $out/bin
# Copy the script there and make it executable
cp ${execName} $out/bin/
chmod +x $out/bin/${execName}
'';
};
in stdenv.mkDerivation {
name = "edopro-environment";
buildInputs = [ edopro ];
}

View file

@ -1,39 +0,0 @@
# Most of these are copied from: https://github.com/Brettm12345/nixos-config/blob/1400c71bce/modules/applications/git/aliases.nix
let
git = text: ''"!git ${text}"'';
f = text: ''"!f(){ ${text} };f"'';
in {
# Unstage all changes
unstage = "reset HEAD --";
# Ammend to the last commit
amend = "commit --amend -C HEAD";
# List branches sorted by last modified
b = git
"for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'";
# Test merge for conflicts before merging
mergetest = f ''
git merge --no-commit --no-ff "$1"; git merge --abort; echo "Merge aborted";'';
# Get description of current repo
description = git
''config --get "branch.$(git rev-parse --abbrev-ref HEAD).description"'';
# Show authors
authors = ''
"!f() { git log --no-merges --pretty='format:%<(26)%an <%ae>' --author "$*" | sort | uniq# }# f"'';
a = "add";
cm = "commit --message";
caa = "commit --ammend";
cl = "clone";
co = "checkout";
col = "checkout @{-1}";
cob = "checkout -b";
st = "stash";
pop = "stash pop";
t = "tag";
}

View file

@ -1,31 +0,0 @@
{ pkgs, ... }: {
home-manager.users.adrielus = {
home.packages = with pkgs;
with gitAndTools; [
# Render a git repo
gource
# Store secrets in github repos
git-secret
git-crypt
# Both of these are github clis
gh
hub
];
programs.git = {
enable = true;
userName = "Matei Adriel";
userEmail = "rafaeladriel11@gmail.com";
extraConfig.core.editor = "nvim";
aliases = import ./aliases.nix;
extraConfig = {
github.user = "Mateiadrielrafael";
hub.protocol = "ssh";
rebase.autoStash = true;
};
};
};
}

View file

@ -1,7 +0,0 @@
{ pkgs, ... }: {
services.logmein-hamachi.enable = true;
home-manager.users.adrielus.home.packages = [
pkgs.logmein-hamachi
pkgs.unstable.haguichi
];
}

View file

@ -1,9 +0,0 @@
{ pkgs, ... }: {
home-manager.users.adrielus = {
services.kdeconnect.enable = true;
};
# Open port for kdeconnect
networking.firewall.allowedTCPPortRanges = [{ from = 1714; to = 1764; }];
networking.firewall.allowedUDPPortRanges = [{ from = 1714; to = 1764; }];
}

View file

@ -1,43 +0,0 @@
{ pkgs, lib, ... }:
let
kmonadRoot = ../../dotfiles/kmonad;
kmonadInstances = [{
config = kmonadRoot + "/keymap.kbd";
inputDevices = [
"/dev/input/by-path/platform-i8042-serio-0-event-kbd"
];
}];
createKmonadInstances = ({ config, inputDevices }:
let
configContent = builtins.readFile config;
in
lib.lists.map
(device:
"${pkgs.writeTextDir "configs/kmonad.kbd" (builtins.replaceStrings [ "$DEVICE" ] [ device ] configContent)}/kmonad.kbd"
)
inputDevices
);
in
{
users.extraUsers.adrielus.extraGroups = [ "input" "uinput" ];
services = {
kmonad = {
enable = true;
# configfiles = lib.lists.concatMap createKmonadInstances kmonadInstances;
configfiles = lib.lists.map ({ config, ... }: config) kmonadInstances;
};
xserver = {
xkbOptions = "compose:ralt";
layout = "us";
};
};
home-manager.users.adrielus = {
home.file.".XCompose".source = kmonadRoot + "/xcompose";
};
}

View file

@ -1,19 +0,0 @@
{ pkgs, ... }: {
i18n.defaultLocale = "en_US.UTF-8";
# time.timeZone = "Europe/Bucharest";
time.timeZone = "Europe/Amsterdam";
i18n.inputMethod = {
enabled = "ibus";
# ibus.engines = with pkgs.ibus-engines; [ /* any engine you want, for example */ anthy ];
};
environment.systemPackages = [
pkgs.source-code-pro
];
console = {
keyMap = "us";
font = "SourceCodePro";
};
}

View file

@ -1,16 +0,0 @@
{ pkgs, ... }: {
home-manager.users.adrielus.home.packages = with pkgs; [
# I love combining these together and generating random stuff lol
fortune
cowsay
lolcat
figlet
toilet
# stuff to look at
doge
sl
asciiquarium
cmatrix
];
}

View file

@ -1,86 +0,0 @@
{ pkgs, ... }: {
home-manager.users.adrielus.home.packages = with pkgs; [
# cmd stuff
tree # print a directory structure
exa # ls replacement
mkpasswd # hash passwords
gnupg # forgot what this was
# acpi # show remaining battery
# typespeed # speed typing game
# unixtools.xxd # to dump binary stuff into a text file (used it for a ctf)
# youtube-dl # download from youtube
neofetch # display system information
xclip # copy paste stuff
# feh # image viewer
# speedtest-cli # test the internet speed and stuff
# openssl
# pkgconfig
# ngrok
# hugo
unzip # for working with .zip files
unrar # for extracting shit from rars
# jdk11o
# jdk8
# gtk3
gnumake
cmake
# unison-ucm
xorg.libX11 # wtf is this
okular # forgot what this does
spotify-tui # spotify terminal ui
# kdeconnect # connect with your phone
sloc # line of code counter
update-nix-fetchgit # for updating fetchgit calls in nix files
pamixer # set pipewire volume
pulseaudio # pactl and stuff (same thing as above)
# editors
# vscodium
# vscode
# vim
# emacs
vimclip # use neovim anywhere
# chat apps
# slack
signal-desktop
# tdesktop # telegram for the desktop
# deluge
zoom-us
# teams
# browsers
unstable.google-chrome
# brave
# firefox
# other stuff
obsidian # knowedge base
# milkytracker # music tracker thingy
spectacle # take screenshots
peek # record gifs
vlc # video player
gimp # image editing
# korganizer # calendar
libreoffice # free office suite
# edopro # yugioh simulator (my derivation doesn't work yet)
# akonadi
# obs-studio # video recorder
# blueman # bluetooth manager
# freesweep # minesweeper I can play w the keyboard.
# multimc
# lmms # music software
libsForQt5.dolphin
# Nes emulators and stuff
# zsnes
# higan
# fceux
# games
# tetrio-desktop # competitive tetris
# vassal # wargame engine
# mindustry # factory building game
# edopro # yugioh sim
];
}

View file

@ -1,87 +0,0 @@
{ pkgs, lib, paths, ... }:
let
teal = pkgs.fetchFromGitHub {
owner = "teal-language";
repo = "tl";
rev = "526fe3640fe6265706541c251e984c033a1a5ec9";
sha256 = "0l31qj492iaiadpp4s0wflfb7vn6zzxwhbiyczisdgpd9ydj20gf";
};
theme = pkgs.myThemes.current;
extraPackages = with pkgs; [
# Language servers
nodePackages.typescript-language-server # typescript
easy-purescript-nix.purescript-language-server # purescript
sumneko-lua-language-server # lua
rnix-lsp # nix
haskell-language-server # haskell
tectonic # also latex something?
texlab # latex
nodePackages_latest.vscode-langservers-extracted
# Formatters
luaformatter # lua
stylua # lua
ormolu # haskell
easy-purescript-nix.purs-tidy
nodePackages_latest.prettier_d_slim
# Others
nodePackages.typescript # typescript
wakatime # time tracking
fd # file finder
ripgrep # grep rewrite (I think?)
update-nix-fetchgit # useful for nix stuff
tree-sitter # syntax highlighting
libstdcxx5 # required by treesitter aparently
zathura # pdf reader
xdotool # for zathura reverse search or whatever it's called
lua # for repls and whatnot
glow # md preview in terminal
pandoc # md processing
libsForQt5.falkon # aparently needed for md preview
luajitPackages.luarocks # lua package manager
texlive.combined.scheme-full # latex stuff
python38Packages.pygments # required for latex syntax highlighting
];
wrapClient = { base, name }:
pkgs.symlinkJoin {
inherit (base) name meta;
paths = [ base ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/${name} \
--prefix PATH : ${lib.makeBinPath extraPackages} \
--set LAZY_NVIM_PATH ${lazy-nvim} \
--set INSIDE_NEOVIDE ${if name == "neovide" then "1" else "0"}
'';
};
neovim = wrapClient { base = pkgs.neovim-nightly; name = "nvim"; };
neovide = wrapClient { base = pkgs.neovide; name = "neovide"; };
nixPlugins = ".local/share/nvim/site/pack/nix";
in
{
home-manager.users.adrielus = { config, ... }:
let simlink = config.lib.file.mkOutOfStoreSymlink; in
{
home.file."${nixPlugins}/start/paq-nvim".source = paq;
home.file."${nixPlugins}/start/theming/lua/my/theme.lua".source = theme.neovim.theme;
home.file."${nixPlugins}/start/teal/lua".source = teal; # teal (typed lua)
home.file."${nixPlugins}/start/snippets".source = simlink "${paths.dotfiles}/vscode-snippets";
home.file.".config/nvim".source = simlink "${paths.dotfiles}/neovim";
# home.file.".config/nvim".source = ../../dotfiles/neovim;
programs.neovim.enable = false;
home.packages = [
neovim
neovide
];
};
}

View file

@ -1,21 +0,0 @@
{ pkgs, lib, paths, ... }:
{
home-manager.users.adrielus.services.polybar = {
enable = true;
extraConfig = ''
${pkgs.myThemes.current.polybar.config or ""}
include-file = ${paths.dotfiles}/polybar/config.ini
'';
script = ''
polybar main &
'';
};
home-manager.users.adrielus.xsession = {
enable = true;
initExtra = ''
polybar main &
'';
};
}

View file

@ -1,28 +0,0 @@
{ pkgs, lib, ... }: {
services.postgresql = {
enable = true;
package = pkgs.postgresql_10;
enableTCPIP = true;
authentication = lib.mkForce ''
# Generated file; do not edit!
# TYPE DATABASE USER ADDRESS METHOD
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
'';
initialScript = pkgs.writeText "backend-initScript" ''
CREATE ROLE adrielus WITH
LOGIN
SUPERUSER
INHERIT
CREATEDB
CREATEROLE
REPLICATION;
CREATE DATABASE lunarbox;
GRANT ALL PRIVILEGES ON DATABASE lunarbox TO adrielus;
'';
};
}

View file

@ -1,23 +0,0 @@
{ pkgs, lib, ... }:
let
theme = pkgs.myThemes.current;
rofi = pkgs.rofi.override
{
plugins = with pkgs;[
rofi-power-menu
rofi-calc
rofi-emoji
];
};
in
{
home-manager.users.adrielus = {
home.packages = [ rofi ];
home.file.".local/share/rofi/themes".source = theme.rofi.themes or "/home/adrielus/.temp-empty-rofi-themes-directory";
xdg.configFile."rofi/config.rasi".text = ''
@import "${./pre.rasi}"
${theme.rofi.config or ""}
'';
};
}

View file

@ -1,5 +0,0 @@
configuration {
location: 0;
cycle: true;
font: "Source Code Pro 16";
}

View file

@ -1,35 +0,0 @@
{
# Ls but looks nicer
ls = "exa -la";
# What even is this???
sl = "sl -e";
# WIfi stuff
wifi = "sudo nmcli con up id";
# Volume controls
"v-up" = "pactl set-sink-volume @DEFAULT_SINK@ +5%";
"v-down" = "pactl set-sink-volume @DEFAULT_SINK@ +5%";
"v-min" = "pactl set-sink-volume @DEFAULT_SINK@ 0%";
"v-mid" = "pactl set-sink-volume @DEFAULT_SINK@ 50%";
"v-max" = "pactl set-sink-volume @DEFAULT_SINK@ 100%";
# "v-up" = "amixer set Master 8%+";
# "v-down" = "amixer set Master 8%-";
# "v-min" = "amixer set Master 0%";
# "v-mid" = "amixer set Master 50%";
# "v-max" = "amixer set Master 100%";
# Print available battery
battery = "acpi";
# Rebuuild nixos
rebuild = "sudo -u adrielus nixos-rebuild switch --flake ~/Projects/nixos-config/";
# Render git repo using gource
"git-render" = "gource -f -s 1 -c 4 --key";
# Neovide multigrid by default
neovide = "neovide --multigrid";
}

Some files were not shown because too many files have changed in this diff Show more