" Vim filetype plugin file for changelogs.
" Remaps [[ and ]] keys to go to next and previous section appropriately.
" Maintainer: xaizek
" Last Change: 28 Oct 2018
nnoremap <silent><buffer> [[ :call cursor(<SID>GoToSection(0), 1)<cr>
nnoremap <silent><buffer> ]] :call cursor(<SID>GoToSection(1), 1)<cr>
vnoremap <silent><buffer> [[ <esc>:let t = <SID>GoToSection(0)
\\| exec 'normal' 'gv'.t.'gg'<cr>
vnoremap <silent><buffer> ]] <esc>:let t = <SID>GoToSection(1)
\\| exec 'normal' 'gv'.t.'gg'<cr>
" Moves cursor to next or previous section depending on value of the
" searchForward argument.
function! s:GoToSection(searchForward)
call cursor(line('.'), 1)
let l:backwardFlag = a:searchForward ? '' : 'b'
let l:position = search('^\S', 'nW'.l:backwardFlag)
if l:position == 0
let l:position = a:searchForward ? line('$') : 1
endif
return l:position
endfunction
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"
Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/dotvim
Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/dotvim
You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a
pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master