Skip to content

Instantly share code, notes, and snippets.

@dragonken
Last active April 11, 2024 13:27
Show Gist options
  • Star 33 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save dragonken/c29123e597c6fdf022284cf36d245b64 to your computer and use it in GitHub Desktop.
Save dragonken/c29123e597c6fdf022284cf36d245b64 to your computer and use it in GitHub Desktop.
YAML space indent for vim
syntax on
filetype plugin indent on
"Get the 2-space YAML as the default when hit carriage return after the colon
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
set is hlsearch ai ic scs
nnoremap <esc><esc> :nohls<cr>
"https://vim.fandom.com/wiki/Moving_lines_up_or_down
nnoremap <A-j> :m .+1<CR>==
nnoremap <A-k> :m .-2<CR>==
inoremap <A-j> <Esc>:m .+1<CR>==gi
inoremap <A-k> <Esc>:m .-2<CR>==gi
vnoremap <A-j> :m '>+1<CR>gv=gv
vnoremap <A-k> :m '<-2<CR>gv=gv
@tom-on-the-internet
Copy link

Thanks

@alicek106
Copy link

Thanks!

@keroloswilliam
Copy link

keroloswilliam commented Aug 5, 2019

Thanks but for comment i think it should be " not # ?

@dragonken
Copy link
Author

Thanks but for comment i think it should be " not # ?

Yes. Thanks

@doge95
Copy link

doge95 commented Jul 6, 2020

Thanks!

@falconws
Copy link

falconws commented Dec 2, 2020

Thank you very much!!

@saryeHaddadi
Copy link

Thanks!

@leobarros
Copy link

Thanks

@aka-apri
Copy link

aka-apri commented Dec 6, 2022

Thank you! +1 star

@reshidseyidli
Copy link

Hi. best one thank you. Can you please add line indent? for ex: displays tabs or white space as char

@anikishov
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment