9 ms·
I’ve learned some vi, and emacs, Visual Studio, VS Code, XCode, IntelliJ, and Android Studio. All the examples listed are pretty uncommon or trivial in any of
by cwbrandsma 8y ago
I’ve learned some vi, and emacs, Visual Studio, VS Code, XCode, IntelliJ, and Android Studio.
All the examples listed are pretty uncommon or trivial in any of the other IDEs (aside from the regex part, which is cool, but I never want to be in a place where I have to regex my code...ever). 90% of the time I’m doing simple code maintenance, with an occasional refactoring. And I know devs that swear by vi...they are developing any faster than I am, and I touch my mouse about as much as they do (hardly ever).
My favorite is still Visual Studio with Resharper, worst is XCode.
- depressed 8y agoSearching with regexes is more likely to be useful when trolling through log or data files than code. Even then, the most common cases for me are searching for a string only at the beginning or ending of a line, or only searching for instances that are not part of a larger word.
- joevandyk 8y agoI search for /def.*partial_name/ frequently when I can’t quite remember what a method is called in Ruby.
- thethirdone 8y ago> but I never want to be in a place where I have to regex my code...ever). I use regex search and replace fairly often; why are you so opposed to it? If I need to change $t1 into t1 in a group of 6 lines (something I did today), its pretty easy to just make that replacement automatically. Doing it by hand would just take longer. > ... with an occasional refactoring That's exactly what I use the feature for.
- mypalmike 8y agoIn a refactoring IDE, you never risk overmatching or under-scoping. You just rename the syntactic object and it's renamed exactly where it needs to be, including possibly on the filesystem and in git.
- thethirdone 8y agoImportantly, you don't get that safety in comments or strings. The nice thing about replacing via vim is that you can restrict it to a selected block which also gives you a type of safety. Particularly for the situation I used replacement today, an IDE couldn't make it better and doing it only on a range was helpful.
- mypalmike 8y agoFair enough. An IDE will generally present you with matching strings on a project level and let you select which ones to change. But if you know where to look, replace within selection seems useful. Apparently IntelliJ supports that, but I've never thought to use it.
- tacomplain 8y agoFirst, I also had trouble with XCode. About the regex in vi: there is a technique of writing/maintaining code based on substitutions instead of inserting/deleting. It can be very powerful but you have to "write" your code thinking about the patterns and maintaining some kind of structure. I am not saying that it is good or recommended. It's interesting. I coded for like 5 years like that. I was maintaining a codebase completely solo. When working with a not very synchronized team or having tools like resharp or omnisharp etc avaliable, I don't think it would pay off.
- brandonmenc 8y agoAt any rate, it's a good thing that literally every single IDE can do search and replace with regexes.
- org3432 8y ago> And I know devs that swear by vi...they are developing any faster than I am I hear about this from time to time, but have never seen it people do it successfully first hand, what I do see is silly mistakes in their checkins; incomplete variable renames, formatting is off, syntax errors, switching between browsers and their code while looking at manuals, or other obvious mistakes that can be caught inline by IDEs while you type.
- nouveaux 8y agoI see the same thing from people using vscode. Its safe to say that those who know their tools well will be more productive than those who do not.
- org3432 8y agoI think VS Code has the same issues I see it with that too, I haven't noticed it as much with VisualStudio and JetBrains' IDEs. Agree completely on knowing how to use your tools, it's like a carpenter showing up for work with a rusty hand saw and thinking they're going to make a house with it.
- colordrops 8y agoHmm, I've got syntax/compile checking, linting, automatic code formatting and generation, and code completion based on context in vim right now. I don't see how any of the problems you mention are vim specific.
- org3432 8y agoWhat packages are you using and what language out of curiosity?
- colordrops 8y agoC++ and JavaScript. I've got about 60 plugins installed and a highly configured vimrc. Some of the important ones: w0rp/ale junegun/fzf junegun/fzf.vim majutsushi/tagbar scrooloose/nerdtree jistr/vim-nerdtree-tabs erahhal/nerdtree-ack tpope/vim-commentary joegesualdo/jsdoc.vim Raimondi/delimitMate tpope/vim-surround vim-scripts/AutoComplPop Shougo/deoplete.nvim carlitux/deoplete-ternjs marijnh/tern_for_vim Rip-Rip/clang_complete SirVer/ultisnips tpope/vim-fugitive mhinz/vim-signify vim-scripts/DirDiff.vim sheerun/vim-polyglot pangloss/vim-javascript vim-utils/vim-man
- billfruit 8y agoI am writing this from emacs experience (some if not all these features are in vi as well), there are features from emacs that make a real difference in writing programs especially: * Unlimited yanking from kill rings: ie pasting text from history of the clipboard.(This is one thing I have most difficulty with when switching from emacs to modern editors) * Macro recording and playback : recording an arbitrary set of edit operations and then replaying them any number of times. * two or more code frames/windows side by side, even displaying the same file Surprisingly modern IDE guis seems not designed for it, eclipse can do it but clumsily. * Remote file editing: use the IDE tools to edit file residing on another computer. * Column edits or rectangle edits. Selecting a vertical column or rectangle of text and copying, moving it to another place.
- max76 8y ago> some if not all these features are in vi as well I'm not sure exactly which vim features are also in vi. Vim has been a daily use tool for me since about 2007. Vim has really good Macro recording. Vim + Tmux is great for side by side code frames, and there are plugins for showing multiple buffers in one Vim instance. Remote file editing is good with SSH + Vim. Vim has multiple registries for yanking/putting. Vim has column editing functionality. Almost anything Emacs does out of the box Vim can do with either a plugin or with an external program pairing. I prefer Vim's keybindings because there are less "chords" (Ctrl-C and Ctrl-V are copy and paste chords, they requiring pressing two buttons at the same time). Too many chords causing my pinky fingers to become tired. Vimscript is a surprisingly powerful language for dealing with text data, but it's cryptic the first decade you are exposed to it. EDIT: I'm more interesting in the code people write than the way people write it, but I wanted to share some of my vim knowledge and point of view.
- byte1918 8y agoIf you're still working with VS & Resharper and your projects allow you to, have a look at Rider from JetBrains. It supports the same color scheme & hotkeys as VS + Resharper out of the box so the transition is very smooth, you'll be productive in minutes after installing it. Also, if you were using VsVim, you can use IdeaVim for Rider and in addition you can install KJump plugin (it's what easy-motion is for vim). Since setting this up, rider & webstorm have become my favorite developer tools I have ever worked with and I feel they are superior to VS & VSCode (the things I was using before).