From 42bf0bb23732c27d4793778d65d848bfc64a0afd Mon Sep 17 00:00:00 2001 From: Uttarayan Mondal Date: Sun, 3 Mar 2024 12:55:20 +0530 Subject: [PATCH] [del] Remove ZSH and Add some nvim plugins --- config/nix/common/home.nix | 67 +++++---- config/nix/common/nvim/default.nix | 69 ++++++--- config/nix/common/nvim/extraConfig.lua | 1 + config/nix/common/tmux.nix | 61 ++++---- config/nix/common/wezterm.nix | 86 ++++------- config/nix/darwin/configuration.nix | 101 +++---------- config/nix/darwin/skhd.nix | 9 +- config/zsh/abbreviations | 190 ------------------------- config/zsh/aliases | 36 ----- config/zsh/env | 56 -------- config/zsh/plugins/zsh-abbr | 1 - config/zsh/plugins/zsh-autocomplete | 1 - config/zsh/plugins/zsh-vim-mode | 1 - config/zsh/zshrc | 190 ------------------------- 14 files changed, 166 insertions(+), 703 deletions(-) delete mode 100644 config/zsh/abbreviations delete mode 100644 config/zsh/aliases delete mode 100644 config/zsh/env delete mode 160000 config/zsh/plugins/zsh-abbr delete mode 160000 config/zsh/plugins/zsh-autocomplete delete mode 160000 config/zsh/plugins/zsh-vim-mode delete mode 100644 config/zsh/zshrc diff --git a/config/nix/common/home.nix b/config/nix/common/home.nix index 33f403cc..6d3d17ee 100644 --- a/config/nix/common/home.nix +++ b/config/nix/common/home.nix @@ -3,13 +3,14 @@ let start-tmux = (import ../scripts/start-tmux.nix) pkgs; # https://mipmip.github.io/home-manager-option-search/ lazy = false; -in { +in +{ imports = [ # Include the results of the hardware scan. ./tmux.nix ./wezterm.nix ] ++ (if device.isLinux then [ ../linux ] else [ ]) - ++ (if !lazy then [ ./nvim ] else [ ]); + ++ (if !lazy then [ ./nvim ] else [ ]); home.packages = with pkgs; [ @@ -21,7 +22,7 @@ in { jq tldr spotify-player - htop-vim + bottom qmk nodejs nix-index @@ -144,17 +145,19 @@ in { enable = true; enableFishIntegration = true; enableNushellIntegration = true; - settings = let flavour = "mocha"; # Replace with your preferred palette - in { - # Other config here - format = "$all"; # Remove this line to disable the default prompt format - palette = "catppuccin_${flavour}"; - } // builtins.fromTOML (builtins.readFile (pkgs.fetchFromGitHub { - owner = "catppuccin"; - repo = "starship"; - rev = "main"; # Replace with the latest commit hash - sha256 = "sha256-nsRuxQFKbQkyEI4TXgvAjcroVdG+heKX5Pauq/4Ota0"; - } + /palettes/${flavour}.toml)); + settings = + let flavour = "mocha"; # Replace with your preferred palette + in { + # Other config here + format = "$all"; # Remove this line to disable the default prompt format + palette = "catppuccin_${flavour}"; + } // builtins.fromTOML (builtins.readFile (pkgs.fetchFromGitHub + { + owner = "catppuccin"; + repo = "starship"; + rev = "main"; # Replace with the latest commit hash + sha256 = "sha256-nsRuxQFKbQkyEI4TXgvAjcroVdG+heKX5Pauq/4Ota0"; + } + /palettes/${flavour}.toml)); }; eza = { enable = true; @@ -182,19 +185,28 @@ in { enable = true; config = { theme = "catppuccin"; }; themes = { - catppuccin = let flavor = "mocha"; - in { - src = pkgs.fetchFromGitHub { - owner = "catppuccin"; - repo = "bat"; - rev = "main"; - sha256 = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw"; + catppuccin = + let flavor = "mocha"; + in { + src = pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "bat"; + rev = "main"; + sha256 = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw"; + }; + file = "Catppuccin-${flavor}.tmTheme"; }; - file = "Catppuccin-${flavor}.tmTheme"; - }; }; }; + rbw = { + enable = true; + settings = { + email = "uttarayan21@gmail.com"; + base_url = "https://pass.uttarayan.me"; + pinenttry = if device.isMac then pkgs.pinentry_mac else pkgs.pinentry-qt; + }; + }; # Let Home Manager install and manage itself. home-manager = { enable = true; }; }; @@ -204,10 +216,11 @@ in { # Home Manager needs a bit of information about you and the paths it should # manage. username = device.user; - homeDirectory = if device.isMac then - lib.mkForce "/Users/${device.user}" - else - lib.mkForce "/home/${device.user}"; + homeDirectory = + if device.isMac then + lib.mkForce "/Users/${device.user}" + else + lib.mkForce "/home/${device.user}"; stateVersion = "23.11"; diff --git a/config/nix/common/nvim/default.nix b/config/nix/common/nvim/default.nix index bf946df2..48ecffde 100644 --- a/config/nix/common/nvim/default.nix +++ b/config/nix/common/nvim/default.nix @@ -21,43 +21,49 @@ undofile = true; }; - globals = { mapleader = " "; }; + globals = { + mapleader = " "; + }; plugins = { lspconfig = { enable = true; servers = { nil = { enable = true; - extraConfig = '' - settings = { - ['nil'] = { - formatting = { - command = { "${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt" }, - }, - nix = { - flake = { - autoArchive = true, + extraConfig = + /* lua */ + '' + settings = { + ['nil'] = { + formatting = { + command = { "${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt" }, + }, + nix = { + flake = { + autoArchive = true, + }, }, }, }, - }, - ''; + ''; }; lua-language-server.enable = true; jsonls.enable = true; html.enable = true; # rust-analyzer.enable = true; }; - extraLua.pre = '' - local lsp_zero = require'lsp-zero' - local lspconfig = require 'lspconfig' - lsp_zero.on_attach(function(client, bufnr) - lsp_zero.default_keymaps({buffer = bufnr}) - if client.server_capabilities.inlayHintProvider then - vim.lsp.inlay_hint.enable(bufnr, true) - end - end) - ''; + extraLua.pre = + /* lua */ + '' + local lsp_zero = require'lsp-zero' + local lspconfig = require 'lspconfig' + lsp_zero.on_attach(function(client, bufnr) + lsp_zero.default_keymaps({buffer = bufnr}) + if client.server_capabilities.inlayHintProvider then + vim.lsp.inlay_hint.enable(bufnr, true) + end + end) + ''; # extraLua.post = '' # vim.lsp.inlay_hint.enable(bufnr, true) # ''; @@ -65,16 +71,32 @@ nvim-dap.enable = true; todo-comments.enable = true; - lualine.enable = true; + lualine = { + enable = true; + }; commentary.enable = true; surround.enable = true; which-key.enable = true; ufo.enable = true; fugitive.enable = true; + markdown-preview = { + enable = true; + autoStart = true; + }; + ts-context-commentstring.enable = true; treesitter = { enable = true; indent = true; + folding = true; + refactor = { + smartRename = { + enable = true; + keymaps = { + smartRename = "rn"; + }; + }; + }; }; mini = { @@ -148,6 +170,7 @@ noice-nvim nvim-web-devicons + ]; extraConfigLua = builtins.readFile ./extraConfig.lua; package = pkgs.neovim-nightly; diff --git a/config/nix/common/nvim/extraConfig.lua b/config/nix/common/nvim/extraConfig.lua index 9c5e8284..8af438d4 100644 --- a/config/nix/common/nvim/extraConfig.lua +++ b/config/nix/common/nvim/extraConfig.lua @@ -133,3 +133,4 @@ require("noice").setup({ lsp_doc_border = true, -- add a border to hover docs and signature help }, }) + diff --git a/config/nix/common/tmux.nix b/config/nix/common/tmux.nix index 70890e08..64dda7b7 100644 --- a/config/nix/common/tmux.nix +++ b/config/nix/common/tmux.nix @@ -9,7 +9,8 @@ let tmux popup -d '#{pane_current_path}' -xC -yC -w$width -h$height -E "tmux attach -t scratch || tmux new -s scratch" fi ''; -in { +in +{ programs.tmux = { enable = true; shell = "${pkgs.nushellFull}/bin/nu"; @@ -26,42 +27,48 @@ in { } { plugin = tmuxPlugins.catppuccin; - extraConfig = '' - set -g @catppuccin_flavour 'mocha' - set -g @catppuccin_window_default_text '''''' - ''; + extraConfig = + /* tmux */ + '' + set -g @catppuccin_flavour 'mocha' + set -g @catppuccin_window_default_text '''''' + ''; } { plugin = tmuxPlugins.battery; - extraConfig = '' - set -g @catppuccin_status_modules_right "battery application session date_time" - ''; + extraConfig = + /* tmux */ + '' + set -g @catppuccin_status_modules_right "battery application session date_time" + ''; } ]; - extraConfig = '' - set -gw mode-keys vi - set -g status-keys vi - set -g allow-passthrough on - set -ga update-environment TERM - set -ga update-environment TERM_PROGRAM - set-option -sg escape-time 10 - set-option -sa terminal-features ',xterm-256color:RGB' + extraConfig = + /* tmux */ + '' + set -gw mode-keys vi + set -g status-keys vi + set -g allow-passthrough on + set -ga update-environment TERM + set -ga update-environment TERM_PROGRAM + set -sg escape-time 10 + set -sa terminal-features ',wezterm:RGB' - bind h select-pane -L - bind j select-pane -D - bind k select-pane -U - bind l select-pane -R + bind h select-pane -L + bind j select-pane -D + bind k select-pane -U + bind l select-pane -R - bind-key -n C-\\ run-shell ${scratchpad} + bind-key -n C-\\ run-shell ${scratchpad} - bind C-n next-window - bind C-p previous-window - bind C-q last-window + bind C-n next-window + bind C-p previous-window + bind C-q last-window - if-shell 'uname | grep -q "Darwin"' { set -s copy-command "pbcopy" } - if-shell 'uname | grep -q "Linux"' { set -s copy-command "wl-copy" } - ''; + if-shell 'uname | grep -q "Darwin"' { set -s copy-command "pbcopy" } + if-shell 'uname | grep -q "Linux"' { set -s copy-command "wl-copy" } + ''; }; } diff --git a/config/nix/common/wezterm.nix b/config/nix/common/wezterm.nix index 9e2ab6c2..e42aac67 100644 --- a/config/nix/common/wezterm.nix +++ b/config/nix/common/wezterm.nix @@ -1,64 +1,32 @@ { pkgs, ... }: { programs.wezterm = { enable = true; - extraConfig = '' - local wezterm = require 'wezterm'; - return { - -- -- font = wezterm.font("Hasklug Nerd Font Mono", { weight = "Regular", stretch = "Normal", style = "Normal" }), - -- font = wezterm.font_with_fallback({ - -- "Hasklig", - -- "Symbols Nerd Font Mono" - -- }), - - color_scheme = "Catppuccin Mocha", - font_size = 16, - -- colors = { - -- -- The default text color - -- foreground = "#f8f8f2", - -- -- The default background color - -- -- background = "#282a36", - -- -- Overrides the cell background color when the current cell is occupied by the - -- -- cursor and the cursor style is set to Block - -- cursor_bg = "#f8f8f2", - -- -- Overrides the text color when the current cell is occupied by the cursor - -- cursor_fg = "#000", - -- -- Specifies the border color of the cursor when the cursor style is set to Block, - -- -- or the color of the vertical or horizontal bar when the cursor style is set to - -- -- Bar or Underline. - -- cursor_border = "#52ad70", - -- -- the foreground color of selected text - -- selection_fg = "#ffffff", - -- -- the background color of selected text - -- selection_bg = "#ffffff", - -- -- The color of the scrollbar "thumb"; the portion that represents the current viewport - -- scrollbar_thumb = "#222222", - -- -- The color of the split lines between panes - -- split = "#444444", - -- ansi = { "#21222c", "#ff5555", "#50fa7b", "#f1fa8c", "#bd93f9", "#ff79c6", "#8be9fd", "#f8f8f2" }, - -- brights = { "#6272a4", "#ff6e6e", "#69ff94", "#ffffa5", "#d6acff", "#ff92df", "#a4ffff", "#ffffff" }, - -- -- Arbitrary colors of the palette in the range from 16 to 255 - -- indexed = { [136] = "#af8700" }, - -- -- Since: nightly builds only - -- -- When the IME, a dead key or a leader key are being processed and are effectively - -- -- holding input pending the result of input composition, change the cursor - -- -- to this color to give a visual cue about the compose state. - -- compose_cursor = "orange", - -- }, - initial_cols = 120, - hide_tab_bar_if_only_one_tab = true, - window_background_opacity = 0.8, - cursor_blink_rate = 8, - default_cursor_style = "BlinkingBlock", - default_prog = { "${pkgs.fish.outPath}/bin/fish", "-l" }, - window_padding = { - left = 2, - right = 0, - top = 2, - bottom = 0, - }, - window_decorations = "RESIZE", - use_ime = false, - } - ''; + extraConfig = /* lua */ + '' + local wezterm = require 'wezterm'; + return { + term = "wezterm", + font = wezterm.font_with_fallback({ + "Hasklig", + "Symbols Nerd Font Mono" + }), + color_scheme = "Catppuccin Mocha", + font_size = 16, + initial_cols = 120, + hide_tab_bar_if_only_one_tab = true, + window_background_opacity = 0.8, + cursor_blink_rate = 8, + default_cursor_style = "BlinkingBlock", + default_prog = { "${pkgs.fish.outPath}/bin/fish", "-l" }, + window_padding = { + left = 2, + right = 0, + top = 2, + bottom = 0, + }, + window_decorations = "RESIZE", + use_ime = false, + } + ''; }; } diff --git a/config/nix/darwin/configuration.nix b/config/nix/darwin/configuration.nix index e5e3115e..d42b42d7 100644 --- a/config/nix/darwin/configuration.nix +++ b/config/nix/darwin/configuration.nix @@ -15,7 +15,22 @@ package = pkgs.nix; }; - security.pam.enableSudoTouchIdAuth = true; + # security.pam.enableSudoTouchIdAuth = true; + system.patches = [ + (pkgs.writeText "pam-reattach.patch" + /* diff */ + '' + new file mode 100644 + index 0000000..e4293c0 + --- /dev/null + +++ b/etc/pam.d/sudo_local + @@ -0,0 +1,3 @@ + +# sudo_local: local config file which survives system update and is included for sudo + +# uncomment following line to enable Touch ID for sudo + +auth optional ${pkgs.pam-reattach}/lib/pam/pam_reattach.so + '') + + ]; programs.bash.enable = true; programs.zsh.enable = true; @@ -40,87 +55,3 @@ } ]; } -# { -# description = "Example Darwin system flake"; -# inputs = { -# nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; -# # home-manager.url = "github:nix-community/home-manager/master"; -# # home-manager.inputs.nixpkgs.follows = "nixpkgs"; -# nix-darwin.url = "github:LnL7/nix-darwin"; -# nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; -# }; -# outputs = inputs @ { -# self, -# nix-darwin, -# nixpkgs, -# }: let -# configuration = {pkgs, ...}: { -# # List packages installed in system profile. To search by name, run: -# # $ nix-env -qaP | grep wget -# environment.systemPackages = with pkgs; [ -# neovim -# bat -# ripgrep -# fd -# fish -# nushellFull -# tmux -# wezterm -# # yabai -# nerdfonts -# ]; -# # Auto upgrade nix package and the daemon service. -# services.nix-daemon.enable = true; -# # nix.package = pkgs.nix; -# # Necessary for using flakes on this system. -# nix = { -# settings = { -# experimental-features = "nix-command flakes repl-flake"; -# max-jobs = 8; -# }; -# extraOptions = '' -# build-users-group = nixbld -# extra-nix-path = nixpkgs=flake:nixpkgs -# ''; -# # keep-outputs = true -# # keep-derivations = true -# }; -# # Create /etc/zshrc that loads the nix-darwin environment. -# # programs.zsh.enable = true; # default shell on catalina -# # programs.fish.enable = true; -# # Set Git commit hash for darwin-version. -# system.configurationRevision = self.rev or self.dirtyRev or null; -# system.keyboard.enableKeyMapping = true; -# system.keyboard.remapCapsLockToControl = true; -# system.keyboard.swapLeftCommandAndLeftAlt = true; -# system.keyboard.userKeyMapping = { -# # Right Command to Option -# HIDKeyboardModifierMappingSrc = 30064771303; -# HIDKeyboardModifierMappingDst = 30064771302; -# # Right Option to command -# HIDKeyboardModifierMappingSrc = 30064771302; -# HIDKeyboardModifierMappingDst = 30064771303; -# }; -# fonts.fonts = [(pkgs.nerdfonts.override {fonts = ["Hasklig" "Hack"];})]; -# system.defaults.finder.AppleShowAllExtensions = true; -# system.defaults.dock.autohide = true; -# # Used for backwards compatibility, please read the changelog before changing. -# # $ darwin-rebuild changelog -# system.stateVersion = 4; -# # The platform the configuration will be used on. -# nixpkgs.hostPlatform = "aarch64-darwin"; -# nix.package = pkgs.nix; -# }; -# in { -# # Build darwin flake using: -# # $ darwin-rebuild build --flake .#simple -# darwinConfigurations.Uttarayans-MacBook-Pro = nix-darwin.lib.darwinSystem { -# # system = "aarch64-darwin"; -# pkgs = import nixpkgs {system = "aarch64-darwin";}; -# modules = [configuration]; -# }; -# # Expose the package set, including overlays, for convenience. -# # darwinPackages = self.darwinConfigurations.Uttarayans-MacBook-Pro.pkgs; -# }; -# } - diff --git a/config/nix/darwin/skhd.nix b/config/nix/darwin/skhd.nix index 3f1773c0..1710897b 100644 --- a/config/nix/darwin/skhd.nix +++ b/config/nix/darwin/skhd.nix @@ -1,16 +1,11 @@ -{ ... }: { +{ pkgs, ... }: { services = { skhd = { enable = true; skhdConfig = '' # open terminal, blazingly fast compared to iTerm/Hyper - # alt - return : /Applications/kitty.app/Contents/MacOS/kitty --single-instance -d ~ - alt - return : /Applications/WezTerm.app/Contents/MacOS/wezterm + alt - return : ${pkgs.wezterm}/bin/wezterm-gui shift + alt - return: pkill mpv - # alt + \ : pkill mpv - - # open qutebrowser - # alt + shift - return : ~/Scripts/qtb.sh # open mpv alt - m : open -na /Applications/mpv.app $(pbpaste) diff --git a/config/zsh/abbreviations b/config/zsh/abbreviations deleted file mode 100644 index 5abaf5b0..00000000 --- a/config/zsh/abbreviations +++ /dev/null @@ -1,190 +0,0 @@ -abbr -g ...="../.." -abbr -g ....="../../.." -abbr -g .....="../../../.." -abbr -g ......="../../../../.." -abbr -g grep="rg" -abbr -="cd -" -abbr _="sudo " -abbr 1="cd -" -abbr 2="cd -2" -abbr 3="cd -3" -abbr 4="cd -4" -abbr 5="cd -5" -abbr 6="cd -6" -abbr 7="cd -7" -abbr 8="cd -8" -abbr 9="cd -9" -abbr afind="ack -il" -abbr cat="bat" -abbr cd="z" -abbr g="git" -abbr ga="git add" -abbr gaa="git add --all" -abbr gap="git apply" -abbr gapa="git add --patch" -abbr gau="git add --update" -abbr gav="git add --verbose" -abbr gb="git branch" -abbr gba="git branch -a" -abbr gbD="git branch -D" -abbr gbd="git branch -d" -abbr gbda="git branch --no-color --merged | command grep -vE \"^(\+|\*|\s*(master|develop|dev)\s*\$)\" | command xargs -n 1 git branch -d" -abbr gbl="git blame -b -w" -abbr gbnm="git branch --no-merged" -abbr gbr="git branch --remote" -abbr gbs="git bisect" -abbr gbsb="git bisect bad" -abbr gbsg="git bisect good" -abbr gbsr="git bisect reset" -abbr gbss="git bisect start" -abbr 'gc!'="git commit -v --amend" -abbr gc="git commit -v" -abbr 'gca!'="git commit -v -a --amend" -abbr gca="git commit -v -a" -abbr gcam="git commit -a -m" -abbr 'gcan!'="git commit -v -a --no-edit --amend" -abbr 'gcans!'="git commit -v -a -s --no-edit --amend" -abbr gcb="git checkout -b" -abbr gcd="git checkout develop" -abbr gcf="git config --list" -abbr gcl="git clone --recurse-submodules" -abbr gclean="git clean -id" -abbr gcm="git checkout master" -abbr gcmsg="git commit -m" -abbr 'gcn!'="git commit -v --no-edit --amend" -abbr gco="git checkout" -abbr gcount="git shortlog -sn" -abbr gcp="git cherry-pick" -abbr gcpa="git cherry-pick --abort" -abbr gcpc="git cherry-pick --continue" -abbr gcs="git commit -S" -abbr gcsm="git commit -s -m" -abbr gd="git diff" -abbr gdca="git diff --cached" -abbr gdct="git describe --tags \$(git rev-list --tags --max-count=1)" -abbr gdcw="git diff --cached --word-diff" -abbr gds="git diff --staged" -abbr gdt="git diff-tree --no-commit-id --name-only -r" -abbr gdw="git diff --word-diff" -abbr gf="git fetch" -abbr gfa="git fetch --all --prune" -abbr gfg="git ls-files | grep" -abbr gfo="git fetch origin" -abbr gg="git gui citool" -abbr gga="git gui citool --amend" -abbr ggpull="git pull origin \"\$(git_current_branch)\"" -abbr ggpur="ggu" -abbr ggpush="git push origin \"\$(git_current_branch)\"" -abbr ggsup="git branch --set-upstream-to=origin/\$(git_current_branch)" -abbr ghh="git help" -abbr gignore="git update-index --assume-unchanged" -abbr gignored="git ls-files -v | grep \"^[[:lower:]]\"" -abbr git-svn-dcommit-push="git svn dcommit && git push github master:svntrunk" -abbr gk="\gitk --all --branches" -abbr gke="\gitk --all \$(git log -g --pretty=%h)" -abbr gl="git pull" -abbr glg="git log --stat" -abbr glgg="git log --graph" -abbr glgga="git log --graph --decorate --all" -abbr glgm="git log --graph --max-count=10" -abbr glgp="git log --stat -p" -abbr glo="git log --oneline --decorate" -abbr globurl="noglob urlglobber " -abbr glod="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset'" -abbr glods="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short" -abbr glog="git log --oneline --decorate --graph" -abbr gloga="git log --oneline --decorate --graph --all" -abbr glol="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'" -abbr glola="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all" -abbr glols="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --stat" -abbr glp="_git_log_prettily" -abbr glum="git pull upstream master" -abbr gm="git merge" -abbr gma="git merge --abort" -abbr gmom="git merge origin/master" -abbr gmt="git mergetool --no-prompt" -abbr gmtvim="git mergetool --no-prompt --tool=vimdiff" -abbr gmum="git merge upstream/master" -abbr gp="git push" -abbr gpd="git push --dry-run" -abbr 'gpf!'="git push --force" -abbr gpf="git push --force-with-lease" -abbr gpoat="git push origin --all && git push origin --tags" -abbr gpristine="git reset --hard && git clean -dffx" -abbr gpsup="git push --set-upstream origin \$(git_current_branch)" -abbr gpu="git push upstream" -abbr gpv="git push -v" -abbr gr="git remote" -abbr gra="git remote add" -abbr grb="git rebase" -abbr grba="git rebase --abort" -abbr grbc="git rebase --continue" -abbr grbd="git rebase develop" -abbr grbi="git rebase -i" -abbr grbm="git rebase master" -abbr grbs="git rebase --skip" -abbr grev="git revert" -abbr grh="git reset" -abbr grhh="git reset --hard" -abbr grm="git rm" -abbr grmc="git rm --cached" -abbr grmv="git remote rename" -abbr groh="git reset origin/\$(git_current_branch) --hard" -abbr grrm="git remote remove" -abbr grs="git restore" -abbr grset="git remote set-url" -abbr grss="git restore --source" -abbr grt="cd \"\$(git rev-parse --show-toplevel || echo .)\"" -abbr gru="git reset --" -abbr grup="git remote update" -abbr grv="git remote -v" -abbr gs="git status" -abbr gsb="git status -sb" -abbr gsd="git svn dcommit" -abbr gsh="git show" -abbr gsi="git submodule init" -abbr gsps="git show --pretty=short --show-signature" -abbr gsr="git svn rebase" -abbr gss="git status -s" -abbr gst="git status" -abbr gsta="git stash push" -abbr gstaa="git stash apply" -abbr gstall="git stash --all" -abbr gstc="git stash clear" -abbr gstd="git stash drop" -abbr gstl="git stash list" -abbr gstp="git stash pop" -abbr gsts="git stash show --text" -abbr gstu="git stash --include-untracked" -abbr gsu="git submodule update" -abbr gsw="git switch" -abbr gswc="git switch -c" -abbr gtl="gtl(){ git tag --sort=-v:refname -n -l \"\${1}*\" }; noglob gtl" -abbr gts="git tag -s" -abbr gtv="git tag | sort -V" -abbr gunignore="git update-index --no-assume-unchanged" -abbr gunwip="git log -n 1 | grep -q -c \"\-\-wip\-\-\" && git reset HEAD~1" -abbr gup="git pull --rebase" -abbr gupa="git pull --rebase --autostash" -abbr gupav="git pull --rebase --autostash -v" -abbr gupv="git pull --rebase -v" -abbr gwch="git whatchanged -p --abbrev-commit --pretty=medium" -abbr gwip="git add -A; git rm \$(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m \"--wip-- [skip ci]\"" -abbr history="omz_history" -abbr l="exa -al" -abbr ls="exa" -abbr md="mkdir -p" -abbr mutt="neomutt" -abbr o="xdg-open" -abbr rpc="patch -p0 < ~/.local/share/console.diff" -abbr s="source venv/bin/activate" -abbr t="~/.config/tmux/start-tmux" -abbr vbspwm="v ~/.config/bspwm/bspwmrc" -abbr vc="v ~/.config/nvim/init.vim" -abbr vt="v ~/.config/tmux/tmux.conf" -abbr wget="curl -O" -abbr which-command="whence" -abbr za="zoxide add" -abbr zi="z -i" -abbr zq="zoxide query" -abbr zr="zoxide remove" diff --git a/config/zsh/aliases b/config/zsh/aliases deleted file mode 100644 index 949391b6..00000000 --- a/config/zsh/aliases +++ /dev/null @@ -1,36 +0,0 @@ -alias ll='exa -al' -alias arduino-cli='arduino-cli --config-file $XDG_CONFIG_HOME/arduino15/arduino-cli.yaml' -alias gdb='gdb -nh -x "$XDG_CONFIG_HOME"/gdb/init' -alias nv=nvim -alias v=nvim -alias m=neomutt -alias n=notmuch -alias dotfiles='/usr/bin/git --git-dir=$XDG_DATA_HOME/dotfiles/ --work-tree=$HOME' -alias yarn="yarn --use-yarnrc $XDG_CONFIG_HOME/yarn/yarnrc" - -function z() { - builtin cd "$@" - - if [[ -z "$VIRTUAL_ENV" ]] ; then - ## If env folder is found then activate the vitualenv - if [[ -d ./venv ]] ; then - source ./venv/bin/activate - fi - else - ## check the current folder belong to earlier VIRTUAL_ENV folder - # if yes then do nothing - # else deactivate - parentdir="$(dirname "$VIRTUAL_ENV")" - if [[ "$PWD"/ != "$parentdir"/* ]] ; then - deactivate - fi - fi -} - -man() { - page=$(/usr/bin/man "$@" | \ - col -b) - if ! [ -z "$page" ];then - echo $page | nvim -R -c 'set ft=man nomod nolist' - - fi -} diff --git a/config/zsh/env b/config/zsh/env deleted file mode 100644 index f8b28733..00000000 --- a/config/zsh/env +++ /dev/null @@ -1,56 +0,0 @@ -# GTK -export GTK_RC_FILES="$XDG_CONFIG_HOME"/gtk-1.0/gtkrc -export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc - -# Notmuch -export NOTMUCH_CONFIG="$XDG_CONFIG_HOME"/notmuch/notmuchrc -export NMBGIT="$XDG_DATA_HOME"/notmuch/nmbug - -# Less -export LESSKEY="$XDG_CONFIG_HOME"/less/lesskey -export LESSHISTFILE="$XDG_CACHE_HOME"/less/history - -# Rust -export RUSTUP_HOME="$XDG_DATA_HOME"/rustup -export CARGO_HOME="$XDG_DATA_HOME"/cargo - -# Android -export ANDROID_SDK_HOME="$XDG_CONFIG_HOME"/android -export ADB_VENDOR_KEY="$XDG_CONFIG_HOME"/android -export ANDROID_PREFS_ROOT="$XDG_CONFIG_HOME"/android -export ADB_KEYS_PATH="$ANDROID_PREFS_ROOT" -export ANDROID_EMULATOR_HOME="$XDG_DATA_HOME"/android/emulator - -# Node -export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc -export npm_config_prefix=$XDG_DATA_HOME/node_modules - -# Wine -export WINEPREFIX="$XDG_DATA_HOME"/wineprefixes/default - -# Java -export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java -export GRADLE_USER_HOME="$XDG_DATA_HOME"/gradle - -# Python -export PYLINTHOME="$XDG_CACHE_HOME"/pylint -export PYTHONSTARTUP="$XDG_CONFIG_HOME"/python/startup.py - -# export XAUTHORITY="$XDG_RUNTIME_DIR"/xauthority -export gnome_user_dir="$XDG_CONFIG_HOME"/gnome/apps - -# LaTeX -export TEXMFHOME=$XDG_DATA_HOME/texmf -export TEXMFVAR=$XDG_CACHE_HOME/texlive/texmf-var -export TEXMFCONFIG=$XDG_CONFIG_HOME/texlive/texmf-config - -# Ruby gems -export GEM_HOME="$XDG_DATA_HOME"/gem -export GEM_SPEC_CACHE="$XDG_CACHE_HOME"/gem -export BUNDLE_USER_CONFIG="$XDG_CONFIG_HOME"/bundle BUNDLE_USER_CACHE="$XDG_CACHE_HOME"/bundle BUNDLE_USER_PLUGIN="$XDG_DATA_HOME"/bundle - -# Pass -export PASSWORD_STORE_DIR="$XDG_DATA_HOME"/pass - -# GPG -export GPG_TTY=$(tty) diff --git a/config/zsh/plugins/zsh-abbr b/config/zsh/plugins/zsh-abbr deleted file mode 160000 index 03328a1a..00000000 --- a/config/zsh/plugins/zsh-abbr +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 03328a1ad501fa126a49590d8bde675edfdf1385 diff --git a/config/zsh/plugins/zsh-autocomplete b/config/zsh/plugins/zsh-autocomplete deleted file mode 160000 index 5cc9da13..00000000 --- a/config/zsh/plugins/zsh-autocomplete +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5cc9da132e7535a540fb1235ce27fd5a233d4f0e diff --git a/config/zsh/plugins/zsh-vim-mode b/config/zsh/plugins/zsh-vim-mode deleted file mode 160000 index 1f9953b7..00000000 --- a/config/zsh/plugins/zsh-vim-mode +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1f9953b7d6f2f0a8d2cb8e8977baa48278a31eab diff --git a/config/zsh/zshrc b/config/zsh/zshrc deleted file mode 100644 index b43a177a..00000000 --- a/config/zsh/zshrc +++ /dev/null @@ -1,190 +0,0 @@ -# If you come from bash you might have to change your $PATH. -# export PATH=$HOME/bin:/usr/local/bin:$PATH - -# Path to your oh-my-zsh installation. -ZSH=/usr/share/oh-my-zsh/ - -# Set name of the theme to load --- if set to "random", it will -# load a random theme each time oh-my-zsh is loaded, in which case, -# to know which specific one was loaded, run: echo $RANDOM_THEME -# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes -ZSH_THEME="spaceship" -SPACESHIP_USER_SHOW="always" -SPACESHIP_EXIT_CODE_SHOW="true" -SPACESHIP_EXIT_CODE_SYMBOL="✘ " -SPACESHIP_DIR_TRUNC="0" - -# Set list of themes to pick from when loading at random -# Setting this variable when ZSH_THEME=random will cause zsh to load -# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/ -# If set to an empty array, this variable will have no effect. -# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) - -# Uncomment the following line to use case-sensitive completion. -# CASE_SENSITIVE="true" - -# Uncomment the following line to use hyphen-insensitive completion. -# Case-sensitive completion must be off. _ and - will be interchangeable. -# HYPHEN_INSENSITIVE="true" - -# Uncomment the following line to disable bi-weekly auto-update checks. -DISABLE_AUTO_UPDATE="true" - -# Uncomment the following line to change how often to auto-update (in days). -# export UPDATE_ZSH_DAYS=13 - -# Uncomment the following line to disable colors in ls. -# DISABLE_LS_COLORS="true" - -# Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment the following line to enable command auto-correction. -# ENABLE_CORRECTION="true" - -# Uncomment the following line to display red dots whilst waiting for completion. -# COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. -# You can set one of the optional three formats: -# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" -# or set a custom format using the strftime function format specifications, -# see 'man strftime' for details. -# HIST_STAMPS="mm/dd/yyyy" - -# Would you like to use another custom folder than $ZSH/custom? -ZSH_CUSTOM=~/.config/zsh -HISTFILE="$XDG_CACHE_HOME"/zsh/history -ZSH_COMPDUMP=$XDG_CACHE_HOME/zsh/zshcomdump -setopt HIST_IGNORE_SPACE -# Which plugins would you like to load? -# Standard plugins can be found in ~/.oh-my-zsh/plugins/* -# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. -plugins=(zsh-autosuggestions zsh-syntax-highlighting zsh-vim-mode zsh-abbr histblock) - - -# User configuration - -# export MANPATH="/usr/local/man:$MANPATH" - -# You may need to manually set your language environment -export LANG=en_US.UTF-8 -export LC_CTYPE=en_US.UTF-8 - - -eval $(systemctl --user show-environment | grep SSH_AUTH_SOCK) -export SSH_AUTH_SOCK - - -# Preferred editor for local and remote sessions -if [[ -n $SSH_CONNECTION ]]; then - export EDITOR='vim' -else - export EDITOR='nvim' -fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# ssh -# export SSH_KEY_PATH="~/.ssh/rsa_id" - -export PATH="$PATH:/home/fs0c131y/.local/bin:/home/fs0c131y/.local/share/gem/bin:/home/fs0c131y/.local/share/node_modules/bin:/home/fs0c131y/.local/share/cargo/bin" - -#if ! pgrep -u "$USER" ssh-agent > /dev/null; then -# ssh-agent > ~/.ssh-agent-thing -#fi -#if [[ ! "$SSH_AUTH_SOCK" ]]; then -# eval "$(<~/.ssh-agent-thing)" -#fi - - -# Set personal aliases, overriding those provided by oh-my-zsh libs, -# plugins, and themes. Aliases can be placed here, though oh-my-zsh -# users are encouraged to define aliases within the ZSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. -# -# Example aliases -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" -# alias ll='exa -al' -#alias tmux='tmux -f ~/.config/tmux/tmux.conf' -source $ZSH_CUSTOM/env -# zoxide -eval "$(zoxide init zsh)" - -# use fs insread of find -export FZF_DEFAULT_COMMAND='fd --type f' - -ZSH_CACHE_DIR=$HOME/.cache/oh-my-zsh -if [[ ! -d $ZSH_CACHE_DIR ]]; then - mkdir $ZSH_CACHE_DIR -fi - - -# eval $(dircolors -p | sed -e 's/DIR 01;34/DIR 01;36/' | dircolors /dev/stdin) - - - -topp() ( - $* &>/dev/null & - pid="$!" - trap ':' INT - echo 'CPU MEM' - while sleep 1; do ps --no-headers -o '%cpu,%mem' -p "$pid"; done - kill "$pid" -) - -# function cd() { -# builtin cd "$@" - -# if [[ -z "$VIRTUAL_ENV" ]] ; then -# ## If env folder is found then activate the vitualenv -# if [[ -d ./venv ]] ; then -# source ./venv/bin/activate -# fi -# else -# ## check the current folder belong to earlier VIRTUAL_ENV folder -# # if yes then do nothing -# # else deactivate -# parentdir="$(dirname "$VIRTUAL_ENV")" -# if [[ "$PWD"/ != "$parentdir"/* ]] ; then -# deactivate -# fi -# fi -# } - -function fmpc() { - local song_position - song_position=$(mpc -f "%position%) %artist% - %title%" playlist | \ - fzf-tmux --query="$1" --reverse --select-1 --exit-0 | \ - sed -n 's/^\([0-9]\+\)).*/\1/p') || return 1 - [ -n "$song_position" ] && mpc -q play $song_position -} - - -# source /usr/share/doc/pkgfile/command-not-found.zsh -source $ZSH/oh-my-zsh.sh - -# # start x if not already started -# if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then -# exec startx -# elif [[ ! $TERM =~ screen ]]; then -# ~/.config/tmux/start-tmux -# fi -# -source $ZSH_CUSTOM/aliases - -PATH="/home/fs0c131y/perl5/bin${PATH:+:${PATH}}"; export PATH; -PERL5LIB="/home/fs0c131y/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; -PERL_LOCAL_LIB_ROOT="/home/fs0c131y/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; -PERL_MB_OPT="--install_base \"/home/fs0c131y/perl5\""; export PERL_MB_OPT; -PERL_MM_OPT="INSTALL_BASE=/home/fs0c131y/perl5"; export PERL_MM_OPT;