Live data from Hacker News

Handy text manipulation tricks in Sublime Text 2

whiletruecode.com

11–20 of 99 posts

Re: Handy text manipulation tricks in Sublime Text 2

#13

Sublime Text makes me feel silly for loving a text editor so much. Now if only it would do text completion across multiple files...

Is there a CTags plugin you can use?

Possibly, but that's a lot fancier and less "just works" than I'm interested in. I just want the same extremely simple "what words have I seen before" autocompletion that you get on a file-by-file basis, but as if I had every open file concatenated into one.

Re: Handy text manipulation tricks in Sublime Text 2

#15

My favourite feature is definently multiple cursors; Ctrl+D selects the next occurance of your highlighted word, Alt+F3 selects all occurances.

That's interesting. Can you edit all selected occurrences at once? I don't think there's an immediate analogue in Vim.

Re: Handy text manipulation tricks in Sublime Text 2

#16

My favourite feature is definently multiple cursors; Ctrl+D selects the next occurance of your highlighted word, Alt+F3 selects all occurances.

That's interesting. Can you edit all selected occurrences at once? I don't think there's an immediate analogue in Vim.

yep. I was amazed to find that Copy/Paste even works...

Re: Handy text manipulation tricks in Sublime Text 2

#17

Vim equivalents if you're feeling jealous (matching the order in the article): J Join line. ddp Swap line with the one below. ddkP Swap line with the one above. dd Delete current line yyp Duplicate line gq} Rewrap a paragraph. Vu Lowercase a line VU Uppercase a line Sort the selection by the Unix `sort` command (eg. sort -rn for reverse numeric order): V :!sort It goes a bit pear-shaped for these ones, though: Title-…

> I'm a bit stumped on toggling comments, though. Any ideas?

http://www.vim.org/scripts/script.php?script_id=1218

Re: Handy text manipulation tricks in Sublime Text 2

#19

Vim equivalents if you're feeling jealous (matching the order in the article): J Join line. ddp Swap line with the one below. ddkP Swap line with the one above. dd Delete current line yyp Duplicate line gq} Rewrap a paragraph. Vu Lowercase a line VU Uppercase a line Sort the selection by the Unix `sort` command (eg. sort -rn for reverse numeric order): V :!sort It goes a bit pear-shaped for these ones, though: Title-…

>> J Join line.

>> ddp Swap line with the one below. >> ddkP Swap line with the one above.

>> dd Delete current line >> yyp Duplicate line

>> gq} Rewrap a paragraph.

These shortcuts work in Sublime too, with Vintage mode enabled.

Re: Handy text manipulation tricks in Sublime Text 2

#20

Vim equivalents if you're feeling jealous (matching the order in the article): J Join line. ddp Swap line with the one below. ddkP Swap line with the one above. dd Delete current line yyp Duplicate line gq} Rewrap a paragraph. Vu Lowercase a line VU Uppercase a line Sort the selection by the Unix `sort` command (eg. sort -rn for reverse numeric order): V :!sort It goes a bit pear-shaped for these ones, though: Title-…

For swapping lines I recommend following shortcuts:

    " Move a line of text using ALT+[jk] or Comamnd+[jk] on mac
    nmap  mz:m+`z
    nmap  mz:m-2`z
    vmap  :m'>+`mzgv`yo`z
    vmap  :m'`>my` 
      nmap  
      vmap  
      vmap  
    endif
Post reply on HN