Skip to content

Instantly share code, notes, and snippets.

View krehwell's full-sized avatar
👣

krehwell

👣
View GitHub Profile
@krehwell
krehwell / init.vim
Last active May 1, 2021 06:37
Unity C# - Vim (windows)
filetype plugin indent on
syntax on
" ----- NOAUTOCOMMENT TO ALL FILES -----
augroup AutoCommetDisable
autocmd!
" autocmd BufEnter * silent! lcd %:p:h
autocmd FileType * set formatoptions-=cro
augroup END
@krehwell
krehwell / super-tip-improved.md
Created February 20, 2021 21:58
Function to convert 4 spaces to 2 spaces indentation to the selected code only - Vim Tip

Put this in .vimrc

fun! Four2Two() range
  '<,'>s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g
  norm!gv
endfun

Select the code V and apply it by :'&lt;,'&gt;call Four2Two()