Adds colored cursors; better error handling for Emacs and Vim

This commit is contained in:
William Carroll 2017-01-23 18:05:21 -05:00
parent 8ca1874d15
commit 66345e287b
2 changed files with 91 additions and 14 deletions

View file

@ -27,7 +27,7 @@
'(neo-window-width 35) '(neo-window-width 35)
'(package-selected-packages '(package-selected-packages
(quote (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-mode t)
'(popwin:popup-window-height 25) '(popwin:popup-window-height 25)
'(tool-bar-mode nil)) '(tool-bar-mode nil))
@ -70,6 +70,9 @@
;; Enable autocompletion ;; Enable autocompletion
(add-hook 'after-init-hook 'global-company-mode) (add-hook 'after-init-hook 'global-company-mode)
;; Remove company delay
(setq-default company-idle-delay 0)
;; View stream of Emacs commands ;; View stream of Emacs commands
(require 'command-log-mode) (require 'command-log-mode)
@ -81,12 +84,14 @@
;; Flycheck Settings ;; Flycheck Settings
;; (add-hook 'after-init-hook #'global-flycheck-mode) (require 'flycheck)
(add-hook 'after-init-hook 'global-flycheck-mode)
;; Elixir (Credo) Settings ;; Elixir flycheck compile-time errors
;; (require 'flycheck-credo) (require 'flycheck-mix)
;; (add-hook 'elixir-mode-hook 'flycheck-credo-setup) (require 'flycheck-credo)
(eval-after-load 'flycheck (lambda () (flycheck-credo-setup) (flycheck-mix-setup)))
;; Magit Settings ;; Magit Settings
@ -132,6 +137,13 @@
(global-set-key (kbd "C-x p") 'helm-projectile-ack) (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 ;; disable popwin-mode in an active Helm session It should be disabled
;; otherwise it will conflict with other window opened by Helm persistent ;; otherwise it will conflict with other window opened by Helm persistent
;; action, such as *Help* window. ;; action, such as *Help* window.
@ -196,6 +208,7 @@
;; Evil Settings ;; Evil Settings
(require 'evil) (require 'evil)
(require 'evil-leader)
(defun register-evil-keybindings-for-neotree () (defun register-evil-keybindings-for-neotree ()
"Registers keybindings for Evil mode for NeoTree plugin." "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 "q") 'neotree-hide)
(evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter)) (evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter))
;; Evil colored-cursors
;; Evil Surround (setq evil-emacs-state-cursor '("red" box))
(require 'evil-surround) (setq evil-normal-state-cursor '("green" box))
(global-evil-surround-mode 1) (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 ;; Display column number alongside row number
@ -234,6 +250,17 @@
(add-hook 'neotree-mode-hook (lambda () (bootstrap-evil-mode) (hl-line-mode)) ) (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 ;; Window movement
(global-set-key (kbd "C-c w f") 'windmove-right) (global-set-key (kbd "C-c w f") 'windmove-right)
(global-set-key (kbd "C-c w b") 'windmove-left) (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) (interactive)
(evil-local-mode t) (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: ;; Toggle off Emacs bindings when in Vim `normal` mode except:
;; * `M-x` ;; * `M-x`
;; (setcdr global-map nil) ;; (setcdr global-map nil)

View file

@ -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! <SID>LocationPrevious()
try
lprev
catch /^Vim\%((\a\+)\)\=:E553/
llast
endtry
endfunction
function! <SID>LocationNext()
try
lnext
catch /^Vim\%((\a\+)\)\=:E553/
lfirst
endtry
endfunction
nnoremap <Leader>[ :call <SID>LocationPrevious()<CR>
nnoremap <Leader>] :call <SID>LocationNext()<CR>
" Alchemist settings " Alchemist settings
let g:alchemist#elixir_erlang_src = '/usr/local/share/src' let g:alchemist#elixir_erlang_src = '/usr/local/share/src'
@ -428,11 +479,6 @@ nnoremap <leader>n :NERDTreeToggle<CR>
nnoremap <leader>f :NERDTreeFind<CR> nnoremap <leader>f :NERDTreeFind<CR>
" Jump to the top / bottom of the Viewport
nnoremap K H
nnoremap J L
" BOL and EOL " BOL and EOL
nnoremap H ^ nnoremap H ^
vnoremap H ^ vnoremap H ^