<commit_before>" edit and reload vimrc
nnoremap ,s :source ~/.vimrc<CR>
nnoremap ,e :edit ~/.vimrc<CR>

" auto open quickfix window
autocmd QuickFixCmdPost * :copen
"  make &c
noremap <Leader>mm	:silent make\|redraw!\|cope<CR>
noremap <Leader>md	:make clean<CR><CR>
noremap <Leader>mr	:silent make run\|redraw!\|cope<CR>


func! MyRunitcmd()
	let fn=expand('%')
	if &filetype=='scheme'
		"return 'racket -f '.fn
		return 'guile -s '.fn
	elseif &filetype=='sh'
		return './'.fn
	elseif &filetype=='python'
		return 'python '.fn
	elseif &filetype=='cpp'
		if filereadable('Makefile')
			" can not execute two cmd
			return 'make'
		else
			return 'g++ a.cpp && ./a.out'
		endif
	elseif &filetype=='sh'
		return 'bash ' . fn
	endif
	echomsg 'unspport type to MyRunit'
	return
endfunc
function! Autoquit()
	if winbufnr(2) == -1
		bdelete
		quit
	endif
endfunc
func! MyRunit()
	if &filetype=='cpp'
		if filereadable('Makefile')
			:make
			:cope
			return
		endif
	endif
	silent! up
	let cmd=MyRunitcmd()
	let MyRunit_title='MyRunit'
	let winnum = bufwinnr(MyRunit_title)
	if winnum != -1
		" jump to existing window
		if winnr() != winnum
			exe winnum . 'wincmd w'
		endif
		execute "normal ggdG"
	else
		exe 'silent! botright vertical split MyRunit'
	endif
	echomsg cmd
	" stdout && stderr to  tmpfile and stdout
	execute '!'.cmd.' 2>&1 | tee /tmp/TmpForRunIt'
	silent execute '0read /tmp/TmpForRunIt'
	silent! setlocal nobuflisted
	silent! setlocal nonumber
	silent! setlocal buftype=nofile
	execute "normal \<c-w>p"
	autocmd BufEnter MyRunit nested call Autoquit()
endfunc
noremap <Leader>rr	:call MyRunit()<cr>
" open helper tmux windows, and send-keys
noremap <Leader>rt	:!tmux send-keys "make && make run" Enter<cr><cr>

" buffer
nnoremap <Leader>s :buffers<cr>:buffer<Space>

" taglist
noremap <Leader>tg	:TlistToggle<CR>
noremap <Leader>ti  :!ctags-exuberant -R --fields=+iaS --extra=+q . --recurse=no<CR><CR>

noremap <Leader>x	:sh<CR>
nnoremap <Leader>wu :!ftpsync<cr><commit_msg>add switchRelative func and shortcut<commit_after>" edit and reload vimrc
nnoremap ,s :source ~/.vimrc<CR>
nnoremap ,e :edit ~/.vimrc<CR>

" auto open quickfix window
autocmd QuickFixCmdPost * :copen
"  make &c
noremap <Leader>mm	:silent make\|redraw!\|cope<CR>
noremap <Leader>md	:make clean<CR><CR>
noremap <Leader>mr	:silent make run\|redraw!\|cope<CR>


func! MyRunitcmd()
	let fn=expand('%')
	if &filetype=='scheme'
		"return 'racket -f '.fn
		return 'guile -s '.fn
	elseif &filetype=='sh'
		return './'.fn
	elseif &filetype=='python'
		return 'python '.fn
	elseif &filetype=='cpp'
		if filereadable('Makefile')
			" can not execute two cmd
			return 'make'
		else
			return 'g++ a.cpp && ./a.out'
		endif
	elseif &filetype=='sh'
		return 'bash ' . fn
	endif
	echomsg 'unspport type to MyRunit'
	return
endfunc
function! Autoquit()
	if winbufnr(2) == -1
		bdelete
		quit
	endif
endfunc
func! MyRunit()
	if &filetype=='cpp'
		if filereadable('Makefile')
			:make
			:cope
			return
		endif
	endif
	silent! up
	let cmd=MyRunitcmd()
	let MyRunit_title='MyRunit'
	let winnum = bufwinnr(MyRunit_title)
	if winnum != -1
		" jump to existing window
		if winnr() != winnum
			exe winnum . 'wincmd w'
		endif
		execute "normal ggdG"
	else
		exe 'silent! botright vertical split MyRunit'
	endif
	echomsg cmd
	" stdout && stderr to  tmpfile and stdout
	execute '!'.cmd.' 2>&1 | tee /tmp/TmpForRunIt'
	silent execute '0read /tmp/TmpForRunIt'
	silent! setlocal nobuflisted
	silent! setlocal nonumber
	silent! setlocal buftype=nofile
	execute "normal \<c-w>p"
	autocmd BufEnter MyRunit nested call Autoquit()
endfunc
noremap <Leader>rr	:call MyRunit()<cr>
" open helper tmux windows, and send-keys
noremap <Leader>rt	:!tmux send-keys "make && make run" Enter<cr><cr>

" buffer
nnoremap <Leader>s :buffers<cr>:buffer<Space>

" taglist
noremap <Leader>tg	:TlistToggle<CR>
noremap <Leader>ti  :!ctags-exuberant -R --fields=+iaS --extra=+q . --recurse=no<CR><CR>

noremap <Leader>x	:sh<CR>
nnoremap <Leader>wu :!ftpsync<cr>

function! SwitchRelative()
    if(&relativenumber == 1)
        set number
    else
        set relativenumber
    endif
endfunc
nnoremap <Leader>f :call SwitchRelative()<cr>
{'fraction_non_alphanumeric': 0.13443565780014377, 'fraction_numerical': 0.003115264797507788, 'mean_word_length': 4.230576441102757, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6145312', 'n_tokens_mistral': 1779, 'n_tokens_neox': 1667, 'n_words': 454}