Formatting from Notepad++ to Vi


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Formatting from Notepad++ to Vi
# 1  
Old 09-19-2012
Formatting from Notepad++ to Vi

Hi,

just quick question, I currently type up my scripts in Notepad++ and then copy them into my file (in VI).

However, i've noticed that all the lines get messed up and it becomes difficult to read the script.

so i've to spend time then using '\' at the end of lines etc and re-formatting the file to make it look presentable.

what does everyone else use?

i've now set Notepad++ to show a line that i think matches the width of my Vi file (settings - preferences - editing - show vertical line - line mode - show vertical line.....and set that to about 124)

anyone recommend anything else?

thanks
# 2  
Old 09-19-2012
I am writing scripts on Notepad++ and copying it in VI from ages and never came across the above problem not sure whats wrong going on with your system...
This User Gave Thanks to vidyadhar85 For This Post:
# 3  
Old 09-19-2012
Hammer & Screwdriver

Quote:
Originally Posted by vidyadhar85
I am writing scripts on Notepad++ and copying it in VI from ages and never came across the above problem not sure whats wrong going on with your system...

so if you'd a long line, how would you format it?

i.e.

Code:
if  [something true etc]
then
             echo "blah blah blah blah blah blah blah blah blah blah blah blah blahblahblah blah blah
 blah blah blah blah blahblah blahblah blah blah "

if i was to tab the second line of 'blah' out to keep the formatting consistent (and to match the first line of blah, the echo would contain a blank space where the tab would be.

hopefully that makes sense Image
# 4  
Old 09-19-2012
You mean something like (as attached) Smilie

i did copy paste from notepad++ into vi.. aplogies if this is not the scenario what u looking for...
# 5  
Old 09-19-2012
I too use Notepad++ if I'm on Windows. I haven't faced the problem before. Not sure if this'll help; try setting the file format in Notepad++ as Unix.
# 6  
Old 09-19-2012
Quote:
Originally Posted by vidyadhar85
You mean something like (as attached) Smilie

i did copy paste from notepad++ into vi.. aplogies if this is not the scenario what u looking for...

sorry maybe my echo statement was the best example.

Code:
if [ -s file_log1 ] 
then
    mailx -r server@myworld.com -s "Error found $HOSTNAME, \
Engine 1, please investigate" my_email@what.com < temp_file_log1

else   
   echo "Error messages NOT found" > /dev/null
fi

so if i try and tab out 'Engine 1' to match the above 'mailx' that is tabbed out, i get an email that reads : "Error found $HOSTNAME, *TAB SPACE HERE* Engine 1, please investigate"

thanks for your time
# 7  
Old 09-19-2012
Quote:
Originally Posted by horhif
sorry maybe my echo statement was the best example.

Code:
if [ -s file_log1 ] 
then
    mailx -r server@myworld.com -s "Error found $HOSTNAME, \
Engine 1, please investigate" my_email@what.com < temp_file_log1
 
else   
   echo "Error messages NOT found" > /dev/null
fi

so if i try and tab out 'Engine 1' to match the above 'mailx' that is tabbed out, i get an email that reads : "Error found $HOSTNAME, *TAB SPACE HERE* Engine 1, please investigate"

thanks for your time
My dear friend you cant tab out half command just to make it look cool... Smilie its like you are trying to run a command say...

Code:
 
$$ > da\
> te
Wed 19 Sep 15:42:01 2012
$$ > da\
>    te
ksh[2]: da:  not found

I am afraid i dont have solution for this... Smilie
This User Gave Thanks to vidyadhar85 For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

UNIX and notepad++

I connect to my office server using ftp option in notepad++ I am not able to open directory's with out setting my clear case view in the notepad++ Hence pls help me in setting the view in notepad++ so that it can read all the files and directorys (6 Replies)
Discussion started by: Syed Imran
6 Replies

2. Windows & DOS: Issues & Discussions

PERL: Running script from Notepad++

I'm not sure if this forum covers PERL issues but here I go: I'm trying to run a PERL script from Notepadd++. I've entered the path of the script from the run command but it is only opening a blank window. Is there anything else that needs to be done when using the 'RUN' feature of Notepad++? (2 Replies)
Discussion started by: millsy5
2 Replies

3. UNIX for Dummies Questions & Answers

Output of the script in notepad

Hi All, I want to show my output for the script to notepad.Anybody know what is the command to do this... Thanks.. (7 Replies)
Discussion started by: mastercar
7 Replies

4. UNIX Desktop Questions & Answers

Wordpad or Notepad?

I am new to using UNIX and after uploading a new script to UNIX from Windows using FTP, the script doesn't always work. It seems this depends on the text editor I use and the transfer type. I understand all scripts should be transferred using ASCII, but can you advise which is the best text editor... (12 Replies)
Discussion started by: Heidi.Ebbs
12 Replies

5. Shell Programming and Scripting

Strange Characters After Using Notepad

Hello all, I'm new to UNIX and new to this forum, so forgive my lack of knowledge. I'm new with editing in vi so I FTP scripts to a Windows machine and edit the script in notepad (when I need to do something quickly). Sometimes when I FTP the script back to the UNIX box, strange characters... (4 Replies)
Discussion started by: dgower2
4 Replies
Login or Register to Ask a Question