major home-manager changes

This commit is contained in:
2021-05-02 09:24:02 +05:30
parent da3ef21ccd
commit 70b18cf4fd
33 changed files with 1115 additions and 37 deletions

19
home/config/nvim/utils.vim Executable file
View File

@@ -0,0 +1,19 @@
" I got this part of the config from Michael Lan Source = https://www.youtube.com/watch?v=I4Rz0qoWYBl
function! TermWrapper(command) abort
if !exists('g:split_term_style') | let g:split_term_style = 'vertical' | endif
if g:split_term_style ==# 'vertical'
let buffercmd = 'vnew'
elseif g:split_term_style ==# 'horizontal'
let buffercmd = 'new'
else
echoerr 'ERROR! g:split_term_style is not a valid value (must be ''horizontal'' or ''vertical'' but is currently set to ''' . g:split_term_style . ''')'
throw 'ERROR! g:split_term_style is not a valid value (must be ''horizontal'' or ''vertical'')'
endif
exec buffercmd
exec 'term ' . a:command
exec 'startinsert'
endfunction
command! -nargs=0 CompileAndRun call TermWrapper(printf('g++ -std=c++17 %s && ./a.out', expand('%')))
autocmd FileType cpp nnoremap <F5> :CompileAndRun<CR>
let g:split_term_style = 'vertical'