General :: Vi Editor - Move Cursor To A Specified Line Number?
Dec 6, 2010
I am using Vi editor for editing and configuring my file.I am facing a little problem when there is long file like 3000 lines. Normally i use
Code:
:set number
in vi editor to visible my line number.The problem is when i have to go in the top of the file like say line number one I use k for it and to move down I use j which is too much time consuming. How can i jump directly my cursor to line number 2333 or line number 2600.
On windows I really only used Notepad++ as my text editor, it had two features that I loved.What I need to accomplish is what I would do with Notepad++ column editor.I could have like 100 lines, and place the cursor at a column, and goto edit>column editor, and I could insert an incrementing number. (I could also pad the incrementing number with 0s, this was GREAT for making batch files among other things.)So each line at that column had a number higher than the previous line.The other feature that I used sometimes was a search/replace with regex patterns.Does anyone know of an editor that has those features for linux? I am mostly after the column editor insert feature but if you know of one with both features that would rock.
I have a file of 200 pages. I want to move my cursor page wise. Suppose I want to move my cursor from last page of the file to up three pages.Is there any command to do it or I use "k" to move up?
I want to print the line number with the pattern of the line on a same line using multi-patterns in sed. But i don't know how to do it. For example, I have a file
I have recently installed Linux mint on my 2007 mac book pro and i found that my touch pad/track pad is not as sensitive as it was running the mac os. i can no longer move my cursor with the tip of my finger.
I am trying to upgrade PHP on our linux box ( CentOS ) I copied the configure command from the phpinfo and now I want to execute that.I am not able to copy the command from an editor in linux to the command prompt, clicking the wheel om my mouse does not work, neither does shift-insert or ctrl-shift-insert.It does work in the editor itself.Is there a way to do this ?Or is there a way to execute the command in linux while it is in the file ? Like a bat file on Windows ?
I use an ancient text editor - Jove - that I maintain and update myself. It has worked fine on Fedora 6, 7 and 8 under gnome-terminal (known to the Jove editor as xterm). I just installed Fedora 12. When moving around a file being edited, the cursor often 'replicates' itself into a series of blocks (or underlines, depending on the cursor type setting) that seem to correspond to tab-stops. I initially thought it was stumbling on TABs, but it does this weirdness on long strings of blanks, as well. Clearing and redrawing the screen cleans things up until the next movement command.
I _intensively_ checked the code for anything that might be sensitive to the new termcap strings that have come with F12, but nothing. I could live with this if the underline cursor blinked so that I could SEE it in text, but alas, there ain't a blinking cursor. Just found out how to get the cursor blinking on another thread. But, I'd _still_ like go get the 'block' to work right. I compared the termcaps used by Jove in LF8 and LF9 and they were identical. Since the "7-block-wide" cursor bug happens in LF9, 10, 11, and 12 but not in LF8, I can confidently conclude that support for termcap/terminfo has been broken as of Fedora 9. And people ask me why I have four computers. (So I can run F8 F9 and F12 and compare their performance!).
Just in case someone can reply a silly question, I've quite forgot the vi/vim command to bring the cursor to the 1st char in the current line. I do remember that for bringing it to EOL is '$'.
I have a project due for my Intro to C++ class and we are suppose to generate a file listing that will take an input of a C++ source code with .cpp extension and make a copy of it with a .lst extention that will have a line number preceding each and every line.
I'm trying to use sed to search for a certain 'primary' pattern that may exist on several lines, with each primary pattern followed by an --unknown-- number of 'secondary' patterns.The lines containing the pattern start with: test(header_name)On that same line is an arbitrary number of strings that come after it.I want to move those strings over to their own lines so that they each are preceded by their own test(header_name).e.g. Original file (mytest.txt):
apples test("Type1", "hat", "cat", "dog", "house"); bananas
anyway i need to take the average of all rows with the same 1st number(key). i.e.
1, 3, 4.66, 5.66, 5 2, 3.5, 4.5, 5, 3.5
I know this is something awk/sed would be great for, i just dont have enough experience with them to accomplish it, Also, what about averaging those columns together? so, after I output this to a file, id like to get another like:
1, 4.58 1, 4.125
The number of colums to add might not always be 4 either. EDIT: this might be easier to do in gnuplot, so I mainly just need an answer to the first part.
I'm not that familiar with sed and awk in order to be able to solve this problem on my own, so I'm calling on you for a bit of assistance. I'm writing a Nagios plugin to check our Oracle tablespaces and the output is given in one line like this: 1.04007771 TEMP 0 UNDOTBS1 .005340579 USERS 0 7 rows selected. I've been playing around with sed like below to delete the obsolete info and change every second space into a newline:
[code]...
how many tablespaces there are so I'd have to check all databases and 'hardcode' the tablespaces in my script. Is there any way to 'automate' this knowing that 'rows selected' preceded by a number is always the last line and using a sort of counter to auto-adjust the number to put in the -e 's/ / /2' part?
Installed linux mint in a virtual box (ose).Only problem,can't get the cursor out of the window,thus unabling me to unmount the iso so keeps reinstalling.Does anyone know how to set it so I can get the cursor to move outside the virtual box.
I installed the files from ppa:canonical-dx-team/une and installed Unity. Now, when I run Unity on my desktop and move my cursor on it, it disappears! Here is what I see in Terminal: [URL]
After playing one of the kde games in squeeze- breakout - which I had a hard time exiting - and even after I restarted the computer the cursor will not go to the lower left corner of the desktop, where the kde menu button is.
I'm running Fedora 14. I'm running a Athlon X2 with 4gb memory and nVidia 8400. I'm using the nvidia drivers ver 260. I'm running KDE 4.6. I've disabled desktop effects (when turnt on they work a charm, performance issues are the same either way). If I open any more than a few applications at once, the system grinds to a halt. even working with Kwrite is painful and it can take several seconds just to move the cursor, browsing the file is almost impossible.
When I have even 7 windows open X goes into a frenzy and sticks around 90% cpu usage. Even with no windows open if I move my mouse between screens X cpu usage stays between 50% and 90%. The system is unbearably slow. i have a XP Pro system with the same spec, lower GPU and I have no problems having 2/3 Visual Studios open, Photoshop, a few skype windows, Eclipse and the android emulator the system remains responsive but with this Linux box I can't even do basic stuff in Kwrite without it grinding to a haltJust.
I'm using Mac as a main machine and Ubuntu Netbook as a secondary. Although synergy gives me a good control over Netbook when it works without external monitor, but when I activate VGA monitor, I can only move around the limited region (details are below).
Phenomenon: Cursor can move in the external monitor's screen. No way to move cursor into the netbook's screen via synergy (it's possible from local touchpad/mouse) In the external monitor's screen, curosor moves only within limited region, which I'm guessing is as large as the size of netbook's screen.
Configuration: Use dual screens (uncheck "Same image in all monitors" in the tool "Monitor" on Ubuntu)
when I move the cursor over things or open menu's I hear a little sound inside my computer... ALMOST like its writing to disc,but the hard drive light indicates otherwise.
We recovered a large number of files from a HD I messed up. I am attempting to move large numbers of files of a type e.g. .txt .jpg , into a folder by type to more easily sort through them.
Here are the commands I have mainly been trying with various edits:
Code:
Code:
So far the most common complaint I have gotten "missing arguments to execdir".