vim

27 posts / 0 new
Last post
#1 12 April, 2011 - 18:55
Offline
Joined: 1 year 10 months ago

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.

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.

15 April, 2011 - 16:27
Offline
Joined: 5 years 9 months ago

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.

15 April, 2011 - 19:07
Offline
Joined: 1 year 10 months ago

I used emacs for a while (which I really like), but I got frustrated with elisp to customize the editor.

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...

23 April, 2012 - 15:40
Offline
Joined: 4 years 9 months ago

Using Kate (Kde Editor) Pro

Very useful

23 April, 2012 - 22:55
Offline
Joined: 5 years 1 month ago

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

24 April, 2012 - 04:13
Offline
Joined: 4 years 9 months ago

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

24 April, 2012 - 05:09
Offline
Joined: 5 years 9 months ago

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.

24 April, 2012 - 11:21
Offline
Joined: 1 year 10 months ago

zakaria wrote:

Kate is very good: with: VI Mode : http://kate-editor.org/kate-vi-mode

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).

nicker wrote:

My current VIM setup includes the following: snipmate, omni-complete w\ ctags, zencoding, nerdtree, html5 plugin, taglist and vim-wiki.

I'll try downloading those.

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

24 April, 2012 - 12:38
Offline
Joined: 5 years 1 month ago

Josh Cohen wrote:

I often use gedit at the moment because I use three different keyboard layouts and vim gets confusing (QWERTY, Dvorak, and German).

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.

24 April, 2012 - 12:48
Offline
Joined: 1 year 10 months ago

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.

6 October, 2012 - 15:33
Offline
Joined: 4 years 4 months ago

Been using vim since 1985 and I still love it !

P.

28 July, 2015 - 02:55
Offline
Joined: 1 year 10 months ago

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. :)

28 July, 2015 - 08:03
Offline
Joined: 1 year 5 months ago

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 ...

28 July, 2015 - 09:46
Offline
Joined: 1 year 10 months ago

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. :)

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

30 July, 2015 - 07:53
Offline
Joined: 1 year 5 months ago

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?

30 July, 2015 - 09:57
Offline
Joined: 1 year 10 months ago

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.
https://github.com/j127/vimrc/blob/master/.vimrc

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

1 November, 2015 - 04:00
Offline
Joined: 1 year 3 months ago

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?

2 November, 2015 - 01:01
Offline
Joined: 1 year 10 months ago

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: yy@", :r!ls, :w !sudo tee %, :earlier 15m, etc.
http://vim.wikia.com/wiki/Best_Vim_Tips
http://stackoverflow.com/questions/726894/what-are-the-dark-corners-of-v...
http://stackoverflow.com/questions/1218390/what-is-your-most-productive-...

4 November, 2015 - 02:43
Offline
Joined: 1 year 3 months ago

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! :)

5 November, 2015 - 02:05
Offline
Joined: 1 year 10 months ago

Quote:

thanks for the information about "vim golfing". Never heard of it. Have you done it yourself?

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.

19 May, 2016 - 01:20
Offline
Joined: 2 years 2 months ago

I am a newcomer with Vim, anyone has some useful book or tut to learn through it?

Thank you guys

19 May, 2016 - 02:01
Offline
Joined: 1 year 10 months ago

The built-in tutorial is good. (Type vimtutor in a terminal to start it.)

This site looks interesting:
http://www.openvim.com/

I learned a lot from free, online cheatsheets.

The built-in help is good. Type :h reg (where reg is the thing you want help with) to bring up the documentation.

vim help

I haven't read this, but it looks good:
http://learnvimscriptthehardway.stevelosh.com/

15 June, 2016 - 12:31
Offline
Joined: 4 years 11 months ago

Got a new job, programming C++ code in vim.
It is fun to be back doing something so basic, yet using such a powerful tool.

:wq

15 June, 2016 - 15:19
Offline
Joined: 2 years 5 months ago

I continue to be an ide junky. I have tried vi/emacs enumerable times and I have never managed a work flow that was more efficient than using a specific use ide, whether it be word or visual studio. Maybe I lack imagination.

16 June, 2016 - 00:17
Offline
Joined: 1 year 10 months ago

Quote:

Got a new job, programming C++ code in vim.

Sounds fun. :)

Quote:

I have tried vi/emacs enumerable times and I have never managed a work flow that was more efficient than using a specific use ide, whether it be word or visual studio.

If you're using it on Windows, Vim might not be that enjoyable. I've never been able to get it set up correctly on Windows. If I'm in Windows, I use Sublime Text 3 at the moment.

I think that the most enjoyable environment for Vim is in a UNIX-like terminal, like in the screenshot above. You can then combine it with things like tmux and all of the command line tools. If you're managing things like virtualenvs, gulp tasks, local servers, remote servers via SSH, git commands, etc., you can split the terminal window into several panes with tmux, and you kind of have your own IDE, running to your exact preferences.

I read that Windows 10 will soon have Ubuntu Linux built in, including bash, so that might be interesting.

There is also an interesting version of Emacs called Spacemacs.

7 July, 2016 - 15:50
Offline
Joined: 6 months 4 weeks ago

Haha just found this. I can't believe there is a Vim thread in a memory forum :)

I love Vim. Lately I am experimenting with Spacemacs as well and I really like it. The way it takes into account memory in the key binding groupings and organisation is quite interesting as well. And org mode is AMAZING!!

10 January, 2017 - 22:32
Offline
Joined: 1 year 10 months ago

I started a related thread about Emacs' Org Mode and Productivity Systems. There is an Org Mode plugin for Vim too, so people might be interested in that discussion.

Learn memory techniques for free! Just click the "Sign up" button below to create an account and we'll send you an email with some tips on how to get started.

Related content: