Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions emacs/kch/.emacs.d/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
(defun disable-minor-mode (mode major-mod-list)
"Disable minor MODE when 'major-mode' in MAJOR-MOD-LIST."
(if (member major-mode major-mod-list)
(funcall mode 0)
(funcall mode 1)))
(funcall mode 0)))

;;line numbering
(global-display-line-numbers-mode 1)
Expand All @@ -51,7 +50,11 @@
treemacs-mode
shell-mode
gud-mode
term-mode
tetris-mode
snake-mode
eww-mode
magit-mode
eshell-mode
doc-view-mode
latex-mode))))
Expand Down
69 changes: 64 additions & 5 deletions emacs/kch/.emacs.d/package.org
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:ensure t)
#+end_src
* Evil
[[https://github.com/emacs-evil/evil][github - evil]]
vim key binding
evil has several states.
you can define key bindings depend on the state.
Expand All @@ -28,14 +29,25 @@
(setq evil-replace-state-cursor '("orange" box)))
#+end_src
* Magit
[[https://github.com/magit/magit][github - magit]]
git interface
- hit C-x g (see the git state)
- hit C-c g (do other git stuff)
#+begin_src emacs-lisp
(use-package magit
:ensure t
:config
(global-set-key (kbd "C-c g") 'magit-dispatch-popup))
#+end_src
* Yassnippet
[[https://github.com/joaotavora/yasnippet][github - yasnippet]]
1. type the key
2. hit the tab
3. complete snippet automatically


- run command yas-new-snippet to add new snippet
- run yas-describe-tables to list up possible snippets depends on major-mode
#+begin_src emacs-lisp
(use-package yasnippet
:ensure t
Expand All @@ -51,6 +63,15 @@
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
#+end_src
* Iedit
[[https://github.com/victorhge/iedit][github - iedit]]
Modify same simbols concurrently
Locate point on the simbol and hit C-c ;
After revise then hit C-c ; again
You can combine Iedit with "emacs narrow" and "emacs wider"
1. Select visual block
2. hit C-x n n (narrow)
3. hit C-x n w (wider)
Use Iedit inside emacs narrow will effect only narrowed buffer.
#+begin_src emacs-lisp
(use-package iedit
:ensure t
Expand All @@ -59,6 +80,7 @@
#+end_src

* Flycheck
[[https://www.flycheck.org/en/latest/][flycheck org]]
grammar check
#+begin_src emacs-lisp
(use-package flycheck
Expand All @@ -70,6 +92,7 @@
(shell-command-to-string "which pylint")))))
#+end_src
* Company
[[https://github.com/company-mode/company-mode][github - company mode]]
autocompletion front hand
#+begin_src emacs-lisp
(use-package company
Expand All @@ -78,6 +101,19 @@
(global-company-mode))
#+end_src
* LSP
[[https://emacs-lsp.github.io/lsp-mode/][lsp-mode github.io]]
Language Server Protocol
language server can understand your code and show up some recommendations.
- list up autocomplete candidates (with company mode)
- error check with flycheck
- xref (behave like ctag)

before use lsp, visit official web site.

If you want to use lsp with C/C++ project has complecated directory architecture,
I strongly recommend "bear"
[[https://github.com/rizsotto/Bear][github - bear]]

** lsp-mode
#+begin_src emacs-lisp
(use-package lsp-mode
Expand Down Expand Up @@ -108,6 +144,7 @@
:ensure t)
#+END_SRC
* Conda
[[https://github.com/necaris/conda.el][github - conda]]
Conda supports different pyls with anaconda.
#+BEGIN_SRC emacs-lisp
(use-package conda
Expand All @@ -124,6 +161,7 @@
* Xcscope
cscope setting with xcscope package.
check github repo get to know how to install this.
[[https://github.com/dkogan/xcscope.el][github - xcscope]]
#+begin_src emacs-lisp
(use-package xcscope
:ensure t
Expand All @@ -144,14 +182,18 @@
(load-theme 'dracula t))
#+end_src
* Ox-reveal (Reveal.js for emacs)
[[https://github.com/hexmode/ox-reveal][github ox-reveal]]
reveal.js presentation
in org buffer, you can use Yassnippet "<pre"
if you want offline support, clone reveal.js into your .emacs.d
#+begin_src emacs-lisp
(use-package ox-reveal
:ensure ox-reveal
:config
(setq org-reveal-root "file:///home/madplayer/.emacs.d/reveal.js"))
#+end_src
* Emms
[[https://www.gnu.org/software/emms/][gnu - emms]]
emacs music player
#+begin_src emacs-lisp
;;music player
Expand Down Expand Up @@ -180,6 +222,7 @@
#+end_src

* Markdown
you need usable pandoc and browser
** markdown-mode
#+begin_src emacs-lisp
(use-package markdown-mode
Expand All @@ -193,6 +236,7 @@
:ensure t)
#+end_src
* Ivy
[[https://github.com/abo-abo/swiper][github - swiper]]
list up your possible choices
#+begin_src emacs-lisp
;;for command searching
Expand All @@ -210,13 +254,15 @@
(define-key ivy-minibuffer-map (kbd "M-p") 'ivy-previous-line))
#+end_src
* Counsel
check link for ivy
#+BEGIN_SRC emacs-lisp
(use-package counsel
:ensure t
:bind
(("C-SPC" . counsel-company)))
#+END_SRC
* Swiper
check link for ivy
ivy applied searching
#+begin_src emacs-lisp
(use-package swiper
Expand All @@ -225,6 +271,7 @@
("C-s" . swiper)))
#+end_src
* Avy
[[https://github.com/abo-abo/avy][github - avy]]
avy char based point shift
#+begin_src emacs-lisp
(use-package avy
Expand All @@ -243,6 +290,13 @@
(global-undo-tree-mode))
#+end_src
* Ibuffer
better buffer manager
- hit j to jump to the buffer
- n, p change point
- m, u mark and unmark buffer
- d mark buffer to kill
- x execute kill
- t mark al
#+BEGIN_SRC emacs-lisp
(defsubst ibuffer-window ()
(interactive)
Expand All @@ -254,8 +308,9 @@
(("C-x C-b" . 'ibuffer-window)))
#+END_SRC
* Projectile
[[https://github.com/bbatsov/projectile][github - projectile]]
project manager
just run the comment then you will know
just run the command then you will know C-c p
projectile distinguishes git, maven, ...ect
#+BEGIN_SRC emacs-lisp
(use-package projectile
Expand All @@ -265,6 +320,7 @@
:bind (("C-c p" . projectile-commander)))
#+END_SRC
* Treemacs
[[https://github.com/Alexander-Miller/treemacs][github - treemacs]]
project directory tree GUI
#+BEGIN_SRC emacs-lisp
(use-package treemacs
Expand All @@ -286,13 +342,16 @@
:ensure t)
#+END_SRC
* Eshell
[[https://www.gnu.org/software/emacs/manual/html_mono/eshell.html][gnu - eshell]]
eshell can read lisp
#+BEGIN_SRC emacs-lisp
(defun eshell/xdg-open (arg)
"ARG is argment for xdg-open."
(async-shell-command (concat "setsid xdg-open "
(shell-quote-argument arg))))
(defun eshell/xdg-open (arg)
"ARG is argment for xdg-open."
(async-shell-command (concat "setsid xdg-open "
(shell-quote-argument arg))))
#+END_SRC
* YAML MODE
[[https://github.com/yoshiki/yaml-mode][github - yaml-mode]]
#+BEGIN_SRC emacs-lisp
(use-package yaml-mode
:ensure t)
Expand Down