Open travula opened 7 years ago
to install javascript
M-x package-list-packages
will list all the packages
search for js2-mode and install it similarly install json-mode
to enable js mode, copy the following lines to .emacs file
(add-hook 'js-mode-hook 'js2-minor-mode)
(add-hook 'js2-mode-hook 'ac-js2-mode)
(setq js2-highlight-level 3)
(setq js-indent-level 2)
Map keys in the dired mode
(setq dired-dwim-target t)
(setq dired-copy-preserve-time t)
(setq dired-recursive-copies 'top)
(define-key dired-mode-map "b" 'browse-url-of-dired-file)
(load "dired-x")
(define-key dired-mode-map "z" 'dired-remote-copy)
(define-key dired-mode-map "r" 'rsync-se-101)
(define-key dired-mode-map "\C-ca" 'dired-acroread-file)
(define-key dired-mode-map "\C-cd" 'cd-buffer-dir)
After installing python-mode from packages, Add these lines to .emacs file
(autoload 'python-mode "python-mode" "Python Mode." t)
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
(add-to-list 'interpreter-mode-alist '("python" . python-mode))
(setq interpreter-mode-alist
(cons '("python" . python-mode)
interpreter-mode-alist)
python-mode-hook
'(lambda () (progn
(set-variable 'py-indent-offset 4)
(set-variable 'indent-tabs-mode nil))))
;; Remove trailing whitespace manually by typing C-t C-w.
(add-hook 'python-mode-hook
(lambda ()
(local-set-key (kbd "C-t C-w")
'delete-trailing-whitespace)))
;; Automatically remove trailing whitespace when file is saved.
(add-hook 'python-mode-hook
(lambda()
(add-hook 'local-write-file-hooks
'(lambda()
(save-excursion
(delete-trailing-whitespace))))))
Add the following lines to .emacs file
(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.
'(ansi-color-names-vector
["#2e3436" "#a40000" "#4e9a06" "#c4a000" "#204a87" "#5c3566" "#729fcf" "#eeeeec"])
'(column-number-mode t)
'(custom-enabled-themes (quote (wheatgrass)))
'(initial-frame-alist (quote ((fullscreen . maximized))))
'(org-agenda-files (quote ("~/web-app-short-course/src/data-model/index.org")))
'(quack-programs
(quote
("mzscheme" "bigloo" "csi" "csi -hygienic" "gosh" "gracket" "gsi" "gsi ~~/syntax-case.scm -" "guile" "kawa" "mit-scheme" "racket" "racket -il typed/racket" "rs" "scheme" "scheme48" "scsh" "sisc" "stklos" "sxi")))
'(show-paren-mode t))
(setq font-string
; "-*-Courier-medium-r-normal-*-18-*-*-*-m-*-iso8859-1"
; "-*-Courier-medium-r-normal-*-24-*-*-*-m-*-iso8859-1"
; "-*-Courier-bold-r-normal-*-12-*-*-*-m-*-iso8859-1"
; "-*-Courier-bold-r-normal-*-18-*-*-*-m-*-iso8859-1" ; not defined
"-*-Courier-bold-r-normal-*-24-*-*-*-m-*-iso8859-1"
)
(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 (:family "DejaVu Sans Mono" :foundry "unknown" :slant normal :weight normal :height 158 :width normal)))))
;; Don't use TABS for indentations.
(setq-default indent-tabs-mode nil)
;;;highlight parens
(setq show-paren-delay 0
show-paren-style 'parenthesis)
(show-paren-mode 1)
To list all the packages