Use the main config for vimpager, and pull vimpager directly into the project rather than requiring it to be separately installed

This commit is contained in:
Kevin MacMartin 2023-02-06 12:42:14 -05:00
parent 4e157811bb
commit d4a829d414
8 changed files with 10 additions and 147 deletions

3
.gitmodules vendored
View file

@ -97,3 +97,6 @@
[submodule "vim/bundle/vim-gutentags"]
path = vim/bundle/vim-gutentags
url = https://github.com/ludovicchabant/vim-gutentags.git
[submodule "vim/bundle/vimpager"]
path = vim/bundle/vimpager
url = https://github.com/rkitover/vimpager

View file

@ -45,15 +45,13 @@ A theme, config and collection of plugins for Vim.
### Vimpager ###
Once darkcloud-vimconfig has been set up, you can configure `vimpager` _1.x_ to use it by running (assuming the default path @ _"/etc/darkcloud-vimconfig"_):
You can configure your PAGER to use darkcloud-vimconfig using vimpager by adding the following to your bashrc (assuming the default path @ _"/etc/darkcloud-vimconfig"_):
`ln -s /etc/darkcloud-vimconfig/vimpagerrc /etc/vimpagerrc` (for a system-wide configuration), or:
`ln -s /etc/darkcloud-vimconfig/vimpagerrc ~/.vimpagerrc` (for a given user).
As usual, to have your system use `vimpager` in place of `less`, you'll need to set the **$PAGER** environment variable to `vimpager`:
`export PAGER=vimpager`, and configure aliases for less in _"/etc/bash.bashrc"_ or _"~/.bashrc"_: `alias less='vimpager'`
```
export PAGER=/etc/darkcloud-vimconfig/vim/bundle/vimpager/vimpager
alias less="$PAGER"
alias zless="$PAGER"
```
## Configuration ##

View file

@ -1 +0,0 @@
../bundle/incsearch.vim

@ -1 +0,0 @@
Subproject commit 401f9d729274f87168bf126b9c477c721ce1711a

View file

@ -1 +0,0 @@
../bundle/vim-polyglot-darkcloud

1
vim/bundle/vimpager Submodule

@ -0,0 +1 @@
Subproject commit 2d3af2bf3d09602d43cbfc294566869a89edfd46

View file

@ -1,87 +0,0 @@
"============================================================"
" "
" Darkcloud Vim Config: vimpager.vim "
" "
" By: Kevin MacMartin (prurigro@gmail.com) "
" Website: https://github.com/prurigro/darkcloud-vimconfig "
" "
" License: MIT "
" "
"============================================================"
"Undo Unwanted Keymappings:
map v <Nop>
noremap w <S-Right>
noremap <PageDown> <C-F>
noremap <kPageDown> <C-F>
noremap <PageUp> <C-B>
noremap <kPageUp> <C-B>
"Main Settings:
set nocursorline nocursorcolumn "disable cursor column/line highlighting
set nofoldenable "disable the fold column
set noru laststatus=0 noshowmode "remove statusline
set clipboard=autoselect "autocopy selection
set clipboard+=unnamed "use '*' reg
if has('unnamedplus')|set clipboard+=unnamedplus|endif "if exists, use '+' reg
set autoread "track file changes
autocmd CursorHold * checktime "use CursorHold events to trigger checktime
set conceallevel=2 "enable the conceal feature to hide unnecessary elements
set concealcursor=n "conceal text in the cursor line while in normal mode
"Override Filetypes:
runtime bundle.pager/vim-markdown-concealed/ftdetect/mkdc.vim
"Mappings:
"mouse
map <C-ScrollWheelUp> <Nop>
map <C-ScrollWheelDown> <Nop>
map <A-ScrollWheelUp> <Nop>
map <A-ScrollWheelDown> <Nop>
noremap <C-ScrollWheelUp> 4zh
noremap <A-ScrollWheelUp> 4zh
noremap <S-ScrollWheelUp> 4zh
noremap <C-ScrollWheelDown> 4zl
noremap <A-ScrollWheelDown> 4zl
noremap <S-ScrollWheelDown> 4zl
"movement
noremap <Home> 0
noremap <kHome> <Home>
noremap <End> $
noremap <kEnd> <End>
noremap <Up> <C-P>
noremap <Down> <C-N>
noremap <Right> zL
noremap <Left> zH
noremap = +
noremap _ -
noremap <C-Up> 4k
noremap <C-Down> 4j
noremap <C-Right> <S-Right>
noremap <C-Left> <S-Left>
noremap <S-Up> gg0
noremap <S-Down> G$
noremap <S-Right> $
noremap <S-Left> ^
"copy/paste
nnoremap Y vg_y
"search
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
nnoremap <silent><expr> // '<Esc>:noh<CR>'
"selection
nnoremap <C-a> gg0vG$
xnoremap <C-a> <Esc>gg0vG$
nnoremap <Leader>a gg0vG$
xnoremap <Leader>a <Esc>gg0vG$
"toggles
nnoremap <silent><expr> <F1> ':set wrap!<CR>:echo "line wrapping toggled"<CR>'
xnoremap <silent><expr> <F1> '<Esc>:set wrap!<CR>gv'
nnoremap <silent><expr> <F2> ':set spell!<CR>:echo "spell checking toggled"<CR>'
xnoremap <silent><expr> <F2> '<Esc>:set spell!<CR>gv'

View file

@ -1,49 +0,0 @@
"============================================================"
" "
" 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
"}}}
"DARKCLOUD CONFIG AND THEME FILES FOR 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 default " hack to fix vimrc colorschemes in some versions of vim
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/{}')
"Vimpager Settings:
runtime config/vimpager.vim
"Load After Config:
runtime config/after.vim
"}}}