diff options
author | Jacob Janzen <jacob.a.s.janzen@gmail.com> | 2024-12-15 21:41:05 -0600 |
---|---|---|
committer | Jacob Janzen <jacob.a.s.janzen@gmail.com> | 2024-12-15 21:41:05 -0600 |
commit | 9cd1661a14b232b5cc0e7ed1d1556a2f2203506e (patch) | |
tree | a28490c886af60b25c487bae45e71f74a2305eff /common | |
parent | f11895461530891c552b2246d3b79f8691d2b716 (diff) |
migrate brew to nix
Diffstat (limited to 'common')
-rw-r--r-- | common/.config/emacs/tools.el.org | 14 | ||||
-rw-r--r-- | common/.flake/home/programs/zsh.nix.org | 123 |
2 files changed, 88 insertions, 49 deletions
diff --git a/common/.config/emacs/tools.el.org b/common/.config/emacs/tools.el.org index a33624e..8c5b001 100644 --- a/common/.config/emacs/tools.el.org +++ b/common/.config/emacs/tools.el.org @@ -18,6 +18,20 @@ Install Magit for Git integration. (setq tramp-default-method "ssh") #+end_src +* Fuzzy Finder +#+begin_src emacs-lisp + (use-package fzf + :bind + ("C-c C-f" . fzf) + :config + (setq fzf/args "-x --color 16 --print-query --margin=1,0 --no-hscroll" + fzf/executable "fzf" + fzf/git-grep-args "-i --line-number %s" + fzf/grep-command "grep -nrH" + fzf/position-bottom nil + fzf/window-height 15)) +#+end_src + * Document Viewing Replace =DocView= with a better document viewer from =pdf-tools=. #+begin_src emacs-lisp diff --git a/common/.flake/home/programs/zsh.nix.org b/common/.flake/home/programs/zsh.nix.org index bb23f88..404586c 100644 --- a/common/.flake/home/programs/zsh.nix.org +++ b/common/.flake/home/programs/zsh.nix.org @@ -1,7 +1,7 @@ #+title: ZSH Configuration Open =zsh= configuration. -#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes +#+begin_src nix { config, pkgs, ... }: { @@ -10,78 +10,103 @@ Open =zsh= configuration. #+end_src Automatically =cd= if only the path is used. -#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes - autocd = true; +#+begin_src nix + autocd = true; #+end_src Enable auto-suggestions. -#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes - autosuggestion = { - enable = true; - }; +#+begin_src nix + autosuggestion = { + enable = true; + }; #+end_src Use =vi= keybindings. -#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes - defaultKeymap = "emacs"; +#+begin_src nix + defaultKeymap = "emacs"; #+end_src Append to the history and ignore duplicates. -#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes - history = { - append = true; - ignoreAllDups = true; - }; +#+begin_src nix + history = { + append = true; + ignoreAllDups = true; + }; #+end_src Specify =ls= aliases. -#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes - shellAliases = { - "ll" = "ls -alF"; - "la" = "ls -a"; - "l" = "ls -F"; - "sl" = "ls"; - }; +#+begin_src nix + shellAliases = { + "ll" = "ls -alF"; + "la" = "ls -a"; + "l" = "ls -F"; + "sl" = "ls"; + }; #+end_src Enable syntax highlighting. -#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes - syntaxHighlighting.enable = true; +#+begin_src nix + syntaxHighlighting.enable = true; +#+end_src + +Load extra code. +#+begin_src nix + initExtra = '' #+end_src Create potential aliases and create the prompt. -#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes - initExtra = '' - which lesspipe.sh &> /dev/null && export LESSOPEN="|lesspipe.sh %s" - which eza &> /dev/null && alias ls=eza - parse_git_dirty() { - git_status="$(git status 2> /dev/null)" - [[ "$git_status" =~ "use \"git push\" to publish your local commits" ]] && echo -n " %F{green}%f" - [[ "$git_status" =~ "Changes to be committed:" ]] && echo -n " %F{magenta}%f" - [[ "$git_status" =~ "Changes not staged for commit:" ]] && echo -n " %F{yellow}%f" - [[ "$git_status" =~ "Untracked files:" ]] && echo -n " %F{red}%f" - } - setopt prompt_subst - autoload -Uz vcs_info - precmd () { vcs_info } - zstyle ':vcs_info:*' formats ' %F{blue}%b%f' # git(main) - PS1='%(?..%B%F{red}[%?%\]%f%b )%F{green}%20<...<%~%<<%f$vcs_info_msg_0_$(parse_git_dirty) $ ' - ''; +#+begin_src sh + which lesspipe.sh &> /dev/null && export LESSOPEN="|lesspipe.sh %s" + which eza &> /dev/null && alias ls=eza +#+end_src + +Set up fuzzy finder. +#+begin_src sh + which zsh &> /dev/null && source <(fzf --zsh) +#+end_src + +Create the prompt. +#+begin_src sh + parse_git_dirty() { + git_status="$(git status 2> /dev/null)" + [[ "$git_status" =~ "use \"git push\" to publish your local commits" ]] && echo -n " %F{green}%f" + [[ "$git_status" =~ "Changes to be committed:" ]] && echo -n " %F{magenta}%f" + [[ "$git_status" =~ "Changes not staged for commit:" ]] && echo -n " %F{yellow}%f" + [[ "$git_status" =~ "Untracked files:" ]] && echo -n " %F{red}%f" + } + setopt prompt_subst + autoload -Uz vcs_info + precmd () { vcs_info } + zstyle ':vcs_info:*' formats ' %F{blue}%b%f' # git(main) + PS1='%(?..%B%F{red}[%?%\]%f%b )%F{green}%20<...<%~%<<%f$vcs_info_msg_0_$(parse_git_dirty) $ ' +#+end_src + +#+begin_src nix + ''; +#+end_src + +Load =.profile= code. +#+begin_src nix + profileExtra = '' #+end_src Launch =ssh-agent= at login. -#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes - profileExtra = '' - if [ ! -S ~/.ssh/ssh_auth_sock ]; then - eval `ssh-agent` > /dev/null - ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock - fi - export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock - ''; +#+begin_src sh + if [ ! -S ~/.ssh/ssh_auth_sock ]; then + eval `ssh-agent` > /dev/null + ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock + fi + export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock #+end_src +Close =.profile= code. +#+begin_src nix + ''; +#+end_src + + Close =zsh= configuration. -#+begin_src nix :tangle ~/.flake/home/programs/zsh.nix :mkdirp yes +#+begin_src nix }; } #+end_src |