xaizek / dotvim (License: Unspecified) (since 2018-12-07)
Vim configuration and plugins.
<root> / after / ftplugin / html.vim (858027aa97a1152c61042c883f9984100673782e) (1,066B) (mode 100644) [raw]
nnoremap <silent><buffer> ]] :call <SID>FindBegin(1)<cr>
nnoremap <silent><buffer> [[ :call <SID>FindBegin(0)<cr>
nnoremap <silent><buffer> ][ :call <SID>FindEnd(1)<cr>
nnoremap <silent><buffer> [] :call <SID>FindEnd(0)<cr>

function! <SID>FindBegin(forward)
    if a:forward
        let l:forward = ''
    else
        let l:forward = 'b'
    endif
    let l:openbracket = search('^\s*{\s*$', 'nW'.l:forward)
    if l:openbracket != -1
        call cursor(l:openbracket, col('.'))
    endif
endfunction

function! <SID>FindEnd(forward)
    if a:forward
        let l:forward = ''
    else
        let l:forward = 'b'
    endif
    let l:openBracket = search('^\s*{\s*$', 'nbcW')
    let l:closeBracket = search('^\s*}\s*$', 'sW'.l:forward)
    let l:openBracketIndent = indent(l:openBracket)
    while l:closeBracket != 1
        if indent(l:closeBracket) == l:openBracketIndent
            call cursor(l:closeBracket, col('.'))
            return
        endif
        let l:closeBracket = search('^\s*}\s*$', 'W'.l:forward)
    endwhile
    normal ''
endfunction
Hints

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