From 14dc82fc4e6c0c08078f97a24a6c1639c1cc5113 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 14 Apr 2020 13:17:26 +0200 Subject: Update --- after/ftplugin/llvm.vim | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'after/ftplugin/llvm.vim') diff --git a/after/ftplugin/llvm.vim b/after/ftplugin/llvm.vim index d67c94b5..fbd4b7ff 100644 --- a/after/ftplugin/llvm.vim +++ b/after/ftplugin/llvm.vim @@ -57,7 +57,7 @@ function! s:is_section_delim(line, func_delim) abort return 0 endif let kind = sec[0] - return kind == s:KIND_BLOCK_PREC || kind == s:KIND_BLOCK_FOLLOW || kind == func_delim + return kind == s:KIND_BLOCK_PREC || kind == s:KIND_BLOCK_FOLLOW || kind == a:func_delim endfunction function! s:next_section(stop_func_begin) abort @@ -85,11 +85,16 @@ function! s:prev_section(stop_func_begin) abort endwhile endfunction +nnoremap (llvm-next-section-begin) :call next_section(1) +nnoremap (llvm-prev-section-begin) :call prev_section(1) +nnoremap (llvm-next-section-end) :call next_section(0) +nnoremap (llvm-prev-section-end) :call prev_section(0) + if !g:llvm_ext_no_mapping - nnoremap ]] :call next_section(1) - nnoremap [[ :call prev_section(1) - nnoremap ][ :call next_section(0) - nnoremap [] :call prev_section(0) + nmap ]] (llvm-next-section-begin) + nmap [[ (llvm-prev-section-begin) + nmap ][ (llvm-next-section-end) + nmap [] (llvm-prev-section-end) endif function! s:function_range_at(linum) abort @@ -222,9 +227,12 @@ function! s:move_to_following_block() abort endtry endfunction +nnoremap (llvm-move-block-prev) :call move_to_pred_block() +nnoremap (llvm-move-block-next) :call move_to_following_block() + if !g:llvm_ext_no_mapping - nnoremap [b :call move_to_pred_block() - nnoremap ]b :call move_to_following_block() + nmap [b (llvm-move-block-prev) + nmap ]b (llvm-move-block-next) endif function! s:get_func_identifiers(line) abort @@ -438,8 +446,10 @@ function! s:goto_definition() abort echom "No definition for '" . ident . "' found" endfunction +nnoremap (llvm-goto-definition) :call goto_definition() + if !g:llvm_ext_no_mapping - nnoremap K :call goto_definition() + nmap K (llvm-goto-definition) endif function! s:run_lli(...) abort -- cgit v1.2.3