~n0mn0m/dotfiles

3c1f7f69ee240e42dc36de5d96dcca466d8237e2 — Alexander 4 months ago d5f7a11
Updated emacs moving to use-package.
2 files changed, 177 insertions(+), 82 deletions(-)

M .emacs
A .zshrc.alt
M .emacs => .emacs +96 -82
@@ 54,18 54,88 @@

(setq default-directory (getenv "HOME"))

(require 'expand-region)
(global-set-key (kbd "C-=") 'er/expand-region)

(setenv "ESHELL" (expand-file-name "~/bin/eshell"))

;; Custom mode hooks
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
;; Enable built in line numbers
(when (version<= "26.0.50" emacs-version )
  (global-display-line-numbers-mode))
;; (add-hook 'prog-mode-hook 'display-line-numbers-mode)

;; Configure backups
(defvar --backup-directory (concat (getenv "HOME") "/.emacs.d/backups"))

(if (not (file-exists-p --backup-directory))
        (make-directory --backup-directory t))

(setq backup-directory-alist `(("." . ,--backup-directory)))

(setq make-backup-files t               ; backup of a file the first time it is saved.
      backup-by-copying t               ; don't clobber symlinks
      version-control t                 ; version numbers for backup files
      delete-old-versions t             ; delete excess backup files silently
      delete-by-moving-to-trash t
      kept-old-versions 6               ; oldest versions to keep when a new numbered backup is made (default: 2)
      kept-new-versions 9               ; newest versions to keep when a new numbered backup is made (default: 2)
      auto-save-default t               ; auto-save every buffer that visits a file
      auto-save-timeout 20              ; number of seconds idle time before auto-save (default: 30)
      auto-save-interval 200            ; number of keystrokes between auto-saves (default: 300)
)

(add-to-list 'default-frame-alist '(fullscreen . maximized))

(use-package rainbow-delimiters
  :ensure t
  :init
    (add-hook 'prog-mode-hook #'rainbow-delimiters-mode))

(use-package expand-region
  :ensure t
  :config
    (global-set-key (kbd "C-=") 'er/expand-region))

(use-package kaolin-themes
  :ensure t
  :init
    (setq kaolin-themes-distinct-fringe t)
    (setq kaolin-themes-distinct-company-scrollbar t)
    (setq kaolin-themes-git-gutter-solid t)
  :config
    (load-theme 'kaolin-light t))

;; load evil
(use-package evil
  :ensure t ;; install the evil package if not installed
  :init ;; tweak evil's configuration before loading it
    (setq evil-search-module 'evil-search)
    (setq evil-ex-complete-emacs-commands nil)
    (setq evil-vsplit-window-right t)
    (setq evil-split-window-below t)
    (setq evil-shift-round nil)
    (setq evil-want-C-u-scroll t)
  :config ;; tweak evil after loading it
    (evil-mode))

(use-package all-the-icons
  :ensure t)

;; Neotree config
(use-package neotree
  :bind
  ("<f8>" . neotree-toggle)
  :config
  (setq neo-theme (if (display-graphic-p) 'icons 'icons))
  ;; Disable line-numbers minor mode for neotree
  (add-hook 'neo-after-create-hook
            (lambda (&rest _) (display-line-numbers-mode -1)))
  (setq-default neo-show-hidden-files t)
  (setq neo-window-width 35)
  (setq neo-smart-open t))

(use-package ivy
  :ensure t
  :diminish (ivy-mode . "")
  :init (ivy-mode 1)
  :init
    (ivy-mode 1)
  :config
    (setq ivy-use-virtual-buffers t)
    (setq ivy-height 20)


@@ 76,6 146,15 @@
  :init
    (add-hook 'after-init-hook 'global-company-mode))

(use-package flycheck
  :ensure t
  :init
    (global-flycheck-mode))

(use-package eglot
  :ensure t
  :demand)

(use-package csharp-mode
  :ensure t
  :mode "\\.cs\\'"


@@ 84,14 163,6 @@
    (add-to-list 'company-backends 'company-omnisharp)
    (add-hook 'csharp-mode-hook 'company-mode))

(use-package flycheck
  :ensure t
  :init (global-flycheck-mode))

(use-package eglot
  :ensure t
  :demand)

(use-package rust-mode
  :ensure t
  :mode "\\.rs\\'"


@@ 104,75 175,17 @@
  :hook ((rust-mode toml-mode) . cargo-minor-mode))

(use-package toml-mode
  :mode "\\.toml\\'"
  :ensure t)

(use-package all-the-icons)

;; Neotree config
(use-package neotree
  :bind
  ("<f8>" . neotree-toggle)
  :config
  (setq neo-theme (if (display-graphic-p) 'icons 'icons))
  ;; Disable line-numbers minor mode for neotree
  (add-hook 'neo-after-create-hook
            (lambda (&rest _) (display-line-numbers-mode -1)))
  (setq-default neo-show-hidden-files t)
  (setq neo-window-width 35)
  (setq neo-smart-open t))

;; Enable built in line numbers
(when (version<= "26.0.50" emacs-version )
  (global-display-line-numbers-mode))
;; (add-hook 'prog-mode-hook 'display-line-numbers-mode)

;; Configure backups
(defvar --backup-directory (concat (getenv "HOME") "/.emacs.d/backups"))

(if (not (file-exists-p --backup-directory))
        (make-directory --backup-directory t))

(setq backup-directory-alist `(("." . ,--backup-directory)))

(setq make-backup-files t               ; backup of a file the first time it is saved.
      backup-by-copying t               ; don't clobber symlinks
      version-control t                 ; version numbers for backup files
      delete-old-versions t             ; delete excess backup files silently
      delete-by-moving-to-trash t
      kept-old-versions 6               ; oldest versions to keep when a new numbered backup is made (default: 2)
      kept-new-versions 9               ; newest versions to keep when a new numbered backup is made (default: 2)
      auto-save-default t               ; auto-save every buffer that visits a file
      auto-save-timeout 20              ; number of seconds idle time before auto-save (default: 30)
      auto-save-interval 200            ; number of keystrokes between auto-saves (default: 300)
)

;; Init windows
(defun my-layout()
  (neotree-toggle))


;; After packages are installed and init is done initialize
;; last steps focus on layout.
(add-hook 'after-init-hook
	  (my-layout)
	  (evil-mode 1))

(add-to-list 'default-frame-alist '(fullscreen . maximized))

(use-package kaolin-themes
  :config
  (load-theme 'kaolin-light t))

(setq kaolin-themes-distinct-fringe t)  
(setq kaolin-themes-distinct-company-scrollbar t)
(setq kaolin-themes-git-gutter-solid t)
  :ensure t
  :mode "\\.toml\\'")

(setq elfeed-feeds
      '("http://planet.emacsen.org/atom.xml"
	"https://blog.acolyer.org/feed/"
	"http://worrydream.com/feed.xml"
	"https://lobste.rs/rss"))
(use-package elfeed
  :ensure t
  :init
    (setq elfeed-feeds
	  '("http://planet.emacsen.org/atom.xml"
	    "https://blog.acolyer.org/feed/"
	    "http://worrydream.com/feed.xml"
	    "https://lobste.rs/rss")))

(custom-set-variables
 ;; custom-set-variables was added by Custom.


@@ 189,3 202,4 @@
 ;; If there is more than one, they won't work right.
 )
;; .emacs ends here


A .zshrc.alt => .zshrc.alt +81 -0
@@ 0,0 1,81 @@
setopt no_beep

bindkey -v
export EDITOR='vim'
export LANG='en_US.UTF-8'

typeset -U path
path=(/usr/local/opt/ruby/bin /Applications/Keybase.app/Contents/SharedSupport/bin /Users/n0mn0m/.cargo/bin /Users/n0mn0m/.npm-global/bin /opt/local/bin /opt/local/sbin/ $path)

# Navigation
setopt AUTO_CD PUSHD_MINUS PUSHD_SILENT
DIRSTACKSIZE='25'

# Completion
autoload -Uz compinit
compinit -u

# Correction
setopt correct

# Prompt
setopt prompt_subst
autoload -U promptinit
promptinit
autoload -Uz vcs_info
autoload +X VCS_INFO_nvcsformats

functions[VCS_INFO_nvcsformats]=${functions[VCS_INFO_nvcsformats]/local -a msgs/}

# Style outside of git repo
zstyle ':vcs_info:*' nvcsformats '%{%F{magenta}%}%~%{%f%}'

# base git formatting in a repo
zstyle ':vcs_info:*' formats '%{%F{magenta}%}%R %{%f%}%{%F{green}%}(%25>…>%b%<<) %{%f%}%c%u'

# show unsubmitted changes
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' unstagedstr '%{%F{red}%B%}!%{%b%f%}'
zstyle ':vcs_info:*' stagedstr '%{%F{green}%B%}+%{%b%f%}'

# Handle special git states such as rebase or merge replacing branch with state information
zstyle ':vcs_info:*' actionformats '%{%F{cyan}%}%45<…<%R%<</%{%f%}%{%F{red}%}(%a|%m)%{%f%}%{%F{cyan}%}%S%{%f%}%c%u'
zstyle ':vcs_info:git:*' patch-format '%10>…>%p%<< (%n applied)'
zstyle ':vcs_info:*+set-message:*' hooks home-path
zstyle ':vcs_info:git+post-backend:*' hooks git-remote-staged

function precmd() { vcs_info }
PROMPT='[ %D{%y-%m-%f %H:%M:%S} | %F{cyan}%n%F{white}@%F{yellow}%m %F{white}| ${vcs_info_msg_0_} %{%b%E%}] %# '

# History
setopt INC_APPEND_HISTORY EXTENDED_HISTORY SHARE_HISTORY HIST_IGNORE_ALL_DUPS HIST_IGNORE_SPACE HIST_EXPIRE_DUPS_FIRST NO_HIST_BEEP
HISTSIZE='1000'
SAVEHIST='1000'
HISTFILE="$HOME/.history"

# Aliases
if [[ -r ~/.aliasrc ]]; then
	. ~/.aliasrc
fi

# Always work in a virtual environment by default for Python.
source $HOME/.virtualenvs/38/bin/activate
export PYTHONBREAKPOINT='pudb.set_trace'

export JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk13/Contents/Home

# Turn off dotnet telemetry
export DOTNET_CLI_TELEMETRY_OPTOUT=1

# zsh parameter completion for the dotnet CLI

_dotnet_zsh_complete()
{
  local completions=("$(dotnet complete "$words")")

  reply=( "${(ps:\n:)completions}" )
}

source $HOME/projects/zsh-autocomplete/zsh-autocomplete.plugin.zsh

compctl -K _dotnet_zsh_complete dotnet