To some extent, this article is the answer — or rather, the supplement — to the publication
“Why a vi-ax for a 21st century programmer .
” I saw that in the comments people were still amazed: what is the point of these editors when there are full-fledged IDEs; The article gave some real examples and, understanding that I have something to say, I decided to share my own experience. Written in an artistic style, because I think that if people wanted a dry squeeze, they would just go read manuals. I also warn you that in Emax manuals, the “Alt” key is referred to as “Meta”. I will say “Alt”, since for many this name is more familiar.
Looking ahead, I’ll say that I’m currently using Emaks for coding with the Evil plugin
(a plugin that emulates VIM’s functionality) and combinations for insert mode
that are disabled in this plugin
(i.e., if I press “Escape” and Emacs is reincarnated in vim, but in insert mode it is still the same ordinary Emacs. Just imagine: at night you are the super hero X, but nobody knows your true alter ego, for during the day you are the usual super hero Y.) .
“What is your typing speed?” - the question asked at the device for practice just six months ago made me embarrassed smile, made me drop my eyes and mumble “Well, I didn’t measure the exact speed, but half-blind ...” Oh, yes, I often I saw in the comments on Habré, dedicated to the blind-set simulators, such kind of proud answers in the comments, "semi-blind ...". Unfortunately, if one of the readers has a “half-blind set” and you want more, then reconcile: my humble opinion says that non-use of Vim or Emax is contraindicated for you. Because when you write code
(aka a lot of text) in these editors, without having such a set, you will have only two ways: to score and use a regular editor or learn to type blindly. Because when you use “Ctrl + n / Ctrl + p” and “Ctrl / Alt + b / f”, etc., instead of arrows, you simply cannot lower your eyes every second to see where you are pressing . At first, however, I was greatly perplexed - “Why is the“ n ”button in place of the“ b ”button? And what the fuck I just pressed the "p" button, and the effect, as if I pressed the key "["? ". But believe me, this will pass.
Relatively recently, I was an ordinary student with a rich imagination, a bunch of superficial knowledge and without any serious programming experience - an average enthusiast. Quite by chance, this student was lucky to get a job in a branch of a large company that writes software for controllers with GNU / Linux running on them and, of course, under the “most popular OS”. Initially, I got there as a practice from the institute, started writing some small software as a server for GNU / Linux and a client for Windows, then I was accepted as a programmer and finished writing it already as a working person.
')
Like an “average enthusiast,” GNU / Linux
(Kubuntu) is at my home, so when I was given a task and a bare computer with uncomfortable WinXR
(compared to KDE) to work with, I understand that in any case I’ll have to development to keep one system under virtualku, decided to take this role HR'yuche and install on office PC Kubuntu.
“What does this have to do with our article?”, You ask. Oh, the most direct: as a result of my decision, I was auto-deprived of Visual Studio. Then I did not know about its analog for Linux aka QtCreator, or rather I knew, but I thought that it can only be used for development on Qt. Therefore, the choice fell on CodeBlocks. Partly, this choice was also due to the fact that this IDE is widely used in our office for software for Linux.
CodeBlocks did not exist for long as an editor, I quickly slipped into editing code in something third-party and running this IDE solely for compilation. I had a little experience using SublimeText - after it, editing code in CodeBlocks seemed extremely inconvenient. Over time, I can’t remember anything concrete that I didn’t like in CB, except for the complete absence of autostock semantics, which made it easier to turn them off, the best color scheme in ST and, of course, the killer feature of the last “mini-map ".
Unfortunately, the moment I switched from SublimeText to Emacs completely fell out of my head. I can only guess how it happened. I can assume that I wanted something new. Or maybe I was inspired by numerous articles about how cool it is to code in Emax, written by independent people with quite a long programming experience. I remember how I tried to switch to Emaks a couple of times, and then I complained to a friend from another city, who, he said, was actively using. I remember how I called this editor bad words, slandered and humiliated in every possible way in the hope that someone would say, “Boy, you are an idiot, you just don’t understand this, and this, and therefore you say so; stop talking nonsense! ”but a friend was the only person who could answer something sensible, and for some reason he was silent. And then, as if after an accident at high speed and a non-racing track, I suddenly found myself in a chair, the tcpdump tsiferki ran in the terminal and I quickly typed something in the editor Emax. "Woke up - gypsum."
For the first time people taking Emax into their hands have a fundamentally wrong expectation from this editor, on which I stumbled more than once, and because of that, I didn’t immediately use it. I see how cool uncles with 30+ years of programming experience, PhDs, use it instead of IDE and then write posts about it, how cool everything is in their world. But in my world, when I asked for a welding machine for a couple of tens of kilowatts, I was given a tinder in my hands, a lot of firewood, a huge volume, and they said that tomorrow it would be hot here. And they also advised not to confuse the volume with the wood.
You need to understand that before it works for you, you will have to spend a lot of time setting it up. And do not even hope that you will be able to avoid learning elisp
(the language used by this editor for scripts) - unless, of course, you want to seek help only because you found a piece of code in some kind of social network like Github ' and from someone's config works not quite as written in the comment.
But these are all lyrics - I’m not a pro at all in Lisp, and the article, as we remember, is by no means about the nuances of the Emax configuration, so I will try to leave this topic aside.
So, since we have not yet reached Vim in the time span, we only have combinations that are famous for their inconvenience for movement through Alt / Ctrl plus the letter. Mini-memo for those who do not know or do not remember:
Forward char ⇒ Ctrl+f
Back char ⇒ Ctrl+b
Forward word ⇒ Alt+f
Back word ⇒ Alt+b
Line up ⇒ Ctrl+p
Line down ⇒ Ctrl+n
, ! , , Caps-Lock Ctrl, , -. , . , , ! -, . , — , , — «f,j», ; , . -, [/], , ,
( ) — .. , , , . , Ctrl , vim', .
— «Ctrl+x b», (aka ), . . , «ido-mode», , , . «Ctrl+s», «Ctrl+r» . ? : Visual Studio, , , VsVim «. », «. », « №n». ok', 100500 , . . . , : , ? — , - , , , , , .
, , IDE': , . , α) , β) «\bmy_var\b», , . α, β, .. , , . , , , β: , , , , , , — .
«*scratch*». , , . . , - . , , , — , , . , , ,
(, , , — ). , , - . SublimeText, , , , . IDE ? , , ?
Visual Studio, , intellisense. , . , , try-catch, . , , - , , , . , , — achtung! — , , , ! , — , Visual Studio, , . , - , , , ., , , . , , — , «flycheck». vim
( «=» ).
«Super-i». , , , «ido-menu», , , IDE . , , , . : . , , , . «Ctrl-u Ctrl-space».
— / , , . , . : — ? , , ? , «(delete-trailing-whitespace)», , , , «before-save-hook», . , , , ++ ? ! «before-save-hook» , , /++, , . .
, Visual Studio — «Alt+q», - . .. - , . , , , - , Visual Studio CodeBlocks.
, , , . Emacs , , , — — ,
( , , , ), , . , , IDE , , , . C# .. omnisharp-server, , , «go to definition», « », , . elisp, , . , — , «omnisharp-mode». . , , , , , github .
, Vim' , . , «» « » , , , «End» «Enter» — . «» . , , : Vim, ?
, , VIM. : Visual Studio #, Omnisharp server'a , .. 12+ , , , , . Visual Studio , . : ; - , , «Ctrl-→» «Alt-f», . -, Alt — , , — , , , .
( File, Edit, .), - . , , . , , «» Windows .
-, Visual Studio
(achtung!) « »! .. «Ctrl-→», , IDE ! , , 80% , , , .
- , Visual Studio, VIM. VsVim, . , « »! : , - , , VIM', , , VsVim, , . hjkl , , , .
« Vim?» , , «Ctrl/Alt-key» . : Ctrl. , Escape , , . , , , /.
Vim . . , , ? M
(iddle), H
(ihg), L
(ow) . ? «Ctrl+d»/«Ctrl+u». / ? [<>, ]<> . ? «5k». ? «3b». ? «gd». ? «f,» , ? «Ctrl-o» «Ctrl-i» .
, , - . , vim , , , - , . , Emacs, Alt Ctrl, , , . , , . ,
( , ) , .
, , vim — . . , ( , , , ) , . , ? «=i{» , ? «da<». : , i
(nside) a
(, ), , . w
(ord), , , . «» , . «i», , .
vim Emacs, , vim . , ! … , … - , vim'a? , , «Evil»! «Escape» Emacs , « » vim? ? — :
;; remove all keybindings from insert-state keymap
(setcdr evil-insert-state-map nil)
;; but [escape] should switch back to normal state
(define-key evil-insert-state-map [escape] 'evil-normal-state)
, , , - , ,
LISP, .
, IDE Emacs ? , , .
, , , , FireFox Pentadactyl. Vimperator, , , . , , Pentadactyl - . , . . ,
Mozilla, Pentadactyl - ,
. , , , , , , , . , . , - , , .
Awesome, , .