|
7 | 7 | (global-set-key [remap goto-line] 'goto-line-preview)) |
8 | 8 | (setq mac-option-modifier 'super) |
9 | 9 |
|
| 10 | + |
| 11 | +(when (eq system-type 'darwin) |
| 12 | + (require 'ls-lisp) |
| 13 | + (setq ls-lisp-use-insert-directory-program nil) |
| 14 | + (setq insert-directory-program "/bin/ls") |
| 15 | + ;; (setq dired-listing-switches "your settings")) |
| 16 | + ) |
| 17 | + |
| 18 | +(show-paren-mode 1) |
| 19 | +(setq show-paren-delay 0) |
| 20 | + |
| 21 | +(electric-pair-mode 1) |
| 22 | +(setq electric-pair-preserve-balance nil) |
| 23 | + |
| 24 | + |
10 | 25 | (use-package projectile |
11 | 26 | :ensure t) |
12 | 27 | (projectile-mode +1) |
|
16 | 31 | (counsel-projectile-mode +1) |
17 | 32 | (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map) |
18 | 33 |
|
19 | | -(show-paren-mode 1) |
20 | | -(setq show-paren-delay 0) |
21 | | - |
22 | | -(electric-pair-mode 1) |
23 | | -(setq electric-pair-preserve-balance nil) |
24 | | - |
25 | 34 | (use-package treemacs-projectile |
26 | 35 | :ensure t) |
27 | 36 |
|
28 | 37 | (use-package restart-emacs |
29 | 38 | :ensure t) |
30 | 39 |
|
31 | 40 |
|
32 | | -;; Config navigative for emacs |
33 | | - |
34 | | - |
35 | | -(when (eq system-type 'darwin) |
36 | | - (require 'ls-lisp) |
37 | | - (setq ls-lisp-use-insert-directory-program nil) |
38 | | - (setq insert-directory-program "/bin/ls") |
39 | | - ;; (setq dired-listing-switches "your settings")) |
40 | | - ) |
41 | | - |
42 | | -(use-package ivy |
| 41 | +;; ;; Config navigative for emacs |
| 42 | + |
| 43 | +;; (use-package ivy |
| 44 | +;; :ensure t |
| 45 | +;; :config |
| 46 | +;; (ivy-mode 1)) |
| 47 | + |
| 48 | + |
| 49 | +;; (defun vuvoth/ivy-format-function-arrow (cands) |
| 50 | +;; "Transform CANDS into a string for minibuffer." |
| 51 | +;; (ivy--format-function-generic |
| 52 | +;; (lambda (str) |
| 53 | +;; (concat " -> " (ivy--add-face (concat str "\n") 'ivy-current-match))) |
| 54 | +;; (lambda (str) |
| 55 | +;; (concat " " str "\n")) |
| 56 | +;; cands |
| 57 | +;; "")) |
| 58 | + |
| 59 | +;; (defun vuvoth/ivy-format-function-line (Cands) |
| 60 | +;; "Transform CANDS into a string for minibuffer." |
| 61 | +;; (ivy--format-function-generic |
| 62 | +;; (lambda (str) |
| 63 | +;; (ivy--add-face (concat str "\n") 'ivy-current-match)) |
| 64 | +;; (lambda (str) |
| 65 | +;; (concat str "\n")) |
| 66 | +;; cands |
| 67 | +;; "")) |
| 68 | + |
| 69 | + |
| 70 | +;; (set-face-attribute 'ivy-current-match nil :underline nil :foreground nil :background "gray15") |
| 71 | + |
| 72 | +;; (setcdr (assq t ivy-format-functions-alist) #'vuvoth/ivy-format-function-arrow) |
| 73 | + |
| 74 | +;; (use-package smex |
| 75 | +;; :ensure t) |
| 76 | +;; (use-package counsel |
| 77 | +;; :ensure t) |
| 78 | +;; (global-set-key (kbd "M-s s") 'swiper) |
| 79 | +;; (global-set-key (kbd "C-c C-r") 'ivy-resume) |
| 80 | +;; (global-set-key (kbd "<f6>") 'ivy-resume) |
| 81 | +;; (global-set-key (kbd "M-x") 'counsel-M-x) |
| 82 | +;; (global-set-key (kbd "C-x C-f") 'counsel-find-file) |
| 83 | +;; (global-set-key (kbd "<f1> f") 'counsel-describe-function) |
| 84 | +;; (global-set-key (kbd "<f1> v") 'counsel-describe-variable) |
| 85 | +;; (global-set-key (kbd "<f1> l") 'counsel-find-library) |
| 86 | +;; (global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol) |
| 87 | +;; (global-set-key (kbd "<f2> u") 'counsel-unicode-char) |
| 88 | +;; (global-set-key (kbd "C-c g") 'counsel-git) |
| 89 | +;; (global-set-key (kbd "C-c j") 'counsel-git-grep) |
| 90 | +;; (global-set-key (kbd "C-c k") 'counsel-ag) |
| 91 | +;; (global-set-key (kbd "C-x l") 'counsel-locate) |
| 92 | + |
| 93 | +;; (define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history) |
| 94 | + |
| 95 | + |
| 96 | +(use-package helm |
43 | 97 | :ensure t |
44 | 98 | :config |
45 | | - (ivy-mode 1)) |
46 | | - |
47 | | - |
48 | | -(defun vuvoth/ivy-format-function-arrow (cands) |
49 | | - "Transform CANDS into a string for minibuffer." |
50 | | - (ivy--format-function-generic |
51 | | - (lambda (str) |
52 | | - (concat " -> " (ivy--add-face (concat str "\n") 'ivy-current-match))) |
53 | | - (lambda (str) |
54 | | - (concat " " str "\n")) |
55 | | - cands |
56 | | - "")) |
| 99 | + (helm-mode +1) |
| 100 | + ;; (require 'helm-config) |
| 101 | + (setq helm-split-window-inside-p t) |
| 102 | + (setq helm-use-frame-when-more-than-two-windows nil) |
| 103 | + (setq helm-autoresize-max-height 0) |
| 104 | + (setq helm-autoresize-min-height 30) |
| 105 | + (setq helm-display-buffer-default-height 23) |
| 106 | + (setq helm-default-display-buffer-functions '(display-buffer-in-side-window)) |
| 107 | + (helm-autoresize-mode 1) |
| 108 | + :bind |
| 109 | + ("C-x C-f" . helm-find-files) |
| 110 | + ("M-x" . helm-M-x) |
| 111 | + ("C-x b" . helm-mini)) |
| 112 | + |
| 113 | + (global-visual-line-mode t) |
57 | 114 |
|
58 | | -(defun vuvoth/ivy-format-function-line (Cands) |
59 | | - "Transform CANDS into a string for minibuffer." |
60 | | - (ivy--format-function-generic |
61 | | - (lambda (str) |
62 | | - (ivy--add-face (concat str "\n") 'ivy-current-match)) |
63 | | - (lambda (str) |
64 | | - (concat str "\n")) |
65 | | - cands |
66 | | - "")) |
| 115 | +;disable backup |
| 116 | +(setq backup-inhibited t) |
| 117 | +;disable auto save |
| 118 | +(setq auto-save-default nil) |
67 | 119 |
|
| 120 | +(setq mac-command-modifier 'meta) |
| 121 | +(setq mac-right-option-modifier 'control) |
68 | 122 |
|
69 | | -(setcdr (assq t ivy-format-functions-alist) #'vuvoth/ivy-format-function-arrow) |
70 | 123 |
|
71 | | -(use-package smex |
72 | | - :ensure t) |
73 | | -(use-package counsel |
74 | | - :ensure t) |
75 | | -(global-set-key (kbd "M-s s") 'swiper) |
76 | | -(global-set-key (kbd "C-c C-r") 'ivy-resume) |
77 | | -(global-set-key (kbd "<f6>") 'ivy-resume) |
78 | | -(global-set-key (kbd "M-x") 'counsel-M-x) |
79 | | -(global-set-key (kbd "C-x C-f") 'counsel-find-file) |
80 | | -(global-set-key (kbd "<f1> f") 'counsel-describe-function) |
81 | | -(global-set-key (kbd "<f1> v") 'counsel-describe-variable) |
82 | | -(global-set-key (kbd "<f1> l") 'counsel-find-library) |
83 | | -(global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol) |
84 | | -(global-set-key (kbd "<f2> u") 'counsel-unicode-char) |
85 | | -(global-set-key (kbd "C-c g") 'counsel-git) |
86 | | -(global-set-key (kbd "C-c j") 'counsel-git-grep) |
87 | | -(global-set-key (kbd "C-c k") 'counsel-ag) |
88 | | -(global-set-key (kbd "C-x l") 'counsel-locate) |
89 | | - |
90 | | -(define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history) |
| 124 | +(setq scroll-preserve-screen-position 1) |
| 125 | +;;scroll window up/down by one line |
| 126 | +(global-set-key (kbd "M-n") (kbd "C-u 1 C-v")) |
| 127 | +(global-set-key (kbd "M-p") (kbd "C-u 1 M-v")) |
91 | 128 |
|
| 129 | +(provide 'navigative) |
92 | 130 |
|
93 | 131 | (global-visual-line-mode t) |
94 | 132 |
|
|
0 commit comments