LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback
User Name
Password
LQ Suggestions & Feedback Do you have a suggestion for this site or an idea that will make the site better? This forum is for you.
PLEASE READ THIS FORUM - Information and status updates will also be posted here.

Notices


Reply
  Search this Thread
Old 09-24-2010, 06:00 AM   #1
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Rep: Reputation: 67
how does one enter a tab character into a post?


I've always copied and pasted a <tab> if I really needed it, but seriously, there's got to be a way? <ctrl>+<shift>+<tab> or something? (Using FF).
 
Old 09-24-2010, 06:38 AM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
If you use the code tags ([ code][ /code] without the spaces) any tabs are preserved. If you are trying to indent paragraphs, there's no need to do that.
 
Old 09-24-2010, 01:19 PM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
There's a Firefox extension called tabinta that allows you to use "tabs in text areas". It never worked all that well for me though. It will insert tabs all right, but the function that's supposed to keep it from tabbing out of the text area has never worked, so using it constantly causes loss of focus. Perhaps you'll have better luck.

In any case, it's a moot point here, because the LQ software converts everything into standard html, which condenses all contiguous whitespace into a single space. Unless it's inside a code block, of course.

Here's a quick test of tabinta.
Inside code tags (one tab between words):
Code:
foo	bar	baz
The same outside of code tags:

foo bar baz
 
Old 09-24-2010, 01:45 PM   #4
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Quote:
the LQ software converts everything into standard html, which condenses all contiguous whitespace into a single space.
That's why my double-spaces between sentences always look like single spaces! Because they are single spaces...

To me single-spacing between sentences looks weird. Dunno why, but I've always double-spaced out of habit. The spaces between all these sentences were doubles when I wrote them, but now they're singles.
 
Old 09-24-2010, 06:07 PM   #5
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Original Poster
Rep: Reputation: 67
I'm talking specifically about writing code within CODE tags. But in general I find it hard to believe that there's no good way in FF (or any browser that I know of) to enter a tab in a form element.

Last edited by Meson; 09-24-2010 at 06:10 PM.
 
Old 09-24-2010, 06:08 PM   #6
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
You would need to write the code in an editor that accepts tab spacing and then copy it to the post submission box and wrap it in code tags.
 
Old 09-25-2010, 11:23 PM   #7
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
Yeah, I have run into this LQ/vBulletin issue myself, and I just copy/paste code, as XavierP said, into CODE tags and add descriptions for the code.

Of course, you should also get into the habit of linking to source or script code from an external site (like Launchpad for instance).
 
Old 09-26-2010, 01:57 AM   #8
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Quote:
Originally Posted by Meson View Post
I'm talking specifically about writing code within CODE tags. But in general I find it hard to believe that there's no good way in FF (or any browser that I know of) to enter a tab in a form element.
Did you try the tabinta extension I mentioned earlier? It does exactly what you're asking, if it works correctly.

@MrCode: Yes, that's right. Although to be more exact, I should've stated that it's the rendering of html that condenses the spaces. You'd have to deliberately insert non-breaking-space characters into the html in order for it to display more, which can't be done through the intermediary bbcode markup available here. If we were allowed to use html markup directly then the pretty much the entire unicode chart, including a variety of different space characters, would be available to us. Maybe it's a good thing we can't.

And yes, double-spacing between sentences is, or at least used to be, proper typographic form (see the link above). That's what I was taught to do in the typing class I took in high school, and I also prefer it to the digital-era single-spacing style. It's more readable when sentence breaks stand out clearly from the rest of the text.

Of course traditionally the "tab" was not a character at all, but a control for quickly moving the cursor/typehead to a particular location on the line. It's only due to historical word-processing conventions that the "hard tab" was developed as an actual character. Html will still render them as single spaces unless protected by pre tags.
 
Old 09-26-2010, 10:00 PM   #9
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
You could also get a tab by typing (in a terminal):

Code:
printf "\x09"
and then copying it to the clipboard and pasting into your post (Ctrl+V) every time you want to insert a tab.

Here's where it will make sense:

Code:
    /*This is some example code*/
Problem worked around.

Last edited by Kenny_Strawn; 09-26-2010 at 10:03 PM.
 
Old 10-05-2010, 04:03 PM   #10
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by Kenny_Strawn View Post
You could also get a tab by typing (in a terminal):

Code:
printf "\x09"
and then copying it to the clipboard and pasting into your post (Ctrl+V) every time you want to insert a tab.
No need to Ctrl+V, just use the middle button! Remember, select to copy, middle to paste, no menus or shortcuts! I wish more people knew that, I don't know how I lived without it!

Anyway, this is even easier:

Code:
printf "\x09" | xclip -i
It puts the tab right into the clipboard, middle-click or Ctrl+V to paste.

The xclip command is very handy. With the -o option, it prints the clipboard to stdout. With the -i option, it puts stdin into the clipboard.
 
Old 10-05-2010, 10:00 PM   #11
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Original Poster
Rep: Reputation: 67
Quote:
Originally Posted by MTK358 View Post
No need to Ctrl+V, just use the middle button! Remember, select to copy, middle to paste, no menus or shortcuts! I wish more people knew that, I don't know how I lived without it!
Wow that is nice. For about 9 months now I've been using PuTTY at work and have grown used to the fact that a simple select puts text in the clipboard, and miss it in Linux. This is even nicer because I have the best of both worlds. Thank you.

Where does this come from? Is it built into X, gnome, ...?

Last edited by Meson; 10-05-2010 at 10:02 PM.
 
Old 10-05-2010, 10:17 PM   #12
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Quote:
Where does this come from? Is it built into X, gnome, ...?
AFAIK it's general to X, i.e. not tied to any specific DE. It works here on Xfce.
 
Old 10-06-2010, 07:15 AM   #13
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
It's built into X.

Another thing I like that's built into X: sloppy focus (that's what it does with no WM). I've always hated the Windows click-to-raise model, what if i WANT to have a window above the focused one (and I do quite often). But for some reason all the major desktops chose Windows compatibility by default instead of common-sense convenience.
 
Old 10-06-2010, 07:36 AM   #14
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
Here's a more n00b-proof way to go: Press Ctrl+Shift+U, letting go of the U but still holding Ctrl+Shift, and type "0009", then let go. You've just inserted the tab character.

Example:

Code:
package=""
if [-z $package]; then
	sudo apt-get install $package
fi
 
Old 10-06-2010, 07:53 AM   #15
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Didn't know about that.

An easier way to think of it would be "Type 'u0009' while holding down Ctrl and Alt".
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
input of a character from console without pressing enter Bonny Programming 8 10-28-2008 04:50 PM
How do you change how many spaces contains a TAB character in the console (tty) ? zahadumy Linux - Software 2 05-18-2006 02:09 AM
Listening to Tab and Enter Keys in Java irfanhab Programming 7 12-18-2005 02:18 PM
Gnome stealing focus, only able to navigate with tab and enter stalefries Ubuntu 2 07-05-2005 02:50 PM
get character without enter/stdin-buffer lea Programming 3 09-07-2003 03:41 PM

LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback

All times are GMT -5. The time now is 08:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration