Emacs tips and tricks
Forum rules
Share your brain ;)
Share your brain ;)
Re: Emacs tips and tricks
I don't like doc-view that much, especially since it doesn't work with pdfs the way a common pdf reader does. Fortunately, I found this: https://github.com/politza/pdf-tools
Had to get libpoppler-private-dev from experimental to compile it, but who cares. Works and feels good.
Had to get libpoppler-private-dev from experimental to compile it, but who cares. Works and feels good.
- Dr_Chroot
- Alfalfa
- Posts: 1100
- Joined: Mon Jun 09, 2014 9:49 pm
- Location: among the sagebrush
- Contact:
Re: Emacs tips and tricks
^ Thanks, Gekko! I have been using xpdf for a while instead of doc-view-mode for the same reason. This is exactly what I need :D
Fight internet censorship.
EFF | Tor Project | Bitcoin
"There have been times throughout American history where what is right is not the same as what is legal. Sometimes to do the right thing you have to break the law." - Edward Snowden
EFF | Tor Project | Bitcoin
"There have been times throughout American history where what is right is not the same as what is legal. Sometimes to do the right thing you have to break the law." - Edward Snowden
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: Emacs tips and tricks
Don't know if it has been mentioned before.
multi-term (M/ELPA), I used this setup, works nicely.
http://paralambda.org/2012/07/02/using- ... -emulator/
multi-term (M/ELPA), I used this setup, works nicely.
http://paralambda.org/2012/07/02/using- ... -emulator/
..gnutella..
Re: Emacs tips and tricks
^ Interesting. Wonder if something similar could be done for eshell.
There seem to be A LOT of fuzz about Helm: http://tuhdo.github.io/helm-intro.html
I have been trying to switch from ido to helm lately (one reason: https://tuhdo.github.io/helm-intro.html#sec-14), but failed horribly. I found Helm too much of a bloat and I can't see any improvement on my productivity using that.
There seem to be A LOT of fuzz about Helm: http://tuhdo.github.io/helm-intro.html
I have been trying to switch from ido to helm lately (one reason: https://tuhdo.github.io/helm-intro.html#sec-14), but failed horribly. I found Helm too much of a bloat and I can't see any improvement on my productivity using that.
Re: Emacs tips and tricks
^ not true.
I dediced to spend some time with helm, replacing ido and try to stick with it. A casual look at helm isn't enough to appreciate its power, I think. Anyway. Here's my helm setup. Mostly from here, but with some fine adds.
I dediced to spend some time with helm, replacing ido and try to stick with it. A casual look at helm isn't enough to appreciate its power, I think. Anyway. Here's my helm setup. Mostly from here, but with some fine adds.
Code: Select all
;; Helm setup
(require 'helm-config)
(helm-mode 1)
;; The default "C-x c" is quite close to "C-x C-c", which quits Emacs.
;; Changed to "C-c h". Note: We must set "C-c h" globally, because we
;; cannot change `helm-command-prefix-key' once `helm-config' is loaded.
(global-set-key (kbd "C-c h") 'helm-command-prefix)
(global-unset-key (kbd "C-x c"))
(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action) ; rebind tab to run persistent action
(define-key helm-map (kbd "C-i") 'helm-execute-persistent-action) ; make TAB works in terminal
(define-key helm-map (kbd "C-z") 'helm-select-action) ; list actions using C-z
(setq helm-split-window-in-side-p t ; open helm buffer inside current window, not occupy whole other window
helm-move-to-line-cycle-in-source t ; move to end or beginning of source when reaching top or bottom of source.
helm-ff-search-library-in-sexp t ; search for library in `require' and `declare-function' sexp.
helm-scroll-amount 8 ; scroll 8 lines other window using M-<next>/M-<prior>
helm-ff-file-name-history-use-recentf t)
(global-set-key (kbd "M-x") 'helm-M-x)
(setq helm-M-x-fuzzy-match t) ;; optional fuzzy matching for helm-M-x
(global-set-key (kbd "M-y") 'helm-show-kill-ring)
(global-set-key (kbd "C-x b") 'helm-mini)
(setq helm-buffers-fuzzy-matching t
helm-recentf-fuzzy-match t)
(global-set-key (kbd "C-x C-f") 'helm-find-files)
;; C-h is delete-backward-char, don't touch it!
(eval-after-load "helm-files"
'(let ((helm-find-files-C-h-map (lookup-key helm-find-files-map (kbd "C-h"))))
;; make sure C-h is no longer a prefix key
(define-key helm-find-files-map (kbd "C-h") nil)
;; rebind "C-h ..." to "M-m ..." to preserve functionality
(define-key helm-find-files-map (kbd "M-m") helm-find-files-C-h-map)))
(setq helm-semantic-fuzzy-match t
helm-imenu-fuzzy-match t)
(add-to-list 'helm-sources-using-default-as-input 'helm-source-man-pages)
(global-set-key (kbd "C-c h o") 'helm-occur)
(setq helm-apropos-function-list t)
(require 'helm-eshell)
(add-hook 'eshell-mode-hook
#'(lambda ()
(define-key eshell-mode-map (kbd "C-c C-l") 'helm-eshell-history)))
Re: Emacs tips and tricks
Since I got a small part in this one (mainly beta-testing it), I will put it here: browse StackExchange straight from Emacs with sx.el.
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: Emacs tips and tricks
Umlauts (or any other unicode shit) in Emacs? Remember C-x 8 RET
I'm sure you all know it already ;)
Note to self (and gekko's wife): for Chinese pinyin input in Emacs, C-\ py
No fucking IME needed :)
Code: Select all
C-x 8 . ·
C-x 8 / Prefix Command
C-x 8 1 Prefix Command
C-x 8 3 Prefix Command
C-x 8 < «
C-x 8 = ¯
C-x 8 > »
C-x 8 ? ¿
C-x 8 C ©
C-x 8 L £
C-x 8 P ¶
C-x 8 R ®
C-x 8 S §
C-x 8 Y ¥
C-x 8 ^ Prefix Command
C-x 8 _ Prefix Command
C-x 8 ` Prefix Command
C-x 8 c ¢
C-x 8 m µ
C-x 8 o °
C-x 8 u µ
C-x 8 x ×
C-x 8 | ¦
C-x 8 ~ Prefix Command
C-x 8 ~ SPC ~
C-x 8 ~ A Ã
C-x 8 ~ D Ð
C-x 8 ~ N Ñ
C-x 8 ~ O Õ
C-x 8 ~ T Þ
C-x 8 ~ a ã
C-x 8 ~ d ð
C-x 8 ~ n ñ
C-x 8 ~ o õ
C-x 8 ~ t þ
C-x 8 ~ ~ ¬
C-x 8 ` SPC `
C-x 8 ` A À
C-x 8 ` E È
C-x 8 ` I Ì
C-x 8 ` O Ò
C-x 8 ` U Ù
C-x 8 ` a à
C-x 8 ` e è
C-x 8 ` i ì
C-x 8 ` o ò
C-x 8 ` u ù
C-x 8 _ a ª
C-x 8 _ o º
C-x 8 ^ SPC ^
C-x 8 ^ 1 ¹
C-x 8 ^ 2 ²
C-x 8 ^ 3 ³
C-x 8 ^ A Â
C-x 8 ^ E Ê
C-x 8 ^ I Î
C-x 8 ^ O Ô
C-x 8 ^ U Û
C-x 8 ^ a â
C-x 8 ^ e ê
C-x 8 ^ i î
C-x 8 ^ o ô
C-x 8 ^ u û
Note to self (and gekko's wife): for Chinese pinyin input in Emacs, C-\ py
No fucking IME needed :)
..gnutella..
Re: Emacs tips and tricks
^ Oh yes, that Chinese pinyin trick is a slap in that face of poor iBus! ;)
Re: Emacs tips and tricks
Flycheck: http://www.lunaryorn.com/2014/12/23/my- ... -0.22.html
Been avoiding this package for way too long. My bad. On-the-fly syntax checking is really helping me a lot in writing better code and understand it better. Probably only for the OCD minds out there.
Been avoiding this package for way too long. My bad. On-the-fly syntax checking is really helping me a lot in writing better code and understand it better. Probably only for the OCD minds out there.
Re: Emacs tips and tricks
Better init file? https://github.com/jwiegley/use-package
My configuration grows every day, I don't know if I have the strength to refactor all of it to use this package.
My configuration grows every day, I don't know if I have the strength to refactor all of it to use this package.
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: Emacs tips and tricks
^ Yeah, that's like re-partition just to try btrfs ;)
Fancier mode line? Powerline style in Emacs? -> https://github.com/Bruce-Connor/smart-mode-line
Of course also more here: http://www.emacswiki.org/emacs/ModeLineConfiguration
Fancier mode line? Powerline style in Emacs? -> https://github.com/Bruce-Connor/smart-mode-line
Of course also more here: http://www.emacswiki.org/emacs/ModeLineConfiguration
..gnutella..
Re: Emacs tips and tricks
^ Using that smart-mode-line lately. Still have to understand how to hide some modes I don't really care having in the mode line, but it is a pretty good package.
Re: Emacs tips and tricks
Ok, since today in the office there is nobody around I refactored all my configuration to use that use-package. Looks cleaner and easier to maintain. If anyone interested, it is here: https://github.com/boccaperta-it/emacs
And to hide undesired modes when using smart-mode-line:
And to hide undesired modes when using smart-mode-line:
Code: Select all
setq rm-blacklist (quote (" my-keys-mode"
" PgLn"
" Projectile"
" company"
" Undo-Tree"))
Re: Emacs tips and tricks
One more praise about use-package, and then I STFU. Try:
upon startup before and after using use-package. Definitely worth it. :)
Code: Select all
M-x emacs-init-time RET
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: Emacs tips and tricks
Has anybody tried the Hemlock already? http://www.common-lisp.net/project/phemlock/
I couldn't get it to run (weeks ago! don't remember what the problem was -- the (ed) in cmucl [ cmucl-source package in Debian ] as shown here http://www.cons.org/cmucl/hemlock/index-print.html didn't do it)
For those who want to have an Emacs-like edtor in the browser, there's http://www.ymacs.org/ (check the demo!)
I couldn't get it to run (weeks ago! don't remember what the problem was -- the (ed) in cmucl [ cmucl-source package in Debian ] as shown here http://www.cons.org/cmucl/hemlock/index-print.html didn't do it)
For those who want to have an Emacs-like edtor in the browser, there's http://www.ymacs.org/ (check the demo!)
..gnutella..
Re: Emacs tips and tricks
Didn't know about Hemlock. We need good ol' Joe for this one. ;)
Re: Emacs tips and tricks
For all the dired junkies: http://oremacs.com/2015/01/12/dired-file-size/
Re: Emacs tips and tricks
Sorry, just now caught up on this thread. What do I need to make happen? Hemlock in Debian? I will give it a go sometime.GekkoP wrote:Didn't know about Hemlock. We need good ol' Joe for this one. ;)
(Edit: Perhaps not getting to this soon, if ever. I'm having a bit of trouble managing some IRL stuff right now.)
Re: Emacs tips and tricks
Masters say: to avoid your left pinky finger to be hurt real bad by all those wacky keybindings, use Caps Lock as left Ctrl key.
I've been trying it out for a while and seems to work for me.
On LinuxBBQ Haggis I just added this to my .xinitrc
This line does not swap Caps Lock and left Ctrl, as some of the masters suggest, but simply adds Caps Lock as an extra Ctrl key. Because I always liked telling my masters "in your face!". Or something like that.
I've been trying it out for a while and seems to work for me.
On LinuxBBQ Haggis I just added this to my .xinitrc
Code: Select all
setxkbmap -option ctrl:nocaps
-
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
- Contact:
Re: Emacs tips and tricks
^ The only useful thing to do with Caps Lock. I also hate the suggestion of 'switching' these two. Caps Lock is so 1950s :)
(And Happy 2222 posts to you, gekko!)
(And Happy 2222 posts to you, gekko!)
..gnutella..