-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5bf92a8
Showing
11 changed files
with
1,807 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
"====[ Make the 81st column stand out ]==================== | ||
|
||
" EITHER the entire 81st column, full-screen... | ||
highlight ColorColumn ctermbg=magenta | ||
set colorcolumn=81 | ||
|
||
" OR ELSE just the 81st column of wide lines... | ||
highlight ColorColumn ctermbg=magenta | ||
call matchadd('ColorColumn', '\%81v', 100) | ||
|
||
" OR ELSE on April Fools day... | ||
highlight ColorColumn ctermbg=red ctermfg=blue | ||
exec 'set colorcolumn=' . join(range(2,80,3), ',') | ||
|
||
|
||
"=====[ Highlight matches when jumping to next ]============= | ||
|
||
" This rewires n and N to do the highlighing... | ||
nnoremap <silent> n n:call HLNext(0.4)<cr> | ||
nnoremap <silent> N N:call HLNext(0.4)<cr> | ||
|
||
" EITHER blink the line containing the match... | ||
function! HLNext (blinktime) | ||
set invcursorline | ||
redraw | ||
exec 'sleep ' . float2nr(a:blinktime * 1000) . 'm' | ||
set invcursorline | ||
redraw | ||
endfunction | ||
|
||
" OR ELSE ring the match in red... | ||
function! HLNext (blinktime) | ||
highlight RedOnRed ctermfg=red ctermbg=red | ||
let [bufnum, lnum, col, off] = getpos('.') | ||
let matchlen = strlen(matchstr(strpart(getline('.'),col-1),@/)) | ||
echo matchlen | ||
let ring_pat = (lnum > 1 ? '\%'.(lnum-1).'l\%>'.max([col-4,1]) .'v\%<'.(col+matchlen+3).'v.\|' : '') | ||
\ . '\%'.lnum.'l\%>'.max([col-4,1]) .'v\%<'.col.'v.' | ||
\ . '\|' | ||
\ . '\%'.lnum.'l\%>'.max([col+matchlen-1,1]) .'v\%<'.(col+matchlen+3).'v.' | ||
\ . '\|' | ||
\ . '\%'.(lnum+1).'l\%>'.max([col-4,1]) .'v\%<'.(col+matchlen+3).'v.' | ||
let ring = matchadd('RedOnRed', ring_pat, 101) | ||
redraw | ||
exec 'sleep ' . float2nr(a:blinktime * 1000) . 'm' | ||
call matchdelete(ring) | ||
redraw | ||
endfunction | ||
|
||
" OR ELSE briefly hide everything except the match... | ||
function! HLNext (blinktime) | ||
highlight BlackOnBlack ctermfg=black ctermbg=black | ||
let [bufnum, lnum, col, off] = getpos('.') | ||
let matchlen = strlen(matchstr(strpart(getline('.'),col-1),@/)) | ||
let hide_pat = '\%<'.lnum.'l.' | ||
\ . '\|' | ||
\ . '\%'.lnum.'l\%<'.col.'v.' | ||
\ . '\|' | ||
\ . '\%'.lnum.'l\%>'.(col+matchlen-1).'v.' | ||
\ . '\|' | ||
\ . '\%>'.lnum.'l.' | ||
let ring = matchadd('BlackOnBlack', hide_pat, 101) | ||
redraw | ||
exec 'sleep ' . float2nr(a:blinktime * 1000) . 'm' | ||
call matchdelete(ring) | ||
redraw | ||
endfunction | ||
|
||
" OR ELSE just highlight the match in red... | ||
function! HLNext (blinktime) | ||
let [bufnum, lnum, col, off] = getpos('.') | ||
let matchlen = strlen(matchstr(strpart(getline('.'),col-1),@/)) | ||
let target_pat = '\c\%#'.@/ | ||
let ring = matchadd('WhiteOnRed', target_pat, 101) | ||
redraw | ||
exec 'sleep ' . float2nr(a:blinktime * 1000) . 'm' | ||
call matchdelete(ring) | ||
redraw | ||
endfunction | ||
|
||
|
||
"====[ Make tabs, trailing whitespace, and non-breaking spaces visible ]====== | ||
|
||
exec "set listchars=tab:\uBB\uBB,trail:\uB7,nbsp:~" | ||
set list | ||
|
||
|
||
"====[ Swap : and ; to make colon commands easier to type ]====== | ||
|
||
nnoremap ; : | ||
nnoremap : ; | ||
|
||
"====[ Swap v and CTRL-V, because Block mode is more useful that Visual mode "]====== | ||
|
||
nnoremap v <C-V> | ||
nnoremap <C-V> v | ||
vnoremap v <C-V> | ||
vnoremap <C-V> v | ||
|
||
"====[ Always turn on syntax highlighting for diffs ]========================= | ||
|
||
" EITHER select by the file-suffix directly... | ||
augroup PatchDiffHighlight | ||
autocmd! | ||
autocmd BufEnter *.patch,*.rej,*.diff syntax enable | ||
augroup END | ||
|
||
" OR ELSE use the filetype mechanism to select automatically... | ||
filetype on | ||
augroup PatchDiffHighlight | ||
autocmd! | ||
autocmd FileType diff syntax enable | ||
augroup END | ||
|
||
|
||
"====[ Open any file with a pre-existing swapfile in readonly mode "]========= | ||
|
||
augroup NoSimultaneousEdits | ||
autocmd! | ||
autocmd SwapExists * let v:swapchoice = 'o' | ||
autocmd SwapExists * echomsg ErrorMsg | ||
autocmd SwapExists * echo 'Duplicate edit session (readonly)' | ||
autocmd SwapExists * echohl None | ||
autocmd SwapExists * sleep 2 | ||
augroup END | ||
|
||
" Also consider the autoswap_mac.vim plugin (but beware its limitations) | ||
|
||
|
||
"====[ Mappings to activate spell-checking alternatives ]================ | ||
|
||
nmap ;s :set invspell spelllang=en<CR> | ||
nmap ;ss :set spell spelllang=en-basic<CR> | ||
" To create the en-basic (or any other new) spelling list: | ||
" | ||
" :mkspell ~/.vim/spell/en-basic basic_english_words.txt | ||
" | ||
" See :help mkspell | ||
|
||
|
||
"====[ Make CTRL-K list diagraphs before each digraph entry ]=============== | ||
|
||
inoremap <expr> <C-K> ShowDigraphs() | ||
function! ShowDigraphs () | ||
digraphs | ||
call getchar() | ||
return "\<C-K>" | ||
endfunction | ||
|
||
" But also consider the hudigraphs.vim and betterdigraphs.vim plugins, | ||
" which offer smarter and less intrusive alternatives | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
A long time ago in a terminal far, | ||
far away.... | ||
|
||
|
||
[ __ __ _____ _____ _____ ] | ||
[ |* \/ *| /**_**\|**__*\|*____| ] | ||
[ |*|\/|*||**/ \**|*|__|*|*__| ] | ||
[ |*| |*|\**\_/**|**_**/|*|___ ] | ||
[ |_| |_________/|_| \_\|_____| ] | ||
[ __ __ _____ __ __ ] | ||
[ \*\ /*/|_***_||* \/ *| ] | ||
[ \*\/*/ |*| |*|\/|*| ] | ||
[ \**/ _|*|__|*| |*| ] | ||
[ \/ |________| |_| ] | ||
|
||
|
||
[[ __ __ __ ____ ____ ]] | ||
[[ |* \/ *| /**\|**_*\|*___| ]] | ||
[[ |*|\/|*||*[]*|*|_|*|*_|_ ]] | ||
[[ |_| |______/|_|\_\|____| ]] | ||
[[ __ __ _____ __ __ ]] | ||
[[ \*\/*/|_***_|* \/ *| ]] | ||
[[ \**/ _|*|_|*|\/|*| ]] | ||
[[ \/ |_______| |_| ]] | ||
|
||
|
||
|
||
[[[ _ _ __ ___ ___ ]]] | ||
[[[ ||\/||/**\|*_*>|*__| ]]] | ||
[[[ || |____/|_|\\|___| ]]] | ||
[[[ _ _ ___ _ _ ]]] | ||
[[[ \\//|_*_| \/ | ]]] | ||
[[[ \/ |____|\/|| ]]] | ||
|
||
|
||
|
||
[[[[ |\/|/\|<>>|*_| ]]]] | ||
[[[[ ||||\/||\\|__| ]]]] | ||
[[[[ \\//|||\/| ]]]] | ||
[[[[ \/ |||||| ]]]] | ||
|
||
|
||
|
||
> Episode IV < | ||
> < | ||
> A NEW HOPE < | ||
> < | ||
> < | ||
|It is a period of software war.| | ||
|Agile dev teams, checking out from| | ||
|a distributed codebase, have won| | ||
|their first symbolic victories| | ||
|against the fanatical GNU Empire.| | ||
| | | ||
|During the battle, Open Source| | ||
|hackers have managed to clone an| | ||
|unauthorized source archive of the| | ||
|Empire's new ultimate weapon, the| | ||
|EMACS TAR: a fully operational| | ||
|operating system with sufficient| | ||
|Alt-Meta-Ctrl-commands to destroy| | ||
|the carpal tunnels of an entire| | ||
|planet. | | ||
| | | ||
|Evading GNU's copy-sinister agenda| | ||
|the mysterious Vimlord, Con Wei,| | ||
|dashes off new Vimscript tools in| | ||
|his heavily fortified text-editor,| | ||
|custodian of the latest tips and| | ||
|plugins that may save his people| | ||
|effort, and restore efficiency to| | ||
|the keyboard.... | | ||
|
||
|
Oops, something went wrong.