Black Background

vi is as complex as an on/off switch. Such statements remind me of reddit posts which claim they can't figure out how to quit out of vim. That, too, is as simple as an on/off switch but I can understand why it's waaaay over the head of anyone on reddit.
Ctrl-Z is the fastest :)
:q! is the proper one. I figured early on - that's probably all I should know about vi.

By the way, something vi might be good at (I suspect): writing documentation. That's not my main use case though.
 
The mistake I made with vi and desktop note applications is using the wrong command to save a text file. I would press ctrl-s in vi, then, it would lock up the vi screen. I believe I used ctrl-c to get out of it, but I would have to be careful to only do it once, or maybe use pkill. Then I would harmlessly press Esc, then type :wq! to try to save a text file on Leafpad.

A problem I have with vi is I have a difficult time telling the status of the command. If it's in insert or on escape mode. I have to memorize which mode I'm in, or keep typing to find it out.
 
At the moment, I'm writing a C program with three instances of vim open. The way I've written code for 15 years. I update or configure all our servers using vi. I never understand why people have issues with such a simple editor.
 
A problem I have with vi is I have a difficult time telling the status of the command. If it's in insert or on escape mode. I have to memorize which mode I'm in, or keep typing to find it out.
Just put this in your ~/.nexrc:
Code:
set showmode
set verbose
With the former vi(1) will tell you in which mode you are, with the latter it will print more explicit error/info messages.
:q! is the proper one. I figured early on - that's probably all I should know about vi.
I suggest you to do not use this after writing a long and/or important document. ;) A :wq will definitively be more appropriate. :)
 
