From f9d8887aca138512c4cbef807025f4e0676f6b10 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Fri, 9 May 2014 01:15:48 -0400 Subject: [PATCH 1/7] Actually block insert mode arrow keys --- .vimrc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.vimrc b/.vimrc index 7038f72..1d47475 100644 --- a/.vimrc +++ b/.vimrc @@ -85,10 +85,14 @@ map :w imap :w " Still using arrow keys when in insert mode sometimes -map -map -map -map +map +map +map +map +inoremap +inoremap +inoremap +inoremap " Don't cancel visual mode while indenting vnoremap > >gv From 5fd363e489a48c7f951f50a51a1807c7fa34a6fb Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Fri, 9 May 2014 01:16:01 -0400 Subject: [PATCH 2/7] Better search highlighting --- .vimrc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.vimrc b/.vimrc index 1d47475..9395a28 100644 --- a/.vimrc +++ b/.vimrc @@ -98,6 +98,10 @@ inoremap vnoremap > >gv vnoremap < n n:call HLNext(0.4) +nnoremap N N:call HLNext(0.4) + " Leaders (shortcuts) let mapleader = "," @@ -197,6 +201,18 @@ function! RenameFile() endif endfunction +" Blink current search item - from Damian Conway 'More Instantly Better Vim' +function! HLNext (blinktime) + let [bufnum, lnum, col, off] = getpos('.') + let matchlen = strlen(matchstr(strpart(getline('.'),col-1),@/)) + let target_pat = '\c\%#'.@/ + let ring = matchadd('ErrorMsg', target_pat, 101) + redraw + exec 'sleep ' . float2nr(a:blinktime * 1000) . 'm' + call matchdelete(ring) + redraw +endfunction + " Set special case colors function! SetColors() highlight CursorLine cterm=NONE ctermbg=234 From fa0a4038f9c31b427415cad77fd02894282be722 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Sun, 11 May 2014 02:48:01 -0400 Subject: [PATCH 3/7] Uncommitted changes --- .vimrc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.vimrc b/.vimrc index 9395a28..071b39f 100644 --- a/.vimrc +++ b/.vimrc @@ -73,9 +73,6 @@ set shiftround " if at odd number spaces, make >> go to next even " Show whitespace markers before cursor in insert mode set list listchars=tab:\ \ ,trail:ยท -" Aliases -command! Q q - " Filetype stuff syntax on @@ -84,6 +81,9 @@ syntax on map :w imap :w +" most common typo ever +command! Q q + " Still using arrow keys when in insert mode sometimes map map @@ -102,6 +102,9 @@ vnoremap < n n:call HLNext(0.4) nnoremap N N:call HLNext(0.4) +" i don't even know what semi-colon does so steal it +noremap ; : + " Leaders (shortcuts) let mapleader = "," From 44cfb54674252578cd7cd53dabc026fe06f2c9f6 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Wed, 14 May 2014 21:39:53 -0400 Subject: [PATCH 4/7] Move colorscheme to plugin --- .vim/colors/vividchalk.vim | 191 ------------------------------------- .vimrc | 1 + 2 files changed, 1 insertion(+), 191 deletions(-) delete mode 100644 .vim/colors/vividchalk.vim diff --git a/.vim/colors/vividchalk.vim b/.vim/colors/vividchalk.vim deleted file mode 100644 index 638a8f4..0000000 --- a/.vim/colors/vividchalk.vim +++ /dev/null @@ -1,191 +0,0 @@ -" Vim color scheme -" Name: vividchalk.vim -" Author: Tim Pope -" Version: 2.0 -" GetLatestVimScripts: 1891 1 :AutoInstall: vividchalk.vim - -" Based on the Vibrank Ink theme for TextMate -" Distributable under the same terms as Vim itself (see :help license) - -if has("gui_running") - set background=dark -endif -hi clear -if exists("syntax_on") - syntax reset -endif - -let colors_name = "vividchalk" - -" First two functions adapted from inkpot.vim - -" map a urxvt cube number to an xterm-256 cube number -fun! s:M(a) - return strpart("0245", a:a, 1) + 0 -endfun - -" map a urxvt colour to an xterm-256 colour -fun! s:X(a) - if &t_Co == 88 - return a:a - else - if a:a == 8 - return 237 - elseif a:a < 16 - return a:a - elseif a:a > 79 - return 232 + (3 * (a:a - 80)) - else - let l:b = a:a - 16 - let l:x = l:b % 4 - let l:y = (l:b / 4) % 4 - let l:z = (l:b / 16) - return 16 + s:M(l:x) + (6 * s:M(l:y)) + (36 * s:M(l:z)) - endif - endif -endfun - -function! E2T(a) - return s:X(a:a) -endfunction - -function! s:choose(mediocre,good) - if &t_Co != 88 && &t_Co != 256 - return a:mediocre - else - return s:X(a:good) - endif -endfunction - -function! s:hifg(group,guifg,first,second,...) - if a:0 && &t_Co == 256 - let ctermfg = a:1 - else - let ctermfg = s:choose(a:first,a:second) - endif - exe "highlight ".a:group." guifg=".a:guifg." ctermfg=".ctermfg -endfunction - -function! s:hibg(group,guibg,first,second) - let ctermbg = s:choose(a:first,a:second) - exe "highlight ".a:group." guibg=".a:guibg." ctermbg=".ctermbg -endfunction - -hi link railsMethod PreProc -hi link rubyDefine Keyword -hi link rubySymbol Constant -hi link rubyAccess rubyMethod -hi link rubyAttribute rubyMethod -hi link rubyEval rubyMethod -hi link rubyException rubyMethod -hi link rubyInclude rubyMethod -hi link rubyStringDelimiter rubyString -hi link rubyRegexp Regexp -hi link rubyRegexpDelimiter rubyRegexp -"hi link rubyConstant Variable -"hi link rubyGlobalVariable Variable -"hi link rubyClassVariable Variable -"hi link rubyInstanceVariable Variable -hi link javascriptRegexpString Regexp -hi link javascriptNumber Number -hi link javascriptNull Constant -highlight link diffAdded String -highlight link diffRemoved Statement -highlight link diffLine PreProc -highlight link diffSubname Comment - -call s:hifg("Normal","#EEEEEE","White",87) -if &background == "light" || has("gui_running") - hi Normal guibg=Black ctermbg=Black -else - hi Normal guibg=Black ctermbg=NONE -endif -highlight StatusLine guifg=Black guibg=#aabbee gui=bold ctermfg=Black ctermbg=White cterm=bold -highlight StatusLineNC guifg=#444444 guibg=#aaaaaa gui=none ctermfg=Black ctermbg=Grey cterm=none -"if &t_Co == 256 - "highlight StatusLine ctermbg=117 -"else - "highlight StatusLine ctermbg=43 -"endif - -highlight Ignore ctermfg=Black -highlight WildMenu guifg=Black guibg=#ffff00 gui=bold ctermfg=Black ctermbg=Yellow cterm=bold -highlight Cursor guifg=Black guibg=White ctermfg=Black ctermbg=White -highlight CursorLine guibg=#333333 guifg=NONE -highlight CursorColumn guibg=#333333 guifg=NONE -highlight NonText guifg=#404040 ctermfg=8 -highlight SpecialKey guifg=#404040 ctermfg=8 -highlight Directory none -high link Directory Identifier -highlight ErrorMsg guibg=Red ctermbg=DarkRed guifg=NONE ctermfg=NONE -highlight Search guifg=NONE ctermfg=NONE gui=none cterm=none -call s:hibg("Search" ,"#555555","DarkBlue",81) -highlight IncSearch guifg=White guibg=Black ctermfg=White ctermbg=Black -highlight MoreMsg guifg=#00AA00 ctermfg=Green -highlight LineNr guifg=#DDEEFF ctermfg=White -call s:hibg("LineNr" ,"#222222","DarkBlue",80) -highlight Question none -high link Question MoreMsg -highlight Title guifg=Magenta ctermfg=Magenta -highlight VisualNOS gui=none cterm=none -call s:hibg("Visual" ,"#555577","LightBlue",83) -call s:hibg("VisualNOS" ,"#444444","DarkBlue",81) -call s:hibg("MatchParen","#1100AA","DarkBlue",18) -highlight WarningMsg guifg=Red ctermfg=Red -highlight Error ctermbg=DarkRed -highlight SpellBad ctermbg=DarkRed -" FIXME: Comments -highlight SpellRare ctermbg=DarkMagenta -highlight SpellCap ctermbg=DarkBlue -highlight SpellLocal ctermbg=DarkCyan - -call s:hibg("Folded" ,"#110077","DarkBlue",17) -call s:hifg("Folded" ,"#aaddee","LightCyan",63) -highlight FoldColumn none -high link FoldColumn Folded -highlight DiffAdd ctermbg=4 guibg=DarkBlue -highlight DiffChange ctermbg=5 guibg=DarkMagenta -highlight DiffDelete ctermfg=12 ctermbg=6 gui=bold guifg=Blue guibg=DarkCyan -highlight DiffText ctermbg=DarkRed -highlight DiffText cterm=bold ctermbg=9 gui=bold guibg=Red - -highlight Pmenu guifg=White ctermfg=White gui=bold cterm=bold -highlight PmenuSel guifg=White ctermfg=White gui=bold cterm=bold -call s:hibg("Pmenu" ,"#000099","Blue",18) -call s:hibg("PmenuSel" ,"#5555ff","DarkCyan",39) -highlight PmenuSbar guibg=Grey ctermbg=Grey -highlight PmenuThumb guibg=White ctermbg=White -highlight TabLine gui=underline cterm=underline -call s:hifg("TabLine" ,"#bbbbbb","LightGrey",85) -call s:hibg("TabLine" ,"#333333","DarkGrey",80) -highlight TabLineSel guifg=White guibg=Black ctermfg=White ctermbg=Black -highlight TabLineFill gui=underline cterm=underline -call s:hifg("TabLineFill","#bbbbbb","LightGrey",85) -call s:hibg("TabLineFill","#808080","Grey",83) - -hi Type gui=none -hi Statement gui=none -if !has("gui_mac") - " Mac GUI degrades italics to ugly underlining. - hi Comment gui=italic - hi railsUserClass gui=italic - hi railsUserMethod gui=italic -endif -hi Identifier cterm=none -" Commented numbers at the end are *old* 256 color values -"highlight PreProc guifg=#EDF8F9 -call s:hifg("Comment" ,"#9933CC","DarkMagenta",34) " 92 -" 26 instead? -call s:hifg("Constant" ,"#339999","DarkCyan",21) " 30 -call s:hifg("rubyNumber" ,"#CCFF33","Yellow",60) " 190 -call s:hifg("String" ,"#66FF00","LightGreen",44,82) " 82 -call s:hifg("Identifier" ,"#FFCC00","Yellow",72) " 220 -call s:hifg("Statement" ,"#FF6600","Brown",68) " 202 -call s:hifg("PreProc" ,"#AAFFFF","LightCyan",47) " 213 -call s:hifg("railsUserMethod","#AACCFF","LightCyan",27) -call s:hifg("Type" ,"#AAAA77","Grey",57) " 101 -call s:hifg("railsUserClass" ,"#AAAAAA","Grey",7) " 101 -call s:hifg("Special" ,"#33AA00","DarkGreen",24) " 7 -call s:hifg("Regexp" ,"#44B4CC","DarkCyan",21) " 74 -call s:hifg("rubyMethod" ,"#DDE93D","Yellow",77) " 191 -"highlight railsMethod guifg=#EE1122 ctermfg=1 diff --git a/.vimrc b/.vimrc index 071b39f..7ff43be 100644 --- a/.vimrc +++ b/.vimrc @@ -24,6 +24,7 @@ Bundle 'tpope/vim-markdown' Bundle 'tpope/vim-rails' Bundle 'tpope/vim-repeat' Bundle 'tpope/vim-surround' +Bundle 'tpope/vim-vividchalk' call vundle#end() filetype plugin indent on From 3ec635765ef8959c34712c8b496c3206f99eea17 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Wed, 14 May 2014 21:48:17 -0400 Subject: [PATCH 5/7] Not for checking in --- tool-sharpener.txt | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 tool-sharpener.txt diff --git a/tool-sharpener.txt b/tool-sharpener.txt deleted file mode 100644 index 784f787..0000000 --- a/tool-sharpener.txt +++ /dev/null @@ -1,5 +0,0 @@ -* insert-sudo function return to end of line -* vi mode on command line -* * set -o vi -* vim -* * copy and paste still off on laptop From 67dfeb0b6f9c9519cba5fe8dcb4024ec051fb804 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Thu, 15 May 2014 23:45:30 -0400 Subject: [PATCH 6/7] Missing thes vim options for some reason --- .vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.vimrc b/.vimrc index 7ff43be..56f5641 100644 --- a/.vimrc +++ b/.vimrc @@ -61,6 +61,9 @@ set noswapfile " Hope for the best set virtualedit=all " Cursor can go anywhere set scrolloff=3 " Keep cursor from touching edges set timeoutlen=500 " Don't wait too long (ambiguous leaders) +set showmatch " Show matching brackets +set hidden " Allow unsaved buffers to be hidden +set wildmenu " Command line completion " Make syntax highlighting faster syntax sync minlines=256 set ttyfast From 833fb79b4412a986e3e37b808b16e9c850c4a2cc Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Sat, 5 Jul 2014 00:35:26 -0400 Subject: [PATCH 7/7] UID too high on mac; not used anyway --- .zsh/atomaka.zsh-theme | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.zsh/atomaka.zsh-theme b/.zsh/atomaka.zsh-theme index 053e74f..630a8d8 100644 --- a/.zsh/atomaka.zsh-theme +++ b/.zsh/atomaka.zsh-theme @@ -13,14 +13,8 @@ done eval PR_NO_COLOR="%{$terminfo[sgr0]%}" eval PR_BOLD="%{$terminfo[bold]%}" -# Check the UID -if [[ $UID -ge 1000 ]]; then # normal user - eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}' - eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}' -elif [[ $UID -eq 0 ]]; then # root - eval PR_USER='${PR_RED}%n${PR_NO_COLOR}' - eval PR_USER_OP='${PR_RED}%#${PR_NO_COLOR}' -fi +# Show username +eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}' # Check if we are on SSH or not if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then