I prefer only to have a 'toggle' style function. I added a mapping to normal and visual modes, but you can remap to anything you like. You simply add a new filetype to the comment_map and its comment leader. vimrc file which works pretty well and can be extended easily. I've come up with a simple addition to my. (Thanks to and for improvements incorporated into this answer) Note 3: Bare-bones vim sometimes doesn't have the norm command compiled into it, so be sure to use the beefed up version, ie typically /usr/bin/vim, not /bin/vi Eg putting the following line in ~/.vimrc lets you type ctrl-n instead of :norm after making your visual selection vnoremap :norm Note 2: You could of course also add a mapping if you find yourself using norm a lot. If you need the escape character as part of your command sequence, type ctrl-v then hit the escape key (or even easier, just record a quick macro and then use norm to execute that macro on each line). Note: Since norm is literally just executing regular vim commands, you're not limited to comments, you could also do some complex editing to each line. Note that unlike block selection, this technique works even if the comments have uneven indentation! Which means "go to the first non-space character, then delete one character". If the comments are indented as in the OP's question, then you can anchor your deletion like this: :norm ^x If I had used a 2-char comment such as // then I'd simply do :norm xx to delete both chars. To start the setup you can use the Metals: New Scala project command, which works as following: Choose the template and then: Use the proposed templates. This deletes the first character of each line. visually select the text as before (or type gv to re-select the previous selection) Make sure your project uses the GHC version installed from GHCup (otherwise. Note that when you type : the range will be filled in, so it will really look like :'norm i# Install the extension (from VSCode: Ctrl + P and then ext install haskell.haskell ). This inserts "#" at the start of each line. visually select the text rows (using V as usual) In these cases a low-tech alternative is the built-in norm command, which just runs any arbitrary vim commands at each line in your specified range. there actually is a key binding to cycle through opening files. Delete the key bindings used by vim by right clicking and selecting remove option. There is no circular switch between panes, similar to what Ctrl + tab s does for files, though. Go to Keyboards Shortcuts (Ctrl K + Ctrl S) Search for these key bindings 'Shift + alt + UpArrow'. vimrc cannot help me, or sometimes NerdCommenter gets it wrong (eg JavaScript embedded inside HTML). For Windows: Ctrl + 1, Ctrl + 2 and Ctrl + 3. Sometimes I'm shelled into a remote box where my plugins and.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |