Skip to content

Instantly share code, notes, and snippets.

@c02y
c02y / init.el
Last active January 28, 2019 03:22
python emacs
;; Python Development Environment
;; elpy or anaconda-mode
;;
;; ;; https://github.com/jorgenschaefer/elpy
;; ;; https://realpython.com/emacs-the-best-python-editor/
;; ;; usage of elpy: https://elpy.readthedocs.io/en/latest/ide.html
;; (elpy-enable)
;; ;; use flycheck instead of default flymake used by elpy
;; (setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
;; ;; (require 'py-autopep8)
@c02y
c02y / config.fish
Created January 28, 2019 02:13
wc alias
function wc
if test (count $argv) -gt 1
command wc $argv | sort -n
else
command wc $argv
end
end
@c02y
c02y / gist:28b5c5211dc6a7b16a536add4972b840
Created January 10, 2019 10:16
tweak toggle-maximize-window and bind ESC ESC ESC to it
(defun toggle-maximize-window (arg)
"Maximize window, called with C-u, maximize the other window."
(interactive "P")
(if (= 1 (length (window-list)))
(if (not (get-register '_))
(message "No window configuration existed!")
(jump-to-register '_))
(progn
(window-configuration-to-register '_)
(if current-prefix-arg
@c02y
c02y / vimrc
Created January 7, 2019 03:25
allow mouse scroll in vim inside tmux
set mouse=a
@c02y
c02y / init.el
Last active January 2, 2019 07:40
. binding in init.el
change
(bind-key "." 'semantic-complete-self-insert prog-mode-map)
(it will cause problems in python-mode)
to
(bind-key "." 'semantic-complete-self-insert c-mode-map)
(bind-key "." 'semantic-complete-self-insert c++-mode-map)
@c02y
c02y / init.el
Created January 2, 2019 03:00
align bindings in emacs
(bind-keys*
("C-c a a" . align)
("C-c a r" . align-regexp))
(dolist (m (list c-mode-map c++-mode-map))
(bind-keys :map m
:prefix-map align-prefix-map
:prefix "C-c a"
;; ("a" . align)
;; ("r" . align-regexp)
("c" . align-c-comments)
@c02y
c02y / config.fish
Last active December 20, 2018 09:41
vim aliases in config.fish
#vim
alias v 'vim'
alias V 'vim -u NONE'
alias vc 'vim ~/.cgdb/cgdbrc'
alias vimv 'vim ~/.vim/vimrc'
alias vimb 'vim ~/.bashrc'
alias vime 'vim ~/.emacs.d/init.el'
alias vim2 'vim ~/Recentchange/TODO'
alias vimf 'vim ~/.config/fish/config.fish; source ~/.config/fish/config.fish; echo config.fish reloaded!'
alias vimt 'vim ~/.tmux.conf; tmux source-file ~/.tmux.conf; echo ~/.tmux.conf reloaded!'
@c02y
c02y / init-tex.el
Last active December 27, 2018 08:57
init-tex.el for automatically install auctex if not installed
(when (not (package-installed-p 'auctex))
(package-install 'auctex))
chmod +x ~/.emacs.d/snippets/*
since if it got no x permission, it cannot be expaned by yasnippet
conda install -c conda-forge ncurses emacs w3m fish the_silver_searcher source-highlight
conda install -c ripl-org tmux
conda install -c freckles stow
pip install ranger-fm
to know what channel(conda-forge) provides the latest version of a package:
conda install -c binstar binstar # renamed to anaconda-client, so `conda install anaconda-client`
binstar search -t conda packgename # get the channel(user) name
conda install -c channel packagename
@c02y
c02y / config.fish
Last active November 27, 2018 06:49
time in ls
add "--time=ctime" in lst/lsh/lsh2/llh/lah/lat/llt