+ Added TwiddleCase

This commit is contained in:
ziro 2020-10-20 12:09:08 +07:00
parent 7fc350c84c
commit d6b049972b
4 changed files with 23 additions and 5 deletions

View file

@ -34,8 +34,8 @@ autocmd FileType sh map <buffer> <F9> :w<CR>:vs<CR>:ter sh "%"<CR>
autocmd FileType sh imap <buffer> <F9> <esc> :w<CR>:vs<CR>:ter sh "%"<CR> autocmd FileType sh imap <buffer> <F9> <esc> :w<CR>:vs<CR>:ter sh "%"<CR>
" c (untested) " c (untested)
autocmd FileType c map <buffer> <F9> :w<CR>:vs<CR>:ter gcc "%" -o %< && ./"%" && read<CR> autocmd FileType c map <buffer> <F9> :w<CR>:vs<CR>:ter gcc "%" -o %< && ./%< && read<CR>
autocmd FileType c imap <buffer> <F9> <esc> :w<CR>:vs<CR>:ter gcc "%" -o %< && ./"%" && read<CR> autocmd FileType c imap <buffer> <F9> <esc> :w<CR>:vs<CR>:ter gcc "%" -o %< && ./%< && read<CR>
" ----- Automatically Render PDF " ----- Automatically Render PDF
autocmd FileType plaintex command! -nargs=0 Lw w !pdflatex % > /dev/null autocmd FileType plaintex command! -nargs=0 Lw w !pdflatex % > /dev/null

View file

@ -38,6 +38,19 @@ map <C-l> gcc
vmap <C-l> gc vmap <C-l> gc
imap <C-l> <esc>gc imap <C-l> <esc>gc
" TwiddleCase
function! TwiddleCase(str)
if a:str ==# toupper(a:str)
let result = tolower(a:str)
elseif a:str ==# tolower(a:str)
let result = substitute(a:str,'\(\<\w\+\>\)', '\u\1', 'g')
else
let result = toupper(a:str)
endif
return result
endfunction
vnoremap ~ y:call setreg('', TwiddleCase(@"), getregtype(''))<CR>gv""Pgv
" ----- 'vim -b' = edit binary using xxd-format! " ----- 'vim -b' = edit binary using xxd-format!
augroup Binary augroup Binary
au! au!
@ -52,6 +65,7 @@ augroup END
" ----- python for vim " ----- python for vim
autocmd BufEnter *.py set ai sw=4 ts=4 sta et fo=croql autocmd BufEnter *.py set ai sw=4 ts=4 sta et fo=croql
autocmd BufEnter *.c set ai sw=4 ts=4 sta et fo=croql
" ----- Auto refresh vimrc " ----- Auto refresh vimrc
augroup myvimrc augroup myvimrc

View file

@ -7,6 +7,9 @@ alias doas='doas -- '
#sudo + vim, yea imagine having that powe- nvm #sudo + vim, yea imagine having that powe- nvm
alias sudovim='sudoedit' alias sudovim='sudoedit'
#switch to pgsql user
alias pg='sudo -iu postgres'
#vim #vim
alias nano=nvim alias nano=nvim
alias vim=nvim alias vim=nvim

View file

@ -5,8 +5,9 @@ choices="1366x768
chosen=$(echo -e "$choices" | rofi -dmenu -i -theme ~/.config/rofi/theme/sidebar) chosen=$(echo -e "$choices" | rofi -dmenu -i -theme ~/.config/rofi/theme/sidebar)
[ -z "$chosen" ] && exit 0
case "$chosen" in case "$chosen" in
1366x768) xrandr --output VGA-1 --mode $chosen && notify-send "Resolution has been changed to" "$chosen";; 1360x765) xrandr --output VGA1 --mode 1360x765_60.00 && notify-send "Resolution has been changed to" "1360x765";;
1360x765) xrandr --output VGA-1 --mode 1360x765_60.00 && notify-send "Resolution has been changed to" "1360x765";; *) xrandr --output VGA1 --mode $chosen && notify-send "Resolution has been changed to" "$chosen";;
1280x720) xrandr --output VGA-1 --mode $chosen && notify-send "Resolution has been changed to" "$chosen";;
esac esac