Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add keymapping variable #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 58 additions & 53 deletions plugin/conque_gdb.vim
Original file line number Diff line number Diff line change
Expand Up @@ -38,47 +38,6 @@ endif
" Load python scripts now
call conque_gdb#load_python()

" Keyboard mappings
if g:conque_gdb_gdb_py_support
if !exists('g:ConqueGdb_ToggleBreak')
let g:ConqueGdb_ToggleBreak = g:ConqueGdb_Leader . 'b'
endif
else
if !exists('g:ConqueGdb_SetBreak')
let g:ConqueGdb_SetBreak = g:ConqueGdb_Leader . 'b'
endif
if !exists('g:ConqueGdb_DeleteBreak')
let g:ConqueGdb_DeleteBreak = g:ConqueGdb_Leader . 'd'
endif
endif
if !exists('g:ConqueGdb_Continue')
let g:ConqueGdb_Continue = g:ConqueGdb_Leader . 'c'
endif
if !exists('g:ConqueGdb_Run')
let g:ConqueGdb_Run = g:ConqueGdb_Leader . 'r'
endif
if !exists('g:ConqueGdb_Next')
let g:ConqueGdb_Next = g:ConqueGdb_Leader . 'n'
endif
if !exists('g:ConqueGdb_Step')
let g:ConqueGdb_Step = g:ConqueGdb_Leader . 's'
endif
if !exists('g:ConqueGdb_Print')
let g:ConqueGdb_Print = g:ConqueGdb_Leader . 'p'
endif
if !exists('g:ConqueGdb_Finish')
let g:ConqueGdb_Finish = g:ConqueGdb_Leader . 'f'
endif
if !exists('g:ConqueGdb_Backtrace')
let g:ConqueGdb_Backtrace = g:ConqueGdb_Leader . 't'
endif
if !exists('g:ConqueGdb_ReadTimeout')
let g:ConqueGdb_ReadTimeout = 50
endif
if !exists('g:ConqueGdb_SaveHistory')
let g:ConqueGdb_SaveHistory = 0
endif

" Commands to open conque gdb
command! -nargs=* -complete=file ConqueGdb call conque_gdb#open(<q-args>, [
\ get(g:conque_gdb_src_splits, g:ConqueGdb_SrcSplit, g:conque_gdb_default_split),
Expand All @@ -103,16 +62,62 @@ command! -nargs=0 ConqueGdbBDelete call conque_gdb#delete_opened_buffers()
" Command to write a command to the gdb tertminal
command! -nargs=+ ConqueGdbCommand call conque_gdb#command(<q-args>)

if g:conque_gdb_gdb_py_support
exe 'nnoremap <silent> ' . g:ConqueGdb_ToggleBreak . ' :call conque_gdb#toggle_breakpoint(expand("%:p"), line("."))<CR>'
else
exe 'nnoremap <silent> ' . g:ConqueGdb_SetBreak . ' :call conque_gdb#command("break " . expand("%:p") . ":" . line("."))<CR>'
exe 'nnoremap <silent> ' . g:ConqueGdb_DeleteBreak . ' :call conque_gdb#command("clear " . expand("%:p") . ":" . line("."))<CR>'
" Keyboard mappings
if !exists('g:ConqueGdb_EnableMapping')
let g:ConqueGdb_EnableMapping = 1
endif
if g:ConqueGdb_EnableMapping
if g:conque_gdb_gdb_py_support
if !exists('g:ConqueGdb_ToggleBreak')
let g:ConqueGdb_ToggleBreak = g:ConqueGdb_Leader . 'b'
endif
else
if !exists('g:ConqueGdb_SetBreak')
let g:ConqueGdb_SetBreak = g:ConqueGdb_Leader . 'b'
endif
if !exists('g:ConqueGdb_DeleteBreak')
let g:ConqueGdb_DeleteBreak = g:ConqueGdb_Leader . 'd'
endif
endif
if !exists('g:ConqueGdb_Continue')
let g:ConqueGdb_Continue = g:ConqueGdb_Leader . 'c'
endif
if !exists('g:ConqueGdb_Run')
let g:ConqueGdb_Run = g:ConqueGdb_Leader . 'r'
endif
if !exists('g:ConqueGdb_Next')
let g:ConqueGdb_Next = g:ConqueGdb_Leader . 'n'
endif
if !exists('g:ConqueGdb_Step')
let g:ConqueGdb_Step = g:ConqueGdb_Leader . 's'
endif
if !exists('g:ConqueGdb_Print')
let g:ConqueGdb_Print = g:ConqueGdb_Leader . 'p'
endif
if !exists('g:ConqueGdb_Finish')
let g:ConqueGdb_Finish = g:ConqueGdb_Leader . 'f'
endif
if !exists('g:ConqueGdb_Backtrace')
let g:ConqueGdb_Backtrace = g:ConqueGdb_Leader . 't'
endif
if !exists('g:ConqueGdb_ReadTimeout')
let g:ConqueGdb_ReadTimeout = 50
endif
if !exists('g:ConqueGdb_SaveHistory')
let g:ConqueGdb_SaveHistory = 0
endif

if g:conque_gdb_gdb_py_support
exe 'nnoremap <silent> ' . g:ConqueGdb_ToggleBreak . ' :call conque_gdb#toggle_breakpoint(expand("%:p"), line("."))<CR>'
else
exe 'nnoremap <silent> ' . g:ConqueGdb_SetBreak . ' :call conque_gdb#command("break " . expand("%:p") . ":" . line("."))<CR>'
exe 'nnoremap <silent> ' . g:ConqueGdb_DeleteBreak . ' :call conque_gdb#command("clear " . expand("%:p") . ":" . line("."))<CR>'
endif
exe 'nnoremap <silent> ' . g:ConqueGdb_Continue . ' :call conque_gdb#command("continue")<CR>'
exe 'nnoremap <silent> ' . g:ConqueGdb_Run . ' :call conque_gdb#command("run")<CR>'
exe 'nnoremap <silent> ' . g:ConqueGdb_Next . ' :call conque_gdb#command("next")<CR>'
exe 'nnoremap <silent> ' . g:ConqueGdb_Step . ' :call conque_gdb#command("step")<CR>'
exe 'nnoremap <silent> ' . g:ConqueGdb_Finish . ' :call conque_gdb#command("finish")<CR>'
exe 'nnoremap <silent> ' . g:ConqueGdb_Backtrace . ' :call conque_gdb#command("backtrace")<CR>'
exe 'nnoremap <silent> ' . g:ConqueGdb_Print . ' :call conque_gdb#print_word(expand("<cword>"))<CR>'
endif
exe 'nnoremap <silent> ' . g:ConqueGdb_Continue . ' :call conque_gdb#command("continue")<CR>'
exe 'nnoremap <silent> ' . g:ConqueGdb_Run . ' :call conque_gdb#command("run")<CR>'
exe 'nnoremap <silent> ' . g:ConqueGdb_Next . ' :call conque_gdb#command("next")<CR>'
exe 'nnoremap <silent> ' . g:ConqueGdb_Step . ' :call conque_gdb#command("step")<CR>'
exe 'nnoremap <silent> ' . g:ConqueGdb_Finish . ' :call conque_gdb#command("finish")<CR>'
exe 'nnoremap <silent> ' . g:ConqueGdb_Backtrace . ' :call conque_gdb#command("backtrace")<CR>'
exe 'nnoremap <silent> ' . g:ConqueGdb_Print . ' :call conque_gdb#print_word(expand("<cword>"))<CR>'