vim

It seems like many of the forum members here have the technology background, so I added this new forum section about technology and computers.

I used to be a Linux user. I had to switch to Windows after I injured my hands because there is no speech to text software for Linux. Edit: I’m back to Linux + Vim + i3 (with Emacs/Evil for Org Mode).

Are there any vim enthusiasts out there?

One of my favorite things in the past was using vim. For anyone who isn’t familiar with vim, it’s a text editor–kind of like Microsoft’s Notepad, except it’s possible to write a 500 page user manual about it.

The software has so many incredibly precise commands available, it feels like it creates a direct link between your brain and the computer screen. You can think of a complex set of movements that you want to happen, and your hands will fly over the keyboard, causing the editor to output your thoughts at many times the speed of a person using a normal text editor.

Here is a screenshot:

vim screenshot Ubuntu

I’m curious if anyone else out there uses vim (or another similar program like emacs), and what you think of it. I think that using the program is a fantastic mental exercise.

Up until recently I was always a vim user, a few months ago I changed to emacs. But I haven’t done anything complicated enough to warrant learning the intricate systems of either. I’m hoping to get back into coding at which point I will dive a little deeper into the man pages and learn the awesome abilities one of these text editors offers.

I used emacs for a while (which I really like), but I got frustrated with elisp to customize the editor, because I didn’t know any elisp at the time.

Vim is especially cryptic at the beginning because of the two modes, but it’s incredibly powerful. If you write HTML, the surround.vim plugin is amazing…

Using Kate (Kde Editor) Pro

Very useful

I use vim, it’s great.
It does make me hate programs that use ‘esc’ as a cancel/quit/exit button though…

1 Like

Yes sir :)-
Kate is very good: with: VI Mode : http://kate-editor.org/kate-vi-mode
I mean in KDE Platform
I used Vim in the paste; and Emacs: http://www.gnu.org/software/emacs
thanks a lot

Back to vim. I discovered some awesome plugins for speeding up the coding process. My current VIM setup includes the following: snipmate, omni-complete w\ ctags, zencoding, nerdtree, html5 plugin, taglist and vim-wiki.

Vim-wiki is an awesome vim based wiki system. I theoretically now have everything in one place (if it were only that easy). Now if only I could keep all my physical notebooks as organized.

I’m going to try that. gedit in Ubuntu 11.10 is a disaster. I often use gedit at the moment because I use three different keyboard layouts and vim gets confusing (QWERTY, Dvorak, and German).

I’ll try downloading those.

Has anyone used Pentadactyl Tridactyl for Firefox? It’s a great idea. I just found it while researching whether Linux runs on the Asus Zenbooks. Install Pentadactyl Tridactyl in Firefox and try the tutorials. Type :help at any point. :slight_smile:

(Edit: Pentadactyl was discontinued, but Tridactyl is similar.)

You can probably set up a .vimrc that detects keyboard layout and remaps all the vim keys appropriately…
If there’s not already a plugin for this.

I do some of it by feel and some by sight, so I get disoriented whenever one of them changes. I’m going to convert all of my keyboards to Dvorak soon though. Maybe that will solve the problem.

Been using vim since 1985 and I still love it !

P.

1 Like

I’ve just started switching from Vim to Spacemacs. It’s an Emacs configuration that makes Emacs easier for Vim users (via “Evil” mode). If you’re into Vim, check it out.

I think that Emacs is a better editor in general, but Vim-style modal editing is faster than Emacs-style. This looks like a good combination of the two. I tried to switch before, but couldn’t get Evil setup correctly in the past.

I found this Spacemacs tutorial to be very helpful.

If any Emacs users have any tips, post them below. :slight_smile:

i came across a book called “Practical Vim: Edit Text at the Speed of Thought” a couple of months ago. I found the title really encouraging and started reading. It was during a semester and in my university you usually switch between linux and windows quite often (operating systems, VHDL, microcontrollers … all different setups). After a couple of chapters i stopped reading , realizing that i needed a platform-independent solution. I looked into Sublime Text 2/3 and it really had nice features like build scripts for different languages (sometimes iam too lazy to write a makefile…). BUT its not free! if you decide to use the demo version an Ad will popup everytime you are saving something telling you to buy the full version … if you can live with it okay … I have seen some classmates using ATOM so I will try this one out. There is a vim-mode aswell. As you can see iam still on a journey …

Emacs and Vim are probably more portable than the others. If you don’t already have a preference, I’d recommend going with either of those. The promise of “editing at the speed of thought” is true, and most other editors don’t do a very good Vim emulation. Evil (Emacs mode for Vim keybindings) is looking good so far, since they’ve ported some essential Vim plugins to Evil.

Vim is completely mindblowing once you get the commands into muscle memory, but vimscript is unpleasant. A main draw of Emacs for me is that you can modify the editor with Lisp. It also has great editing modes for Lisp/Scheme, and you can run a Python shell right in the editor. I’m sure that I’ve barely scratched the surface.

If you want a portable Vim or Emacs, you can put your .vimrc or .emacs file(s) on Github with two branches: one for Linux and one for Windows, or whatever OSs you use. If you manage the Vim plugins with Vundle, you only need to copy the .vimrc file and run :PluginInstall to download the extensions. With Spacemacs, I think you can put your .spacemacs file and “private layers” directory in your own Git repo to move it between platforms. I’m still learning how to use Emacs, but I have Vim and Emacs/Spacemacs working on both Ubuntu 14.04 and Windows 8.

I’ve tried Sublime and Atom, and they are good, but I left them for a couple of reasons:

I tried Sublime 2 and 3 for months, but has some defaults that I don’t like (tabs, 2-space indents) and an incomplete Vim mode. Some of it is fixable, but you still have to maintain the settings files across different computers, so it isn’t more portable than Vim.

I installed Atom, but abandoned it quickly because it’s built with Coffeescript, and I want an editor that is fun to modify. I bought a book on Coffeescript, but I haven’t been able to get myself to like the language. :slight_smile:

I’m biased towards the first two, but I think that one can’t really go wrong with any of those four editors.

Hey thanks for the recommendation of Spacemacs, i already tried it out a little. Well basically doing the vim-tutor again after a long time of not doing anything in vim … There was something with the windows version of vim (gVim) that didnt really work. I think it was the shell commands that didnt work. for this you had to use the cygwin version of vim and this one was not really customizable.

EDIT:

What are your settings for gvim under windows or did you switch completely to spacemacs?

The command line is a problem in Windows. I don’t like Windows for programming, so I also use a virtualbox with Ubuntu on Windows. It looks like I abandoned tracking the Windows .vimrc on Github, but Gvim is still working on my Windows computer. I’m not using Cygwin, because I can do all of my terminal stuff in the Virtualbox.

My .vimrc file is here, though it is a bit chaotic at the moment, and it may not include the latest changes.

I’ll upload the latest version when I get to my computer later.

Hey guys! I have also started programming with vim and I can understand the enthusiasm. Although I am a novice I am already captivated by the huge amount of keyboard commands and its really fun to jump around the lines with them!

Do you have any recommendations for modules that are ‘must-haves’ (up to date)? Or any other tips and tricks that you learned for vim and want to share?

For plugins, vim-surround, emmet, easy motion, nerdtree, and nerd commenter are ones that I use often. It depends on what kind of text you’re editing.

It helps to paste a cheatsheet on the wall next to your desk to learn new commands each day:
http://www.catswhocode.com/blog/130-essential-vim-commands
http://www.fprintf.net/vimCheatSheet.html

If you’re just starting out, a good thing to know is that Vim works like a language, so you can construct “sentences” out of commands. For example: v means to visually select. You can follow that with an “adjective”: i for “inside”, and then an object: . So vi” means “visually-select inside the quotes”. Another sentence: cit in an HTML file would “change inside tags”. Your target could be quotes, tags, parentheses, brackets or anything else.

Tip for developing speed: think about golfing every command. If you think about the shortest number of keystrokes required, along with the next steps, and then execute it slowly, it will get into muscle memory, and then become extremely fast after a while.

Example: if you have to from the bottom of the file to line 5 (5G) just to make a simple change before returning, you can set a mark at the current location (ma) before doing the jump. So instead of something like 5G + [edit some text] + Gkkkkkkkkklkkkk to get back where you were, you can do: ma5G + [edit some text] + `a and you’ll be back in the exact same spot as before without needing to move back up from the bottom of the file or remember line numbers. The cognitive load will be much smaller as well, because it will be in muscle memory and happen more like “speaking” to the editor than typing.

Check out pages like the ones below for endless tips. Some of these are very interesting: [email protected]", :r!ls, :w !sudo tee %, :earlier 15m, etc.



Hey Josh! Thank you very much!
I already did some tutorials and also printed out some cheatsheets etc. So the first part you mentioned is not new to me.
But thank you for listing those plugins! I will take a look at them!
And thanks for the information about “vim golfing”. Never heard of it. Have you done it yourself?
Especially the links at the end of your post are very cool! I was exactly searching for such advanced tips and tricks! I already bookmarked them and will take a closer look next days! Cool stuff! :slight_smile:

I don’t play that Vim golf game, but I spend a lot of time working on my typing efficiency to minimize keystrokes.

There is another Vim game here that might be fun. I’ve only played it briefly.