This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove dired+ and bookmark+ packages | |
clean dired+ config | |
;; (setq desktop-save 'ask) | |
;;desktop-save ask means always ask | |
;; (desktop-save-mode nil) | |
(setq confirm-kill-emacs 'y-or-n-p) | |
(defun ask-before-closing () | |
"Useful to be used in emacsclient to avoid accident exit of Emacs like 'Save desktop?'." | |
(interactive) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delete tokei config | |
download scc bin to ~/.local/bin/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The packages needed to be installed using conda are(only if you have no sudo permission or the offcial is old) | |
# conda install -c conda-forge ncurses emacs w3m fish the_silver_searcher source-highlight tokei | |
# conda install -c ripl-org tmux | |
# conda install -c lebedov tig | |
delete space at the end of condai | |
emi -> eme | |
replace cloc with tokei | |
abbr cl 'tokei --sort code' # install tokei using `conda install -c conda-forge tokei` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fu -d 'fu command and prompt to ask to open it or not' | |
# $argv could be builtin keyword, function, alias, file(bin/script) in $PATH, abbr | |
# And they all could be defined in script or temporally (could be found in any file) | |
set found 0 | |
# Check `type` output, NOTE: `type` doesn't support abbr | |
if type $argv ^/dev/null # omit the result once error(abbr or not-a-thing) returned, $status = 0 | |
set found 1 # for not-a-thing | |
set result (type $argv) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delete drag-stuff config and package | |
;; cool-moves | |
(require 'cool-moves) | |
;; M-.. are useful in org-mode, use elpy-mode-map instead of python-mode-map here | |
(dolist (m (list prog-mode-map elpy-mode-map)) | |
(bind-keys :map m | |
("M-<up>" . cool-moves/line-backward) | |
("M-<down>" . cool-moves/line-forward) | |
("M-<left>" . cool-moves/sexp-backward) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If less gets stuck when opening a file | |
comment LESSOPEN line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function t -d 'if tmux is running, attach it, if not, create a new tmux session, and check $SHELL' | |
if not command -sq tmux | |
echo tmux is not installed, please install it! | |
return 1 | |
end | |
if test (basename $SHELL) = "bash" | |
if test -f ~/anaconda3/bin/fish | |
set -gx SHELL ~/anaconda3/bin/fish | |
else if command -sq fish |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. delete `;; You can do M-c/...` line | |
2. delete `C-x M-c` line | |
3. delete the comment-style line, since it will affect M-; comment style if it is one line | |
4. delete sh-mode-hook part | |
─ | |
(defun in-comment-p (&optional pos) | |
"Test if character at POS is comment. If POS is nil, character at `(point)' is tested. | |
From https://emacs.stackexchange.com/a/14716/794" | |
(interactive) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
t () { # set $SHELL fish if it is not, attach tmux session if exists | |
if ! hash tmux 2>/dev/null; then | |
echo tmux is not installed, please install it! | |
return 1 | |
fi | |
if [ $(basename $SHELL) != "fish" ]; then | |
if [ -f ~/anaconda3/bin/fish ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delete origami config(and other func mentioned origami) and package since it doesn't work well with Python | |
delete iy-go-to-char config and package | |
C-return binding doesn't work with Emacs in terminal, so rebind | |
;; yafolding | |
;; (autoload 'yafolding "yafolding" t) | |
(add-hook 'prog-mode-hook 'yafolding-mode) | |
(bind-keys :map prog-mode-map | |
("C-c f" . yafolding-toggle-element) | |
("C-c F" . yafolding-toggle-all)) |