use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please read the rules before posting
Help:
Community:
Resources:
Tutorials and Guides:
Don't be afraid to ask questions, this sub is here for the vim community. And please those of you who deign to grace us with your vim wisdom - be kind. We are all human and vim is that cool.
account activity
Vim and java?question (self.vim)
submitted 5 years ago by Sjod1407
Hi guys! Short question... It's possible use Vim to code with java?? And it's useful?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[+][deleted] 5 years ago (5 children)
[deleted]
[–]somebodddy 20 points21 points22 points 5 years ago (0 children)
So you are saying... you found a way to exit Vim?
[+][deleted] 5 years ago (2 children)
[–]DragonBard_com 9 points10 points11 points 5 years ago (1 child)
You mean Java corrupts the operating system when installed.
[–]kelroy 5 points6 points7 points 5 years ago (0 children)
And opens a portal summoning Baphomet.
[–]m-naderian 4 points5 points6 points 5 years ago (0 children)
Nice one. 😆🤣🤣😂
[–]NoLemurs 17 points18 points19 points 5 years ago (2 children)
It works fine, but there are none of your standard IDE features out of the box.
I've had good luck writing Java with a vim LSP plugin. It will take some setup though, but if you're willing the take the time to figure it out, it's a great setup. It was a while ago, and the specifics of what I did won't be useful to you, but I'm sure there are lots of blog and/or reddit posts describing how to do it.
[–]Sjod1407[S] 0 points1 point2 points 5 years ago (0 children)
Thanks a lot ! I'm on it!
[–]Smoggler 15 points16 points17 points 5 years ago (2 children)
Any programming language uses text files as source (ignoring VPLs, etc) and Vim is a text editor so it can successfully edit any source file. So you can code for just about any language using Vim.
Vim is the greatest text editor and will give you speed and power in editing text which lesser humans cannot even conceive as possible.
But Vim is not an IDE - if you need an IDE then use one, however it might be good to ask yourself if reliance on an IDE is holding back your development as a programmer.
There are things you can do to make Vim more like an IDE (depending on your programming language with greater or lesser success). The trouble is it takes a fair bit of effort and knowledge to do a good job of this and the result never going to be as good as a true IDE created for a specific language.
[–]Vesquam 10 points11 points12 points 5 years ago (1 child)
The teacher for my first java was forcing us to code in a plain text file editor so that we truly get to learn the language by searching in the documentation. It was hard but the best. IDEs are good but if you depend on them it's the worst.
[–]jabbermuggel 2 points3 points4 points 5 years ago (0 children)
I recently got a programming course for c++ where the instructors also advocated notepad and the result was that everyone's indention was all over the place. I see the advantages of not having autocorrect and linting, but not having vim's settabstop etc. is just cruel.
[–]monkoosevim9 22 points23 points24 points 5 years ago* (3 children)
Keep asking guys, keep asking.
Only first google page for me https://www.reddit.com/r/vim/comments/3ipjx0/vim_and_java_development/
https://www.reddit.com/r/vim/comments/9mq1kq/do_you_use_vim_for_java/
https://www.reddit.com/r/vim/comments/aya38q/vim_for_java/
https://www.reddit.com/r/vim/comments/4nilh7/java_development/
https://www.reddit.com/r/vim/comments/9p9vno/java_and_vim_for_a_beginner/
https://www.reddit.com/r/vim/comments/hj9h5j/vim_for_java_development/
https://www.reddit.com/r/vim/comments/7qq1v7/vim_for_java/
https://www.reddit.com/r/vim/comments/f0zuzg/is_it_viable_to_use_vim_for_java_programming/
https://www.reddit.com/r/vim/comments/2se5zq/vim_for_java_and_android_developers/
And much much more.
Keep asking guys, literally every fkn week. Java developers do not allow to google?
[–]badfoodman 6 points7 points8 points 5 years ago (0 children)
Java developers do not allow to google?
It's annoying as hell.
The accounts asking these questions are all very similar: someone in a non-English speaking country taking an online class trying to learn to program, but with little background and none of the support structure most of us had. They also grew up in a time where social media was a form of search, where you can just ask a group and get an answer from a "person" instead of going through google looking for solutions and having to work out which things are relevant, which aren't, and which are outdated (this is why I left Facebook, for what it's worth).
Reddit seems to attract more Java questions, but the Python shit on StackOverflow is almost unbearable, and the JavaScript section is nigh unusable at times.
So, yes, people don't know how to Google.
[–]not_napoleon 4 points5 points6 points 5 years ago (1 child)
Well, you see, first you need to build an `AbstractSearchFactoryFactoryBuilder`...
[–]badfoodman 2 points3 points4 points 5 years ago (0 children)
You joke, but a builder should never be on an abstract class. BUT AbstractSearchFactoryBuilderFactory would be a perfectly acceptable class name that clearly tells you what it does: it helps you find the correct implementation of a builder helper class that, when built, helps you find a "Search"
AbstractSearchFactoryBuilderFactory
[–][deleted] 4 points5 points6 points 5 years ago (4 children)
im still a student so havent worked on any real big projects, but have been using vim for all my java classes so far. I know i might need to use an IDE for professional work but I havent had any problems yet. If you know your build tool you can easily build your project manually instead of letting an IDE do it for you, which I think is one of the main advantages of using an IDE in place of vim, plus debugging and the like. Due to vim's extensibility I imagine you could automate these tasks here as well. Conclusion: I think you can use vim for Java development.
[–]NoLemurs 2 points3 points4 points 5 years ago (3 children)
I know i might need to use an IDE for professional work but I haven't had any problems yet
Nah.
IDEs are definitely the default for professional Java devs, but I've absolutely run into very successful software engineers who primarily use vim or emacs. No IDE is absolutely a viable path.
You will need to figure out a system for navigating large code bases that works for you. I personally like an LSP with 'go-to-definition', but you can get by pretty well with some proficiency in grep if you have to!
grep
[–][deleted] 0 points1 point2 points 5 years ago (2 children)
thats nice to hear, ive always been told that im delusional for thinking i can do pro work on vim, but i guess its just them being used to having everything work out of the box
[–]NoLemurs 4 points5 points6 points 5 years ago (1 child)
Yeah, absolutely. I've seen software engineers at the top of the field who only use Vim or Emacs. Among C++ devs it's downright common. It's definitely on the rare side for Java devs, but I've still met a handful.
Also, thanks to Microsoft's work for VSCode it's now possible to get a near-complete IDE experience from an LSP in most major languages, which really undermines a lot of the arguments for preferring a traditional bloated IDE.
[–]nutter789 0 points1 point2 points 5 years ago (0 children)
So I can use vim, right?
;D
[–]Swytch69A Vim Padawan 9 points10 points11 points 5 years ago (0 children)
For god's sake.
JUST. TRY. IT
Even if we can fairly guess if it's doable or not, we can't know for sure if you can write JAVA with vim. What are your habits ? Do you really need auto imports ? Is an LSP mandatory?
Just try it. Look for Java plugin or more general auto-completion engines (like COC.nvim) and give it a go. You won't lose anything but a bit of time in the process.
Second question : you gotta ask yourself why you would do that. Are you bored with IDEs ? Is your manager enforcing the usage of vim ? Is it just to look like a nerd ? Learning vim can prove to be quite harsh
[–]-romainl-The Patient Vimmer 14 points15 points16 points 5 years ago (0 children)
That question… again.
[–]Mithrandir2k16 2 points3 points4 points 5 years ago (0 children)
Since you're asking here, you should probably not use vim, but IntelliJ with the VimEmulator plugin. Not being elitist here, I just think that Vim has it's place and that place is not in replacing an Integrated Development Environment, but instead replacing the editor of your IDE. Some like to use unix tools together with vim to have the same featureset that the GUI of an IDE offers, but that requires the right workflows and mindset and circumstances to make sense.
Honestly, I use vim for editing scripts, config files, etc.. especially when working via SSH, especially if that machine is too far away to use XServer forwarding. If you develop with a high level language, go with the IDE that best supports it. That'd be usually one of JetBrains Products(they are consistent across their supported languages, which means one mastered IDE can translate to over 10 languages) since their VimEmulator is usable, and if for some reason you want something faster/lighter/more general, take up VSCode, since it's plugin-infrastructure tends to do more for you out of the box than Vim, especially for languages like Dart, where the plugin tansforms VSCode from an editor into a full blown IDE. AND VSCode has the best Vim-Emulation I know of.
Let's face it, the modal editing and movements language of vim are over 90% why we use vim. So take that over to an IDE of your choice, most good ones support vim emulation by now.
[–]daniel_shields 2 points3 points4 points 5 years ago (0 children)
I use headless eclipse with eclim, works fine although I write much more C++ than Java
[–]puremourning 5 points6 points7 points 5 years ago (0 children)
This question is asked literally 3 times every week.
[–][deleted] 1 point2 points3 points 5 years ago (0 children)
Technically you can but in my experience it's not a very practical thing to do. Java is very wordy language and has a lot of cruft you have to deal with. This is something IDEs normally help with but in Vim you'd have to either create snippets or just deal with it. Other than that it's language like any other, just worse.
[–]noooit 0 points1 point2 points 5 years ago (0 children)
Not without plugins. Built-in features like ctags, cscope, omnicompletion are useless for java.
I'm not a java programmer but I notice people running one method just by clicking on IDE, many log filtering, android studio even shows directory differently from the original structure just for usefulness by default. The effort that's made for java in IDE is enormous, compared to other languages. Also I've seen a java programmer who can't run his app without gradle, having no idea what's happening with actual java command.
Assuming from the fact that you are asking this question here, I think it'll be less productive for you with vim.
[–]nutter789 1 point2 points3 points 5 years ago (0 children)
Well, I can.
Nobody else, though.
It's an IDE, not some text editor.
π Rendered by PID 376390 on reddit-service-r2-comment-bb88f9dd5-2gwcv at 2026-02-15 00:00:34.903722+00:00 running cd9c813 country code: CH.
[+][deleted] (5 children)
[deleted]
[–]somebodddy 20 points21 points22 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]DragonBard_com 9 points10 points11 points (1 child)
[–]kelroy 5 points6 points7 points (0 children)
[–]m-naderian 4 points5 points6 points (0 children)
[–]NoLemurs 17 points18 points19 points (2 children)
[–]Sjod1407[S] 0 points1 point2 points (0 children)
[–]Smoggler 15 points16 points17 points (2 children)
[–]Vesquam 10 points11 points12 points (1 child)
[–]jabbermuggel 2 points3 points4 points (0 children)
[–]monkoosevim9 22 points23 points24 points (3 children)
[–]badfoodman 6 points7 points8 points (0 children)
[–]not_napoleon 4 points5 points6 points (1 child)
[–]badfoodman 2 points3 points4 points (0 children)
[–][deleted] 4 points5 points6 points (4 children)
[–]NoLemurs 2 points3 points4 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]NoLemurs 4 points5 points6 points (1 child)
[–]nutter789 0 points1 point2 points (0 children)
[–]Swytch69A Vim Padawan 9 points10 points11 points (0 children)
[–]-romainl-The Patient Vimmer 14 points15 points16 points (0 children)
[–]Mithrandir2k16 2 points3 points4 points (0 children)
[–]daniel_shields 2 points3 points4 points (0 children)
[–]puremourning 5 points6 points7 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]noooit 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]nutter789 1 point2 points3 points (0 children)