From f27ecaf54fa0458db141453f28ca5879f1abf888 Mon Sep 17 00:00:00 2001 From: natto1784 Date: Fri, 11 Jun 2021 10:41:57 +0530 Subject: [PATCH] Satori:zsh: change settings --- configs/nvim.nix | 1 + configs/nvim/init.lua | 1 - configs/nvim/test.patch | 27 +++++++++++++++++++++++++ hosts/personal/satori/pkgs.nix | 35 ++++++++++++++++++++++++++++++--- hosts/personal/satori/stuff.nix | 6 ------ 5 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 configs/nvim/test.patch diff --git a/configs/nvim.nix b/configs/nvim.nix index 9f20fcb..1e6432a 100644 --- a/configs/nvim.nix +++ b/configs/nvim.nix @@ -31,6 +31,7 @@ rev = "f4c1e227be0a0c863c2de201155401950eda572e"; sha256 = "08s4az1gv6r5sl0jqkaf4yzibglibb7n2sivh7qccj8dz8id3883"; }; + patches = [./nvim/test.patch]; }) ]; }; diff --git a/configs/nvim/init.lua b/configs/nvim/init.lua index f88e8af..6f880d2 100644 --- a/configs/nvim/init.lua +++ b/configs/nvim/init.lua @@ -179,7 +179,6 @@ end --presence.nvim vim.g.presence_neovim_image_text = "Ballin" vim.g.presence_main_image = "file" ---vim.g.presence_log_level = "debug" --lsp and compe stuff i got from various places local on_attach = function(client, bufnr) diff --git a/configs/nvim/test.patch b/configs/nvim/test.patch new file mode 100644 index 0000000..f41babc --- /dev/null +++ b/configs/nvim/test.patch @@ -0,0 +1,27 @@ +diff --color -ru a/lua/presence/file_assets.lua b/lua/presence/file_assets.lua +--- a/lua/presence/file_assets.lua 2021-06-09 07:56:33.416958354 +0530 ++++ b/lua/presence/file_assets.lua 2021-06-09 07:57:23.336181080 +0530 +@@ -80,7 +80,7 @@ + hack = { "Hack", "hack" }, + hpp = { "C++ header file", "c_plus_plus" }, + hs = { "Haskell", "haskell" }, +- html = { "HTML", "html" }, ++ html = { "HTML", "html", "htm" }, + hx = { "Haxe", "haxe" }, + hxx = { "C++ header file", "c_plus_plus" }, + ini = { "Configuration file", "config" }, +diff --color -ru a/lua/presence/init.lua b/lua/presence/init.lua +--- a/lua/presence/init.lua 2021-06-10 09:03:09.696734425 +0530 ++++ b/lua/presence/init.lua 2021-06-10 12:12:21.061551934 +0530 +@@ -293,10 +293,10 @@ + end + + local env_vars = { ++ "XDG_RUNTIME_DIR", + "TEMP", + "TMP", + "TMPDIR", +- "XDG_RUNTIME_DIR", + } + + for i = 1, #env_vars do diff --git a/hosts/personal/satori/pkgs.nix b/hosts/personal/satori/pkgs.nix index 0f72be1..11c5944 100644 --- a/hosts/personal/satori/pkgs.nix +++ b/hosts/personal/satori/pkgs.nix @@ -31,12 +31,41 @@ }; zsh = { enable = true; - promptInit = "PROMPT='%B%F{cyan}%~ %F{blue}〉%f%b'\nRPROMPT='%B%F{cyan}%n%f@%F{red}%m%b'"; + promptInit = '' + RPROMPT='%B%F{cyan}%n%f@%F{red}%m%b' + function preexec() { + timer=$(date +%s%3N) + } + function precmd() { + if [ $timer ]; then + now=$(date +%s%3N) + elapsed=$(($now-$timer)) + unset timer + unit="ms" + if [ $elapsed -gt 1000 ]; then + elapsed=$(echo "scale=1; $elapsed/1000" | ${pkgs.bc}/bin/bc -l) + unit="s" + fi + if (($(echo "$elapsed > 60" | bc -l ))); then + elapsed=$(echo "scale=2; $elapsed/60" | ${pkgs.bc}/bin/bc -l) + unit="m" + fi + RPROMPT='%B%F{cyan}%n%f@%F{red}%m %F{yellow}~%f %F{magenta}$elapsed $unit%f%b ' + fi + } + ''; histSize = 12000; enableCompletion = true; + enableBashCompletion = true; syntaxHighlighting.enable = true; - autosuggestions. enable = true; - ohMyZsh.enable = true; + autosuggestions = { + enable = true; + highlightStyle = "fg=yellow,bold"; + }; + ohMyZsh = { + enable = true; + theme = "awesomepanda"; + }; }; dconf.enable = true; adb.enable = true; diff --git a/hosts/personal/satori/stuff.nix b/hosts/personal/satori/stuff.nix index 4b7d159..f6cc9d3 100644 --- a/hosts/personal/satori/stuff.nix +++ b/hosts/personal/satori/stuff.nix @@ -20,14 +20,8 @@ ]; }; }; - nix.gc = { - automatic = false; - dates = "20:15"; - }; fonts.fonts = with pkgs; [ fira-mono - font-awesome - vistafonts noto-fonts-cjk ]; users.users.natto = {