Programming :: Create Doc Comments In Vim Using Pre-typed Text?
Jul 5, 2011
I currently have a set up in vim so that when I type "<leader>ns" it takes any given word and turns it into a sub "sub word(){}". I also have it when I type "<leader>nc" it creates a doc comment section that is "blank". I was wondering if someone could help me out with combining the two so that when I typed <leader>ns it would create the doc comments with the word already in the Subroutine: line and create the new sub routine aswell. I'm trying to understand what I have (downloaded from the internet) and only doing so so.
Code:
" Put cursor over word and hit ,ns to create new Sub
nmap <leader>nc o
#------------------------------------------------------------------------------
# Subroutine:
# Function :
[code]....
View 3 Replies
ADVERTISEMENT
May 24, 2011
i want to create a command that can be typed in any old terminal window that would display a message on screen for anyone who typed it. is this possible? i just want to do this for the randomness of it.
and cuz i need to get used to messing with terminal windows.
for example i would like to have "rawr" setup as a command to display a message on screen in a popup window with an "Ok" button to close the popup. i googled it but all i came up with was creating commands to launch applications without having to type the full path/command. not what i'm looking for. thanks in advance!!!
View 4 Replies
View Related
Apr 17, 2011
Does anyone have tips for starting a virtual-terminal with pre-typed text?
This starts 'xterm' and keeps open at desired directory:
Code:
xterm -title installed software packages -e 'cd /var/log/packages && /bin/bash'
But I want to be even more lazier and have 'ls | grep -i ' already pre-typed so I can quickly search/ls packages by name.
Code:
david@slackware13:/var/log/packages$ ls | grep -i <READY FOR MY TEXT>
Code:
david@slackware13:/var/log/packages$ ls | grep -i CALC
xcalc-1.0.2-i486-2
View 2 Replies
View Related
Jun 16, 2011
I have a lot of scripts in Bash and am 'converting' one of them to Python just to get to know how Python works. Up to now I'm loving it, the feel, the logic, the power, ...
1. I have a template file which will be filled in by a technician, meaning it's filled with comments (#) and variable = value combinations, where the technician needs to fill in the values needed under the section referring to the configuration he's performing. 2. After installing from DVD/ISO, the software RPMs get installed and there is a default configuration file containing variable = value combinations where the values need to be changed to the values indicated in the template file mentioned in 1.
In order to do this I played around (and Googled a lot) with ConfigParser. I can load the template, get whatever value I need, load the configuration file, set the new value to the correct variable and write the file.
I checked that the template and configuration files loaded (open()) contain everything, including comments. However when I write the configuration file all comments get lost.
Here's what I have so far: Class to create a fakesection header since ConfigParser needs sections and the configuration file doesn't have those.
Code:
class FakeSectionHead(object):
def __init__(self, fd):
self.fd = fd
[Code]....
View 3 Replies
View Related
Dec 21, 2010
I have a file with 5000 lines. it is a list of books authors, series and titles. all lines start with the author names, than there is a dash (-) than the series name, a dash again and the title of the book.
The problem I encounter is that sometime there is a series, sometime not, and as I try to enter this list in a database, I wanted to create a cvs file to import into mysql.
ex:
The best would be to be able to add in the second line, a "space dash space" just after the author name, but how to make sure it does not do it to the first line as well.
If I could separate all line with 2 dash, (grep ?) then I would be able to do a simple replace, and change the single dash into two.
View 2 Replies
View Related
Feb 3, 2010
I am using C. I have a fuction that returns a string
Code:
I need to format this string so that I can create a text file like so:
So I'm trying:
Code:
But I get errors like:
View 2 Replies
View Related
Oct 1, 2009
I am working on a script to convert a comma seperated text file into html code line by line. The text file is like so:
Code:
link url, image url, description and I want it to output this:
Code:
<td><a href=�link url�><img src="image url" alt=�description" /></a></td>
Here is what I have so far:
Code:
#!/bin/bash
var1='<td><a href=
var2='><img src="'
var3='" alt=�thumbnail image" /></a></td>'
[code].....
It puts the entire line into the html so its no good. I'll probably need to use awk (I think).
View 5 Replies
View Related
Nov 11, 2010
What I plan to do is, create a duplicate file of a text file, and then append some text into the new text file.
View 1 Replies
View Related
May 2, 2010
i am on processing text tasks And i found that if you assign a text to a variable is chomp'ed automatically the newline
Code:
variable=$(cat file.txt)
The problem is i can only access the items/lines using:
Code:
for line in $variable
do
echo $line
# Other commands
done
how do i convert this to an indexed array. More importantly, how do i get access to individual $line[0], ..., $line[n] Another thing, if the file.txt, has lines with spaces it is a mess using the for...in..., but echoing prints line by line...o_0
View 11 Replies
View Related
Jan 19, 2009
I need to insert 3-4 lines of text to the beginning of a text file. The file is a largish MYSQL dump, the result of a backup shell script. This shell script should insert the required text.I've wrestled with sed, but lost.
View 2 Replies
View Related
Jan 13, 2010
I have to delete a certain line of text from the a textfile via ubuntu's shell scripting.I have done research, and it seems that most people advocate the usage of sed /d option. sed makes does not edit the text file. Hence, most options I discovered involved the use of a temporary variable/textfile and then overwriting the old file with the temporary new file. Is there anyway whereby I can bypass the use of temporary storage containers? I hope there is any magical combination of commands to edit the file directly.
View 3 Replies
View Related
Jan 8, 2011
I want to display something in my text view widget in glade using c code. that's all right.
now I need to attach a save button beneath the text view.so that on click the text view content should save as a txt file..
View 8 Replies
View Related
Feb 9, 2011
I want to display the contents of a particular log file (simple text file, I mean in Linux). But there is a problem: The contents need to be organized in a fixed format. Have a look at this log file:
sampleLog.txt
Code:
User Name: XYZ
Reported Problems Description: Blah! Blah! Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah!
[code]....
So, while displaying the contents of above file on a web page, I want to format the field names found in the log file: User Name:, Reported Problems Description:, and Remarks:. These fields may contain a variable length of text and no specific line number is assumed for them to appear on.
The desired output should look like this:
User Name: XYZ
Reported Problems Description: Blah! Blah! Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah!
[code]....
Well, what I am trying to do may sound wierd to some of you. The filed "Reported Problems Description:" can possible contain text which embeds colon (.
View 15 Replies
View Related
Feb 13, 2010
I am trying to find sed command combination to print out the "start command" line, the id line and all lines between "details" and "stop command" only if "error" exists. Here's the original output (test.txt):
start command
id 1
kajsdlfjsalj
[code]...
View 3 Replies
View Related
May 3, 2010
a sed command to add a text before line number in text file? I have text file with 500 lines, and i want to add 3 more lines with text after line 300, OR before line 302, isn't no problem.
View 16 Replies
View Related
Dec 19, 2010
How can I print a PDF file with comments (and highlights) on Fedora 14?
View 4 Replies
View Related
Jun 19, 2010
I typed "step", but gdb did not step into the specified function.
The code is:
Code:
It seems that gdb can't step into the function of "operator_analyze"class.
View 4 Replies
View Related
Aug 12, 2010
I went through recordMyDesktop and xvidcap and I didn't find any possibility how to insert written comments into recorded video.
View 2 Replies
View Related
Jun 24, 2010
Imported an Excel file into OO.o Calc. EVerything is fine except the comments are all blank. It knows that comments should be there, but they're all empty. how to recover the contents?
View 2 Replies
View Related
Jul 15, 2011
I have seen that it's possible to put special comments in a source file that tell vim what indentation style to use. The problem is that i don't know how to use them, and can't find and tutorials or documeantaion since I have no clue what this feature is called.
View 3 Replies
View Related
Sep 9, 2011
Every time I try to create a text file with gedit while using su I get this error:
(gedit:2401): EggSMClient-WARNING **:
Failed to connect to the session manager:
None of the authentication protocols specified are supported
**
GLib-GIO:ERROR:gdbusconnection.c:2270:initable_init: assertion failed: (connection->initialization_error == NULL)
Aborted (core dumped) I'm following the Fedora Bible (2010 edition) and I'm trying to get KDE up. This is what it says to do: After running switchdesk or switchdesk-gui, you need to perform one other task. As root, edit or create the file /etc/sysconfig/desktop. Add the following lines to the file:
DESKTOP="KDE"
DISPLAYMANAGER="KDE"
However, I receive that error. Does it want me to log in as root? I tried and it wouldn't let me, so I tried looking up how to do it, and I needed to change another text file with su (which is my problem in the first place). Just to be clear, this error occurs in any directory that I'm in. (home, or otherwise)
View 2 Replies
View Related
Jun 16, 2011
I have a file like:
a
1
2
[code].....
and I would like to convert it to CSV, so that it looks like:
a,1,2
b,1,2
c0,1,2
d0a1,1,2
Basically, I would like to move every 2nd and 3rd line onto the above line, and put a comma to separate
View 5 Replies
View Related
May 18, 2011
Can anyone point me to a well working peace of software (free will be preferred) that can convert text-files into pdf.
View 6 Replies
View Related
Dec 30, 2010
I've recently installed Proftpd to host for someone for a couple of hours.
With the default config it works however when taken the comments out and edited for anonymous, proftpd fails to start
This is the default config file which works if you have a user and password for my machine, but anonymous wont work (when the comments were removed).
View 1 Replies
View Related
Jan 28, 2009
I have a text file called file1.txt containing many lines eg.
line1
line2
line3
line4
line5
line6
Then i have another text file called file2.txt contains
3
5
6
Is there a command to remove the lines in file1.txt based on the keywords in file2.txt? note: It should remove line3,line5,line6 based on 3,5,6
View 10 Replies
View Related
Apr 13, 2010
I can do multiscan documents using xsane and the scanner and create multipage PDF. My next wonderment was how would you create it so you can search for text in the PDF file. I am assuming the scanner is really just creating an image file. And the reader needs text? I did find a decent OCR web based solution. It looks like it would be a lot of work to put something like that together.
View 4 Replies
View Related
Jun 23, 2010
1. I need guide on how to create a folder name from the text file with .txt format.
2. First, I call the function of reading the directory.
3. Then, I dont know how to do.
4. Finally, I close the directory
This is my source code in perl
## read text.txt file ##
open F, "from/$directory/text.txt";
read F, $buf, 9999;
close F;[/size]
This source code is used to print the folder with date format like "ddmm" d stands for day and m stands for month
if ($command =~ s/-O "(.*)"/-O "$websites/$month/$file"/)
Instead, I want to have the name from text.txt to be folder name
View 4 Replies
View Related
May 12, 2011
create a shortcut to my email, so when im loggin in on different homepages,i can just press ex ALT+F1 and my email will be written in the selected area..
View 4 Replies
View Related
Nov 17, 2010
How to create binary file with text in it, something like
Quote:
Hola Mundo!
I want it binary, because I want to execute it directly from Bios before Windows.
View 7 Replies
View Related
Mar 29, 2010
Does anyone know of any (GNU) software that can scan in letters that have been typed, and encode the text to unicode/ASCII/etc. I've looked for "Handrwriting recognition" (figuring if some software can interpret handwriting it could interpret typewriter text) in the Ubuntu software center and on an internet search, but all the hits are for tablet and stylus type programs.
View 1 Replies
View Related