Jelajahi Sumber

Expanded newMusic function and enabled company mode in emacs

Should probably find a better place for the music scripts since those are pretty non-portable.
Tom Flucke 8 tahun lalu
induk
melakukan
0619f0ece9
3 mengubah file dengan 31 tambahan dan 6 penghapusan
  1. 1 1
      .Xresources
  2. 8 1
      .bashrc
  3. 22 4
      .emacs.d/init.el

+ 1 - 1
.Xresources

@@ -3,4 +3,4 @@
 XTerm*metaSendsEscape: true
 XTerm*eightBitInput: false
 XTerm*Background: black
-XTerm*Foreground: green
+XTerm*Foreground: green

+ 8 - 1
.bashrc

@@ -63,7 +63,6 @@ ecex()
 alias emacs='emacs -nw'
 alias xterm='ecex xterm -rv'
 alias decks='ecex "$MTG_DIR" && ecex mv /tmp/*.dec "$MTG_DIR"'
-alias newMusic='ecex sudo chown media /tmp/*.mp3 && ecex sudo -u media mv -v /tmp/*.mp3 /media/music && ecex mpc update'
 alias playMusic='ecex mpc clear && ecex getLyricalSongs | ecex mpc add && ecex mpc shuffle && ecex mpc play'
 alias conServer='ecex ssh tflucke@63.246.2.164'
 alias packageSize="pacman -Qi | gawk '/^Name/ { x = $3 }; /^Installed Size/ { sub(/Installed Size  *:/, ""); print x":" $0 }' | sort -k2,3nr"
@@ -82,6 +81,14 @@ amount () {
     fi	
 } 
 
+newMusic() {
+    for x in /tmp/*.mp3; do
+        sudo chown media "$x"
+	sudo -u media mv -v "$x" /media/music
+    done
+    ecex mpc update
+}
+
 mysqlpermissions()
 {
   mysql -B -N $@ -e "SELECT DISTINCT CONCAT(

+ 22 - 4
.emacs.d/init.el

@@ -29,6 +29,20 @@
         collect (funcall f b)))
 
 ;; ------------- Keybindings -------------
+(defun smart-beginning-of-line ()
+  "Move point to first non-whitespace character or beginning-of-line.
+
+Move point to the first non-whitespace character on this line.
+If point was already at that position, move point to beginning of line."
+  (interactive "^")
+  ;(if (version< "22" emacs-version) (interactive "^") (interactive))
+  (let ((oldpos (point)))
+    (beginning-of-line-text); goes to first significant character
+    ;(back-to-indentation); goes to first non-whitespace
+    (and (= oldpos (point))
+         (beginning-of-line))))
+
+(global-set-key [home] 'smart-beginning-of-line)
 (global-set-key (kbd "C-c /") 'comment-or-uncomment-region)
 (global-set-key (kbd "C-c C-k") 'compile)
 
@@ -52,8 +66,8 @@
 
 ;; ---------- Use X11 clipboard -----------
 (use-package xclip
-  :hook ((text-mode-hook prog-mode-hook) . xclip-mode)
-  :if (executable-find "xclip"))
+  :if (executable-find "xclip")
+  :config (xclip-mode 1))
 
 ;; ---------- Color Themes ----------
 (use-package color-theme
@@ -100,9 +114,13 @@
 (use-package scala-mode
   :mode "\\.scala\\'")
 
+(use-package company)
+
 (use-package ensime
-  :disabled
   :if (version<= "24.4" emacs-version)
+  :requires company
+  :hook (scala-mode java-mode)
+  :config (setq ensime-startup-notification nil)
   :pin melpa-stable)
 
 ; --------- C Syntax checker ---------
@@ -225,7 +243,7 @@
  ;; If there is more than one, they won't work right.
  '(package-selected-packages
    (quote
-    (xclip hl-todo comment-tags restclient markdown-mode autopair highlight-parentheses flyspell-correct-popup rust-mode rust-playground slime-volleyball use-package multi-web-mode magit ensime color-theme base16-theme))))
+    (company xclip hl-todo comment-tags restclient markdown-mode autopair highlight-parentheses flyspell-correct-popup rust-mode rust-playground slime-volleyball use-package multi-web-mode magit ensime color-theme base16-theme))))
 (custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.