From 6ed623bd6fc4b5d0b41e699a8781da9b07477626 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Wed, 13 Mar 2024 21:56:32 +0100 Subject: [PATCH] Up --- README.md | 7 --- home/nvim/alpha.nix | 116 +++++++++++++++++++++++++++++++++++++++ home/nvim/default.nix | 124 +----------------------------------------- home/nvim/keymaps.nix | 44 +++++++++++++++ 4 files changed, 163 insertions(+), 128 deletions(-) create mode 100644 home/nvim/alpha.nix create mode 100644 home/nvim/keymaps.nix diff --git a/README.md b/README.md index 955f629..b705d35 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,6 @@ You can search for it with ripgrep: `rg "CHANGEME"` # TODOLIST - [ ] Variable user & homeDir -- [ ] Settings fzf -- [ ] Nixvim Alpha config -- [ ] Scripts: - - [ ] Edit - - [ ] Rebuild - - [ ] Update - - [ ] Garbage collector - [ ] Ricing things - [ ] Peaclock - [ ] Find a tui app for white noises (does that exist ? If not, I'll build my own) diff --git a/home/nvim/alpha.nix b/home/nvim/alpha.nix new file mode 100644 index 0000000..639194e --- /dev/null +++ b/home/nvim/alpha.nix @@ -0,0 +1,116 @@ +{ + programs.nixvim.plugins.alpha = { + enable = true; + layout = [ + { + type = "padding"; + val = 4; + } + { + type = "text"; + opts = { position = "center"; }; + val = [ + "  " + " ████ ██████ █████ ██ " + " ███████████ █████  " + " █████████ ███████████████████ ███ ███████████ " + " █████████ ███ █████████████ █████ ██████████████ " + " █████████ ██████████ █████████ █████ █████ ████ █████ " + " ███████████ ███ ███ █████████ █████ █████ ████ █████ " + " ██████ █████████████████████ ████ █████ █████ ████ ██████ " + " " + ]; + } + { + type = "padding"; + val = 4; + } + { + type = "group"; + + val = [ + { + type = "button"; + val = "󰭎 Find file"; + on_press.__raw = "function() vim.cmd[[Telescope find_files]] end"; + opts = { + shortcut = "nf"; + position = "center"; + cursor = 3; + width = 50; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + { + type = "button"; + val = " New file"; + on_press.__raw = "function() vim.cmd[[ene]] end"; + opts = { + shortcut = "nn"; + position = "center"; + cursor = 3; + width = 50; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + { + type = "button"; + val = " NixOs Config"; + on_press.__raw = "function() vim.cmd[[e ~/.config/nixos]] end"; + opts = { + shortcut = "nc"; + position = "center"; + cursor = 3; + width = 50; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + { + type = "button"; + val = " Recently used"; + on_press.__raw = "function() vim.cmd[[Telescope oldfiles]] end"; + opts = { + shortcut = "no"; + position = "center"; + cursor = 3; + width = 50; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + { + type = "button"; + val = "󰱽 Find text"; + on_press.__raw = "function() vim.cmd[[Telescope live_grep]] end"; + opts = { + shortcut = "nt"; + position = "center"; + cursor = 3; + width = 50; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + { + type = "button"; + val = "󰩈 Quit Neovim"; + on_press.__raw = "function() vim.cmd[[qa]] end"; + opts = { + shortcut = "nq"; + position = "center"; + cursor = 3; + width = 50; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + ]; + + } + ]; + }; + +} diff --git a/home/nvim/default.nix b/home/nvim/default.nix index 8101a5e..0c28e0c 100644 --- a/home/nvim/default.nix +++ b/home/nvim/default.nix @@ -1,6 +1,4 @@ -{ pkgs, inputs, ... }: - -{ +{ pkgs, inputs, ... }: { imports = [ inputs.nixvim.homeManagerModules.nixvim ./auto-pairs.nix @@ -19,130 +17,14 @@ ./copilot.nix ./obsidian.nix ./whichkey.nix + ./alpha.nix + ./keymaps.nix ]; programs.nixvim = { - enable = true; - colorschemes.catppuccin.enable = true; colorschemes.catppuccin.transparentBackground = true; - - plugins.alpha = { - enable = true; - layout = [ - { - type = "padding"; - val = 4; - } - { - type = "text"; - opts = { position = "center"; }; - val = [ - "  " - " ████ ██████ █████ ██ " - " ███████████ █████  " - " █████████ ███████████████████ ███ ███████████ " - " █████████ ███ █████████████ █████ ██████████████ " - " █████████ ██████████ █████████ █████ █████ ████ █████ " - " ███████████ ███ ███ █████████ █████ █████ ████ █████ " - " ██████ █████████████████████ ████ █████ █████ ████ ██████ " - " " - ]; - } - { - type = "padding"; - val = 4; - } - { - type = "group"; - val = [ - { - type = "button"; - val = " New file"; - on_press.__raw = "function() vim.cmd[[ene]] end"; - opts = { - shortcut = "n"; - position = "center"; - cursor = 3; - width = 50; - align_shortcut = "right"; - hl_shortcut = "Keyword"; - }; - } - { - type = "button"; - val = " NixOs Config"; - on_press.__raw = "function() vim.cmd[[e ~/.config/nixos]] end"; - opts = { - shortcut = "c"; - position = "center"; - cursor = 3; - width = 50; - align_shortcut = "right"; - hl_shortcut = "Keyword"; - }; - } - { - type = "button"; - val = "󰩈 Quit Neovim"; - on_press.__raw = "function() vim.cmd[[qa]] end"; - opts = { - shortcut = "q"; - position = "center"; - cursor = 3; - width = 50; - align_shortcut = "right"; - hl_shortcut = "Keyword"; - }; - } - ]; - } - ]; - }; - - keymaps = [ - { - key = "e"; - action = "Neotree toggle"; - } - { - key = "fm"; - action = "lua vim.lsp.buf.format()"; - } - - { - key = "ot"; - action = "lua require('obsidian').util.toggle_checkbox()"; - } - - { - key = "oo"; - action = "ObsidianQuickSwitch"; - } - - { - key = "on"; - action = "ObsidianNew"; - } - - { - key = "of"; - action = "ObsidianSearch"; - } - - { - key = "oi"; - action = "ObsidianPasteImg"; - } - - # Terminal Mappings - { - mode = "t"; - key = ""; - action = ""; - } - ]; }; } diff --git a/home/nvim/keymaps.nix b/home/nvim/keymaps.nix new file mode 100644 index 0000000..8efc76c --- /dev/null +++ b/home/nvim/keymaps.nix @@ -0,0 +1,44 @@ +{ + programs.nixvim.keymaps = [ + { + key = "e"; + action = "Neotree toggle"; + } + { + key = "fm"; + action = "lua vim.lsp.buf.format()"; + } + + { + key = "ot"; + action = "lua require('obsidian').util.toggle_checkbox()"; + } + + { + key = "oo"; + action = "ObsidianQuickSwitch"; + } + + { + key = "on"; + action = "ObsidianNew"; + } + + { + key = "of"; + action = "ObsidianSearch"; + } + + { + key = "oi"; + action = "ObsidianPasteImg"; + } + + # Terminal Mappings + { + mode = "t"; + key = ""; + action = ""; + } + ]; +}