Ctrl-Z is the fastest
This doesn't exit anything, it stops the current process and puts in the background.
Code:
       If you are running a job and wish to do something else you may hit the
       suspend key (usually `^Z'), which sends a STOP signal to the current
       job.  The shell will then normally indicate that the job has been
       `Suspended' and print another prompt.  If the listjobs shell variable
       is set, all jobs will be listed like the jobs builtin command; if it is
       set to `long' the listing will be in long format, like `jobs -l'.  You
       can then manipulate the state of the suspended job.  You can put it in
       the ``background'' with the bg command or run some other commands and
       eventually bring the job back into the ``foreground'' with fg.  (See
       also the run-fg-editor editor command.)  A `^Z' takes effect
       immediately and is like an interrupt in that pending output and unread
       input are discarded when it is typed.  The wait builtin command causes
       the shell to wait for all background jobs to complete.

I would press ctrl-s in vi, then, it would lock up the vi screen.
It's not vi that "locks up", it's your TTY that's been paused. You've sent it an XOFF. Give it an XON (ctrl+Q) to "unlock" it.

 
The mistake I made with vi and desktop note applications is using the wrong command to save a text file. I would press ctrl-s in vi, then, it would lock up the vi screen. I believe I used ctrl-c to get out of it, but I would have to be careful to only do it once, or maybe use pkill. Then I would harmlessly press Esc, then type :wq! to try to save a text file on Leafpad.
Add
Code:
# not to be disturbed by ctrl+s ctrl+q while using terminals
stty -ixon
to your ~/.zshrc or ~/.bashrc.
 
I can use editors/vim but can get a lot more work done quicker on Leafpad.
It is only true if you know only some of its basic commands and features,
but when you know some of its advanced commands, keybindings and functionality,
then you're able to do things with editors/vim 100 times quicker
than with any regular editor, because where you need to spend some time editing
using leafpad, for example, it's possible to do same tasks in vim with few key presses,
that's why it is one of most popular editors, because some of vim features are unique.
For example, it is possible to record actions in vim and then to repeat this action so many
times you need using few key presses. Also its functionality may be heavily extended even more using custom vimrc file.
 
I suggest you to do not use this after writing a long and/or important document. ;) A :wq will definitively be more appropriate. :)
Now, that's a hypothetical scenario really unlikely to happen :)
If I were forced to write a long and important document on vi, I would have probably killed myself long before it's worth to save it. Let me clarify - it's just that I am incapable of using vi. I know it's a fine editor for the right people.
 
This doesn't exit anything, it stops the current process and puts in the background.
Yeah, I know. When I am in vi the struggle is mostly how do I get out of it and into a console where I can kill the process. :)
Well, that was before knowing the command :q! It was a lot of keyboard shortcut trying and hair pulling.
 
It is only true if you know only some of its basic commands and features...

I do a lot of copy&paste from pages I've already typed by hand when working on my website and can normally have 10 or more open instances of Leafpad and Gimp to work from as I go. I have to think about what I'm doing with vim.

I seriously doubt I would ever become anywhere near as fast at vim as I am Leafpad no matter how much I studied or used it. A text editor is all I've ever used for everything and before it was Leafpad it was Notepad or what ever clone Linux offered. There's not much difference in them so have 20 years experience using it.
 
Vi is my preferred text editor for the console.

One inconvenience I have with vi, is when I want to edit the first position of the comment, for instance to add a # to comment out text, vi becomes no longer in insert mode. The indicator of which mode in vi is in helps.

Using grep on the terminal is better to compare files, than to manually compare them using leafpad. cat with >> is also useful to merge files. It depends on what I need, or what is more convenient at the moment.
 
Vi is my preferred text editor for the console.

Now we're talking ee. I know the file hierarchy and if I do have a question another laptop always running to check.

I'm more interested in disk space when it comes to file size than comparing files and df -h what I use most. I used grep and wc to see how many Categories and Responses were in Demonica's Language Center.

Sitting at a terminal of text with a keyboard is what I always envisioned to be "real" computer usage before I ever used one so ee has an attraction for me. The AT&T and Bell Labs connection what first impressed me about UNIX then interested me in FreeBSD. This is really something I idolized a long time ago and made it happen. When Windows users ask what kind of computer I use I ask if they've seen Wargames or The Matrix and say like that. :p
 
I seriously doubt I would ever become anywhere near as fast at vim as I am Leafpad no matter how much I studied or used it.
A text editor is all I've ever used for everything
I can agree when you working with GUI apps and get used to working with their menus and mouse and ..., it becomes hard too keep switching between them and terminal. Since terminal is text only no menu, no mouse, ... . So choosing an editor like Leafpad seems reasonable.
That comes true specially if your desingings are near GUI level mostly.
But for many people specially low level programmers, long document editors, Vi(and Vim) has capablities hardly any other editor has.
One of those capablities is the Black Background!!!
 
Markup Languages are all I write. XHTML and CSS and have written AIML and XML. I've always used a plain text editor and don't need anything with syntax highlighting or other features. I keep Leafpad fullscreen and minimized when working on my site and work from the taskbar to pull up what I need.

They used to have little "Made with Notepad" buttons for your web site and might have had one at GeoCities myself. I took pride in writing valid code by hand and learned at W3Schools, who I still patronize with a "I Love Validator" donation button.
 
That comes true specially if your desingings are near GUI level mostly.
But for many people specially low level programmers, long document editors, Vi(and Vim) has capablities hardly any other editor has.
One of those capablities is the Black Background!!!
Personally I see only advantages when using console version of editors/vim under X11, I like it much more than gvim, because, for example, it is possible to select text with two different types of selection, when using vim in xterm or urxvt, and it's quite handy, because sometimes you need to select text without moving vim cursor, to do this, just hold shift key and select required text, then you're able to paste it with shift+insert or middle mouse click. To enable vim mouse support add "set mouse=a" to your vimrc, so there is really no advantages of using GUI version of vim like gvim, just disadvantages.
I'm using also black background in vim :), but also I like terminal emulators with transparency support.
Снимок экрана от 2019-10-20 17-04-01.png
 
I do a lot of copy&paste from pages I've already typed by hand when working on my website and can normally have 10 or more open instances of Leafpad and Gimp to work from as I go. I have to think about what I'm doing with vim.
Vim also has tab support, to open files in tabs using vim, it is possible to use
% vim -p file1 file2 file3… or % vim -p file*
Снимок экрана от 2019-10-20 19-46-54.png

To switch tabs use ctrl+pageup/pagedown (or mouse click). To move tabs I'm using
Code:
" ctrl+shift+alt+pgup/pgdn to move tabs
map <C-S-M-PageUp> :tabmove -1<CR>
map <C-S-M-PageDown> :tabmove +1<CR>
in vimrc. My full vimrc file may be found here.
 
I'm using editors/joe for 25 years. It's a fully configurable text editor with the usual modern features: programmable macros, syntax highlighting, binary/hex mode, auto-indent/-dedent, …(*) The default key bindings resemble those editors common in old DOS days (e.g. WordStar, Turbo Pascal, Borland C) that I used 35 years ago, so my fingers are pretty quick with those. ;)

I can use vi if I have to. Thankfully that doesn't happen very often.

(*) The only feature missing is function folding, but apparently the developers are working on that.
 
If I were forced to write a long and important document on vi, I would have probably killed myself long before it's worth to save it.

Got a bit of a chuckle out of that, but I don't think I'd fare much better. I only use vi/vim for system admin stuff, usually scripts or config files which generally aren't too long. I sometimes get confused and q! out of a text file to start over. I can get the command and input modes confused and make a mess. For a really long document that would make things very difficult for me.
 
Back
Top