the all-thing | 2010-09-09 18:34:30 -0400 ========================================== Vim ruby syntax comment reformatting ------------------------------------ Date: July 20, 2008 2:44pm Author: William Morgan Labels: ruby, vim URL: http://all-thing.net/old22.txt The vim ruby syntax seems to screw up comments that have multiple hashes. E.g. I like to differentiate ### section heading comments, ## non-inline comments, and x = a + b # inline comments But reformatting the comments (e.g. with "gq}") always screws them up, unless you do: $ mkdir -p ~/.vim/after/syntax $ cat > ~/.vim/after/syntax/ruby.vim set comments=n:# which tells vim that multiple hash marks are ok. Replies -------- Brendan, on July 20, 2008 3:06pm: ["| ruby without textmate? is that even legal in this state?\n", "| \n", "| i'm allowed to say things like that, it's like jews making jewish jokes\n", "| http://dotfiles.org/~brendano/.vimrc [1]\n", "| \n", "| \n", "| [1] http://dotfiles.org/~brendano/.vimrc\n"] William, on July 21, 2008 11:35am: ["| Good god. Mighty big file you got there son. Mighty big.\n", "| \n", "| Do you have a recommendation for handling large numbers of open files in Vim?\n", "| That's the thing I miss most about Emacs. Primarily I'm looking for a way to\n", "| see the list of recently-opened buffers and switch to them easily. I've been\n", "| using a plugin called \"MRU\" but it's not quite what I want...\n", "| \n"] Brendan, on July 21, 2008 3:06pm: ["| yeah, default vim is pretty lousy for lots of open files. The most basic way,\n", "| :set hidden, :bn, and :bp, is pretty poor.\n", "| \n", "| I like \"bufexplorer\", which is just like emacs electric-buffer-list, and I\n", "| bind it to a single keystroke \";\" so ;[down][enter] to switch to the most\n", "| recently used buffer, and same again to switch again.\n", "| \n", "| for lots of files in a directory, I like \"NERD Tree Explorer\" the best.\n", "| \n", "| both are on vim.org.\n", "| \n"] William, on July 21, 2008 7:04pm: ["| Bufexplorer is pretty much exactly what I was looking for.\n", "| \n", "| And NERDTree lets me create files, fixing irritation #2 with vim. Thanks for\n", "| improving my life!\n", "| \n"] This delicious text version served up by Whisper .