How to become productive with Vim / Emacs

I have been an Eclipse user for the past 3 years or more. I am developing Java EE (and Spring), and so far I have completed 90% of my tasks without having to touch the mouse. Usually my Eclipse setup is as follows:

  • Subheading (or, conversely, I use the command line)
  • m2clipse (Maven Eclipse plugin)
  • Data Source Explorer (working with SQL)

Typical Eclipse actions that I do (and would like to pass this to Vim / Emacs) (this is for multi-module / multi-project / multi-line source code):

  • Refactoring (renaming method in the whole "open project")
  • Go to class implementation
  • Search for all uses of a particular class or method
  • Dependency update (third-party JARs) via maven pom.xml
  • Go to a third-party library implementation (maven can load source.jar, if the local repository does not have this, eclipse will lead me to the actual Java code to say that the implementation is Hibernate-noun).
  • Record and run unit-test

All of the above actions will not require me to use the mouse. There are several actions in which I will need to use a little mouse, for example, a global search file

Recently, I wanted to try development using virtual machines. The idea here is to create a barebone VM (say, use Ubuntu Server) and start coding there or use Putty / SSH.

I have a 13 "MacBook Pro that will benefit from using VIM / Emacs or any lightweight editor.

There are two main goals:

  • Mobility (both in travel and in coding)
  • VM as a development environment

The tools I would like to use are as follows:

  • Linux
  • Ruby, Python, PHP (and sometimes even Java is possible, but definitely not Microsoft.NET)
  • Any DBMS
  • Any build / dependency system
  • Test Module Structure

What would you recommend: VIM? Emacs Others? What about other tools? Gnu screen, ctags, etc.

Help me create my dream environment: lightweight, productive, easy to reproduce :)

Thanks!

+6
source share
5 answers

If you ask a question that includes "vim OR emacs", you will never get a useful answer. This is a religious question that does not have the right answer! However, you should clearly use Vim! ;-) But seriously: Vim is much lighter, so it can better describe the scenario you are describing. Vim can be written in different languages, and you can find many useful scripts at www.vim.org. Emacs is heavier, but Lisp is a very powerful scripting language. Thus, Emacs is a much more general tool than a text editor. IDE functionality (e.g. project management) is what I occasionally miss in Vim. There are several scenarios for this, but I do not like them. If you need it, I would go for Emacs.

+5
source

I'm an Emacs guy (using vi only for editing configuration files in / etc). I think that with Emacs you should not run it most often (and this is very different from vim ), and you should configure it in your .emacs file. For example, I will compile the F12 key with (global-set-key [f12] 'recompile) in .emacs .

+3
source

I am a vim guy, using it for Perl scripts for about 6 years - and am happy that it is still - so using it to write any scripts you said should also be easy and interesting in vim. As soon as you start learning vim, you will really like it because of the many functions that it has!

I would like to highlight a couple of vim plugins that can give you an IDE feel! (but I can’t do it like a real IDE!)

And I believe that vim definitely does not need a mouse!

And you can find several other features described here in a series of vim tips and tricks (some of them were written by me.)

+2
source

For Java development, Eclipse has many features that you will miss from Emacs or VIM. However, there is a project that allows you to access these functions from other editors. You may find it helpful to make up for the missing features.

By the way, if you approach other editors with Eclipse thinking, then you will almost certainly be disappointed because these editors are built on different philosophies. Their strengths lie elsewhere than the strengths of Eclipse.
+1
source

Any of these text editors will have a learning curve. In doing so, I successfully used emacs to perform the following tasks, which are on the line with what you requested:

  • Write PL / SQL and execute it in the oracle DB from the editor.
  • Record, compile, run java.
  • Edit pom files.
  • Keep a pretty good todo list in org mode.

You can run the shell in emacs, and this function MAY itself from what you requested (SVN, make / ant / mvn / etc).

If you jump into one of these editors and hope for a pretty eclipse and for studio features like a green joyt bar, I'm not sure if they exist. The Eclipse refactoring tool works very well and I don’t know what is possible in emacs. Although with emacs I found that someone usually wrote some kind of extension to do what I want, you just need to find it and find out how to use it. At best, I’m a neophyte of emacs, but in shorthand projects, I found it to be quite effective, and I don’t really have to pull my hands off the keyboard very much.

Disclaimer (java / ee / spring eclipse developer of the day who randomly works with lua and framework love using emacs at night)

+1
source

Source: https://habr.com/ru/post/900731/


All Articles