4 ms·
I'm by no means a high level expert of command line, but if I need to do a quick edit I just use nano, and if I need to get down and dirty I use VS Code. Is thi
by partiallypro 6y ago
I'm by no means a high level expert of command line, but if I need to do a quick edit I just use nano, and if I need to get down and dirty I use VS Code. Is this abnormal? I know a lot of power users use Vim, but I've just never fallen in love with it.
- mongol 6y agoIt is not abnormal. I used to use pico as my terminal editor and nedit as X editor the first five years or so I used Linux / Unix. Today I use VSCode as well, but vi rather than pico (nano). Over the course of many years I got more and more comfortable with it. It was never really a conscious choice. But it is always there. Perhaps it was the times I needed to fix things when booting in emergency mode that forced me to learn vim enough to get by, and eventually proficient.
- archarios 6y agoThis is unfortunately not uncommon. I feel like most of my coworkers at most companies Ive worked for don't use vim. One killer app of vim for me is macros. You can record a string of commands and map doing that to a letter. This makes certain mundane changes you have to do sometimes in software a breeze. For example, I had some code where someone was using string literals everywhere when they should have defined an enum. The convention we use for this kind of thing is to use UPPER_SNAKE_CASE and the strings were in camelCase. I was able to define two macros that let me improve this code in a few seconds. If I wasn't using vim I'd probably just leave that code as it was because it would have been so much effort.
- j-james 6y ago> If I wasn't using vim I'd probably just leave that code as it was because it would have been so much effort. Most modern editors, Visual Studio Code included, have powerful refactoring abilities. Not only that, but they're usable without needing to be an editor expert - just right-clicking and selecting "Change all occurrences" (or pressing F2) does the trick.
- read_if_gay_ 6y agoThis is reasonably fast, but not nearly as fast as if can be on Vim. IDK how GP did it, but one quick way might be searching for strings and hitting . whenever the macro needs to be applied. So you would end up doing something like n n n . n n . n n and so on, where each n means “go to next string” and each dot corresponds to finding and renaming something manually in other editors. You can go through dozens of occurrences in seconds, orders of magnitude faster than other editors.
- allannienhuis 6y agoThe vscode rename is much simpler/faster than that - cursor over the symbol/variable, press F2, type in the new name, press enter. Renames all references across all files in your project. edit: no shade on VIM and VIM macros; they're great. I'm a very experienced vim power user, but have switched to vscode with vim keybindings, and I'm very very happy with the switch.
- xfer 6y agoYou're conveniently forgetting that this works for only supported languages. These things are also possible in vim with additional plugin for your language.
- read_if_gay_ 6y agoThis is true for renaming a variable but GP mentioned converting string literals to enums. For tasks like that, I think Vim is pretty much the fastest. Also, Vim can also rename variables with coc (https://github.com/neoclide/coc.nvim https://github.com/neoclide/coc.nvim)
- archarios 6y agoThe change I was just describing is much more complicated than a simple rename.
- saagarjha 6y ago> One killer app of vim for me is macros. You can record a string of commands and map doing that to a letter. Nano lets you do that too.
- caymanjim 6y agoI've been using Vim since before it was Vim. I learned C on the 'ed' editor in the mid-80s, which was a predecessor to vi and Vim (and a subset of its command line UI). So Vim is always my go-to editor. nano is fine for quick edits, but the more Vim you know, the better off you'll be in that situation. If you're not a devops/sysadmin person, or you don't spend a lot of time in command-line Unix, there's no shame in not knowing Vim. But it is universally better than nano.