Permalink
Browse files

added sub-frame and tweek rake, auto-complete.

  • Loading branch information...
1 parent d039c81 commit 138f60d2ab39b0c5b49c4297e1246e61c20f372e @tm8st committed Jan 9, 2012
Showing with 100 additions and 39 deletions.
  1. +8 −0 init/init-basic.el
  2. +15 −11 init/init-complete.el
  3. +3 −0 init/init-elisp.el
  4. +29 −15 init/init-haskell.el
  5. +6 −0 init/init-keybindings.el
  6. +21 −7 init/init-misc.el
  7. +11 −5 init/init-my-misc.el
  8. +6 −0 init/init-org.el
  9. +1 −1 init/init-theme.el
View
@@ -227,6 +227,14 @@
;;cygwin風ディレクリ指定
(my-require 'cygwin-mount)
(cygwin-mount-activate)
+
+ (setenv "PATH"
+ (format "%s;%s;%s;%s"
+ (getenv "PATH")
+ "c:/MinGW/lib"
+ "c:/MinGW/bin"
+ "c:/MinGW/include"
+ ))
))
(provide 'init-basic)
View
@@ -21,14 +21,15 @@
;;;-------------------------------------
(my-require 'auto-complete)
(my-require 'auto-complete-config)
-(ac-config-default)
+;; (ac-config-default)
(global-auto-complete-mode t)
(customize-set-value 'ac-dictionary-directories
(list "~/elisps/external/complete/m2ym-auto-complete/dict"
(concat my-dropbox-directory "/Emacs/resource/dict")))
(setq ac-auto-start 2)
+(setq ac-dwim 1)
(customize-set-value 'ac-ignore-case nil)
(customize-set-value 'ac-candidate-limit 500)
(customize-set-value 'ac-use-fuzzy 't)
@@ -49,19 +50,22 @@
(my-require 'popup)
(my-require 'pcomplete)
+
(ac-define-source pcomplete
'((candidates . pcomplete-completions)))
-;; ac source setting. all mode use same setting.
-(setq ac-sources
- '(ac-source-pcomplete
- ac-source-words-in-buffer
- ac-source-gtags
- ;; ya-gtags
- ac-source-words-in-same-mode-buffers
- ac-source-filename
- ac-source-symbols
- ac-source-dictionary))
+;; ac source setting.
+(setq-default ac-sources
+ '(ac-source-words-in-buffer
+ ac-source-words-in-same-mode-buffers
+ ac-source-dictionary
+ ac-source-yasnippet
+ ;; ac-source-pcomplete
+ ;; ac-source-gtags
+ ;; ac-source-imenu
+ ;; ac-source-filename
+ ;; ac-source-symbols
+ ))
;; use ac modes.
(add-to-list 'ac-modes 'shell-mode)
View
@@ -194,3 +194,6 @@
;; (add-hook 'lisp-mode-hook 'enable-paredit-mode)
(provide 'init-elisp)
+
+
+
View
@@ -17,6 +17,7 @@
(my-require 'inf-haskell)
(my-require 'prefix-arg-commands)
(my-require 'init-keybindings)
+(my-require 'auto-complete)
(add-to-list 'auto-mode-alist '("\\.hs$" . haskell-mode))
(add-to-list 'auto-mode-alist '("\\.lhs$" . haskell-mode))
@@ -145,21 +146,18 @@
(insert funcName))))
(ac-define-source ghc-mod
- '((depends ghc)
- (candidates . (ghc-select-completion-symbol))
- (symbol . "s")
- (cache)))
+ '((depends ghc)
+ (candidates . (ghc-select-completion-symbol))
+ (symbol . "g")
+ (cache)))
(defun my-ac-haskell-mode ()
- (setq ac-sources '(ac-source-words-in-same-mode-buffers ac-source-dictionary ac-source-ghc-mod)))
-(add-hook 'haskell-mode-hook 'my-ac-haskell-mode)
+ ;; (push 'ac-source-ghc-mod ac-sources)
+ (setq ac-sources '(ac-source-ghc-mod
+ ac-source-words-in-same-mode-buffers
+ )))
-(defun my-haskell-ac-init ()
- (when (member (file-name-extension buffer-file-name) '("hs" "lhs"))
- (auto-complete-mode t)
- (setq ac-sources '(ac-source-words-in-same-mode-buffers ac-source-dictionary ac-source-ghc-mod))))
-
-(add-hook 'haskell-mode-hook 'my-haskell-ac-init)
+(add-hook 'haskell-mode-hook 'my-ac-haskell-mode)
(define-key haskell-mode-map (kbd "C-S-F")
(lambda ()
@@ -173,8 +171,8 @@
(ad-activate 'haskell-indent-indentation-info)
-(require 'anything)
-(require 'anything-hasktags)
+(my-require 'anything)
+(my-require 'anything-hasktags)
;; make tags command.
;; alias hasktags-r="find . -type f -name \*.\*hs -print0 | xargs -0 hasktags -c"
@@ -213,6 +211,8 @@
(define-key haskell-mode-map (kbd "C-c C-a") '(lambda () (interactive) (insert " <*> ")))
(define-key haskell-mode-map (kbd "C-c C-f") '(lambda () (interactive) (insert " <$> ")))
(define-key haskell-mode-map (kbd "C-c C-l") '(lambda () (interactive) (insert " <- ")))
+(define-key haskell-mode-map (kbd "C-c C-6") '(lambda () (interactive) (insert " .&. ")))
+(define-key haskell-mode-map (kbd "C-c C-\\") '(lambda () (interactive) (insert " .|. ")))
(define-key haskell-mode-map (kbd "C-c C-r") `prefix-arg-commands-insert-haskell-right-arrow)
(define-key haskell-mode-map (kbd "C-c C-@") '(lambda () (interactive) (insert " `` ") (backward-char 2)))
(define-key haskell-mode-map (kbd "C-c C-1") '(lambda () (interactive) (insert " !! ") (backward-char 2)))
@@ -227,7 +227,21 @@
(define-key inferior-haskell-mode-map (kbd "C-c C-1") '(lambda () (interactive) (insert " !! ") (backward-char 2)))
(define-key inferior-haskell-mode-map (kbd "C-c C--") '(lambda () (interactive) (insert " = ")))
-(define-key haskell-mode-map (kbd "C-c C-c") 'inferior-haskell-load-file)
+(defun my-shell-command-on-current-directory (cmd)
+ ""
+ (concat "cd \"" (my-get-buffer-directory)
+ "\" && " cmd))
+
+(defun my-iferior-haskell-load-file ()
+ "load hs and hlint."
+ (interactive)
+ (sf:async-shell-command
+ (my-shell-command-on-current-directory
+ (concat "hlint " (buffer-file-name))) "*hs-lint*")
+ (inferior-haskell-load-file)
+ )
+
+(define-key haskell-mode-map (kbd "C-c C-c") 'my-iferior-haskell-load-file)
(define-key haskell-mode-map (kbd "C-c C-e") 'inferior-haskell-load-and-run)
(define-key haskell-mode-map (kbd "C-c l") 'hs-lint)
(define-key haskell-mode-map (kbd "C-c s") 'hs-scan)
View
@@ -399,4 +399,10 @@
(define-key global-map (kbd "C-l C-j C-r") 'my-insert-space-rectangle)
+(my-require 'sub-frame)
+(global-set-key (kbd "C-l C-s C-[") 'sf:jump-to-buffer-top)
+(global-set-key (kbd "C-l C-s C-]") 'sf:jump-to-buffer-bottom)
+(global-set-key (kbd "C-l C-s C-;") 'sf:scroll-down)
+(global-set-key (kbd "C-l C-s C-v") 'sf:scroll-up)
+
(provide 'init-keybindings)
View
@@ -301,18 +301,29 @@
(selected-frame)
'my-frame-arrange-mini)))
-;;; Rakefile for Haskell.
-(defvar rake-task-alist '(("run") ("build") ("debug") ("clean") ("clobber") ("test") ("profile") ("hpc") ("tags")))
+;;;-------------------------------
+;;; Rakefile.
+;;;-------------------------------
+(my-require 'sub-frame)
+(defvar rake-task-list '(("run") ("build") ("debug") ("clean") ("clobber") ("test") ("profile") ("hpc") ("tags") ("lint")))
+(defun my-get-buffer-directory ()
+ (let* ((dir (buffer-file-name))
+ (dir (and dir (file-name-directory dir)))
+ (dir (or dir dired-directory)))
+ dir
+ ))
+
(defun my-run-rakefile ()
(interactive)
- (async-shell-command
+ (sf:async-shell-command
(concat (if (my-is-mac)
"rake"
- "rake.bat")
+ (concat "cd \"" (my-get-buffer-directory) "\" && rake.bat"))
" -t "
- (completing-read "task?: " rake-task-alist nil t))
- (get-buffer-create "*Rake*")))
+ (completing-read "task?: " rake-task-list nil t))
+ (get-buffer-create "*RakeTask*")))
+;; (add-to-list 'popwin:special-display-config '("*RakeTask*"))
(define-key global-map (kbd "C-l C-o C-b") 'my-run-rakefile)
;;; yalinum
@@ -450,8 +461,11 @@
(kbd "M-=")
'text-scale-decrease)))
-(require 'hahhah)
+(my-require 'hahhah)
(hahhah-mode t)
+;; (my-require 'nyan-mode)
+;; (setq mode-line-format (nyan-create))
+
(provide 'init-misc)
View
@@ -606,19 +606,19 @@ default name is filename:current line string."
(when (my-is-windows)
(defun my-open-file-os (&optional filename)
"osの関連付けを利用してファイルを開く"
- (interactive
+ (interactive)
(save-excursion
(let*
- ((filename (if (eq filename nil)
+ ((filename2 (if (eq filename nil)
(find-file-read-args "Find file: "
(confirm-nonexistent-file-or-buffer))
filename))
- (value (find-file-noselect (car filename) nil nil nil)))
+ (value (find-file-noselect (car filename2) nil nil nil)))
(if (listp value)
(mapcar 'switch-to-buffer (nreverse value))
(switch-to-buffer value)
(my-buffer-cygstart-exe)
- (kill-buffer (current-buffer))))))))
+ (kill-buffer (current-buffer)))))))
(when (my-is-mac)
(defun my-open-file-os (&optional filename)
@@ -652,10 +652,16 @@ default name is filename:current line string."
(defun my-git-commit-and-push ()
"git commit and push command"
(interactive)
- (async-shell-command (concat "git commit -a -m " "\""(read-string "commit log:") "\"") "*git commit*")
+ (my-git-commit)
(async-shell-command "git push origin master" "*git push*")
)
+(defun my-git-commit ()
+ "git commit and push command"
+ (interactive)
+ (async-shell-command (concat "git commit -a -m " "\""(read-string "commit log:") "\"") "*git commit*")
+ )
+
(defun my-move-line-up (p)
"Move current line up, copy from crazycool@smth"
(interactive "*p")
View
@@ -219,6 +219,9 @@
(define-key org-mode-map (kbd "C-c C-o") 'my-org-clock-out)
(define-key org-mode-map (kbd "C-c C-q") 'org-clock-display)
(define-key org-mode-map (kbd "C-c C-r") 'org-clock-report)
+(define-key org-mode-map (kbd "C-c C-u") 'pcomplete)
+(define-key org-mode-map (kbd "C-c C-p") 'outline-up-heading)
+(define-key org-mode-map (kbd "C-c C-n") 'outline-down-heading)
(global-set-key (kbd "C-l C-o C-c") 'my-org-clock-cancel)
@@ -281,4 +284,7 @@
(add-hook 'org-mode-hook 'my-org-mode-hook)
+(my-require 'anything-org-mode)
+(global-set-key (kbd "C-l C-o C-j") 'anything-org-agenda)
+
(provide 'init-org)
View
@@ -392,6 +392,6 @@
'(("\\<\\(my-require\\)\\>" 1 font-lock-keyword-face t)))
;; setting pixel between lines
-(setq-default line-spacing 2)
+(setq-default line-spacing 0)
(provide 'init-theme)

0 comments on commit 138f60d

Please sign in to comment.