Skip to content

Instantly share code, notes, and snippets.

@iMagesh
Created November 1, 2012 08:43
Show Gist options
  • Save iMagesh/3992530 to your computer and use it in GitHub Desktop.
Save iMagesh/3992530 to your computer and use it in GitHub Desktop.
shopo laptop .emacs config
(setq inhibit-startup-message t) ;; Removes startup message
(setq-default indent-tabs-mode nil)
(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.
'(auto-save-default t)
'(cua-mode t nil (cua-base))
'(delete-auto-save-files t)
'(font-use-system-font t)
'(fringe-mode 0 nil (fringe))
'(javascript-indent-level 2)
'(ruby-indent-level 2)
'(show-paren-mode t)
'(speedbar-default-position (quote left))
'(sr-speedbar-right-side nil)
'(sr-speedbar-width-x 14)
'(standard-indent 6)
'(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify)))
'(uniquify-buffer-name-style (quote forward) nil (uniquify)))
(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.
'(default ((t (:inherit nil :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))))
(add-to-list 'load-path "/etc/emacs/site-start.d/")
;;Karl Landstram's javascript mode
(add-to-list 'auto-mode-alist '("\\.js\\'" . javascript-mode))
(autoload 'javascript-mode "javascript" nil t)
;; Put autosave files (ie #foo#) in one place, *not*
;; scattered all over the file system!
(defvar autosave-dir
(concat "/tmp/emacs_autosaves/" (user-login-name) "/"))
(make-directory autosave-dir t)
(defun auto-save-file-name-p (filename)
(string-match "^#.*#$" (file-name-nondirectory filename)))
(defun make-auto-save-file-name ()
(concat autosave-dir
(if buffer-file-name
(concat "#" (file-name-nondirectory buffer-file-name) "#")
(expand-file-name
(concat "#%" (buffer-name) "#")))))
;; comment region
(global-set-key "\M-\=" `comment-region)
;; uncomment region
(global-set-key "\M-\\" `uncomment-region)
;; replace-regexp
(global-set-key "\M-&" `replace-regexp)
;; replace-string
(global-set-key "\M-s" `replace-string)
;;indent-region
(global-set-key "\C-\M-\\" `indent-region)
;;goto-line <number>
(global-set-key "\C-\l" `goto-line)
;;(global-set-key "\M-<right>" `next-buffer)
(global-set-key "\C-x\C-r" 'recentf-open-files)
;;CSS http://mewde.googlecode.com/files/css-mode.el
(add-to-list 'auto-mode-alist '("\\.css\\'" . css-mode))
(autoload 'css-mode "css-mode" nil t)
;;Karl Landstram's javascript mode
(add-to-list 'auto-mode-alist '("\\.js\\'" . javascript-mode))
(autoload 'javascript-mode "javascript" nil t)
;; Remote file editing via ssh
(add-to-list 'load-path "~/.emacs.d/tramp/lisp/")
(require 'tramp)
(setq tramp-default-method "ssh")
;; Save existing buffers while exit and reopen it next time
(desktop-save-mode 1)
(desktop-load-default)
;; Start emacs full screen
(defun toggle-fullscreen ()
(interactive)
(x-send-client-message nil 0 nil "_NET_WM_STATE" 32
'(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))
(x-send-client-message nil 0 nil "_NET_WM_STATE" 32
'(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))
)
(toggle-fullscreen)
;; Markdown-mode
(autoload 'markdown-mode "markdown-mode.el"
"Major mode for editing Markdown files" t)
(setq auto-mode-alist
(cons '("\\.md" . markdown-mode) auto-mode-alist))
;; Tabs
(tabbar-mode)
;; Tabs in single group
(setq tabbar-buffer-groups-function
(lambda ()
(list "All"))) ;; code by Peter Barabas
;; emacs-rails
;;(setq load-path (cons "/etc/site-start.d/emacs-rails" load-path))
;; (require 'rails)
;; Rinari
(add-to-list 'load-path "/etc/emacs/site-start.d/rinari")
(require 'rinari)
;; Haml mode
;; (add-hook 'haml-mode-hook 'rinari-minor-mode)
;; (add-to-list 'load-path "/etc/emacs/site-start.d/haml-mode")
;; (add-to-list 'auto-mode-alist '("\\.html.haml\\'" . haml-mode))
(autoload 'haml-mode "haml-mode" nil t)
(add-hook 'haml-mode-hook
'(lambda ()
(setq indent-tabs-mode nil)
(define-key haml-mode-map "\C-m" 'newline-and-indent)))
;; Interactively Do Things (highly recommended, but not strictly required)
(require 'ido)
(ido-mode t)
;; auto-refresh all buffers when file changed
(global-auto-revert-mode t)
;; avoid backup files
;; (add-hook 'dired-load-hook
;; (lambda ()
;; (require 'dired-x)))
(add-to-list 'load-path "/etc/emacs/site-start.d/auto-complete")
(require 'auto-complete)
(global-auto-complete-mode t)
;; delete trailing whitespace before save
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;; Speedbar within the frame
;; (require 'sr-speedbar)
;; (sr-speedbar-open)
;; (defcustom sr-speedbar-auto-refresh t
;; "Automatically refresh speedbar content when changed directory.
;; Default is t."
;; :type 'boolean
;; :set (lambda (symbol value)
;; (set symbol value))
;; :group 'sr-speedbar)
;; (require 'recentf-mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment