Remove configs we do not need

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2019-12-31 12:46:48 +05:30
parent d113ff9d6b
commit abf723ada1
5 changed files with 0 additions and 1713 deletions

View File

@ -1,116 +0,0 @@
! urxvt
URxvt.perl-ext-common: default,clipboard,url-select,keyboard-select
URxvt.url-select.launcher: google-chrome-stable
URxvt.url-select.underline: true
URxvt.keysym.M-u: perl:url-select:select_next
URxvt.keysym.M-Escape: perl:keyboard-select:activate
URxvt.keysym.M-s: perl:keyboard-select:search
URxvt.iso14755: False
URxvt.keysym.Shift-Control-C: perl:clipboard:copy
URxvt.keysym.Shift-Control-V: perl:clipboard:paste
URxvt*selectToClipboard: true
urxvt*transparent: false
urxvt*shading: 15
URxvt*buffered: true
URxvt*cursorBlink: true
URxvt*underlineColor: yellow
URxvt*font: xft:Ubuntu Mono:size=14:antialias=true
URxvt*depth: 32
URxvt*borderless: 1
URxvt*scrollBar: false
URxvt*loginShell: true
Urxvt*secondaryScroll: true # Enable Shift-PageUp/Down in screen
URxvt*saveLines: 2000
URxvt*termName: rxvt-unicode
URxvt.keysym.Home: \033[1~
URxvt.keysym.End: \033[4~
URxvt.keysym.KP_Home: \033[1~
URxvt.keysym.KP_End: \033[4~
XTerm*faceName: Bitstream Vera Serif Mono
xterm*faceSize: 11
xterm*vt100*geometry: 80x60
xterm*saveLines: 16384
xterm*loginShell: true
xterm*charClass: 33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48
xterm*termName: xterm-color
xterm*eightBitInput: false
!BLK Cursor
#define _color0 #000d18
#define _color8 #000d18
!RED Tag
#define _color1 #e89393
#define _color9 #e89393
!GRN SpecialKey
#define _color2 #9ece9e
#define _color10 #9ece9e
!YEL Keyword
#define _color3 #f0dfaf
#define _color11 #f0dfaf
!BLU Number
#define _color4 #8cd0d3
#define _color12 #8cd0d3
!MAG Precondit
#define _color5 #c0bed1
#define _color13 #c0bed1
!CYN Float
#define _color6 #dfaf8f
#define _color14 #dfaf8f
!WHT Search
#define _color7 #efefef
#define _color15 #efefef
!FMT Include, StatusLine, ErrorMsg
#define _colorBD #ffcfaf
#define _colorUL #ccdc90
#define _colorIT #80d4aa
!TXT Normal, Normal, Cursor
#define _foreground #dcdccc
#define _background #1f1f1f
#define _cursorColor #8faf9f
URxvt*color0 : _color0
URxvt*color1 : _color1
URxvt*color2 : _color2
URxvt*color3 : _color3
URxvt*color4 : _color4
URxvt*color5 : _color5
URxvt*color6 : _color6
URxvt*color7 : _color7
URxvt*color8 : _color8
URxvt*color9 : _color9
URxvt*color10 : _color10
URxvt*color11 : _color11
URxvt*color12 : _color12
URxvt*color13 : _color13
URxvt*color14 : _color14
URxvt*color15 : _color15
URxvt*colorBD : _colorBD
URxvt*colorIT : _colorIT
URxvt*colorUL : _colorUL
URxvt*foreground : _foreground
URxvt*background : _background
URxvt*cursorColor : _cursorColor
XTerm*color0 : _color0
XTerm*color1 : _color1
XTerm*color2 : _color2
XTerm*color3 : _color3
XTerm*color4 : _color4
XTerm*color5 : _color5
XTerm*color6 : _color6
XTerm*color7 : _color7
XTerm*color8 : _color8
XTerm*color9 : _color9
XTerm*color10 : _color10
XTerm*color11 : _color11
XTerm*color12 : _color12
XTerm*color13 : _color13
XTerm*color14 : _color14
XTerm*color15 : _color15
XTerm*colorBD : _colorBD
XTerm*colorIT : _colorIT
XTerm*colorUL : _colorUL
XTerm*foreground : _foreground
XTerm*background : _background
XTerm*cursorColor : _cursorColor

848
init.el
View File

@ -1,848 +0,0 @@
;;; init.el --- Initialization file for emacs
;;; Commentary: Emacs startup file --- initialization file for emacs
(setq
custom-file (concat user-emacs-directory ".emacs-customize.el")
require-final-newline t)
;; Track emacs load time
(defconst emacs-start-time (current-time))
;; Other configs
(setq make-backup-files nil)
(setq auto-save-default nil)
(global-auto-revert-mode t)
;; Splash Screen
(setq inhibit-startup-screen t)
(setq initial-scratch-message ";; Happy Hacking")
;; Show matching parens
(setq show-paren-delay 0)
(show-paren-mode 1)
(electric-pair-mode 1)
;; UI configurations
(if (display-graphic-p)
(progn
(tool-bar-mode -1)
(scroll-bar-mode -1)))
(tooltip-mode -1)
(menu-bar-mode -1)
(global-linum-mode 1)
;; Font configurations
(add-to-list 'default-frame-alist '(font . "Iosevka-14"))
(add-to-list 'default-frame-alist '(height . 24))
(add-to-list 'default-frame-alist '(width . 80))
(add-to-list 'default-frame-alist '(fullscreen . maximized))
;;; Package Management
(require 'package)
(setq package-enable-at-startup nil)
(setq package-archives
'(("org" . "http://orgmode.org/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(package-initialize)
;; Bootstrap `use-package`
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(eval-when-compile
(require 'use-package))
;; always download all packages if not already downloaded
(setq use-package-always-ensure t)
;; keep stats about packages
(setq use-package-compute-statistics t)
; no longer included with use-package by default
(use-package diminish)
(use-package auto-package-update
:ensure t
:config
(setq auto-package-update-delete-old-versions t
auto-package-update-interval 4)
(auto-package-update-maybe))
;; Restart emacs from within emacs
(use-package restart-emacs
:ensure t)
;; Theme
(use-package doom-themes
:ensure t
:config
(load-theme 'doom-molokai t))
;; Auto enforced consistence
(use-package editorconfig
:diminish ""
:init
(setq auto-mode-alist
(cl-union auto-mode-alist
'(("\\.editorconfig\\'" . editorconfig-conf-mode)
("editorconfig\\'" . editorconfig-conf-mode))))
:config
(editorconfig-mode 1))
(use-package smartparens
:hook ((prog-mode-hook) . smartparens-mode)
:config
(require 'smartparens-config))
(use-package aggressive-indent
:diminish ""
:config
(global-aggressive-indent-mode t))
(use-package fzf
:ensure t)
;; Anzu for search matching
(use-package anzu
:ensure t
:config
(global-anzu-mode 1)
(global-set-key [remap query-replace-regexp]
'anzu-query-replace-regexp)
(global-set-key [remap query-replace]
'anzu-query-replace))
(use-package avy
:defer t
:init
(progn
(setq avy-all-windows 'all-frames)
(setq avy-background t)))
(use-package dumb-jump
:ensure t)
;; Vim mode
(use-package evil
:ensure t
:config
(evil-mode 1))
(use-package evil-escape
:ensure t
:init
(setq-default evil-escape-key-sequence "jk")
:config
(evil-escape-mode 1))
(use-package evil-nerd-commenter
:ensure t)
(use-package evil-surround
:ensure t
:config
(global-evil-surround-mode 1))
(use-package disable-mouse
:ensure t
:config
(global-disable-mouse-mode))
;; Helm
(use-package helm
:ensure t
:init
(setq helm-M-x-fuzzy-match t
helm-mode-fuzzy-match t
helm-buffers-fuzzy-matching t
helm-recentf-fuzzy-match t
helm-locate-fuzzy-match t
helm-semantic-fuzzy-match t
helm-imenu-fuzzy-match t
helm-completion-in-region-fuzzy-match t
helm-candidate-number-list 80
helm-split-window-inside-p t
helm-move-to-line-cycle-in-source t
helm-echo-input-in-header-line t
helm-autoresize-max-height 0
helm-autoresize-min-height 20)
:config
(helm-mode 1))
;; RipGrep
(use-package helm-rg :ensure t)
;; Projectile
(use-package projectile
:ensure t
:init
(setq projectile-require-project-root nil)
:config
(projectile-mode 1))
;; Helm Projectile
(use-package helm-projectile
:ensure t
:init
(setq helm-projectile-fuzzy-match t)
:config
(helm-projectile-on))
;; All The Icons
(use-package all-the-icons :ensure t)
;; Which Key
(use-package which-key
:ensure t
:init
(setq which-key-separator " ")
(setq which-key-prefix-prefix "+")
:config
(which-key-mode))
;; Git Support
(use-package magit
:defer t)
(use-package evil-magit
:defer t)
(use-package magit-gitflow
:defer t)
(use-package helm-git-grep
:defer t)
(use-package helm-gitignore
:defer t)
(use-package git-commit
:defer t)
(use-package git-messenger
:defer t
:config
(define-key git-messenger-map [escape] 'git-messenger:popup-close))
(use-package gitattributes-mode
:defer t)
(use-package gitconfig-mode
:defer t)
(use-package gitignore-mode
:defer t)
(use-package git-link
:defer t
:config
(setq git-link-open-in-browser t))
(use-package git-gutter
:defer t
:config
(global-git-gutter-mode +1))
(use-package gitignore-templates
:defer t)
;; See below 3 links for why config has been set like this
;; https://stackoverflow.com/questions/25517190/missing-complete-candidate-for-verilog-mode-with-company-mode
;; https://github.com/flycheck/flycheck/issues/740
;; https://github.com/flycheck/flycheck/issues/1250
(use-package verilog-mode
:defer t
:config
(add-to-list 'company-keywords-alist (cons 'verilog-mode verilog-keywords))
(setq flycheck-verilog-verilator-executable "verilator_bin"))
;; Custom keybinding
(use-package general
:ensure t
:init
(setq general-override-states '(insert
emacs
hybrid
normal
visual
motion
operator
replace))
:config
(general-define-key
:states '(normal visual insert emacs)
:prefix "SPC"
:non-normal-prefix "M-SPC"
"TAB" '(switch-to-prev-buffer
:which-key "previous buffer")
"SPC" '(helm-M-x :which-key "M-x")
;; fuzzy search
"ff" '(fzf :which-key "fuzzy file search")
;; Projectile
"/" '(helm-projectile-rg
:which-key "ripgrep")
"pf" '(helm-projectile-find-file
:which-key "find files")
"pF" '(helm-projectile-find-file-dwim
:which-key "find files dwim")
"pp" '(helm-projectile-switch-project
:which-key "switch project")
"pb" '(helm-projectile-switch-to-buffer
:which-key "switch buffer")
"pr" '(helm-projectile-recent
:which-key "show recent")
"pd" '(helm-projectile-find-dir
:which-key "find dir")
"ph" '(helm-projectile
:which-key "helm projectile")
;; Buffers
"bb" '(helm-mini :which-key "buffers list")
;; Window
"wl" '(windmove-right :which-key "move right")
"wh" '(windmove-left :which-key "move left")
"wk" '(windmove-up :which-key "move up")
"wj" '(windmove-down :which-key "move bottom")
"w/" '(split-window-right :which-key "split right")
"w-" '(split-window-below :which-key "split bottom")
"wx" '(delete-window :which-key "delete window")
"qz" '(delete-frame :which-key "delete frame")
"qq" '(kill-emacs :which-key "quit")
"qr" '(restart-emacs :which-key "restart emacs")
;; Others
"at" '(eshell :which-key "open terminal")
;; Magit key bindings
"gc" '(magit-clone
:which-key "magit clone")
"gff" '(magit-find-file
:which-key "magit find file")
"gfl" '(magit-log-buffer-file
:which-key "magit log buffer file")
"gfd" '(magit-diff-dwim
:which-key "magit diff buffer file popup")
"gi" '(magit-init
:which-key "magit initialize")
"gL" '(magit-list-repositories
:which-key "magit list repositories")
"gm" '(magit-dispatch-popup
:which-key "magit dispatch popup")
"gs" '(magit-status
:which-key "open Magit status buffer")
"gS" '(magit-stage-file
:which-key "magit stage file")
"gU" '(magit-unstage-file
:which-key "magit unstage file")
"g/" '(helm-git-grep
:which-key "open helm git grep")
"g*" '(helm-git-grep-at-point
:which-key "open helm git grep at point")
"gI" '(helm-gitignore
:which-key "helm gitignore")
"%" 'magit-gitflow-popup
"gti" 'gitignore-templates-insert
"gtn" 'gitignore-templates-new-file
"gM" 'git-messenger:popup-message
"gll" 'spacemacs/git-link
"glL" 'spacemacs/git-link-copy-url-only
"glc" 'spacemacs/git-link-commit
"glC" 'spacemacs/git-link-commit-copy-url-only
;; evil nerd commenter
"ci" 'evilnc-comment-or-uncomment-lines
"cl" 'evilnc-quick-comment-or-uncomment-to-the-line
"ll" 'evilnc-quick-comment-or-uncomment-to-the-line
"cc" 'evilnc-copy-and-comment-lines
"cp" 'evilnc-comment-or-uncomment-paragraphs
"cr" 'comment-or-uncomment-region
"cv" 'evilnc-toggle-invert-comment-line-by-line
"." 'evilnc-copy-and-comment-operator
"\\" 'evilnc-comment-operator
"jb" 'avy-pop-mark
"jj" 'evil-avy-goto-char-timer
"jl" 'evil-avy-goto-line
"jw" 'evil-avy-goto-word-or-subword-1
;; dumb jump
"dg" 'dumb-jump-go
"dp" 'dump-jump-back
"dq" 'dump-jump-quick-look
"dw" 'dumb-jump-go-other-window
"de" 'dumb-jump-go-prefer-external
"do" 'dumb-jump-go-prefer-external-other-window
"dp" 'dumb-jump-go-prompt
;; xref
"xv" 'visit-tags-table
"xd" 'xref-find-definitions
"xr" 'xref-find-references
"xa" 'xref-find-apropos
"xf" 'xref-find-definitions-other-frame
"xp" 'xref-pop-marker-stack
"xq" 'xref-query-replace-in-results
"xs" 'tags-search))
(general-define-key
:states '(normal visual emacs)
:prefix "SPC m"
:keymaps 'haskell-mode-map
;; Haskell bindings
"f" '(hindent-reformat-decl
:which-key "format declaration using hindent")
"F" '(haskell-mode-stylish-buffer
:which-key "format buffer using haskell stylish")
"rb" '(hlint-refactor-refactor-buffer
:which-key "apply all hlint suggestions")
"rr" '(hlint-refactor-refactor-at-point
:which-key "apply hlint suggestion under cursor"))
(general-define-key
:states '(normal visual emacs)
:prefix "SPC m"
:keymaps 'rust-mode-map
"c." '(cargo-process-repeat
:which-key "repeat the last cargo command")
"cC" '(cargo-process-clean
:which-key "remove build artifacts with cargo")
"cX" '(cargo-process-run-example
:which-key "execute project example with cargo")
"cc" '(cargo-process-build
:which-key "compile project with cargo")
"cd" '(cargo-process-doc
:which-key "generate documentation with cargo")
"cD" '(cargo-process-doc-open
:which-key "open cargo docs")
"ce" '(cargo-process-bench
:which-key "run benchmarks with cargo")
"cf" '(cargo-process-fmt
:which-key "format all project files with rustfmt")
"ci" '(cargo-process-init
:which-key "create a new project with cargo")
"cl" '(cargo-process-clippy
:which-key "run linter with cargo")
"cn" '(cargo-process-new
:which-key "create new project with cargo")
"co" '(cargo-process-current-file-tests
:which-key "run all tests in current file with cargo")
"cs" '(cargo-process-search
:which-key "search for packages on crates.io")
"ct" '(cargo-process-current-test
:which-key "run the current test with cargo")
"cu" '(cargo-process-update
:which-key "update dependencies with cargo")
"cx" '(cargo-process-run
:which-key "execute a process with cargo")
"cv" '(cargo-process-check
:which-key "verify a project with cargo")
"t" '(cargo-process-test
:which-key "run test with cargo")
"==" '(rust-format-buffer
:which-key "rust reformat the buffer"))
(general-define-key
:states '(normal visual emacs)
:prefix "SPC m"
:keymaps 'lisp-mode-map
"cc" '(slime-compile-file
:which-key "compile file")
"cC" '(slime-compile-and-load-file
:which-key "compile file and load")
"cl" '(slime-load-file
:which-key "load file")
"cf" '(slime-compile-defun
:which-key "compile function")
"cr" '(slime-compile-region
:which-key "compile region")
"cn" '(slime-remove-notes
:which-key "remove compilation notes")
"eb" '(slime-eval-buffer
:which-key "evaluate buffer")
"ef" '(slime-eval-defun
:which-key "evaluate top level sexpr")
"eF" '(slime-undefine-function
:which-key "undefine the fn at point")
"ee" '(slime-eval-last-expression
:which-key "evaluate last sexpr")
"er" '(slime-eval-region
:which-key "evaluate region")
"gb" '(slime-pop-find-definition-stack
:which-key "go back")
"gn" '(slime-next-note
:which-key "next note")
"gN" '(slime-previous-note
:which-key "previous note")
"ha" '(slime-apropos
:which-key "SLIME appropos")
"hA" '(slime-apropos-all
:which-key "SLIME appropos all")
"hd" '(slime-disassemble-symbol
:which-key "disassemble symbol at point")
"hh" '(slime-describe-symbol
:which-key "describe symbol at point")
"hH" '(slime-hyperspec-lookup
:which-key "hyperspec lookup symbol at point")
"hi" '(slime-inspect-definition
:which-key "inspect defintion")
"hp" '(slime-apropos-package
:which-key "browse appropos results for package's exported symbols")
"ht" '(slime-toggle-trace-definition
:which-key "toggle tracing of function at point")
"hT" '(slime-untrace-all
:which-key "untrace all functions")
"h<" '(slime-who-calls
:which-key "show all known callers")
"h>" '(slime-calls-who
:which-key "show all known callees")
"hr" '(slime-who-references
:which-key "show references to global variable")
"hm" '(slime-who-macroexpands
:which-key "show all usages of a macro")
"hs" '(slime-who-specializes
:which-key "show all methods specialized on a class")
"ma" '(slime-macroexpand-all
:which-key "macroexpand the expr at point completely")
"mo" '(slime-macroexpand-1
:which-key "macroexpand the expr at point once")
"se" '(slime-eval-last-expression-in-repl
:which-key "evaluate last sexpr in repl")
"si" '(slime
:which-key "start an inferior process")
"sq" '(slime-quit-lisp
:which-key "quit")
"tf" '(slime-toggle-fancy-trace))
(general-define-key
:states '(normal visual emacs)
:prefix "SPC m"
:keymaps 'scheme-mode-map
"'" '(geiser-mode-switch-to-repl)
"," '(lisp-state-toggle-lisp-state)
"cc" '(geiser-compile-current-buffer
:which-key "compile current buffer")
"cp" '(geiser-add-to-load-path
:which-key "add directory to load path")
"eb" '(geiser-eval-buffer
:which-key "evaluate the whole buffer")
"ee" '(geiser-eval-last-sexp
:which-key "evaluate last sexp")
"ef" '(geiser-eval-definition
:which-key "evaluate current function")
"el" '(lisp-state-eval-sexp-end-of-line
:which-key "evaluate line")
"er" '(geiser-eval-region
:which-key "evaluate region")
"gb" '(geiser-pop-symbol-stack
:which-key "go back")
"gm" '(geiser-edit-module
:which-key "goto module")
"gn" '(next-error
:which-key "next error")
"gN" '(previous-error
:which-key "previous error")
"hh" '(geiser-doc-symbol-at-point
:which-key "docs for symbol at point")
"hd" '(geiser-doc-look-up-manual
:which-key "look up manual entry for symbol at point")
"hm" '(geiser-doc-module
:which-key "display exports for module")
"h<" '(geiser-xref-callers
:which-key "display callers")
"h>" '(geiser-xref-callees
:which-key "display callees")
"il" '(geiser-insert-lambda
:which-key "insert lambda")
"me" '(geiser-expand-last-sexp
:which-key "macroexpand last sexp")
"mf" '(geiser-expand-definition
:which-key "macroexpand surrounding sexp")
"mx" '(geiser-expand-region
:which-key "macroexpand region")
"si" '(geiser-mode-switch-to-repl
:which-key "start or switch to repl")
"sb" '(geiser-eval-buffer
:which-key "send buffer to repl")
"sB" '(geiser-eval-buffer-and-go
:which-key "send buffer to repl and focus it")
"sf" '(geiser-eval-definition
:which-key "send definition to repl")
"sF" '(geiser-eval-definition-and-go
:which-key "send definition to repl and focus it")
"se" '(geiser-eval-last-sexp
:which-key "send last sexp to repl")
"sr" '(geiser-eval-region
:which-key "send region to repl")
"sR" '(geiser-eval-region-and-go
:which-key "send region to repl and focus it")
"ss" '(geiser-set-scheme
:which-key "select scheme implementation"))
;(general-define-key
;:states '(normal visual emacs)
;:prefix "SPC m"
;:keymaps 'go-mode-map
;"hh" '(godoc-at-point
;:which-key "godoc at point")
;"ig" '(go-goto-imports
;:which-key "goto imports")
;"ia" '(go-import-add
;:which-key "add imports")
;"ir" '(go-remove-unused-imports
;:which-key "remove unused imports")
;"eb" '(go-play-buffer
;:which-key "go-play buffer")
;"er" '(go-play-region
;:which-key "go-play region")
;"ed" '(go-download-play
;:which-key "download go-play snippet")
;"xx" '(go-run-main
;:which-key "run go run for current main package")
;"ga" '(ff-find-other-file
;:which-key "jump to matching test file or back")
;"gc" '(go-coverage
;:which-key "open a clone of buffer with coverage info")
;"rn" '(go-rename
;:which-key "go rename")
;"fd" '(go-guru-describe
;:which-key "go-guru describe symbol at point")
;"ff" '(go-guru-freevars
;:which-key "go-guru show free variables")
;"fi" '(go-guru-implements
;:which-key "go-guru show implements relation")
;"fc" '(go-guru-peers
;:which-key "go-guru show channel sends/receives")
;"fr" '(go-guru-referrers
;:which-key "go-guru show referrers")
;"fj" '(go-guru-definition
;:which-key "go-guru jump to symbol definition")
;"fp" '(go-guru-pointsto
;:which-key "go-guru show what select expr points to")
;"fs" '(go-guru-callstack
;:which-key "go-guru show call stack")
;"fe" '(go-guru-whicherrs
;:which-key "go-guru show possible constants/types for error value")
;"f<" '(go-guru-callers
;:which-key "go-guru show possible callers")
;"f>" '(go-guru-callees
;:which-key "go-guru show call targets")
;"fo" '(go-guru-set-scope
;:which-key "go-guru set analysis scope"))
;; custom functions
(defun spacemacs/git-link-copy-url-only ()
"Only copy the generated link to the kill ring."
(interactive)
(let (git-link-open-in-browser)
(call-interactively 'spacemacs/git-link)))
(defun spacemacs/git-link-commit-copy-url-only ()
"Only copy the generated link to the kill ring."
(interactive)
(let (git-link-open-in-browser)
(call-interactively 'spacemacs/git-link-commit)))
(defun spacemacs/git-link ()
"Allow the user to run git-link in a git-timemachine buffer."
(interactive)
(require 'git-link)
(if (and (boundp 'git-timemachine-revision)
git-timemachine-revision)
(cl-letf (((symbol-function 'git-link--branch)
(lambda ()
(car git-timemachine-revision))))
(call-interactively 'git-link))
(call-interactively 'git-link)))
(defun spacemacs/git-link-commit ()
"Allow the user to run git-link-commit in a git-timemachine buffer."
(interactive)
(require 'git-link)
(if (and (boundp 'git-timemachine-revision)
git-timemachine-revision)
(cl-letf (((symbol-function 'word-at-point)
(lambda ()
(car git-timemachine-revision))))
(call-interactively 'git-link-commit))
(call-interactively 'git-link-commit)))
(defun go-run-main ()
(interactive)
(shell-command
(format "go run %s"
(shell-quote-argument (buffer-file-name)))))
;; Fancy titlebar for MacOS
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
(add-to-list 'default-frame-alist '(ns-appearance . dark))
(setq ns-use-proxy-icon nil)
(setq frame-title-format nil)
;; Flycheck
(use-package flycheck
:ensure t
:init (global-flycheck-mode))
;; To disable flycheck while working with this file
(setq-default flycheck-disabled-checkers '(emacs-lisp-checkdoc))
;; Company mode
(use-package company
:ensure t
:diminish ""
:init
(add-hook 'after-init-hook 'global-company-mode)
(setq company-minimum-prefix-length 3)
(setq company-auto-complete nil)
(setq company-idle-delay 0)
(setq company-require-match 'never)
(setq company-frontends
'(company-pseudo-tooltip-unless-just-one-frontend
company-preview-frontend company-echo-metadata-frontend))
(setq tab-always-indent 'complete)
(defvar completion-at-point-functions-saved nil)
:config
(global-company-mode 1)
(define-key company-active-map (kbd "TAB")
'company-complete-common-or-cycle)
(define-key company-active-map (kbd "<tab>")
'company-complete-common-or-cycle)
(define-key company-active-map (kbd "S-TAB")
'company-select-previous)
(define-key company-active-map (kbd "<backtab>")
'company-select-previous)
(define-key company-mode-map [remap indent-for-tab-command]
'company-indent-for-tab-command)
(defun company-indent-for-tab-command (&optional arg)
(interactive "P")
(let ((completion-at-point-functions-saved completion-at-point-functions)
(completion-at-point-functions '(company-complete-common-wrapper)))
(indent-for-tab-command arg)))
(defun company-complete-common-wrapper ()
(let ((completion-at-point-functions completion-at-point-functions-saved))
(company-complete-common))))
(use-package company-quickhelp
:init
(company-quickhelp-mode 1))
;; Powerline
(use-package spaceline
:ensure t
:init
(setq powerline-default-separator 'slant)
:config
(spaceline-emacs-theme)
(spaceline-toggle-minor-modes-off)
(spaceline-toggle-buffer-size-off)
(spaceline-toggle-evil-state-on))
;;; Language Support
;; Haskell support
(use-package haskell-mode
:defer t
:init
(electric-indent-mode 0)
:custom
((haskell-process-type 'stack-ghci)
(haskell-process-suggest-remove-import-lines t)
(haskell-process-auto-import-loaded-modules t)
(haskell-process-log t)
(haskell-stylish-on-save t)
(haskell-indentation-layout-offset 4)
(haskell-indentation-starter-offset 4)
(haskell-indentation-left-offset 4)
(haskell-indentation-where-pre-offset 4)
(haskell-indentation-where-post-offset 4)))
(use-package flycheck-haskell
:defer t
:config
(setq-default flycheck-disabled-checkers '(haskell-stack-ghc))
:hook
(haskell-mode . #'flycheck-haskell-setup))
(use-package company-ghci
:defer t
:config
(push 'company-ghci company-backends)
:hook
(haskell-interactive-mode . company-mode))
(use-package hindent
:defer t
:config
(setq-default hindent-reformat-buffer-on-save t)
:hook
(haskell-mode . #'hindent-mode))
(use-package hlint-refactor
:defer t)
(use-package rainbow-delimiters
:ensure t
:hook
(prog-mode-hook . rainbow-delimiters-mode))
;; Rust support
(use-package rust-mode
:defer t
:ensure t
:config
(setq rust-format-on-save t))
(use-package racer
:defer t
:hook
((rust-mode . racer-mode)
(racer-mode . eldoc-mode)
(racer-mode . company-mode)))
(use-package cargo
:defer t)
;; LISP support
(use-package evil-cleverparens
:ensure t)
(use-package parinfer
:ensure t
:init
(progn
(setq parinfer-extensions '(defaults
pretty-parens
evil
paredit
smart-tab
smart-yank)))
:hook
((emacs-lisp-mode . parinfer-mode)
(common-lisp-mode . parinfer-mode)
(lisp-mode . parinfer-mode)
(scheme-mode . parinfer-mode)))
(use-package slime
:commands slime-mode
:init
(progn
(setq slime-contribs '(slime-asdf
slime-fancy
slime-indentation
slime-sbcl-exts
slime-scratch)
inferior-lisp-program "sbcl")
(setq slime-complete-symbol*-fancy t)
(setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol)
(defun slime/disable-smartparens ()
(smartparens-strict-mode -1)
(turn-off-smartparens-mode))
(add-hook 'slime-repl-mode-hook #'slime/disable-smartparens))
:config
(slime-setup))
;; scheme support
(use-package geiser
:defer t
:commands run-geiser
:hook
(scheme-mode . company-mode))
;; go support
;(use-package company-go
;:defer t
;:init
;(progn
;(setq company-go-show-annotation t)
;(push 'company-go company-backends)))
;(use-package go-impl
;:defer t)
;(use-package go-guru
;:defer t)
;(use-package go-mode
;:defer t
;:init
;(setq-local tab-width 8)
;:config
;(add-hook 'before-save-hook 'gofmt-before-save)
;:hook
;(go-mode . company-mode))
;;; init.el ends

301
spacemacs
View File

@ -1,301 +0,0 @@
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
;; or `spacemacs'. (default 'spacemacs)
dotspacemacs-distribution 'spacemacs
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (i.e. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()
;; List of configuration layers to load. If it is the symbol `all' instead
;; of a list then all discovered layers will be installed.
dotspacemacs-configuration-layers
'(shell-scripts
asm
;; ----------------------------------------------------------------
;; Example of useful layers you may want to use right away.
;; Uncomment some layer names and press <SPC f e R> (Vim style) or
;; <M-m f e R> (Emacs style) to install them.
;; ----------------------------------------------------------------
;; better-defaults
;; spell-checking
;; syntax-checking
;; version-control
auto-completion
git
markdown
(shell :variables
shell-default-height 30
shell-default-position 'bottom
shell-default-shell 'eshell
shell-enable-smart-eshell t)
haskell
idris
rust
emacs-lisp
c-c++
python
gtags
latex
)
;; List of additional packages that will be installed without being
;; wrapped in a layer. If you need some configuration for these
;; packages then consider to create a layer, you can also put the
;; configuration in `dotspacemacs/config'.
dotspacemacs-additional-packages '()
;; A list of packages and/or extensions that will not be install and loaded.
dotspacemacs-excluded-packages '()
;; If non-nil spacemacs will delete any orphan packages, i.e. packages that
;; are declared in a layer which is not a member of
;; the list `dotspacemacs-configuration-layers'. (default t)
dotspacemacs-delete-orphan-packages t))
(defun dotspacemacs/init ()
"Initialization function.
This function is called at the very startup of Spacemacs initialization
before layers configuration.
You should not put any user code in there besides modifying the variable
values."
;; This setq-default sexp is an exhaustive list of all the supported
;; spacemacs settings.
(setq-default
;; One of `vim', `emacs' or `hybrid'. Evil is always enabled but if the
;; variable is `emacs' then the `holy-mode' is enabled at startup. `hybrid'
;; uses emacs key bindings for vim's insert mode, but otherwise leaves evil
;; unchanged. (default 'vim)
dotspacemacs-editing-style 'vim
;; If non nil output loading progress in `*Messages*' buffer. (default nil)
dotspacemacs-verbose-loading nil
;; Specify the startup banner. Default value is `official', it displays
;; the official spacemacs logo. An integer value is the index of text
;; banner, `random' chooses a random text banner in `core/banners'
;; directory. A string value must be a path to an image format supported
;; by your Emacs build.
;; If the value is nil then no banner is displayed. (default 'official)
dotspacemacs-startup-banner 'official
;; List of items to show in the startup buffer. If nil it is disabled.
;; Possible values are: `recents' `bookmarks' `projects'.
;; (default '(recents projects))
dotspacemacs-startup-lists '(recents projects)
;; List of themes, the first of the list is loaded when spacemacs starts.
;; Press <SPC> T n to cycle to the next theme in the list (works great
;; with 2 themes variants, one dark and one light)
dotspacemacs-themes '(monokai
spacemacs-dark
spacemacs-light
solarized-light
solarized-dark
leuven
zenburn)
;; If non nil the cursor color matches the state color.
dotspacemacs-colorize-cursor-according-to-state t
;; Default font. `powerline-scale' allows to quickly tweak the mode-line
;; size to make separators look not too crappy.
dotspacemacs-default-font '("Cantarell"
:size 16
:weight normal
:width normal
:powerline-scale 1.1)
;; The leader key
dotspacemacs-leader-key "SPC"
;; The leader key accessible in `emacs state' and `insert state'
;; (default "M-m")
dotspacemacs-emacs-leader-key "M-m"
;; Major mode leader key is a shortcut key which is the equivalent of
;; pressing `<leader> m`. Set it to `nil` to disable it. (default ",")
dotspacemacs-major-mode-leader-key ","
;; Major mode leader key accessible in `emacs state' and `insert state'.
;; (default "C-M-m)
dotspacemacs-major-mode-emacs-leader-key "C-M-m"
;; The command key used for Evil commands (ex-commands) and
;; Emacs commands (M-x).
;; By default the command key is `:' so ex-commands are executed like in Vim
;; with `:' and Emacs commands are executed with `<leader> :'.
dotspacemacs-command-key ":"
;; If non nil `Y' is remapped to `y$'. (default t)
dotspacemacs-remap-Y-to-y$ t
;; Location where to auto-save files. Possible values are `original' to
;; auto-save the file in-place, `cache' to auto-save the file to another
;; file stored in the cache directory and `nil' to disable auto-saving.
;; (default 'cache)
dotspacemacs-auto-save-file-location nil
;; If non nil then `ido' replaces `helm' for some commands. For now only
;; `find-files' (SPC f f), `find-spacemacs-file' (SPC f e s), and
;; `find-contrib-file' (SPC f e c) are replaced. (default nil)
dotspacemacs-use-ido nil
;; If non nil, `helm' will try to miminimize the space it uses. (default nil)
dotspacemacs-helm-resize nil
;; if non nil, the helm header is hidden when there is only one source.
;; (default nil)
dotspacemacs-helm-no-header nil
;; define the position to display `helm', options are `bottom', `top',
;; `left', or `right'. (default 'bottom)
dotspacemacs-helm-position 'bottom
;; If non nil the paste micro-state is enabled. When enabled pressing `p`
;; several times cycle between the kill ring content. (default nil)
dotspacemacs-enable-paste-micro-state nil
;; Which-key delay in seconds. The which-key buffer is the popup listing
;; the commands bound to the current keystroke sequence. (default 0.4)
dotspacemacs-which-key-delay 0.4
;; Which-key frame position. Possible values are `right', `bottom' and
;; `right-then-bottom'. right-then-bottom tries to display the frame to the
;; right; if there is insufficient space it displays it at the bottom.
;; (default 'bottom)
dotspacemacs-which-key-position 'bottom
;; If non nil a progress bar is displayed when spacemacs is loading. This
;; may increase the boot time on some systems and emacs builds, set it to
;; nil to boost the loading time. (default t)
dotspacemacs-loading-progress-bar t
;; If non nil the frame is fullscreen when Emacs starts up. (default nil)
;; (Emacs 24.4+ only)
dotspacemacs-fullscreen-at-startup nil
;; If non nil `spacemacs/toggle-fullscreen' will not use native fullscreen.
;; Use to disable fullscreen animations in OSX. (default nil)
dotspacemacs-fullscreen-use-non-native nil
;; If non nil the frame is maximized when Emacs starts up.
;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil.
;; (default nil) (Emacs 24.4+ only)
dotspacemacs-maximized-at-startup nil
;; A value from the range (0..100), in increasing opacity, which describes
;; the transparency level of a frame when it's active or selected.
;; Transparency can be toggled through `toggle-transparency'. (default 90)
dotspacemacs-active-transparency 90
;; A value from the range (0..100), in increasing opacity, which describes
;; the transparency level of a frame when it's inactive or deselected.
;; Transparency can be toggled through `toggle-transparency'. (default 90)
dotspacemacs-inactive-transparency 90
;; If non nil unicode symbols are displayed in the mode line. (default t)
dotspacemacs-mode-line-unicode-symbols t
;; If non nil smooth scrolling (native-scrolling) is enabled. Smooth
;; scrolling overrides the default behavior of Emacs which recenters the
;; point when it reaches the top or bottom of the screen. (default t)
dotspacemacs-smooth-scrolling t
;; If non-nil smartparens-strict-mode will be enabled in programming modes.
;; (default nil)
dotspacemacs-smartparens-strict-mode nil
;; Select a scope to highlight delimiters. Possible values are `any',
;; `current', `all' or `nil'. Default is `all' (highlight any scope and
;; emphasis the current one). (default 'all)
dotspacemacs-highlight-delimiters 'all
;; If non nil advises quit functions to keep server open when quitting.
;; (default nil)
dotspacemacs-persistent-server nil
;; List of search tool executable names. Spacemacs uses the first installed
;; tool of the list. Supported tools are `ag', `pt', `ack' and `grep'.
;; (default '("ag" "pt" "ack" "grep"))
dotspacemacs-search-tools '("ag" "pt" "ack" "grep")
;; The default package repository used if no explicit repository has been
;; specified with an installed package.
;; Not used for now. (default nil)
dotspacemacs-default-package-repository nil
))
(defun dotspacemacs/user-init ()
"Initialization function for user code.
It is called immediately after `dotspacemacs/init'. You are free to put any
user code."
)
(defun dotspacemacs/user-config ()
"Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration. You are free to put any user code."
(setq-default xterm-query-timeout nil)
(require 'helm-bookmark)
(xterm-mouse-mode -1)
(setq-default tab-width 8 indent-tabs-mode t)
(global-set-key (kbd "TAB") 'self-insert-command)
(when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
(global-auto-revert-mode t)
(windmove-default-keybindings)
(setq windmove-wrap-around t)
(setq TeX-view-program-selection '((output-pdf "Evince")))
(setq TeX-source-correlate-mode t)
(setq TeX-source-correlate-start-server t)
(setq TeX-source-correlate-method 'synctex)
(setq TeX-engine 'xetex)
(require 'desktop)
(defvar my-desktop-session-dir
(concat (getenv "HOME") "/.emacs.d/desktop-sessions/")
"*Directory to save desktop sessions in")
(defvar my-desktop-session-name-hist nil
"Desktop session name history")
(defun my-desktop-save (&optional name)
"Save desktop by name."
(interactive)
(unless name
(setq name (my-desktop-get-session-name "Save session" t)))
(when name
(make-directory (concat my-desktop-session-dir name) t)
(desktop-save (concat my-desktop-session-dir name) t)))
(defun my-desktop-save-and-clear ()
"Save and clear desktop."
(interactive)
(call-interactively 'my-desktop-save)
(desktop-clear)
(setq desktop-dirname nil))
(defun my-desktop-read (&optional name)
"Read desktop by name."
(interactive)
(unless name
(setq name (my-desktop-get-session-name "Load session")))
(when name
(desktop-clear)
(desktop-read (concat my-desktop-session-dir name))))
(defun my-desktop-change (&optional name)
"Change desktops by name."
(interactive)
(let ((name (my-desktop-get-current-name)))
(when name
(my-desktop-save name))
(call-interactively 'my-desktop-read)))
(defun my-desktop-name ()
"Return the current desktop name."
(interactive)
(let ((name (my-desktop-get-current-name)))
(if name
(message (concat "Desktop name: " name))
(message "No named desktop loaded"))))
(defun my-desktop-get-current-name ()
"Get the current desktop name."
(when desktop-dirname
(let ((dirname (substring desktop-dirname 0 -1)))
(when (string= (file-name-directory dirname) my-desktop-session-dir)
(file-name-nondirectory dirname)))))
(defun my-desktop-get-session-name (prompt &optional use-default)
"Get a session name."
(let* ((default (and use-default (my-desktop-get-current-name)))
(full-prompt (concat prompt (if default
(concat " (default " default "): ")
": "))))
(completing-read full-prompt (and (file-exists-p my-desktop-session-dir)
(directory-files my-desktop-session-dir))
nil nil nil my-desktop-session-name-hist default)))
(define-key global-map "\M-[1~" 'beginning-of-line)
(define-key global-map [select] 'end-of-line)
)
;; Do not write anything past this comment. This is where Emacs will
;; auto-generate custom variable definitions.

View File

@ -1,48 +0,0 @@
-- xmobar config originally from Vic Fryzel
-- Author: Vic Fryzel
-- Changes by: Sanchayan Maity
-- http://github.com/SanchayanMaity/xmonad-config
-- This is setup for dual 1920x1080 monitors, with the right monitor as primary
Config {
font = "xft:Ubuntu Mono:size=12:antialias=true",
bgColor = "#000000",
fgColor = "#ffffff",
position = BottomW C 100,
lowerOnStart = True,
commands = [
Run MultiCpu ["-t",
"Cpu: <total0> <total1> <total2> <total3>",
"-L","30",
"-H","60",
"-h","#FFB6B0",
"-l","#CEFFAC",
"-n","#FFFFCC",
"-w","3"] 10,
Run BatteryP ["BAT0"]
["-t", "<acstatus><watts> (<left>%)",
"-L", "10", "-H", "80", "-p", "3",
"--", "-O", "<fc=green>On</fc> - ", "-i", "",
"-L", "-15", "-H", "-5",
"-l", "red", "-m", "blue", "-h", "green"] 600,
Run Memory ["-t",
"Mem: <usedratio>%",
"-H","8192",
"-L","4096",
"-h","#FFB6B0",
"-l","#CEFFAC",
"-n","#FFFFCC"] 10,
Run Swap ["-t",
"Swap: <usedratio>%",
"-H","1024",
"-L","512",
"-h","#FFB6B0",
"-l","#CEFFAC",
"-n","#FFFFCC"] 10,
Run Date "%a %b %_d %l:%M" "date" 10,
Run StdinReader
],
sepChar = "%",
alignSep = "}{",
template = "%StdinReader% }{ %multicpu% %battery% %memory% %swap% <fc=#FFFFCC>%date%</fc>"
}

View File

@ -1,400 +0,0 @@
-- xmonad config originally from Vic Fryzel
-- Author: Vic Fryzel
-- Changes by: Sanchayan Maity
-- http://github.com/SanchayanMaity/xmonad-config
import System.IO
import System.Exit
import XMonad
import XMonad.Actions.CycleWS
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.SetWMName
import XMonad.Layout.Fullscreen
import XMonad.Layout.NoBorders
import XMonad.Layout.Spiral
import XMonad.Layout.Tabbed
import XMonad.Layout.ThreeColumns
import XMonad.Layout.IndependentScreens
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import Graphics.X11.ExtraTypes.XF86
import qualified XMonad.StackSet as W
import qualified Data.Map as M
------------------------------------------------------------------------
-- Terminal
-- The preferred terminal program, which is used in a binding below and by
-- certain contrib modules.
--
myTerminal = "/usr/bin/urxvt"
-- The command to lock the screen or show the screensaver.
myScreensaver = "/usr/bin/gnome-screensaver-command --lock"
-- The command to take a selective screenshot, where you select
-- what you'd like to capture on the screen.
mySelectScreenshot = "scrot ~/Pictures/%Y-%m-%d-%T-screenshot.png"
-- The command to take a fullscreen screenshot.
myScreenshot = "scrot ~/Pictures/%Y-%m-%d-%T-screenshot.png"
-- The command to use as a launcher, to launch commands that don't have
-- preset keybindings.
myLauncher = "$(rofi -show run)"
------------------------------------------------------------------------
-- Workspaces
-- The default number of workspaces (virtual screens) and their names.
--
myWorkspaces = ["1:okular","2:urxvt","3:web","4:code","5:urxvt","6:urxvt","7:urxvt","8:media","9:Misc"]
------------------------------------------------------------------------
-- Window rules
-- Execute arbitrary actions and WindowSet manipulations when managing
-- a new window. You can use this to, for example, always float a
-- particular program, or have a client always appear on a particular
-- workspace.
--
-- To find the property name associated with a program, use
-- > xprop | grep WM_CLASS
-- and click on the client you're interested in.
--
-- To match on the WM_NAME, you can use 'title' in the same way that
-- 'className' and 'resource' are used below.
--
myManageHook = composeAll
[ className =? "Chromium" --> doFloat
, className =? "google-chrome" --> doFloat
, className =? "emacs" --> doFloat
, className =? "transmission-gtk" --> doFloat
, className =? "skypeforlinux" --> doFloat
, className =? "vlc" --> doFloat
, className =? "thunar" --> doFloat
, className =? "okular" --> doFloat
, resource =? "desktop_window" --> doIgnore
, className =? "kcalc" --> doFloat
, className =? "stalonetray" --> doIgnore
, isFullscreen --> (doF W.focusDown <+> doFullFloat)]
------------------------------------------------------------------------
-- Layouts
-- You can specify and transform your layouts by modifying these values.
-- If you change layout bindings be sure to use 'mod-shift-space' after
-- restarting (with 'mod-q') to reset your layout state to the new
-- defaults, as xmonad preserves your old layout settings by default.
--
-- The available layouts. Note that each layout is separated by |||,
-- which denotes layout choice.
--
myLayout = avoidStruts (
ThreeColMid 1 (3/100) (1/2) |||
Tall 1 (3/100) (1/2) |||
Mirror (Tall 1 (3/100) (1/2)) |||
tabbed shrinkText tabConfig |||
Full |||
spiral (6/7)) |||
noBorders (fullscreenFull Full)
------------------------------------------------------------------------
-- Colors and borders
-- Currently based on the ir_black theme.
--
myNormalBorderColor = "#7c7c7c"
myFocusedBorderColor = "#ffb6b0"
-- Colors for text and backgrounds of each tab when in "Tabbed" layout.
tabConfig = def {
activeBorderColor = "#7C7C7C",
activeTextColor = "#CEFFAC",
activeColor = "#000000",
inactiveBorderColor = "#7C7C7C",
inactiveTextColor = "#EEEEEE",
inactiveColor = "#000000"
}
-- Color of current window title in xmobar.
xmobarTitleColor = "#FFB6B0"
-- Color of current workspace in xmobar.
xmobarCurrentWorkspaceColor = "#CEFFAC"
-- Width of the window border in pixels.
myBorderWidth = 1
------------------------------------------------------------------------
-- Key bindings
--
-- modMask lets you specify which modkey you want to use. The default
-- is mod1Mask ("left alt"). You may also consider using mod3Mask
-- ("right alt"), which does not conflict with emacs keybindings. The
-- "windows key" is usually mod4Mask.
--
myModMask = mod4Mask
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
----------------------------------------------------------------------
-- Custom key bindings
--
-- Start a terminal. Terminal to start is specified by myTerminal variable.
[ ((modMask .|. shiftMask, xK_Return),
spawn $ XMonad.terminal conf)
-- Lock the screen using command specified by myScreensaver.
, ((modMask .|. controlMask, xK_l),
spawn myScreensaver)
-- Spawn the launcher using command specified by myLauncher.
-- Use this to launch programs without a key binding.
, ((modMask, xK_p),
spawn myLauncher)
-- Take a selective screenshot using the command specified by mySelectScreenshot.
, ((modMask .|. shiftMask, xK_p),
spawn mySelectScreenshot)
-- Take a full screenshot using the command specified by myScreenshot.
, ((modMask .|. controlMask .|. shiftMask, xK_p),
spawn myScreenshot)
-- Mute volume.
, ((0, xF86XK_AudioMute),
spawn "amixer -q set Master toggle")
-- Decrease volume.
, ((0, xF86XK_AudioLowerVolume),
spawn "amixer -q set Master 5%-")
-- Increase volume.
, ((0, xF86XK_AudioRaiseVolume),
spawn "amixer -q set Master 5%+")
-- Mute volume.
, ((modMask .|. controlMask, xK_m),
spawn "amixer -q set Master toggle")
-- Decrease volume.
, ((modMask .|. controlMask, xK_j),
spawn "amixer -q set Master 10%-")
-- Increase volume.
, ((modMask .|. controlMask, xK_k),
spawn "amixer -q set Master 10%+")
-- Audio previous.
, ((0, 0x1008FF16),
spawn "")
-- Play/pause.
, ((0, 0x1008FF14),
spawn "")
-- Audio next.
, ((0, 0x1008FF17),
spawn "")
-- Eject CD tray.
, ((0, 0x1008FF2C),
spawn "eject -T")
-- Increase brightness.
, ((0, xF86XK_MonBrightnessUp),
spawn "exec xbacklight -inc 5")
-- Decrease brightness.
, ((0, xF86XK_MonBrightnessDown),
spawn "exec xbacklight -dec 5")
--------------------------------------------------------------------
-- "Standard" xmonad key bindings
--
-- Close focused window.
, ((modMask .|. shiftMask, xK_q),
kill)
-- Cycle through the available layout algorithms.
, ((modMask, xK_space),
sendMessage NextLayout)
-- Reset the layouts on the current workspace to default.
, ((modMask .|. shiftMask, xK_space),
setLayout $ XMonad.layoutHook conf)
-- Resize viewed windows to the correct size.
, ((modMask, xK_n),
refresh)
-- Move focus to the next window.
, ((modMask, xK_Tab),
windows W.focusDown)
-- Move focus to the next window.
, ((modMask, xK_j),
windows W.focusDown)
-- Move focus to the previous window.
, ((modMask, xK_k),
windows W.focusUp )
-- Move focus to the master window.
, ((modMask, xK_m),
windows W.focusMaster )
-- Swap the focused window and the master window.
, ((modMask, xK_Return),
windows W.swapMaster)
-- Swap the focused window with the next window.
, ((modMask .|. shiftMask, xK_j),
windows W.swapDown )
-- Swap the focused window with the previous window.
, ((modMask .|. shiftMask, xK_k),
windows W.swapUp )
-- Shrink the master area.
, ((modMask, xK_h),
sendMessage Shrink)
-- Expand the master area.
, ((modMask, xK_l),
sendMessage Expand)
-- Push window back into tiling.
, ((modMask, xK_t),
withFocused $ windows . W.sink)
-- Increment the number of windows in the master area.
, ((modMask, xK_comma),
sendMessage (IncMasterN 1))
-- Decrement the number of windows in the master area.
, ((modMask, xK_period),
sendMessage (IncMasterN (-1)))
-- Toggle the status bar gap.
-- TODO: update this binding with avoidStruts, ((modMask, xK_b),
-- Quit xmonad.
, ((modMask .|. shiftMask, xK_c),
io (exitWith ExitSuccess))
-- Restart xmonad.
, ((modMask, xK_q),
restart "xmonad" True)
]
++
-- mod-[1..9], Switch to workspace N
-- mod-shift-[1..9], Move client to workspace N
[((m .|. modMask, k), windows $ f i)
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
++
-- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
-- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
[((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
| (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
------------------------------------------------------------------------
-- Mouse bindings
--
-- Focus rules
-- True if your focus should follow your mouse cursor.
myFocusFollowsMouse :: Bool
myFocusFollowsMouse = True
myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $
[
-- mod-button1, Set the window to floating mode and move by dragging
((modMask, button1),
(\w -> focus w >> mouseMoveWindow w))
-- mod-button2, Raise the window to the top of the stack
, ((modMask, button2),
(\w -> focus w >> windows W.swapMaster))
-- mod-button3, Set the window to floating mode and resize by dragging
, ((modMask, button3),
(\w -> focus w >> mouseResizeWindow w))
-- you may also bind events to the mouse scroll wheel (button4 and button5)
]
------------------------------------------------------------------------
-- Status bars and logging
-- Perform an arbitrary action on each internal state change or X event.
-- See the 'DynamicLog' extension for examples.
--
-- To emulate dwm's status bar
--
-- > logHook = dynamicLogDzen
--
------------------------------------------------------------------------
-- Startup hook
-- Perform an arbitrary action each time xmonad starts or is restarted
-- with mod-q. Used by, e.g., XMonad.Layout.PerWorkspace to initialize
-- per-workspace layout choices.
--
-- By default, do nothing.
myStartupHook =
spawn "compton -f"
------------------------------------------------------------------------
-- Run xmonad with all the defaults we set up.
--
main = do
xmproc <- spawnPipe "xmobar ~/.xmonad/xmobar.hs"
xmonad $ defaults {
logHook = dynamicLogWithPP $ xmobarPP {
ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor xmobarTitleColor "" . shorten 100
, ppCurrent = xmobarColor xmobarCurrentWorkspaceColor ""
, ppSep = " "
}
, manageHook = manageDocks <+> myManageHook
, startupHook = setWMName "LG3D" <+> myStartupHook
}
------------------------------------------------------------------------
-- Combine it all together
-- A structure containing your configuration settings, overriding
-- fields in the default config. Any you don't override, will
-- use the defaults defined in xmonad/XMonad/Config.hs
--
-- No need to modify this.
--
defaults = def {
-- simple stuff
terminal = myTerminal,
focusFollowsMouse = myFocusFollowsMouse,
borderWidth = myBorderWidth,
modMask = myModMask,
workspaces = myWorkspaces,
normalBorderColor = myNormalBorderColor,
focusedBorderColor = myFocusedBorderColor,
-- key bindings
keys = myKeys,
mouseBindings = myMouseBindings,
-- hooks, layouts
layoutHook = smartBorders $ myLayout,
manageHook = myManageHook,
startupHook = myStartupHook
}