dotfiles/nvim/.config/nvim/functions.vim
Sanchayan Maity 80e2aa9341 nvim: Refactor neovim configuration
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
2020-05-07 13:06:50 +05:30

60 lines
1.1 KiB
VimL

function! NvimGdbNoTKeymaps()
tnoremap <silent> <buffer> <Esc> <C-\><C-n>
endfunction
" Taken from gitgutter README. Cycles through all hunks in all open buffers.
function! NextHunkAllBuffers()
let line = line('.')
GitGutterNextHunk
if line('.') != line
return
endif
let bufnr = bufnr('')
while 1
bnext
if bufnr('') == bufnr
return
endif
if !empty(GitGutterGetHunks())
1
GitGutterNextHunk
return
endif
endwhile
endfunction
function! PrevHunkAllBuffers()
let line = line('.')
GitGutterPrevHunk
if line('.') != line
return
endif
let bufnr = bufnr('')
while 1
bprevious
if bufnr('') == bufnr
return
endif
if !empty(GitGutterGetHunks())
normal! G
GitGutterPrevHunk
return
endif
endwhile
endfunction
function! GotoJump()
jumps
let j = input("Please select your jump: ")
if j != ''
let pattern = '\v\c^\+'
if j =~ pattern
let j = substitute(j, pattern, '', 'g')
execute "normal " . j . "\<C-i>"
else
execute "normal " . j . "\<C-o>"
endif
endif
endfunction