From 66345e287bd5ec01ab82c43c8633435c86322af3 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 23 Jan 2017 18:05:21 -0500 Subject: Adds colored cursors; better error handling for Emacs and Vim --- configs/.emacs | 49 ++++++++++++++++++++++++++++++++++++++++--------- configs/.vimrc | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 91 insertions(+), 14 deletions(-) (limited to 'configs') diff --git a/configs/.emacs b/configs/.emacs index 6588bad15eda..dd72ff9df20e 100644 --- a/configs/.emacs +++ b/configs/.emacs @@ -27,7 +27,7 @@ '(neo-window-width 35) '(package-selected-packages (quote - (typescript-mode evil-surround erlang elixir-mode golden-ratio flycheck-credo flycheck command-log-mode atom-one-dark-theme exec-path-from-shell clues-theme gotham-theme dracula-theme zenburn-theme fill-column-indicator neotree evil helm-swoop iedit vimrc-mode helm-ispell transpose-frame helm-projectile helm-ack nyan-mode alchemist helm magit dockerfile-mode elm-mode ack))) + (evil-leader flycheck-mix flycheck-elixir evil-matchit typescript-mode evil-surround erlang elixir-mode golden-ratio flycheck-credo flycheck command-log-mode atom-one-dark-theme exec-path-from-shell clues-theme gotham-theme dracula-theme zenburn-theme fill-column-indicator neotree evil helm-swoop iedit vimrc-mode helm-ispell transpose-frame helm-projectile helm-ack nyan-mode alchemist helm magit dockerfile-mode elm-mode ack))) '(popwin-mode t) '(popwin:popup-window-height 25) '(tool-bar-mode nil)) @@ -70,6 +70,9 @@ ;; Enable autocompletion (add-hook 'after-init-hook 'global-company-mode) +;; Remove company delay +(setq-default company-idle-delay 0) + ;; View stream of Emacs commands (require 'command-log-mode) @@ -81,12 +84,14 @@ ;; Flycheck Settings -;; (add-hook 'after-init-hook #'global-flycheck-mode) +(require 'flycheck) +(add-hook 'after-init-hook 'global-flycheck-mode) -;; Elixir (Credo) Settings -;; (require 'flycheck-credo) -;; (add-hook 'elixir-mode-hook 'flycheck-credo-setup) +;; Elixir flycheck compile-time errors +(require 'flycheck-mix) +(require 'flycheck-credo) +(eval-after-load 'flycheck (lambda () (flycheck-credo-setup) (flycheck-mix-setup))) ;; Magit Settings @@ -132,6 +137,13 @@ (global-set-key (kbd "C-x p") 'helm-projectile-ack) +;; Ansi Term Settings +;; (define-key 'term-mode-map (kbd "C-h") 'window-left) +;; (define-key 'term-mode-map (kbd "C-l") 'window-right) +;; (define-key 'term-mode-map (kbd "C-k") 'window-up) +;; (define-key 'term-mode-map (kbd "C-j") 'window-down) + + ;; disable popwin-mode in an active Helm session It should be disabled ;; otherwise it will conflict with other window opened by Helm persistent ;; action, such as *Help* window. @@ -196,6 +208,7 @@ ;; Evil Settings (require 'evil) +(require 'evil-leader) (defun register-evil-keybindings-for-neotree () "Registers keybindings for Evil mode for NeoTree plugin." @@ -204,10 +217,13 @@ (evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide) (evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter)) - -;; Evil Surround -(require 'evil-surround) -(global-evil-surround-mode 1) +;; Evil colored-cursors +(setq evil-emacs-state-cursor '("red" box)) +(setq evil-normal-state-cursor '("green" box)) +(setq evil-visual-state-cursor '("orange" box)) +(setq evil-insert-state-cursor '("red" bar)) +(setq evil-replace-state-cursor '("red" bar)) +(setq evil-operator-state-cursor '("red" hollow)) ;; Display column number alongside row number @@ -234,6 +250,17 @@ (add-hook 'neotree-mode-hook (lambda () (bootstrap-evil-mode) (hl-line-mode)) ) +;; Evil Plugins + +;; Evil Match-it +(require 'evil-matchit) +(global-evil-matchit-mode 1) + +;; Evil Surround +(require 'evil-surround) +(global-evil-surround-mode 1) + + ;; Window movement (global-set-key (kbd "C-c w f") 'windmove-right) (global-set-key (kbd "C-c w b") 'windmove-left) @@ -266,6 +293,10 @@ when in Vim's `insert` mode, favoring native Emacs bindings instead." (interactive) (evil-local-mode t) + ;; Evil-leader + (global-evil-leader-mode) + (evil-leader/set-leader (kbd "SPC")) + ;; Toggle off Emacs bindings when in Vim `normal` mode except: ;; * `M-x` ;; (setcdr global-map nil) diff --git a/configs/.vimrc b/configs/.vimrc index e7a06d70ec51..e0476e3f12d1 100644 --- a/configs/.vimrc +++ b/configs/.vimrc @@ -158,6 +158,57 @@ let g:neomake_elixir_credo_maker = { \ } +let g:neomake_elixir_enabled_makers = ['mix', 'credo'] + +augroup my_error_signs + au! + autocmd ColorScheme * hi NeomakeErrorSign ctermfg=203 guifg=#ff5f5f + autocmd ColorScheme * hi NeomakeWarningSign ctermfg=209 guifg=#ffaf00 + autocmd ColorScheme * hi NeomakeInfoSign ctermfg=183 guifg=#dfafff + autocmd ColorScheme * hi NeomakeMessageSign ctermfg=27 guifg=#0087ff +augroup END + + +let g:neomake_error_sign = { + \ 'text': '>>', + \ 'texthl': 'NeoMakeErrorSign', + \ } + +let g:neomake_warning_sign = { + \ 'text': '>>', + \ 'texthl': 'NeoMakeWarningSign', + \ } + +let g:neomake_info_sign = { + \ 'text': '>>', + \ 'texthl': 'NeoMakeInfoSign', + \ } + +let g:neomake_message_sign = { + \ 'text': '>>', + \ 'texthl': 'NeoMakeMessageSign', + \ } + +function! LocationPrevious() + try + lprev + catch /^Vim\%((\a\+)\)\=:E553/ + llast + endtry +endfunction + +function! LocationNext() + try + lnext + catch /^Vim\%((\a\+)\)\=:E553/ + lfirst + endtry +endfunction + +nnoremap [ :call LocationPrevious() +nnoremap ] :call LocationNext() + + " Alchemist settings let g:alchemist#elixir_erlang_src = '/usr/local/share/src' @@ -428,11 +479,6 @@ nnoremap n :NERDTreeToggle nnoremap f :NERDTreeFind -" Jump to the top / bottom of the Viewport -nnoremap K H -nnoremap J L - - " BOL and EOL nnoremap H ^ vnoremap H ^ -- cgit 1.4.1