This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
| " Automatically strip trailing whitespace from lines within files | |
| """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
| autocmd BufWinEnter,BufRead,InsertLeave,BufEnter * call RemoveTrailingWhitespace() | |
| function! RemoveTrailingWhitespace() | |
| silent! execute '%s/\s\+$//g' | |
| endfunction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
| "Highlight whitespace at the end of lines | |
| " From: http://vim.wikia.com/wiki/Highlight_unwanted_spaces | |
| """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
| highlight ExtraWhitespace ctermbg=red guibg=red | |
| match ExtraWhitespace /\s\+$/ | |
| autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ | |
| autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/ | |
| autocmd InsertLeave * match ExtraWhitespace /\s\+$/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (1..100).each do |n| | |
| o = "" | |
| o << "Fizz" if (n % 3) == 0 | |
| o << "Buzz" if (n % 5) == 0 | |
| puts "#{o.empty? ? n : o}" | |
| end |
NewerOlder