summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/i3/config~226
-rw-r--r--.emacs.d/.gitignore3
-rw-r--r--.emacs.d/.gitignore~1
-rw-r--r--.emacs.d/TODO.md~0
-rw-r--r--.emacs.d/auto-save-list/.saves-1063-steve~8
-rw-r--r--.emacs.d/auto-save-list/.saves-1119-steve~8
-rw-r--r--.emacs.d/auto-save-list/.saves-1187-steve~6
-rw-r--r--.emacs.d/auto-save-list/.saves-12850-steve~2
-rw-r--r--.emacs.d/auto-save-list/.saves-1490-steve~4
-rw-r--r--.emacs.d/auto-save-list/.saves-2594-steve~2
-rw-r--r--.emacs.d/auto-save-list/.saves-4830-steve~2
-rw-r--r--.emacs.d/auto-save-list/.saves-655-steve~4
-rw-r--r--.emacs.d/auto-save-list/.saves-833-steve~2
-rw-r--r--.emacs.d/auto-save-list/.saves-859-steve~2
-rw-r--r--.emacs.d/custom.el21
-rw-r--r--.emacs.d/custom.el~21
-rw-r--r--.emacs.d/init.el~70
-rw-r--r--.emacs.d/lisp/init-company.el1
-rw-r--r--.emacs.d/lisp/init-company.el~0
-rw-r--r--.emacs.d/lisp/init-elpa.el112
-rw-r--r--.emacs.d/lisp/init-elpa.el~0
-rw-r--r--.emacs.d/lisp/init-evil.el3
-rw-r--r--.emacs.d/lisp/init-evil.el~47
-rw-r--r--.emacs.d/lisp/init-expand-region.el2
-rw-r--r--.emacs.d/lisp/init-expand-region.el~8
-rw-r--r--.emacs.d/lisp/init-flycheck.el2
-rw-r--r--.emacs.d/lisp/init-flycheck.el~13
-rw-r--r--.emacs.d/lisp/init-helm.el1
-rw-r--r--.emacs.d/lisp/init-helm.el~15
-rw-r--r--.emacs.d/lisp/init-neotree.el2
-rw-r--r--.emacs.d/lisp/init-neotree.el~11
-rw-r--r--.emacs.d/lisp/init-org.el~55
-rw-r--r--.emacs.d/lisp/init-program-basic.el~53
-rw-r--r--.emacs.d/lisp/init-slime.el2
-rw-r--r--.emacs.d/lisp/init-slime.el~13
-rw-r--r--.emacs.d/lisp/init-window-numbering.el2
-rw-r--r--.emacs.d/lisp/init-window-numbering.el~3
-rw-r--r--.gitignore1
38 files changed, 120 insertions, 608 deletions
diff --git a/.config/i3/config~ b/.config/i3/config~
deleted file mode 100644
index 52d703a..0000000
--- a/.config/i3/config~
+++ /dev/null
@@ -1,226 +0,0 @@
-# This file has been auto-generated by i3-config-wizard(1).
-# It will not be overwritten, so edit it as you like.
-#
-# Should you change your keyboard layout some time, delete
-# this file and re-run i3-config-wizard(1).
-#
-
-# i3 config file (v4)
-#
-# Please see http://i3wm.org/docs/userguide.html for a complete reference!
-set $mod Mod4
-set $alt Mod1
-
-# Font for window titles. Will also be used by the bar unless a different font
-# is used in the bar {} block below.
-# This font is widely installed, provides lots of unicode glyphs, right-to-left
-# text rendering and scalability on retina/hidpi displays (thanks to pango).
-font pango:DejaVu Sans Mono 8
-# Before i3 v4.8, we used to recommend this one as the default:
-# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
-# The font above is very space-efficient, that is, it looks good, sharp and
-# clear in small sizes. However, its unicode glyph coverage is limited, the old
-# X core fonts rendering does not support right-to-left and this being a bitmap
-# font, it doesn’t scale on retina/hidpi displays.
-
-# Use Mouse+$mod to drag floating windows to their wanted position
-floating_modifier $mod
-
-# start a terminal
-bindsym $mod+Return exec i3-sensible-terminal --hide-menubar --hide-tabbar
-#bindsym $mod+Return exec konsole --enable-transparency
-
-# kill focused window
-bindsym $mod+Shift+q kill
-
-# start dmenu (a program launcher)
-bindsym $mod+d exec dmenu_run
-# There also is the (new) i3-dmenu-desktop which only displays applications
-# shipping a .desktop file. It is a wrapper around dmenu, so you need that
-# installed.
-# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
-
-# change focus
-bindsym $mod+h focus left
-bindsym $mod+j focus down
-bindsym $mod+k focus up
-bindsym $mod+l focus right
-
-# alternatively, you can use the cursor keys:
-# bindsym $mod+Left focus left
-# bindsym $mod+Down focus down
-# bindsym $mod+Up focus up
-# bindsym $mod+Right focus right
-
-# move focused window
-bindsym $mod+Shift+h move left
-bindsym $mod+Shift+j move down
-bindsym $mod+Shift+k move up
-bindsym $mod+Shift+l move right
-
-# alternatively, you can use the cursor keys:
-# bindsym $mod+Shift+Left move left
-# bindsym $mod+Shift+Down move down
-# bindsym $mod+Shift+Up move up
-# bindsym $mod+Shift+Right move right
-
-# split in horizontal orientation
-bindsym $mod+Up split h
-
-# split in vertical orientation
-bindsym $mod+Down split v
-
-# enter fullscreen mode for the focused container
-bindsym $mod+f fullscreen
-
-# change container layout (stacked, tabbed, toggle split)
-bindsym $mod+s layout stacking
-bindsym $mod+w layout tabbed
-bindsym $mod+e layout toggle split
-
-# toggle tiling / floating
-bindsym $mod+Shift+space floating toggle
-
-# change focus between tiling / floating windows
-bindsym $mod+space focus mode_toggle
-
-# focus the parent container
-bindsym $mod+a focus parent
-
-# focus the child container
-#bindsym $mod+d focus child
-
-
-# switch to workspace
-bindsym $mod+1 workspace 1
-bindsym $mod+2 workspace 2
-bindsym $mod+3 workspace 3
-bindsym $mod+4 workspace 4
-bindsym $mod+5 workspace 5
-bindsym $mod+6 workspace 6
-bindsym $mod+7 workspace 7
-bindsym $mod+8 workspace 8
-bindsym $mod+9 workspace 9
-bindsym $mod+0 workspace 10
-bindsym $mod+Left workspace prev
-bindsym $mod+Right workspace next
-
-# move focused container to workspace
-bindsym $mod+Shift+1 move container to workspace 1
-bindsym $mod+Shift+2 move container to workspace 2
-bindsym $mod+Shift+3 move container to workspace 3
-bindsym $mod+Shift+4 move container to workspace 4
-bindsym $mod+Shift+5 move container to workspace 5
-bindsym $mod+Shift+6 move container to workspace 6
-bindsym $mod+Shift+7 move container to workspace 7
-bindsym $mod+Shift+8 move container to workspace 8
-bindsym $mod+Shift+9 move container to workspace 9
-bindsym $mod+Shift+0 move container to workspace 10
-
-# reload the configuration file
-bindsym $mod+Shift+c reload
-# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
-bindsym $mod+Shift+r restart
-# exit i3 (logs you out of your X session)
-bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
-
-# resize window (you can also use the mouse for that)
-mode "resize" {
- # These bindings trigger as soon as you enter the resize mode
-
- # Pressing left will shrink the window’s width.
- # Pressing right will grow the window’s width.
- # Pressing up will shrink the window’s height.
- # Pressing down will grow the window’s height.
- bindsym j resize shrink width 10 px or 10 ppt
- bindsym k resize grow height 10 px or 10 ppt
- bindsym l resize shrink height 10 px or 10 ppt
- bindsym semicolon resize grow width 10 px or 10 ppt
-
- # same bindings, but for the arrow keys
- bindsym Left resize shrink width 10 px or 10 ppt
- bindsym Down resize grow height 10 px or 10 ppt
- bindsym Up resize shrink height 10 px or 10 ppt
- bindsym Right resize grow width 10 px or 10 ppt
-
- # back to normal: Enter or Escape
- bindsym Return mode "default"
- bindsym Escape mode "default"
-}
-
-bindsym $mod+r mode "resize"
-
-# Start i3bar to display a workspace bar (plus the system information i3status
-# finds out, if available)
-bar {
- status_command /home/stevelee/.i3/i3script.sh
- status_command i3status
- mode hide
- hidden_state hide
- modifier Mod1
-}
-
-
-# Personal config
-# Start fcitx when start i3wm
-exec --no-startup-id fcitx
-exec --no-startup-id xsetroot -solid "#333333"
-exec --no-startup-id xcape -e 'Control_L=Escape'
-exec --no-startup-id xcape -e "Shift_L=parenleft;Shift_R=parenright"
-
-# dropbox
-exec --no-startup-id dropbox
-
-# xmodmap
-exec --no-startup-id xmodmap /home/steve/.xmodmap
-
-# Start the nm-applet
-exec --no-startup-id nm-applet
-
-exec --no-startup-id xcompmgr -c -f -n
-# exec --no-startup-id feh --bg-center /home/stevelee/Pictures/background/evil-corp-qhd-1280x1024.jpg
-
-# bindsym $mod+p exec xrandr --output VGA1 --auto && xrandr --output LVDS1 --off && feh --bg-center /home/stevelee/Pictures/background/evil-corp-qhd-1280x1024.jpg
-bindsym $mod+p exec xrandr --output DP1 --auto && xrandr --output eDP1 --off && feh --bg-center /home/stevelee/Pictures/background/evil-corp-qhd-1280x1024.jpg
-# bindsym $mod+i exec xrandr --output LVDS1 --auto && xrandr --output VGA1 --off
-bindsym $mod+i exec xrandr --output eDP1 --auto && xrandr --output DP1 --off
-# bindsym $mod+u exec xrandr --output VGA1 --auto --right-of LVDS1 && feh --bg-center /home/stevelee/Pictures/background/evil-corp-qhd-1280x1024.jpg
-bindsym $mod+u exec xrandr --output DP1 --auto --right-of eDP1 && feh --bg-center /home/stevelee/Pictures/background/evil-corp-qhd-1280x1024.jpg
-bindsym $mod+Shift+u exec xrandr --output VGA1 --auto --left-of LVDS1 && feh --bg-center /home/stevelee/Pictures/background/evil-corp-qhd-1280x1024.jpg
-
-
-#exec --no-startup-id wicd-gtk
-
-hide_edge_borders both
-
-for_window [class="^.*"] border pixel 1
-new_window 1pixel
-
-# $mod + o to launch program.
-bindsym $mod+o mode "$mode_launcher"
-
-mode "$mode_launcher" {
- bindsym f exec firefox-esr
- bindsym b exec chromium
- bindsym p exec ~/Code/PhpStorm/bin/phpstorm.sh
- bindsym c exec ~/Tools/pycharm-2016.3/bin/pycharm.sh
- bindsym v exec gvim
- bindsym m exec netease-cloud-music
- bindsym w exec ~/software/electronic-wechat-linux-x64/electronic-wechat
- bindsym x exec ~/Tools/xmind/XMind_amd64/XMind
-
- bindsym Escape mode "default"
- bindsym Return mode "default"
-}
-
-# Control key bind
-bindsym XF86AudioMute exec amixer -q set Master toggle
-bindsym XF86AudioRaiseVolume exec amixer -q set Master 2%+ unmute
-bindsym XF86AudioLowerVolume exec amixer -q set Master 2%- unmute
-bindsym XF86MonBrightnessDown exec xbacklight -10
-bindsym XF86MonBrightnessUp exec xbacklight +10
-# bindsym Super_L + P
-# bindsym Super_L + Tab
-# bindsym Turns Keyboard backlight on/off
-# bindsym Print
-# bindsym Insert
diff --git a/.emacs.d/.gitignore b/.emacs.d/.gitignore
index 95bc89c..9029749 100644
--- a/.emacs.d/.gitignore
+++ b/.emacs.d/.gitignore
@@ -1 +1,4 @@
+custom.el
+*~
elpa/
+elpa*
diff --git a/.emacs.d/.gitignore~ b/.emacs.d/.gitignore~
deleted file mode 100644
index ffe32fa..0000000
--- a/.emacs.d/.gitignore~
+++ /dev/null
@@ -1 +0,0 @@
-./elpa
diff --git a/.emacs.d/TODO.md~ b/.emacs.d/TODO.md~
deleted file mode 100644
index e69de29..0000000
--- a/.emacs.d/TODO.md~
+++ /dev/null
diff --git a/.emacs.d/auto-save-list/.saves-1063-steve~ b/.emacs.d/auto-save-list/.saves-1063-steve~
deleted file mode 100644
index 5c12ae2..0000000
--- a/.emacs.d/auto-save-list/.saves-1063-steve~
+++ /dev/null
@@ -1,8 +0,0 @@
-/home/steve/tmp/review/Lao_Lao/ctrip.py
-/home/steve/tmp/review/Lao_Lao/#ctrip.py#
-/home/steve/tmp/review/Fiesta_Resort/ctrip.py
-/home/steve/tmp/review/Fiesta_Resort/#ctrip.py#
-/home/steve/tmp/review/Hyatt/ctrip.py
-/home/steve/tmp/review/Hyatt/#ctrip.py#
-/home/steve/tmp/review/Kensington_Hotel_Saipan/ctrip.py
-/home/steve/tmp/review/Kensington_Hotel_Saipan/#ctrip.py#
diff --git a/.emacs.d/auto-save-list/.saves-1119-steve~ b/.emacs.d/auto-save-list/.saves-1119-steve~
deleted file mode 100644
index fe9f0ec..0000000
--- a/.emacs.d/auto-save-list/.saves-1119-steve~
+++ /dev/null
@@ -1,8 +0,0 @@
-/home/steve/tmp/Final/141160029李向阳/solution_4.py
-/home/steve/tmp/Final/141160029李向阳/#solution_4.py#
-/home/steve/tmp/Final/141160029李向阳/solution_3.py
-/home/steve/tmp/Final/141160029李向阳/#solution_3.py#
-/home/steve/tmp/Final/141160029李向阳/solution_2.py
-/home/steve/tmp/Final/141160029李向阳/#solution_2.py#
-/home/steve/tmp/Final/141160029李向阳/solution_1.py
-/home/steve/tmp/Final/141160029李向阳/#solution_1.py#
diff --git a/.emacs.d/auto-save-list/.saves-1187-steve~ b/.emacs.d/auto-save-list/.saves-1187-steve~
deleted file mode 100644
index 893dee7..0000000
--- a/.emacs.d/auto-save-list/.saves-1187-steve~
+++ /dev/null
@@ -1,6 +0,0 @@
-/home/steve/Code/env_model/Model.py
-/home/steve/Code/env_model/#Model.py#
-/home/steve/Code/env_model/DatabaseManager.py
-/home/steve/Code/env_model/#DatabaseManager.py#
-/home/steve/Code/env_model/sql.py
-/home/steve/Code/env_model/#sql.py#
diff --git a/.emacs.d/auto-save-list/.saves-12850-steve~ b/.emacs.d/auto-save-list/.saves-12850-steve~
deleted file mode 100644
index 94b5090..0000000
--- a/.emacs.d/auto-save-list/.saves-12850-steve~
+++ /dev/null
@@ -1,2 +0,0 @@
-/home/steve/Dropbox/Courses/Computer Networks/lab/lab-1-wireshark.txt
-/home/steve/Dropbox/Courses/Computer Networks/lab/#lab-1-wireshark.txt#
diff --git a/.emacs.d/auto-save-list/.saves-1490-steve~ b/.emacs.d/auto-save-list/.saves-1490-steve~
deleted file mode 100644
index 550b8ed..0000000
--- a/.emacs.d/auto-save-list/.saves-1490-steve~
+++ /dev/null
@@ -1,4 +0,0 @@
-/home/steve/Code/env_model/main.py
-/home/steve/Code/env_model/#main.py#
-/home/steve/Code/env_model/Model.py
-/home/steve/Code/env_model/#Model.py#
diff --git a/.emacs.d/auto-save-list/.saves-2594-steve~ b/.emacs.d/auto-save-list/.saves-2594-steve~
deleted file mode 100644
index 5152968..0000000
--- a/.emacs.d/auto-save-list/.saves-2594-steve~
+++ /dev/null
@@ -1,2 +0,0 @@
-/home/steve/.emacs.d/init.el
-/home/steve/.emacs.d/#init.el#
diff --git a/.emacs.d/auto-save-list/.saves-4830-steve~ b/.emacs.d/auto-save-list/.saves-4830-steve~
deleted file mode 100644
index ffcd50d..0000000
--- a/.emacs.d/auto-save-list/.saves-4830-steve~
+++ /dev/null
@@ -1,2 +0,0 @@
-/home/steve/tmp/review/Kensington_Hotel_Saipan/ctrip.py
-/home/steve/tmp/review/Kensington_Hotel_Saipan/#ctrip.py#
diff --git a/.emacs.d/auto-save-list/.saves-655-steve~ b/.emacs.d/auto-save-list/.saves-655-steve~
deleted file mode 100644
index 550b8ed..0000000
--- a/.emacs.d/auto-save-list/.saves-655-steve~
+++ /dev/null
@@ -1,4 +0,0 @@
-/home/steve/Code/env_model/main.py
-/home/steve/Code/env_model/#main.py#
-/home/steve/Code/env_model/Model.py
-/home/steve/Code/env_model/#Model.py#
diff --git a/.emacs.d/auto-save-list/.saves-833-steve~ b/.emacs.d/auto-save-list/.saves-833-steve~
deleted file mode 100644
index a91f696..0000000
--- a/.emacs.d/auto-save-list/.saves-833-steve~
+++ /dev/null
@@ -1,2 +0,0 @@
-/home/steve/Code/env_model/main.py
-/home/steve/Code/env_model/#main.py#
diff --git a/.emacs.d/auto-save-list/.saves-859-steve~ b/.emacs.d/auto-save-list/.saves-859-steve~
deleted file mode 100644
index cb085fa..0000000
--- a/.emacs.d/auto-save-list/.saves-859-steve~
+++ /dev/null
@@ -1,2 +0,0 @@
-/home/steve/tmp/review/ctrip/ctrip.py
-/home/steve/tmp/review/ctrip/#ctrip.py#
diff --git a/.emacs.d/custom.el b/.emacs.d/custom.el
deleted file mode 100644
index 18431b0..0000000
--- a/.emacs.d/custom.el
+++ /dev/null
@@ -1,21 +0,0 @@
-;;; company --- All custom configuration
-
-;;; Commentary:
-
-;;; Code:
-
-(custom-set-variables
- ;; custom-set-variables was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
- '(inhibit-startup-screen t)
- '(package-selected-packages
- (quote
- (slime evil window-numbering scala-mode oceanic-theme neotree helm flycheck expand-region evil-leader company))))
-(custom-set-faces
- ;; custom-set-faces was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
- )
diff --git a/.emacs.d/custom.el~ b/.emacs.d/custom.el~
deleted file mode 100644
index 18431b0..0000000
--- a/.emacs.d/custom.el~
+++ /dev/null
@@ -1,21 +0,0 @@
-;;; company --- All custom configuration
-
-;;; Commentary:
-
-;;; Code:
-
-(custom-set-variables
- ;; custom-set-variables was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
- '(inhibit-startup-screen t)
- '(package-selected-packages
- (quote
- (slime evil window-numbering scala-mode oceanic-theme neotree helm flycheck expand-region evil-leader company))))
-(custom-set-faces
- ;; custom-set-faces was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
- )
diff --git a/.emacs.d/init.el~ b/.emacs.d/init.el~
deleted file mode 100644
index 99dffce..0000000
--- a/.emacs.d/init.el~
+++ /dev/null
@@ -1,70 +0,0 @@
-;;; package --- My .emacs.d init. 2017.12.12
-;;; Commentary:
-;; -*- coding: utf-8 -*-
-
-;;; Code:
-
-;; Base config
-
-;; Added by Package.el. This must come before configurations of
-;; installed packages. Don't delete this line. If you don't want it,
-;; just comment it out by adding a semicolon to the start of the line.
-;; You may delete these explanatory comments.
-;; (package-initialize)
-(setq debug-on-error t)
-
-;; Path
-(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))
-
-(menu-bar-mode -1)
-(tool-bar-mode -1)
-(scroll-bar-mode -1)
-(blink-cursor-mode -1)
-
-
-;; Line number
-;; (global-linum-mode 1)
-;; Disable visual bell
-(setq ring-bell-function 'ignore)
-;; Transparent
-;;(set-frame-parameter (selected-frame) 'alpha '(85 . 50))
-;;(add-to-list 'default-frame-alist '(alpha . (85 . 50)))
-
-;; Personal information
-(setq user-full-name "李向阳 141160029"
- user-mail-address "me@xiangyangli.com")
-
-;; Bootstrap
-(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
-
-;; (setq emacs-load-start-time (current-time))
-
-(let ((file-name-handler-alist nil))
- (require 'init-elpa)
- (require 'init-evil)
- (require 'init-org)
- (require 'init-program-basic)
- (require 'init-company)
- (require 'init-flycheck)
- (require 'init-expand-region)
- (require 'init-helm)
- (require 'init-neotree)
- (require 'init-window-numbering))
-
-;; Theme
-(load-theme 'misterioso t)
-;; Make highlight color differ from the highlight line
-
-;; Highlight current line, and keep syntax hightlight(:interit nil)
-(when window-system
- (global-hl-line-mode))
-(set-face-attribute 'hl-line nil :inherit nil :background "gray13")
-
-;;----------------------------------------------------------------------------
-;; Variables configured via the interactive 'customize' interface
-;;----------------------------------------------------------------------------
-(when (file-exists-p custom-file)
- (load custom-file))
-
-(provide 'init)
-;;; init.el ends here
diff --git a/.emacs.d/lisp/init-company.el b/.emacs.d/lisp/init-company.el
index c6579b4..df6dc5e 100644
--- a/.emacs.d/lisp/init-company.el
+++ b/.emacs.d/lisp/init-company.el
@@ -4,6 +4,7 @@
;;; Code:
+(package-install 'company)
(global-company-mode)
(provide 'init-company)
diff --git a/.emacs.d/lisp/init-company.el~ b/.emacs.d/lisp/init-company.el~
deleted file mode 100644
index e69de29..0000000
--- a/.emacs.d/lisp/init-company.el~
+++ /dev/null
diff --git a/.emacs.d/lisp/init-elpa.el b/.emacs.d/lisp/init-elpa.el
index 1430955..a6ee481 100644
--- a/.emacs.d/lisp/init-elpa.el
+++ b/.emacs.d/lisp/init-elpa.el
@@ -1,15 +1,113 @@
+;;; init-elpa.el --- Settings and helpers for package.el -*- lexical-binding: t -*-
+;;; Commentary:
+;;; Code:
-;;; elpa
+(require 'package)
-;;;
+
+;;; Install into separate package dirs for each Emacs version, to prevent bytecode incompatibility
+(let ((versioned-package-dir
+ (expand-file-name (format "elpa-%s.%s" emacs-major-version emacs-minor-version)
+ user-emacs-directory)))
+ (setq package-user-dir versioned-package-dir))
-;;;
-(require 'package)
-(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
+
+;;; Standard package repositories
+
+(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
+ (not (gnutls-available-p))))
+ (proto (if no-ssl "http" "https")))
+ (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
+ ;; Official MELPA Mirror, in case necessary.
+ ;;(add-to-list 'package-archives (cons "melpa-mirror" (concat proto "://www.mirrorservice.org/sites/melpa.org/packages/")) t)
+ (if (< emacs-major-version 24)
+ ;; For important compatibility libraries like cl-lib
+ (add-to-list 'package-archives '("gnu" . (concat proto "://elpa.gnu.org/packages/")))
+ (unless no-ssl
+ ;; Force SSL for GNU ELPA
+ (setcdr (assoc "gnu" package-archives) "https://elpa.gnu.org/packages/"))))
+
+
+;;; On-demand installation of packages
+
+(require 'cl-lib)
+
+(defun require-package (package &optional min-version no-refresh)
+ "Install given PACKAGE, optionally requiring MIN-VERSION.
+If NO-REFRESH is non-nil, the available package lists will not be
+re-downloaded in order to locate PACKAGE."
+ (or (package-installed-p package min-version)
+ (let* ((known (cdr (assoc package package-archive-contents)))
+ (versions (mapcar #'package-desc-version known)))
+ (if (cl-find-if (lambda (v) (version-list-<= min-version v)) versions)
+ (package-install package)
+ (if no-refresh
+ (error "No version of %s >= %S is available" package min-version)
+ (package-refresh-contents)
+ (require-package package min-version t))))))
+
+(defun maybe-require-package (package &optional min-version no-refresh)
+ "Try to install PACKAGE, and return non-nil if successful.
+In the event of failure, return nil and print a warning message.
+Optionally require MIN-VERSION. If NO-REFRESH is non-nil, the
+available package lists will not be re-downloaded in order to
+locate PACKAGE."
+ (condition-case err
+ (require-package package min-version no-refresh)
+ (error
+ (message "Couldn't install optional package `%s': %S" package err)
+ nil)))
+
+
+;;; Fire up package.el
+
+(setq package-enable-at-startup nil)
(package-initialize)
-(provide 'init-elpa)
-;;; init-elpa.el ends here
+
+;; package.el updates the saved version of package-selected-packages correctly only
+;; after custom-file has been loaded, which is a bug. We work around this by adding
+;; the required packages to package-selected-packages after startup is complete.
+(defvar sanityinc/required-packages nil)
+(defun sanityinc/note-selected-package (oldfun package &rest args)
+ "If OLDFUN reports PACKAGE was successfully installed, note it in `sanityinc/required-packages'."
+ (let ((available (apply oldfun package args)))
+ (prog1 available
+ (when (and available (boundp 'package-selected-packages))
+ (add-to-list 'sanityinc/required-packages package)))))
+
+(advice-add 'require-package :around 'sanityinc/note-selected-package)
+
+(when (fboundp 'package--save-selected-packages)
+ (require-package 'seq)
+ (add-hook 'after-init-hook
+ (lambda () (package--save-selected-packages
+ (seq-uniq (append sanityinc/required-packages package-selected-packages))))))
+
+
+(require-package 'fullframe)
+(fullframe list-packages quit-window)
+
+
+(defun sanityinc/set-tabulated-list-column-width (col-name width)
+ "Set any column with name COL-NAME to the given WIDTH."
+ (when (> width (length col-name))
+ (cl-loop for column across tabulated-list-format
+ when (string= col-name (car column))
+ do (setf (elt column 1) width))))
+
+(defun sanityinc/maybe-widen-package-menu-columns ()
+ "Widen some columns of the package menu table to avoid truncation."
+ (when (boundp 'tabulated-list-format)
+ (sanityinc/set-tabulated-list-column-width "Version" 13)
+ (let ((longest-archive-name (apply 'max (mapcar 'length (mapcar 'car package-archives)))))
+ (sanityinc/set-tabulated-list-column-width "Archive" longest-archive-name))))
+
+(add-hook 'package-menu-mode-hook 'sanityinc/maybe-widen-package-menu-columns)
+
+
+(provide 'init-elpa)
+;;; init-elpa.el ends here
diff --git a/.emacs.d/lisp/init-elpa.el~ b/.emacs.d/lisp/init-elpa.el~
deleted file mode 100644
index e69de29..0000000
--- a/.emacs.d/lisp/init-elpa.el~
+++ /dev/null
diff --git a/.emacs.d/lisp/init-evil.el b/.emacs.d/lisp/init-evil.el
index 7463dd0..cd57a7e 100644
--- a/.emacs.d/lisp/init-evil.el
+++ b/.emacs.d/lisp/init-evil.el
@@ -4,7 +4,8 @@
;;; Code:
-(package-install 'evil)
+(require-package 'evil)
+(require-package 'evil-leader)
;; Evil leader, more evil
(global-evil-leader-mode)
(require 'evil)
diff --git a/.emacs.d/lisp/init-evil.el~ b/.emacs.d/lisp/init-evil.el~
deleted file mode 100644
index 6e3ecbd..0000000
--- a/.emacs.d/lisp/init-evil.el~
+++ /dev/null
@@ -1,47 +0,0 @@
-;;; init-evil --- All config of evil-mode
-
-;;; Commentary:
-
-;;; Code:
-
-(package-install 'evil)
-;; Evil leader, more evil
-(global-evil-leader-mode)
-(require 'evil)
-(evil-mode 1)
-
-;; TODO function and keybinding to open file in new window
-;; TODO combined keybindings
-
-(evil-leader/set-leader ";")
-(evil-leader/set-key
- "ss" 'evil-scroll-line-down
- "s" 'save-buffer
- "c" 'execute-c-program
- "e" 'find-file
- "b" 'switch-to-buffer
- "q" 'quit-window
- "e" 'er/expand-region
- "f" 'google-search
- "t" 'test-function
-
- ;; switch window
- "0" 'select-window-0
- "1" 'select-window-1
- "2" 'select-window-2
- "3" 'select-window-3
- "4" 'select-window-4
- "5" 'select-window-5
- "6" 'select-window-6
- "7" 'select-window-7
- "8" 'select-window-8
- "9" 'select-window-9)
-
-(defun google-search ()
- (interactive)
- (let (url)
- (setq url (read-string "Enter search content:"))
- (browse-url-firefox (concat "https://www.google.com/search?q=" url))))
-
-(provide 'init-evil)
-;;; init-evil ends here
diff --git a/.emacs.d/lisp/init-expand-region.el b/.emacs.d/lisp/init-expand-region.el
index 05b3ac0..19064d2 100644
--- a/.emacs.d/lisp/init-expand-region.el
+++ b/.emacs.d/lisp/init-expand-region.el
@@ -4,7 +4,7 @@
;;; Code:
-(require 'expand-region)
+(require-package 'expand-region)
(provide 'init-expand-region)
;;; init-expand-region ends here
diff --git a/.emacs.d/lisp/init-expand-region.el~ b/.emacs.d/lisp/init-expand-region.el~
deleted file mode 100644
index fffd943..0000000
--- a/.emacs.d/lisp/init-expand-region.el~
+++ /dev/null
@@ -1,8 +0,0 @@
-;;; expand-region --- Configuration
-
-;;; Commentary:
-
-;;; Code:
-
-(provide 'init-expand-region)
-;;; init-expand-region ends here
diff --git a/.emacs.d/lisp/init-flycheck.el b/.emacs.d/lisp/init-flycheck.el
index d124711..8a7f546 100644
--- a/.emacs.d/lisp/init-flycheck.el
+++ b/.emacs.d/lisp/init-flycheck.el
@@ -4,7 +4,7 @@
;;; Code:
-(package-install 'flycheck)
+(require-package 'flycheck)
(global-flycheck-mode)
(setq flycheck-check-syntax-automatically '(mode-enabled save))
diff --git a/.emacs.d/lisp/init-flycheck.el~ b/.emacs.d/lisp/init-flycheck.el~
deleted file mode 100644
index d124711..0000000
--- a/.emacs.d/lisp/init-flycheck.el~
+++ /dev/null
@@ -1,13 +0,0 @@
-;;; flycheck --- All flycheck configuration
-
-;;; Commentary:
-
-;;; Code:
-
-(package-install 'flycheck)
-
-(global-flycheck-mode)
-(setq flycheck-check-syntax-automatically '(mode-enabled save))
-
-(provide 'init-flycheck)
-;;; init-flycheck ends here
diff --git a/.emacs.d/lisp/init-helm.el b/.emacs.d/lisp/init-helm.el
index 52708c1..0280565 100644
--- a/.emacs.d/lisp/init-helm.el
+++ b/.emacs.d/lisp/init-helm.el
@@ -4,6 +4,7 @@
;;; Code:
+(require-package 'helm)
(require 'helm-config)
(global-set-key (kbd "M-x") 'helm-M-x)
diff --git a/.emacs.d/lisp/init-helm.el~ b/.emacs.d/lisp/init-helm.el~
deleted file mode 100644
index 0353c64..0000000
--- a/.emacs.d/lisp/init-helm.el~
+++ /dev/null
@@ -1,15 +0,0 @@
-;;; helm --- Configuration
-
-;;; Commentary:
-
-;;; Code:
-
-(require 'helm-config)
-
-(global-set-key (kbd "M-x") 'helm-M-x)
-(global-set-key (kbd "C-x C-p") 'helm-find-files)
-
-(helm-mode 1)
-
-(provide 'init-helm)
-;;; init-helm ends here
diff --git a/.emacs.d/lisp/init-neotree.el b/.emacs.d/lisp/init-neotree.el
index d25e13f..a1ca271 100644
--- a/.emacs.d/lisp/init-neotree.el
+++ b/.emacs.d/lisp/init-neotree.el
@@ -4,6 +4,8 @@
;;; Code:
+(require-package 'neotree)
+
(global-unset-key (kbd "C-e"))
(global-set-key (kbd "C-x x") 'neotree-toggle)
diff --git a/.emacs.d/lisp/init-neotree.el~ b/.emacs.d/lisp/init-neotree.el~
deleted file mode 100644
index c035d14..0000000
--- a/.emacs.d/lisp/init-neotree.el~
+++ /dev/null
@@ -1,11 +0,0 @@
-;;; neotree --- Configuration
-
-;;; Commentary:
-
-;;; Code:
-
-(global-unset-key (kbd "C-e"))
-(global-set-key (kbd "C-e") 'neotree-toggle)
-
-(provide 'init-neotree)
-;;; init-neotree ends here
diff --git a/.emacs.d/lisp/init-org.el~ b/.emacs.d/lisp/init-org.el~
deleted file mode 100644
index bc818e9..0000000
--- a/.emacs.d/lisp/init-org.el~
+++ /dev/null
@@ -1,55 +0,0 @@
-;;; org --- All configuration of org-mode
-
-;;; Commentary:
-;; Mostly the pdf export configuration
-
-;;; Code:
-
-;; active Babel languages
-(org-babel-do-load-languages
- 'org-babel-load-languages
- '((sql . t)))
-;; add additional languages with '((language . t)))
-
-(setq org-latex-classes
- '(("article"
- "
- \\documentclass[11pt]{article}
- \\usepackage{xeCJK}
- \\usepackage{indentfirst}
- \\usepackage{amsmath}
- \\setlength{\\parindent}{2em}
- \\setCJKmainfont{SimSun}
- \\numberwithin{equation}{section}
- \\newtheorem{Theorem}{定理}[section]
- \\newtheorem{Definition}[Theorem]{定义}
- \\newtheorem{Lemma}[Theorem]{引理}
- \\newtheorem{Corollary}[Theorem]{推论}
- \\topmargin=-0.45in
- \\evensidemargin=0in
- \\oddsidemargin=0in
- \\textwidth=6.5in
- \\textheight=9.0in
- \\headsep=0.25in
-
- \\linespread{1.1}
- "
- ("\\section{%s}" . "\\section*{%s}")
- ("\\subsection{%s}" . "\\subsection*{%s}")
- ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
- ("\\paragraph{%s}" . "\\paragraph*{%s}")
- ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
- ))
-;; Use XeLaTex
-(setq org-latex-pdf-process
- '("xelatex -interaction nonstopmode -output-directory %o %f"
- "xelatex -interaction nonstopmode -output-directory %o %f"
- "xelatex -interaction nonstopmode -output-directory %o %f"))
-
-(setq org-log-done t)
-(setq org-agenda-files (list "~/org/work.org"
- "~/org/school.org"
- "~/org/home.org"
- "~/42/Personal/Plan/plan.org"))
-(provide 'init-org)
-;;; init-org ends here
diff --git a/.emacs.d/lisp/init-program-basic.el~ b/.emacs.d/lisp/init-program-basic.el~
deleted file mode 100644
index 04266aa..0000000
--- a/.emacs.d/lisp/init-program-basic.el~
+++ /dev/null
@@ -1,53 +0,0 @@
-;;; program-basic --- Some basic configuration
-
-;;; Commentary:
-;; None
-
-;;; Code:
-
-(setq-default c-basic-offset 4
- tab-width 4
- indent-tabs-mode t)
-
-(defun execute-c-program ()
- "Complie current c file and run it."
- (interactive)
- (save-buffer)
- (defvar foo)
- (setq foo (concat
- "gcc " (include-source-file (buffer-name)) " -o " (buffer-name) ".out && ./" (buffer-name) ".out" ))
- (shell-command foo))
-
-(defun include-source-file (file-path)
- "Get transfer all include header file from FILE-PATH to source file(string)."
- (let (content)
- (setq content (format "%s" (get-c-source-file (get-string-from-file file-path))))
- (if (string= nil content)
- file-path
- (substring content 1 -1))))
-
-(defun get-c-source-file (content)
- "Get the header list of a string CONTENT, for instant a .c file."
- (defun header-to-source (header)
- "Whole line of header"
- (replace-regexp-in-string "[.]h" ".c " (substring header 10 -1)))
- (let (value)
- (dolist (element (split-string content "\n" t) value)
- (if (string-prefix-p "#include \"" element)
- (setq value (cons (header-to-source element) value))))))
-
-
-(defun read-lines (file-path)
- "Return a list of lines of a file at FILE-PATH."
- (with-temp-buffer
- (insert-file-contents file-path)
- (split-string (buffer-string) "\n" t)))
-
-(defun get-string-from-file (file-path)
- "Return FILE-PATH's file content in list."
- (with-temp-buffer
- (insert-file-contents file-path)
- (buffer-string)))
-
-(provide 'init-program-basic)
-;;; init-program-basic ends here
diff --git a/.emacs.d/lisp/init-slime.el b/.emacs.d/lisp/init-slime.el
index 157f0ee..96c863a 100644
--- a/.emacs.d/lisp/init-slime.el
+++ b/.emacs.d/lisp/init-slime.el
@@ -4,7 +4,7 @@
;;; Code:
-(package-install 'slime)
+(require-package 'slime)
(setq inferior-lisp-program "/usr/bin/sbcl")
(setq slime-contribs '(slime-fancy))
diff --git a/.emacs.d/lisp/init-slime.el~ b/.emacs.d/lisp/init-slime.el~
deleted file mode 100644
index 28258b9..0000000
--- a/.emacs.d/lisp/init-slime.el~
+++ /dev/null
@@ -1,13 +0,0 @@
-;;; slime --- All slime configuration
-
-;;; Commentary:
-
-;;; Code:
-
-(package-install 'slime)
-
-(setq inferior-lisp-program "/opt/sbcl/bin/sbcl")
-(setq slime-contribs '(slime-fancy))
-
-(provide 'init-slime)
-;;; init-slime ends here
diff --git a/.emacs.d/lisp/init-window-numbering.el b/.emacs.d/lisp/init-window-numbering.el
index c8425ff..3fd48e0 100644
--- a/.emacs.d/lisp/init-window-numbering.el
+++ b/.emacs.d/lisp/init-window-numbering.el
@@ -4,6 +4,8 @@
;;; Code:
+(require-package 'window-numbering)
+
(window-numbering-mode)
(provide 'init-window-numbering)
diff --git a/.emacs.d/lisp/init-window-numbering.el~ b/.emacs.d/lisp/init-window-numbering.el~
deleted file mode 100644
index cb3ccc8..0000000
--- a/.emacs.d/lisp/init-window-numbering.el~
+++ /dev/null
@@ -1,3 +0,0 @@
-;;; window-numbering --- All configuration of window-numbering
-
-;;; C
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b25c15b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*~