From c81b6905aa178349c8633ac623ae2cd1d91f88a9 Mon Sep 17 00:00:00 2001 From: gxlin Date: Tue, 23 Mar 2021 18:26:11 +0800 Subject: More config --- .emacs.d/init.el | 33 ++++++++++++++++++++++++++++++++- .vim/init.vim | 23 +++++++++++++++++++---- .vim/plugins/ime.vim | 4 ---- .vim/plugins/startify.vim | 1 + .vim/plugins/tex.vim | 1 + 5 files changed, 53 insertions(+), 9 deletions(-) delete mode 100644 .vim/plugins/ime.vim create mode 100644 .vim/plugins/startify.vim create mode 100644 .vim/plugins/tex.vim diff --git a/.emacs.d/init.el b/.emacs.d/init.el index b3583b0..141702e 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -4,12 +4,18 @@ '("melpa" . "https://melpa.org/packages/")) (package-initialize) +(dolist (package '(use-package)) + (unless (package-installed-p package) + (package-install package))) +(require 'use-package) + (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. - '(package-selected-packages '(paredit auto-complete ledger-mode evil))) + '(package-selected-packages + '(evil-escape counsel evil-org paredit auto-complete ledger-mode evil))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. @@ -26,9 +32,26 @@ (package-install 'evil)) (require 'evil) (evil-mode 1) +(evil-set-leader 'normal ",") + +;; Evil escape +(unless (package-installed-p 'evil-escape) + (package-install 'evil-escape)) +(require 'evil-escape) +(evil-escape-mode) +(setq-default + evil-escape-key-sequence "jk" + evil-escape-unordered-key-sequence t) ;; Org Mode (add-hook 'org-mode-hook (lambda () (setq truncate-lines nil))) +(use-package evil-org + :ensure t + :after org + :hook (org-mode . (lambda () evil-org-mode)) + :config + (require 'evil-org-agenda) + (evil-org-agenda-set-keys)) ;; ledger-mode (unless (package-installed-p 'ledger-mode) @@ -54,3 +77,11 @@ (require 'paredit) (add-hook 'emacs-lisp-mode-hook (lambda () (paredit-mode 1))) +;; Counsel +(unless (package-installed-p 'counsel) + (package-install 'counsel)) +(ivy-mode) +(setq ivy-use-virutal-buffers t) +(setq enable-recursive-minibuffers t) +(evil-define-key 'normal 'global (kbd "ff") 'counsel-find-file) +(evil-define-key 'normal 'global (kbd "go") 'counsel-git-grep) diff --git a/.vim/init.vim b/.vim/init.vim index bd00085..93bebcc 100644 --- a/.vim/init.vim +++ b/.vim/init.vim @@ -13,7 +13,7 @@ filetype indent on set modeline set textwidth=72 set formatoptions+=mB -set formatoptions-=t +set formatoptions-=tc set secure set hidden @@ -29,8 +29,19 @@ endif if has("gui_running") if has("gui_macvim") set guifont=Monaco:h15 - set noimdisable set transparency=10 + set noimdisable + + noremap :tabn 1 + noremap :tabn 2 + noremap :tabn 3 + noremap :tabn 4 + noremap :tabn 5 + noremap :tabn 6 + noremap :tabn 7 + noremap :tabn 8 + noremap :tabn 9 + noremap :tablat endif endif @@ -83,8 +94,12 @@ set tags=./.tags;,.tags " mapping let mapleader=',' " change the key -nnoremap n :bn -nnoremap p :bp +inoremap jk +nnoremap [w h +nnoremap [ww k +nnoremap ]w :wincmd l +nnoremap ]ww :wincmd j +nnoremap cd :cd %:p:h :pwd source ~/.dotfiles/.vim/plugins/init.vim diff --git a/.vim/plugins/ime.vim b/.vim/plugins/ime.vim deleted file mode 100644 index de7dcf2..0000000 --- a/.vim/plugins/ime.vim +++ /dev/null @@ -1,4 +0,0 @@ -Plug 'pi314/ime.vim' -Plug 'pi314/ime-phonetic.vim' - -let g:ime_plugins = ['pinyin'] diff --git a/.vim/plugins/startify.vim b/.vim/plugins/startify.vim new file mode 100644 index 0000000..a4f7c1d --- /dev/null +++ b/.vim/plugins/startify.vim @@ -0,0 +1 @@ +Plug 'mhinz/vim-startify' diff --git a/.vim/plugins/tex.vim b/.vim/plugins/tex.vim new file mode 100644 index 0000000..b74256a --- /dev/null +++ b/.vim/plugins/tex.vim @@ -0,0 +1 @@ +Plug 'lervag/vimtex' -- cgit v1.2.3