Updated spacemacs, xmobar, xmonad, and NixOS configs

This commit is contained in:
Logan Saunders 2016-09-17 20:24:23 -07:00
parent 5290d914d7
commit e36c934026
4 changed files with 136 additions and 45 deletions

View File

@ -23,47 +23,42 @@ values."
;; Uncomment some layer names and press <SPC f e R> (Vim style) or ;; Uncomment some layer names and press <SPC f e R> (Vim style) or
;; <M-m f e R> (Emacs style) to install them. ;; <M-m f e R> (Emacs style) to install them.
;; ---------------------------------------------------------------- ;; ----------------------------------------------------------------
auto-completion
better-defaults
colors
emacs-lisp emacs-lisp
emoji
gnus
git git
github github
haskell
javascript
markdown markdown
nixos
org org
;; (shell :variables perl
;; shell-default-height 30 rcirc
;; shell-default-position 'bottom) react
shell
spell-checking spell-checking
spotify
syntax-checking syntax-checking
version-control version-control
react
javascript
company-mode
spotify
emoji
autocompletion
colors
better-defaults
shell
haskell
rcirc
) )
;; List of additional packages that will be installed without being ;; List of additional packages that will be installed without being
;; wrapped in a layer. If you need some configuration for these ;; wrapped in a layer. If you need some configuration for these
;; packages, then consider creating a layer. You can also put the ;; packages, then consider creating a layer. You can also put the
;; configuration in `dotspacemacs/user-config'. ;; configuration in `dotspacemacs/user-config'.
dotspacemacs-additional-packages '( dotspacemacs-additional-packages '(
auto-complete
ac-js2
tern-auto-complete
git-gutter+ git-gutter+
evil-smartparens evil-smartparens
dockerfile-mode dockerfile-mode
yaml-mode yaml-mode
nix-mode
simpleclip simpleclip
tide
) )
;; A list of packages and/or extensions that will not be install and loaded. ;; A list of packages and/or extensions that will not be install and loaded.
dotspacemacs-excluded-packages '( dotspacemacs-excluded-packages '(
company
) )
;; If non-nil spacemacs will delete any orphan packages, i.e. packages that ;; If non-nil spacemacs will delete any orphan packages, i.e. packages that
;; are declared in a layer which is not a member of ;; are declared in a layer which is not a member of
@ -129,7 +124,7 @@ values."
dotspacemacs-colorize-cursor-according-to-state t dotspacemacs-colorize-cursor-according-to-state t
;; Default font. `powerline-scale' allows to quickly tweak the mode-line ;; Default font. `powerline-scale' allows to quickly tweak the mode-line
;; size to make separators look not too crappy. ;; size to make separators look not too crappy.
dotspacemacs-default-font '("Source Code Pro" dotspacemacs-default-font '("Source Code Pro for Powerline"
:size 13 :size 13
:weight normal :weight normal
:width normal :width normal
@ -254,6 +249,7 @@ values."
;; delete only whitespace for changed lines or `nil' to disable cleanup. ;; delete only whitespace for changed lines or `nil' to disable cleanup.
;; (default nil) ;; (default nil)
dotspacemacs-whitespace-cleanup nil dotspacemacs-whitespace-cleanup nil
)) ))
(defun dotspacemacs/user-init () (defun dotspacemacs/user-init ()
@ -293,6 +289,17 @@ before packages are loaded. If you are unsure, you should try in setting them in
(setq projectile-enable-caching t) (setq projectile-enable-caching t)
) )
(defun setup-tide-mode ()
(interactive)
(tide-setup)
(flycheck-mode +1)
(setq flycheck-check-syntax-automatically '(save mode-enabled))
(eldoc-mode +1)
;; company is an optional dependency. You have to
;; install it separately via package-install
;; `M-x package-install [ret] company`
(company-mode +1))
(defun dotspacemacs/user-config () (defun dotspacemacs/user-config ()
"Configuration function for user code. "Configuration function for user code.
This function is called at the very end of Spacemacs initialization after This function is called at the very end of Spacemacs initialization after
@ -300,6 +307,12 @@ before packages are loaded. If you are unsure, you should try in setting them in
This is the place where most of your configurations should be done. Unless it is This is the place where most of your configurations should be done. Unless it is
explicitly specified that a variable should be set before a package is loaded, explicitly specified that a variable should be set before a package is loaded,
you should place your code here." you should place your code here."
(setq company-tooltip-align-annotations t)
(add-hook 'before-save-hook 'tide-format-before-save)
(add-hook 'typescript-mode-hook #'setup-tide-mode)
(setq tide-format-options '(:insertSpaceAfterFunctionKeywordForAnonymousFunctions t :placeOpenBraceOnNewLineForFunctions nil :BaseIndentSize? 2 :IndentSize 2 :TabSize 2 :ConvertTabsToSpaces t :IndentStyle None :InsertSpaceBeforeAndAfterBinaryOperators t ))
(add-hook 'js2-mode-hook #'setup-tide-mode)
(global-company-mode)
(add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode)) (add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode))
(simpleclip-mode 1) (simpleclip-mode 1)
(add-to-list (add-to-list
@ -309,27 +322,57 @@ before packages are loaded. If you are unsure, you should try in setting them in
(global-git-gutter+-mode) (global-git-gutter+-mode)
(add-to-list 'auto-mode-alist '("Dockerfile\\'" . dockerfile-mode)) (add-to-list 'auto-mode-alist '("Dockerfile\\'" . dockerfile-mode))
(add-hook 'js2-mode-hook #'smartparens-mode) (add-hook 'js2-mode-hook #'smartparens-mode)
(add-hook 'web-mode-hook #'smartparens-mode) ;; (add-hook 'web-mode-hook #'smartparens-mode)
(add-hook 'smartparens-enabled-hook #'evil-smartparens-mode) (add-hook 'smartparens-enabled-hook #'evil-smartparens-mode)
(setq powerline-default-separator 'slant) (setq powerline-default-separator 'slant)
(add-to-list 'auto-mode-alist '("\\.js[x]?\\'" . web-mode)) ;; (add-to-list 'auto-mode-alist '("\\.js[x]?\\'" . web-mode))
(setq web-mode-content-types-alist ;; (setq web-mode-content-types-alist
'(("jsx" . "\\.js[x]?\\'"))) ;; '(("jsx" . "\\.js[x]?\\'")))
(with-eval-after-load 'flycheck (with-eval-after-load 'flycheck
(setq-default flycheck-disabled-checkers (setq-default flycheck-disabled-checkers
(append flycheck-disabled-checkers (append flycheck-disabled-checkers
'(javascript-jshint))) '(javascript-jshint)))
;; use eslint with web-mode for jsx files ;; use eslint with web-mode for jsx files
(flycheck-add-mode 'javascript-eslint 'web-mode)) (flycheck-add-mode 'javascript-eslint 'js2-mode))
(flycheck-add-mode 'javascript-eslint 'typescript-mode)
(evil-leader/set-key "n" 'neotree-toggle) (evil-leader/set-key "n" 'neotree-toggle)
(global-git-commit-mode t) (global-git-commit-mode t)
(global-flycheck-mode) (global-flycheck-mode)
(ac-config-default) ;; Gnus
(add-to-list 'ac-modes 'web-mode) ;; Get email, and store in nnml
(setq ac-auto-show-menu 0.05) (setq gnus-secondary-select-methods
(setq ac-delay 0.05) '(
(tern-ac-setup) (nnimap "gmail"
(setq ac-js2-evaluate-calls t) (nnimap-address
"imap.gmail.com")
(nnimap-server-port 993)
(nnimap-stream ssl))
))
;; Send email via Gmail:
(setq message-send-mail-function 'smtpmail-send-it
smtpmail-default-smtp-server "smtp.gmail.com")
;; Archive outgoing email in Sent folder on imap.gmail.com:
(setq gnus-message-archive-method '(nnimap "imap.gmail.com")
gnus-message-archive-group "[Gmail]/Sent Mail")
;; set return email address based on incoming email address
(setq gnus-posting-styles
'(((header "to" "address@outlook.com")
(address "address@outlook.com"))
((header "to" "address@gmail.com")
(address "address@gmail.com"))))
;; store email in ~/gmail directory
(setq nnml-directory "~/gmail")
(setq message-directory "~/gmail")
(with-eval-after-load 'web-mode
(add-to-list 'web-mode-indentation-params '("lineup-args" . nil))
(add-to-list 'web-mode-indentation-params '("lineup-concats" . nil))
(add-to-list 'web-mode-indentation-params '("lineup-calls" . nil)))
;; Vim key bindings ;; Vim key bindings
(evil-leader/set-key (evil-leader/set-key
@ -352,11 +395,15 @@ before packages are loaded. If you are unsure, you should try in setting them in
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(paradox-github-token t)) '(paradox-github-token t)
'(send-mail-function (quote smtpmail-send-it))
'(smtpmail-smtp-server "smtp.gmail.com")
'(smtpmail-smtp-service 25))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
) '(company-tooltip-common ((t (:inherit company-tooltip :weight bold :underline nil))))
'(company-tooltip-common-selection ((t (:inherit company-tooltip-selection :weight bold :underline nil)))))

View File

@ -1,20 +1,33 @@
import System.IO import System.IO
import Data.List
import Graphics.X11.ExtraTypes.XF86
import XMonad import XMonad
import XMonad.Actions.Volume
import XMonad.Hooks.DynamicLog import XMonad.Hooks.DynamicLog
import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageDocks
import XMonad.Layout.IndependentScreens import XMonad.Layout.IndependentScreens
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Prompt.Ssh
import XMonad.Prompt.Window
import XMonad.Util.EZConfig(additionalKeys) import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Util.Run(spawnPipe) import XMonad.Util.Run(spawnPipe)
myManageHook = composeAll
[ className =? "chromium" --> doShift "1:web_0"
, className =? "emacs" --> doShift "4:emacs"
, manageDocks
]
main = do main = do
xmproc <- spawnPipe "xmobar" xmproc <- spawnPipe "xmobar"
xmonad $ ewmh defaultConfig xmonad $ ewmh defaultConfig
{ handleEventHook = { handleEventHook =
handleEventHook defaultConfig <+> fullscreenEventHook handleEventHook defaultConfig <+> fullscreenEventHook
, manageHook = manageDocks <+> manageHook defaultConfig , manageHook = manageDocks <+> myManageHook <+> manageHook defaultConfig
, modMask = mod4Mask , modMask = mod4Mask
, workspaces = withScreens 2 ["web", "skype", "emacs"] , workspaces = ["1:web_0", "2:web_1", "3:terminal", "4:emacs", "5", "6", "7", "8", "9"]
, terminal = "urxvtc" , terminal = "urxvtc"
, layoutHook = avoidStruts $ layoutHook defaultConfig , layoutHook = avoidStruts $ layoutHook defaultConfig
, logHook = dynamicLogWithPP xmobarPP , logHook = dynamicLogWithPP xmobarPP
@ -24,5 +37,16 @@ main = do
} `additionalKeys` } `additionalKeys`
[ ((mod4Mask .|. shiftMask, xK_z), spawn "xscreensaver-command -lock; xset dpms force off") [ ((mod4Mask .|. shiftMask, xK_z), spawn "xscreensaver-command -lock; xset dpms force off")
, ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s") , ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
, ((mod4Mask, xK_u), spawn "urxvt")
, ((mod4Mask, xK_p), shellPrompt defaultXPConfig)
, ((mod4Mask, xK_s), sshPrompt defaultXPConfig)
, ((0, xK_Print), spawn "scrot") , ((0, xK_Print), spawn "scrot")
, ((mod4Mask .|. shiftMask, xK_l), spawn "slock")
, ((mod4Mask, xK_g), windowPromptGoto
defaultXPConfig { autoComplete = Just 500000 } )
, ((mod4Mask .|. shiftMask, xK_g), windowPromptBring
defaultXPConfig { autoComplete = Just 500000 } )
, ((0, xF86XK_AudioLowerVolume), lowerVolume 4 >> return ())
, ((0, xF86XK_AudioRaiseVolume), raiseVolume 4 >> return ())
, ((0, xF86XK_AudioMute), toggleMute >> return())
] ]

20
.zshrc
View File

@ -5,14 +5,14 @@
# Look in ~/.oh-my-zsh/themes/ # Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each # Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded. # time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell" ZSH_THEME="frisk"
# Uncomment the following line to use case-sensitive completion. # Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true" # CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case # Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable. # sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true" HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks. # Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true" # DISABLE_AUTO_UPDATE="true"
@ -47,13 +47,13 @@ ZSH_THEME="robbyrussell"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse) # Example format: plugins=(rails git ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup. # Add wisely, as too many plugins slow down shell startup.
plugins=(git docker lein npm sudo systemd wd cp) plugins=(git docker npm sudo systemd wd cp zsh-autosuggestions sublime zsh-syntax-highlighting zsh-history-substring-search)
# User configuration # User configuration
export PATH="/home/gigavinyl/bin:/var/setuid-wrappers:/home/gigavinyl/.nix-profile/bin:/home/gigavinyl/.nix-profile/sbin:/home/gigavinyl/.nix-profile/lib/kde4/libexec:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/nix/var/nix/profiles/default/lib/kde4/libexec:/run/current-system/sw/bin:/run/current-system/sw/sbin:/run/current-system/sw/lib/kde4/libexec" export PATH="/home/gigavinyl/bin:/var/setuid-wrappers:/home/gigavinyl/.nix-profile/bin:/home/gigavinyl/.nix-profile/sbin:/home/gigavinyl/.nix-profile/lib/kde4/libexec:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/nix/var/nix/profiles/default/lib/kde4/libexec:/run/current-system/sw/bin:/run/current-system/sw/sbin:/run/current-system/sw/lib/kde4/libexec"
# export MANPATH="/usr/local/man:$MANPATH" # export MANPATH="/usr/local/man:$MANPATH"
source $ZSH/oh-my-zsh.sh source $ZSH/oh-my-zsh.sh
@ -65,7 +65,7 @@ source $ZSH/oh-my-zsh.sh
# if [[ -n $SSH_CONNECTION ]]; then # if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim' # export EDITOR='vim'
# else # else
# export EDITOR='mvim' export EDITOR='vim'
# fi # fi
# Compilation flags # Compilation flags
@ -84,5 +84,13 @@ source $ZSH/oh-my-zsh.sh
# alias ohmyzsh="mate ~/.oh-my-zsh" # alias ohmyzsh="mate ~/.oh-my-zsh"
alias cl="clear && screenfetch" alias cl="clear && screenfetch"
alias git="hub" alias git="hub"
alias excerism="/home/gigavinyl/app/excerism"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias cl="clear && screenfetch"
alias git="hub"
screenfetch screenfetch
export PATH=$PATH:/home/gigavinyl/apps
export PATH=$PATH:/home/gigavinyl/apps/.npm-packages/bin
export PATH=$PATH:/home/gigavinyl/apps/firefox

View File

@ -47,7 +47,9 @@
powerManagement.enable = true; powerManagement.enable = true;
virtualisation.docker.enable = true; virtualisation = {
docker.enable = true;
};
# Set your time zone. # Set your time zone.
time.timeZone = "America/Los_Angeles"; time.timeZone = "America/Los_Angeles";
@ -57,31 +59,40 @@
programs.zsh.enable = true; programs.zsh.enable = true;
security.setuidPrograms = [ "slock" ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
dropbox-cli dropbox-cli
emacs emacs
feh feh
gcc
ghc ghc
git git
google-chrome-beta gnumake
chromium
haskellPackages.cabal-install
haskellPackages.ghc-mod haskellPackages.ghc-mod
haskellPackages.hasktags haskellPackages.hasktags
haskellPackages.hlint haskellPackages.hlint
haskellPackages.stack
haskellPackages.stylish-haskell haskellPackages.stylish-haskell
haskellPackages.xmobar haskellPackages.xmobar
htop htop
gnumake kbdlight
gcc
networkmanagerapplet networkmanagerapplet
nodejs
nox nox
python python
python27Packages.udiskie python27Packages.udiskie
rxvt_unicode rxvt_unicode
silver-searcher silver-searcher
slock
sublime3
sudo sudo
unzip unzip
vim vim
wget wget
xautolock
xflux xflux
]; ];
@ -137,6 +148,7 @@
URxvt.*color15: #eeeeec URxvt.*color15: #eeeeec
''}" ''}"
''; '';
};
windowManager = { windowManager = {
xmonad = { xmonad = {
enable = true; enable = true;