Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rework the package install not using a list but diectly in extra-mode…

…s.el
  • Loading branch information...
commit b6194925e40cc99b9854bd98a254d6db89f485ff 1 parent a07bd87
@chmouel authored
Showing with 43 additions and 124 deletions.
  1. +43 −63 configs/extra-modes.el
  2. +0 −3  init.el
  3. +0 −39 install-packages.el
  4. +0 −19 packages.txt
View
106 configs/extra-modes.el
@@ -1,49 +1,23 @@
-;Elscreen
-(if (and (featurep 'elscreen) window-system)
- (progn
- (setq elscreen-display-tab t)
- (global-set-key (read-kbd-macro "M-1")
- (lambda () (interactive) (elscreen-goto 0)))
- (global-set-key (read-kbd-macro "M-2")
- (lambda () (interactive) (elscreen-goto 1)))
- (global-set-key (read-kbd-macro "M-3")
- (lambda () (interactive) (elscreen-goto 2)))
- (global-set-key (read-kbd-macro "M-4")
- (lambda () (interactive) (elscreen-goto 3)))
- (global-set-key (read-kbd-macro "M-5")
- (lambda () (interactive) (elscreen-goto 4)))
- (global-set-key (read-kbd-macro "M-6")
- (lambda () (interactive) (elscreen-goto 5)))
- (global-set-key (read-kbd-macro "M-7")
- (lambda () (interactive) (elscreen-goto 6)))
- (global-set-key (read-kbd-macro "M-8")
- (lambda () (interactive) (elscreen-goto 7)))
- (global-set-key (read-kbd-macro "M-9")
- (lambda () (interactive) (elscreen-goto 8)))
- (global-set-key (read-kbd-macro "M-0")
- (lambda () (interactive) (elscreen-goto 9)))
- (global-set-key '[(control home)] 'elscreen-previous)
- (global-set-key '[(control end)] 'elscreen-next)
- (define-key elscreen-map (read-kbd-macro "SPC") 'elscreen-next)
- (define-key elscreen-map (read-kbd-macro "DEL") 'elscreen-previous)
- (elscreen-create)
- (elscreen-create)
- (elscreen-create)
- (elscreen-goto 0)
- (require 'elscreen-dired)
- )
- )
-
-;Disable screen when not window-system
-(if (and (featurep 'elscreen) (not window-system))
- (setq elscreen-display-tab nil)
- )
-
;RST
(autoload 'rst-mode "rst" "RST" t)
(push '("\\.rst\\'" . rst-mode) auto-mode-alist)
+;TodoTXT
+(autoload 'todotxt "todotxt" nil t)
+(global-set-key (kbd "<f12>") 'todotxt)
+(setq todotxt-file (expand-file-name "~/Dropbox/todo/todo.txt"))
+
+
+;Ensure package is installed
+(package-initialize)
+(defun my-ensure-installed (package)
+ (if (not (package-installed-p package))
+ (package-install package)))
+
; For Yas/Snippet
+(my-ensure-installed 'yasnippet)
+(my-ensure-installed 'yasnippet-bundle)
+(my-ensure-installed 'dropdown-list)
(require 'yasnippet nil t) ;; not yasnippet-bundle
(when (featurep 'yasnippet)
(yas/global-mode 1)
@@ -54,46 +28,52 @@
)
;Flymake
+(my-ensure-installed 'flymake-cursor)
(eval-after-load "flymake"
'(progn
(require 'flymake-cursor)))
+; Flymake shell mode
+(my-ensure-installed 'flymake-shell)
+(eval-after-load "flymake"
+ '(progn
+ (require 'flymake-shell nil t)
+ (add-hook 'sh-set-shell-hook 'flymake-shell-load)))
+
;RegexTool
+(my-ensure-installed 'regex-tool)
(autoload 'regex-tool "regex-tool" "REGEX Tool" t)
;Magit
+(my-ensure-installed 'magit)
(autoload 'magit-status "magit" "Magit Status" t)
(global-set-key (read-kbd-macro "C-c g") 'magit-status)
-;Todo-Txt
-(require 'todotxt nil t)
-(when (featurep 'todotxt)
- (global-set-key (kbd "<f12>") 'todotxt)
- (setq todotxt-file (expand-file-name "~/Dropbox/todo/todo.txt"))
-)
-
; Hightly more than 80
-(require 'highlight-80+ nil t)
+(my-ensure-installed 'highlight-80+)
+(autoload 'highlight-80+ "highlight-80+" nil t)
; Highlight Indentation
-(require 'highlight-indentation nil t)
+(my-ensure-installed 'highlight-indentation)
+(autoload 'highlight-indentation "highlight-indentation" nil t)
;Find find in GIT repo
+(my-ensure-installed 'find-file-in-git-repo)
(require 'find-file-in-git-repo nil t)
-(when (featurep 'find-file-in-git-repo)
- (global-set-key (kbd "C-c C-g") 'find-file-in-git-repo)
- (global-set-key (kbd "C-S-f") 'find-file-in-git-repo)
- )
-
-; Like eclispe F2
-(require 'mark-more-like-this nil t)
-(when (featurep 'mark-more-like-this)
- (global-set-key (kbd "C-S-2") 'mark-more-like-this))
+(global-set-key (kbd "C-c C-g") 'find-file-in-git-repo)
+(global-set-key (kbd "C-S-f") 'find-file-in-git-repo)
; Browse Kill ring
+(my-ensure-installed 'browse-kill-ring)
(autoload 'browse-kill-ring "browse-kill-ring" "Browse Kill Ring" t)
-; Flymake shell mode
-(require 'flymake-shell nil t)
-(when (featurep 'flymake-shell)
- (add-hook 'sh-set-shell-hook 'flymake-shell-load))
+; Multiple cursors
+(setq mc/list-file "~/.emacs.d/auto-save-list/mc-lists.el")
+(my-ensure-installed 'multiple-cursors)
+(autoload 'mc/mark-next-like-this "multiple-cursors" "Multiple Cursors" t)
+(global-set-key (kbd "C-@") 'mc/mark-next-like-this)
+
+; Expand Region
+(my-ensure-installed 'expand-region)
+(autoload 'er/expand-region "expand-region" "Multiple Cursors" t)
+(global-set-key (kbd "C-=") 'er/expand-region)
View
3  init.el
@@ -25,9 +25,6 @@
;; Some macros.
(defmacro GUI (&rest x) (list 'if (not (null window-system)) (cons 'progn x)))
-;Load autopackage install
-(load-file (concat my-init-directory "/install-packages.el"))
-
;Loading Packages
(if (fboundp 'normal-top-level-add-subdirs-to-load-path)
(let* ((my-lisp-dir (expand-file-name (concat my-init-directory "/packages/")))
View
39 install-packages.el
@@ -1,39 +0,0 @@
-;;; my-packages.el --- Package Initialization.
-;; Copyright Irfan Shah
-;; Author: Irfan Shah
-;; URL: http://github.com/irfn/my-packages
-;; Version: 0.1.0
-
-;; save my package names to file on install. So
-;; that i can bootstrap using the same config on a different machine.
-
-
-(require 'package)
-
-(package-initialize)
-
-(when (null package-archive-contents)
- (package-refresh-contents))
-
-(defun read-lines (filePath)
- "Return a list of lines of a file at FILEPATH."
- (with-temp-buffer
- (insert-file-contents filePath)
- (split-string (buffer-string) "\n" t)))
-
-(defun my-packages ()
- (condition-case nil
- (read-lines "~/.emacs.d/packages.txt")
- (error nil)))
-
-(defun my-packages-install ()
- (condition-case nil
- (dolist (p (my-packages))
- (when (not (package-installed-p (intern p)))
- (package-install (intern p))))
- (error nil)))
-
-(my-packages-install)
-(provide 'my-packages)
-
-;;; my-packages.el ends here
View
19 packages.txt
@@ -1,19 +0,0 @@
-browse-kill-ring
-csharp-mode
-dropdown-list
-find-file-in-git-repo
-find-things-fast
-flymake-cursor
-flymake-shell
-highlight-80+
-highlight-indentation
-inf-ruby
-lua-mode
-magit
-mark-multiple
-mark-more-like-this
-nose
-regex-tool
-yaml-mode
-yasnippet
-yasnippet-bundle
Please sign in to comment.
Something went wrong with that request. Please try again.