Author Topic: A few "How To" questions  (Read 2505 times)

SlickUser56

  • Junior Community Member
  • Posts: 6
  • Hero Points: 0
A few "How To" questions
« on: December 17, 2014, 08:20:37 pm »
1. Does SlickEdit have an easy way to delete everything beyond a certain column (say column 50 to end of line)...for the entire file or a given selection?
2. Does SlickEdit have an easy way to delete every line that start with a certain character?
3. When editing a Fortran source code, how do I get SlickEdit to only show Subroutines and Functions in the View->Tool Windows->Def Window?

Thanks...

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3913
  • Hero Points: 513
Re: A few "How To" questions
« Reply #1 on: December 17, 2014, 09:18:59 pm »
1) cut_end_line().  Bound to Ctrl+e in CUA.  Use the "where-is" command or the Key Bindings dialog to look up the binding if you are in another emulation.  There is also a delete_end_line() command, but cut_end_line() is more useful as it places the text on the clipboard.

2) Search and Replace with a Unix regular expression:  ^C.*\n

3) Right click and select Quick Filters > Functions Only

SlickUser56

  • Junior Community Member
  • Posts: 6
  • Hero Points: 0
Re: A few "How To" questions
« Reply #2 on: December 18, 2014, 01:32:29 am »
1) cut_end_line().  Bound to Ctrl+e in CUA.   This seems to only work one line at a time.  How do I remove a range of columns for all lines within a file without doing each line individuality?

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3913
  • Hero Points: 513
Re: A few "How To" questions
« Reply #3 on: December 18, 2014, 02:05:25 am »
Sorry, I didn't read the OP closely enough.

Make a block selection (Right click and drag), then Delete

A slightly faster way, if you want to delete to the end of the line, is to do Edit > Select Block (Ctrl+B), then cursor down to the bottom of the line range you want to delete, then hit Ctrl+e to cut-end-line on all the selected lines.

You can also do this by creating multiple cursors.

rgloden

  • Senior Community Member
  • Posts: 169
  • Hero Points: 5
Re: A few "How To" questions
« Reply #4 on: December 18, 2014, 04:36:28 am »
For #1, you can also Search and Replace using a regular expression, e.g. a Perl regex might look like
Search Expression: ^(.{50}).*
Replace Expression: \1