Starting port of old configuration

Also, documenting it as I go. Especially keyboard shortcuts.
This commit is contained in:
Emmanuel BENOîT 2015-03-02 17:58:40 +01:00
parent 1e5a2de57a
commit d6f121f28f
7 changed files with 80 additions and 0 deletions

2
cfg/03-hlsearch.vim Normal file
View file

@ -0,0 +1,2 @@
set hlsearch
nnoremap <silent> <Leader><space> :nohlsearch<CR>

14
cfg/03-mouse.vim Normal file
View file

@ -0,0 +1,14 @@
" Enable mouse by default, provide <Leader>M shortcut to toggle on/off
function! <SID>ToggleMouse()
if &g:mouse != ""
echo "Mouse disabled."
set mouse=
else
echo "Mouse enabled."
set mouse=a
endif
endfunction
set mouse=a
nnoremap <silent> <Leader>M :call <SID>ToggleMouse()<cr>

9
cfg/04-local-help.vim Normal file
View file

@ -0,0 +1,9 @@
" If 'doc' directories exist in the local / main configuration, use them
if isdirectory( g:vim_home . "/doc" )
execute "helptags" g:vim_home . "/doc"
endif
if exists( "g:vim_local_path" ) && isdirectory( g:vim_local_path . "/doc" )
execute "helptags" g:vim_local_path . "/doc"
endif

6
cfg/05-folding.vim Normal file
View file

@ -0,0 +1,6 @@
" Folding is enabled by default in marker mode.
" The plus key opens/closes folds.
set foldenable
set foldmethod=marker
nnoremap + za

View file

@ -0,0 +1,32 @@
" Trailing spaces and visible tabs
"
" Trailing spaces are visible in normal or visual mode, but hidden in insert
" mode. Tabs can be displayed or hidden using <Leader>T.
set list
set listchars=""
set listchars+=trail:•
set listchars+=tab:\ \
let s:VisibleTabs = 0
function! s:UpdateListChars(type,value)
let lc = filter( split( &l:listchars , "," ) , "v:val !~ '^" . a:type . ":'" ) + [ a:type . ":" . a:value ]
let &l:listchars = join( lc , "," )
endfunction
function! <SID>SwitchVisibleTabs()
if s:VisibleTabs == 1
let s:VisibleTabs = 0
call s:UpdateListChars( "tab" , " " )
else
let s:VisibleTabs = 1
call s:UpdateListChars( "tab" , "» " )
endif
endfunction
nnoremap <silent> <Leader>T :call <SID>SwitchVisibleTabs()<cr>
augroup TrailingWhitespace
autocmd!
autocmd InsertEnter * :call <SID>UpdateListChars( "trail" , " " )
autocmd InsertLeave * :call <SID>UpdateListChars( "trail" , "•" )
augroup END

15
doc/heavim.txt Normal file
View file

@ -0,0 +1,15 @@
*heavim.txt* A really heavy Vim configuration
1. Keyboard shortcuts |heavim-shortcuts|
=============================================================================
1. KEYBOARD SHORTCUTS ~ *heavim-shortcuts*
Note: Heavim defines Space as the global leader key, and comma (',') as the
local leader key.
+ Toggle folds
<Leader><Space> Clear highlighted search
<Leader>M Toggle mouse
<Leader>T Toggle visible tabs

2
doc/tags Normal file
View file

@ -0,0 +1,2 @@
heavim-shortcuts heavim.txt /*heavim-shortcuts*
heavim.txt heavim.txt /*heavim.txt*