A little thing a little bit annoying is when I reach the end of the file during programming.
I use very often to crtl-l to return at the middle of the file but when I reach the end of the file it doesn't work (of course).
I sometimes solve putting many blanks line at the and adding new lines with ctrl-o, but is't not very comfortable.. Are there other ways??
Am I the only one having this kind of problem?? Maybe you already solved it?
I would love an answer to this as well. The Mac ports of both Vim and Emacs do this, as well as BBedit, which even lets you choose how much extra space to add! I know it's only a tiny feature, but it makes working in MacVim feel very comfortable when it's something you are used to.
If anyone has any info on this, or a workaround, then I'd love to know too.
Thanks, Nigel
On 8 Jan 2009, at 22:33, Andrea Crotti wrote:
Am I the only one having this kind of problem?? Maybe you already solved it? -- View this message in context: http://www.nabble.com/End-of-screen-tp21319865p21362424.html Sent from the textmate users mailing list archive at Nabble.com.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
I agree with you guys. It's one of the only really frustrating things about TextMate.
On Jan 9, 2009, at Jan 9, 2009 | 3:00 AM, Nigel Green wrote:
I would love an answer to this as well. The Mac ports of both Vim and Emacs do this, as well as BBedit, which even lets you choose how much extra space to add! I know it's only a tiny feature, but it makes working in MacVim feel very comfortable when it's something you are used to.
If anyone has any info on this, or a workaround, then I'd love to know too.
Thanks, Nigel
On 8 Jan 2009, at 22:33, Andrea Crotti wrote:
Am I the only one having this kind of problem?? Maybe you already solved it? -- View this message in context: http://www.nabble.com/End-of-screen-tp21319865p21362424.html Sent from the textmate users mailing list archive at Nabble.com.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
I'm happy there's someone else ;)
Anyway I'm sure this can be solved, I don't find anywhere the definition of ctrl-l, is one of the few things not inserted in any bundle??
The idea anyway is simply: - get the last line visible on the the screen - get the current line - if last - current < n, then creates n blank lines at the end - go to the new middle
But I don't know how to implement because there are no variables to get the last line...
Andrea Crotti wrote:
I'm happy there's someone else ;)
Anyway I'm sure this can be solved, I don't find anywhere the definition of ctrl-l, is one of the few things not inserted in any bundle??
The idea anyway is simply:
- get the last line visible on the the screen
- get the current line
- if last - current < n, then creates n blank lines at the end
- go to the new middle
But I don't know how to implement because there are no variables to get the last line...
Of course it shoud create n blank lines only if there's no already some text below it ;)
The ctrl-l is system-wide and works as an emacs key combo in any cocoa text apps (try ctrl-a,ctrl-e and ctrl-o as well). I find these really useful to supplement the 'traditional' navigation and it would be great to have ctrl-l working as you outlined.
Nigel
On 10 Jan 2009, at 07:40, Andrea Crotti kerny404@gmail.com wrote:
Andrea Crotti wrote:
I'm happy there's someone else ;)
Anyway I'm sure this can be solved, I don't find anywhere the definition of ctrl-l, is one of the few things not inserted in any bundle??
The idea anyway is simply:
- get the last line visible on the the screen
- get the current line
- if last - current < n, then creates n blank lines at the end
- go to the new middle
But I don't know how to implement because there are no variables to get the last line...
Of course it shoud create n blank lines only if there's no already some text below it ;)
-- View this message in context: http://www.nabble.com/End-of-screen-tp21319865p21385773.html Sent from the textmate users mailing list archive at Nabble.com.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On Jan 10, 2009, at Jan 10, 2009 | 3:08 AM, Nigel Green wrote:
The ctrl-l is system-wide and works as an emacs key combo in any cocoa text apps (try ctrl-a,ctrl-e and ctrl-o as well). I find these really useful to supplement the 'traditional' navigation and it would be great to have ctrl-l working as you outlined.
Nigel
On 10 Jan 2009, at 07:40, Andrea Crotti kerny404@gmail.com wrote:
Andrea Crotti wrote:
I'm happy there's someone else ;)
Anyway I'm sure this can be solved, I don't find anywhere the definition of ctrl-l, is one of the few things not inserted in any bundle??
The idea anyway is simply:
- get the last line visible on the the screen
- get the current line
- if last - current < n, then creates n blank lines at the end
- go to the new middle
But I don't know how to implement because there are no variables to get the last line...
Of course it shoud create n blank lines only if there's no already some text below it ;)
-- View this message in context: http://www.nabble.com/End-of-screen-tp21319865p21385773.html Sent from the textmate users mailing list archive at Nabble.com.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
while we are somewhat on the subject, has anyone done anything similar to the vim/macvim bindings of 'zt' to take the current line to the top of the viewable area and 'zb' to take the current line to the bottom of the viewable area?
On 10 Jan 2009, at 14:19, chad gulley wrote:
while we are somewhat on the subject, has anyone done anything similar to the vim/macvim bindings of 'zt' to take the current line to the top of the viewable area and 'zb' to take the current line to the bottom of the viewable area?
I'm not sure if that would be possible in Textmate as it really realies on Vim's modality for those to make sense. You could create a macro or script to do this and bind it as a tab trigger to 'zt' or 'zb', but I don't think this would be as elegant as in Vim.
I may see what I can pull together to make a little Emacs bundle for myself - mainly to implement the navigation elements discussed in this thread - and I'll post anything back here if I have any success.
Nigel
I tried to code something to solve this, it's not elegant at all and it doesn't always work but it's a start
tot=$(wc -l $TM_FILEPATH) tot=$(echo $tot | cut -d ' ' -f 1) echo $tot, $TM_LINE_NUMBER if [ $tot == $((TM_LINE_NUMBER - 1)) ] # we are at the end of the file then ruby -e 'puts "\n"*30' fi
If appears that we are at the end of the file it print 30 newlines. The problems are: - sometimes (wc -l) executed in this way gives me a wrong result (don't understand why) - the caret goes to the last line
When this will be solved for me it will be fine... Maybe would be better to use macros?
Looks good - maybe you need to wrap this around a macro that saves the file before it runs. I am guessing that 'wc -l' gives a wrong result if its run when the file has been altered but not saved? Best to create a macro that sinply saves the file, then a new macro which calls the save macro, then runs the code.
I had a similar problem with the caret moving when I tried to set up a macro to fix common typos using sed on save. If you find out how to reposition the cursor to where it was when the macro is run, can you let me know?
Thanks,
Nigel
On 16 Jan 2009, at 21:53, Andrea Crotti wrote:
I tried to code something to solve this, it's not elegant at all and it doesn't always work but it's a start
tot=$(wc -l $TM_FILEPATH) tot=$(echo $tot | cut -d ' ' -f 1) echo $tot, $TM_LINE_NUMBER if [ $tot == $((TM_LINE_NUMBER - 1)) ] # we are at the end of the file then ruby -e 'puts "\n"*30' fi
If appears that we are at the end of the file it print 30 newlines. The problems are:
- sometimes (wc -l) executed in this way gives me a wrong
result (don't understand why)
- the caret goes to the last line
When this will be solved for me it will be fine... Maybe would be better to use macros? -- View this message in context: http://www.nabble.com/End-of-screen-tp21319865p21509237.html Sent from the textmate users mailing list archive at Nabble.com.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Nigel Green wrote:
Looks good - maybe you need to wrap this around a macro that saves the file before it runs. I am guessing that 'wc -l' gives a wrong result if its run when the file has been altered but not saved? Best to create a macro that sinply saves the file, then a new macro which calls the save macro, then runs the code.
I had a similar problem with the caret moving when I tried to set up a macro to fix common typos using sed on save. If you find out how to reposition the cursor to where it was when the macro is run, can you let me know?
Thanks,
Nigel
Of course I will. I tried to register a macro as you said but it wasn't successful.. It just made this { beforeRunningCommand = nop; command = "tot=$(wc -l $TM_FILEPATH)\ntot=$(echo $tot | cut -d ' ' -f 1)\n# echo $tot, $TM_LINE_NUMBER\nif [ $tot == $((TM_LINE_NUMBER - 1)) ]\n # we are at the end of the file\nthen\n \truby -e 'puts "\n"*40'\nfi"; input = selection; name = center; output = afterSelectedText; scope = source; uuid = "29DCBC0A-6C1F-4C0A-A640-767E6A412394"; }
I don't quite understand where all the macro magic comes from, and why there is almost no documentation about, and how should I know for example what "selectHardLine" does.
Where it looks it doesn't say anything about saving file, in fact it doesn't work. Moving the caret back to the center it's not so easy apparently, any hints?
Hans posted a message about this in the week:
For that purpose I have a simple helper tmcommand "saveMe":
- Bundle Editor > New Command - Save: Current File - Command: - Input: None - Output: Discard
* Command: is really empty!
Set up your command and this "saveMe" command, then start recording a macro and run "saveMe", then run your command (use the "cog" menu at the bottom of the TextMate window to access and run the commands rather than any key combos you have them saved to). Save the macro, then when you run it the file will be saved before your commands are processed, which should mean 'wc -l' always returns a correct value.
Hope that helps!
Nigel
On 18 Jan 2009, at 15:26, Andrea Crotti wrote:
Nigel Green wrote:
Looks good - maybe you need to wrap this around a macro that saves the file before it runs. I am guessing that 'wc -l' gives a wrong result if its run when the file has been altered but not saved? Best to create a macro that sinply saves the file, then a new macro which calls the save macro, then runs the code.
I had a similar problem with the caret moving when I tried to set up a macro to fix common typos using sed on save. If you find out how to reposition the cursor to where it was when the macro is run, can you let me know?
Thanks,
Nigel
Of course I will. I tried to register a macro as you said but it wasn't successful.. It just made this { beforeRunningCommand = nop; command = "tot=$(wc -l $TM_FILEPATH)\ntot=$(echo $tot | cut -d ' ' -f 1)\n# echo $tot, $TM_LINE_NUMBER\nif [ $tot == $((TM_LINE_NUMBER - 1)) ]\n # we are at the end of the file\nthen\n \truby -e 'puts "\n "*40'\nfi"; input = selection; name = center; output = afterSelectedText; scope = source; uuid = "29DCBC0A-6C1F-4C0A-A640-767E6A412394"; }
I don't quite understand where all the macro magic comes from, and why there is almost no documentation about, and how should I know for example what "selectHardLine" does.
Where it looks it doesn't say anything about saving file, in fact it doesn't work. Moving the caret back to the center it's not so easy apparently, any hints? -- View this message in context: http://www.nabble.com/End-of-screen-tp21319865p21528935.html Sent from the textmate users mailing list archive at Nabble.com.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
I tried to code something to solve this, it's not elegant at all and it doesn't always work but it's a start
tot=$(wc -l $TM_FILEPATH) tot=$(echo $tot | cut -d ' ' -f 1) echo $tot, $TM_LINE_NUMBER if [ $tot == $((TM_LINE_NUMBER - 1)) ] # we are at the end of the file then ruby -e 'puts "\n"*30' fi
If appears that we are at the end of the file it print 30 newlines. The problems are: - sometimes (wc -l) executed in this way gives me a wrong result (don't understand why) - the caret goes to the last line
When this will be solved for me it will be fine... Maybe would be better to use macros?