mirror of
https://github.com/prurigro/darkcloud-vimconfig.git
synced 2024-11-22 06:44:09 -05:00
dccde2f30d
vimpager-specific mappings out into a separate keyboard config file that both vimpager and vim use eventually, but this works well for now)
123 lines
4.5 KiB
Text
123 lines
4.5 KiB
Text
"============================================================"
|
|
" "
|
|
" Darkcloud Vim Config: vimpagerrc "
|
|
" "
|
|
" By: Kevin MacMartin (prurigro@gmail.com) "
|
|
" Website: https://github.com/prurigro/darkcloud-vimconfig "
|
|
" "
|
|
" License: MIT "
|
|
" "
|
|
"============================================================"
|
|
|
|
"darkcloud vim config folder path: {{{
|
|
" if you want to use darkcloud-vimconfig as a package without symlinking
|
|
" the vim folder or placing it @ /etc/darkcloud-vimconfig, create a file
|
|
" @ ~/.vim/darkcloud-path.vim and in it place the following, except with
|
|
" the path pointing to the cloned repo:
|
|
"
|
|
" let g:darkcloudpath="/etc/darkcloud-vimconfig"
|
|
|
|
if filereadable(glob("~/.vim/darkcloud-path.vim"))
|
|
source ~/.vim/darkcloud-path.vim
|
|
else
|
|
let g:darkcloudpath="/etc/darkcloud-vimconfig"
|
|
endif
|
|
"}}}
|
|
|
|
"LOAD DARKCLOUD CONFIG AND THEME FILES: (relevant to vimpager) {{{
|
|
"Add Config Directory: (distro-agnostic system-wide)
|
|
let &runtimepath=printf('%s,%s/vim,%s/vim/after',&runtimepath,g:darkcloudpath,g:darkcloudpath)
|
|
|
|
"Load Colour Scheme:
|
|
colorscheme darkcloud
|
|
|
|
"Load Settings:
|
|
runtime config/settings.vim
|
|
|
|
"Init Plugin Loader:
|
|
runtime bundle/vim-pathogen/autoload/pathogen.vim
|
|
|
|
"Load Plugins:
|
|
execute pathogen#infect('bundle.pager/{}')
|
|
|
|
"Load After Config:
|
|
runtime config/after.vim
|
|
|
|
"Tweak Settings:
|
|
set nocursorline nocursorcolumn "disable cursor column/line highlighting
|
|
set nofoldenable "disable the fold column
|
|
set noru laststatus=0 noshowmode "remove statusline
|
|
|
|
"Keymappings: {{{
|
|
"mouse
|
|
map <C-ScrollWheelUp> <Nop>
|
|
map <C-ScrollWheelDown> <Nop>
|
|
map <A-ScrollWheelUp> <Nop>
|
|
map <A-ScrollWheelDown> <Nop>
|
|
nnoremap <C-ScrollWheelUp> 4zl
|
|
xnoremap <C-ScrollWheelUp> 4zl
|
|
nnoremap <C-ScrollWheelDown> 4zh
|
|
xnoremap <C-ScrollWheelDown> 4zh
|
|
nnoremap <A-ScrollWheelUp> zl
|
|
xnoremap <A-ScrollWheelUp> zl
|
|
nnoremap <A-ScrollWheelDown> zh
|
|
xnoremap <A-ScrollWheelDown> zh
|
|
|
|
"movement
|
|
map <Home> 0
|
|
map <End> $
|
|
nnoremap = +
|
|
nnoremap <C-Up> 4k
|
|
nnoremap <C-Down> 4j
|
|
nnoremap <C-Right> <S-Right>
|
|
nnoremap <C-Left> <S-Left>
|
|
nnoremap <S-Up> gg0
|
|
nnoremap <S-Down> G$
|
|
nnoremap <S-Right> $
|
|
nnoremap <S-Left> ^
|
|
vmap <A-Up> <Plug>MoveBlockUp
|
|
vmap <A-Down> <Plug>MoveBlockDown
|
|
nmap <A-Up> <Plug>MoveLineUp
|
|
nmap <A-Down> <Plug>MoveLineDown
|
|
vmap <A-Left> <Plug>MoveBlockHalfPageUp
|
|
vmap <A-Right> <Plug>MoveBlockHalfPageDown
|
|
nmap <A-Left> <Plug>MoveLineHalfPageUp
|
|
nmap <A-Right> <Plug>MoveLineHalfPageDown
|
|
vmap <A-h> <Plug>MoveBlockHalfPageUp
|
|
vmap <A-l> <Plug>MoveBlockHalfPageDown
|
|
nmap <A-h> <Plug>MoveLineHalfPageUp
|
|
nmap <A-l> <Plug>MoveLineHalfPageDown
|
|
|
|
"copy/paste
|
|
noremap y vy<Esc>
|
|
nnoremap <C-c> y
|
|
vnoremap <C-c> y
|
|
nnoremap T vg_y
|
|
vnoremap T g_y
|
|
|
|
"selection
|
|
nnoremap <C-a> gg0vG$
|
|
xnoremap <C-a> <Esc>gg0vG$
|
|
nnoremap <Leader>a <Esc>gg0vG$
|
|
xnoremap <Leader>a gg0vG$
|
|
xnoremap <C-Up> 4k
|
|
xnoremap <C-Down> 4j
|
|
xnoremap <C-Right> <S-Right>
|
|
xnoremap <C-Left> <S-Left>
|
|
xnoremap <S-Up> gg0
|
|
xnoremap <S-Down> G$
|
|
xnoremap <S-Right> $
|
|
xnoremap <S-Left> ^
|
|
nnoremap <silent><expr> <Leader>/ ':noh<CR>:echo "Search results have been cleared"<CR>'
|
|
|
|
"folds
|
|
nnoremap <Space> za
|
|
nnoremap <silent><expr> <Leader><Space> 'zn:echo "all folds have been opened"<CR>'
|
|
nnoremap <silent><expr> <Leader>= 'zn:echo "all folds have been opened"<CR>'
|
|
nnoremap <silent><expr> <Leader>+ 'zn:echo "all folds have been opened"<CR>'
|
|
nnoremap <silent><expr> <Leader><Leader><Space> 'zN:echo "all opened folds have been closed"<CR>'
|
|
nnoremap <silent><expr> <Leader>- 'zN:echo "all opened folds have been closed"<CR>'
|
|
nnoremap <silent><expr> <Leader>_ 'zN:echo "all opened folds have been closed"<CR>'
|
|
nnoremap <silent><expr> <Leader>0 'zX:echo "all folds have been reset"<CR>'
|
|
"}}}
|
|
"}}}
|