Important or unimportant points about using "vi?"

Discuss the security implications of the various flavors of linux and unix

Important or unimportant points about using "vi?"

Post by ghostheadx2 on Mon Mar 07, 2016 1:57 am
([msg=91792]see Important or unimportant points about using "vi?"[/msg])

So, I'm reading a book that's telling me the main points for using vi, which I have a hard time picturing. My book says

vi is always available. This can be a ilfesaver if we have a system with no graphical interface, such as a remote server or a local system with a broken X configuration. nano, while increasinly popular, is still not universal. POSIX, a standard for program compatibility on Unix systems, requires that vi be present.

vi is lightweight and fast. For many tasks, it's easier to bring up vi than it is to find the graphical text editer in the menus and wait for its multiple megabytes to load. In addition, vi is designed for typing speed. As we shall see, a skilled vi user never has to lift his or her fingers from the keyboard while editing.


I looked up the advantages to using vi and found this:

http://www.websiterepairguy.com/article ... rn_vi.html

I read the first few reasons the web page gives and can't decide if the web page article really gets the point. I think the page is talking about a million different things, but if someone asks you "why do you use vi", it doesn't feel like someone would say the reasons on the web page as much as the books.

My understanding of the book's points are

1. vi is universally used, both throughout the linux operating system and it is universally used among linux users
2. vi is simple, quick, efficient, and convenient, so much so that one doesn't have to take their finger off the keyboard while using vi.

Does anyone agree? I think those are the two big points that the web page article doesn't have primary focus on compared to other points, although I think they are mentioned. I just want to know if I'm understanding my book correctly.
ghostheadx2
Contributor
Contributor
 
Posts: 728
Joined: Wed Nov 19, 2014 1:19 am
Blog: View Blog (0)


Re: Important or unimportant points about using "vi?"

Post by Jbraithwaite on Mon Mar 07, 2016 2:55 am
([msg=91795]see Re: Important or unimportant points about using "vi?"[/msg])

I pretty much use vi for every file I want to open, edit and save. Get some new piece of info on a subject, or need to quickly jot down a cookie to manipulate, just vi a new txt doc right in terminal Esc, :wq to save and quit and you're all good.

Not really much else to say about it. Use it for that, move on to the next challenge.
In training....
Jbraithwaite
Poster
Poster
 
Posts: 198
Joined: Tue Nov 10, 2015 4:35 am
Location: Whatever my VPN says.
Blog: View Blog (0)


Re: Important or unimportant points about using "vi?"

Post by cyberdrain on Wed Mar 09, 2016 8:07 pm
([msg=91856]see Re: Important or unimportant points about using "vi?"[/msg])

If you learn the peculiarities of vi(m) it can become very powerful, but most users use it just like Jbraithwaite described. If you can use it for whatever plain text editing you want to achieve, that's probably enough if it's not your main editor. Any time spent learning vi(m) well is time well spent in my opinion, but your mileage may vary.
Free your mind / Think clearly
User avatar
cyberdrain
Expert
Expert
 
Posts: 2160
Joined: Sun Nov 27, 2011 1:58 pm
Blog: View Blog (0)


Re: Important or unimportant points about using "vi?"

Post by ghostheadx2 on Thu Mar 10, 2016 4:12 pm
([msg=91879]see Re: Important or unimportant points about using "vi?"[/msg])

@Cyberdrain, I understand your point. So maybe I'll look at a tutorial more on just vi(m) later, when I finish the book, or even sooner and do this other stuff for now. Thanks for letting me know that. I'll definitely keep it in mind.
ghostheadx2
Contributor
Contributor
 
Posts: 728
Joined: Wed Nov 19, 2014 1:19 am
Blog: View Blog (0)


Re: Important or unimportant points about using "vi?"

Post by -Ninjex- on Fri Mar 11, 2016 6:10 am
([msg=91894]see Re: Important or unimportant points about using "vi?"[/msg])

Vi(m) is extremely powerful. If I'm at any kind of terminal, it's my goto editor of choice. The plugins and .vimrc file is where the real power comes from. With a skeleton rc file, it's not going to be very efficient. You have the choice to pretty much configure this editor any way you could imagine. You can quickly move lines of text around, split text by columns and at the same time add arbitrary data to the end of that text. Vi(m) doesn't stop there, it's able to read nearly any kind of data you want to throw at it, and it handles it very well where most other editors might fail or freeze up. Now, another great use is that it is command line based. This means Vi(m) and all it's awesomeness can be used with remote servers (such as sshing into a dedicated server). It would be harder and just inefficient to do this with other editors; you have to hack around to get it to work. A example of this is when I used sumblime text to allow editing of files on a remote server: https://gist.github.com/Ninjex/9582357 It's just not feasible... Anyway, Vi(m) has thousands of plugins and development isn't going to stop anytime soon like other editors you may pick up (i.e, lighttable) Vi(m) also has nice built in functions like being able to record a macro and replay it, or saving recordings to play when you choose. I mean, you aren't going to find anything better. I argue that the only reason people don't use Vi(m) is because they are too lazy or don't have the time to devote to the steep learning curve that comes with it. Vi(m) isn't just an editor you can pop up and be able to use.. As all great tools that ship out with a plethora of capabilities and options, the learning curve will be steep.
Don't be a bitch, learn that shit and change yo life
image
For those that know
K: 0x2CD8D4F9
User avatar
-Ninjex-
Moderator
Moderator
 
Posts: 1691
Joined: Sun Sep 02, 2012 8:02 pm
Blog: View Blog (0)


Re: Important or unimportant points about using "vi?"

Post by Jbraithwaite on Fri Mar 11, 2016 9:32 am
([msg=91898]see Re: Important or unimportant points about using "vi?"[/msg])

Indeed a tool worthy of time looking into it if it's that powerful. Cheers for the insight.
In training....
Jbraithwaite
Poster
Poster
 
Posts: 198
Joined: Tue Nov 10, 2015 4:35 am
Location: Whatever my VPN says.
Blog: View Blog (0)


Re: Important or unimportant points about using "vi?"

Post by tremor77 on Fri Mar 11, 2016 9:47 pm
([msg=91909]see Re: Important or unimportant points about using "vi?"[/msg])

I'll admit to being lazy. First thing I do is make sure nano is installed. And for that matter rarely use that, maybe for a quick edit on a conf file.. as a developer most of my file edits are within an IDE and on local development box with a GUI. The most used tools are GIT, SCP and the command line. I can get around in vi if I need to, but I often find myself :q! because I done goofed because of muscle memory from the earliest editors I ever used which were DOS Edit and VMS Edit. But I'm not on a 14k modem anymore and I've got 32GB ram for whatever IDE I'm jazzing on in any particular month.. Hell even if I have a VPS it's no big thing to installed a web based server management tool and edit files in a browser based texted editor.

So my take away is tools are tools, use what you like and what works for you. For a developer or administrator you own your world and can put whatever you want on a box. For a hacker you're probably going to want to know vi, because simply -you know that will be available if you manage to get shell access on something.
Image
User avatar
tremor77
Addict
Addict
 
Posts: 1095
Joined: Wed Mar 31, 2010 12:00 pm
Location: New York
Blog: View Blog (0)



Return to *nix

Who is online

Users browsing this forum: No registered users and 0 guests