DEV Community

Ben Halpern
Ben Halpern

Posted on

Which editor do you use when opening files like .bash_profile, etc?

And is it the same editor you use for the majority of your software development?

Top comments (150)

Collapse
 
irreverentmike profile image
Mike Bifulco

Confusingly, this is the only thing I use vim for. Everything else is in a different tool.

Collapse
 
ben profile image
Ben Halpern

I don't find this to be overly odd. I was actually specifically curious as to whether this was a thing.

Collapse
 
faraazahmad profile image
Syed Faraaz Ahmad

I think since some people (myself included) think of vim as an editor just for quick edits, we use it for just that

Thread Thread
 
ben profile image
Ben Halpern

What about the thought that stuff like vi is often the default way to do these things, it becomes your standard procedure, even if for code editing you've always used other types of editors?

I feel like this scenario could play out because folks may not switch off of the approximate default behavior.

Thread Thread
 
ennor profile image
Enno Rehling (恩諾)

What if the situation in which we edit these files is one where we're on an ssh connection in a console window where vim is the most powerful choice that isn't a desktop application? And then that becomes default behavior for config files, like you suggest.

Collapse
 
philnash profile image
Phil Nash

I used to do this in vim, I think because I thought it was quicker. Since I have VS Code open almost all of the time, especially if I'm doing something to .bash_profile, it's just as quick to open in Code and easier (well, more comfortable) to edit.

Also, I have tended to use the terminal from within VS Code more these days, so the whole open and edit process can happen in the same program and I like that.

Collapse
 
mgh87 profile image
Martin Huter

For me it's the same. The only downside is that my vim skills don't evolve as fast as I want them to.

Collapse
 
molly profile image
Molly Struve (she/her)

SAME! I have never even considered opening it in Sublime which is my main editor of choice when I am coding

Collapse
 
pandaa880 profile image
Prashant Chaudhari

I do the same.. but i use nvim.

Collapse
 
pmsuntuwarg profile image
Mahesh Sunuwar

I use the same, and never thought about other tool to edit it.

Collapse
 
thomasbnt profile image
Thomas Bnt ☕

Nanoooo

Collapse
 
sn0n profile image
Rob Foraker • Edited

100% nano, and if using a current release of nano, -lmx is nice °>°

Collapse
 
nikoheikkila profile image
Niko Heikkilä

code -r /path/to/file

This opens the file with VS Code to the same workspace as rest of the files making it a really fast process. Then just save and close it like usual. I'm only using Vim when I'm working over SSH.

Collapse
 
alexandreramosdev profile image
Alexandre Ramos dos Santos

Cool. I don't know it

Collapse
 
deciduously profile image
Ben Lovy

nano -w

If you're just going in and out, why get fancy. You still get emacs-like keyboard nav at a fraction of the cost.

Collapse
 
equiman profile image
Camilo Martinez

On Linux I like use more nano than vim

Collapse
 
guin profile image
Angelika Jarosz

Vim, but i also use vim as my regular editor.

Collapse
 
ben profile image
Ben Halpern

I feel like if you use a terminal editor, it's probably the obvious choice.

I'm curious if folks who use standalone editors choose terminal apps in these contexts.

Collapse
 
dmfay profile image
Dian Fay

It is (I do everything except Java in NeoVim); but also, if I'm just looking something up and don't mean to make changes, we've got other shell tools. I use less and grep/rg a lot with history files and so on.

Thread Thread
 
ben profile image
Ben Halpern

Makes sense

Collapse
 
dance2die profile image
Sung M. Kim

Nano.
but now I see many people using VS Code to open, I will give that a try too 😀

Collapse
 
jeankaplansky profile image
Jean Kaplansky

Vi. It was the only editor in town other than emacs when I first learned to edit anything on the computer.

I still use Vim for CLI stuff and VS Code for other stuff. Don’t know why I don’t use Vim for writing anymore. Probably years of other options making their way into MY $PATH.

Collapse
 
eddinn profile image
Edvin Dunaway

Same

Collapse
 
rpalo profile image
Ryan Palo

Vim, and I’ll use that as my regular editor if it’s just a few files I’m throwing together to try something, or if it is on a less powerful computer. It works good but looking at multiple files and projects, I can’t be as productive. I know the shortcuts and the plugins. It just doesn’t work as well as vs code for me.

Vs code is definitely my high productivity, big brain space editor of choice. It is just generally a little slower if I’m just tweaking a few lines or doing a quick search and replace.

Although, vs code does have some amazing command line flags that make it ideal for git commit message editor, diff viewer, and more.

Collapse
 
aleccool213 profile image
Alec Brunelle • Edited

I swear by Micro. It has made editing in the command line a joy.

Features:

  • Common keybindings (ctrl-s, ctrl-c, ctrl-v, ctrl-z...)
  • Extremely good mouse support
  • Copy and paste with the system clipboard
Collapse
 
vgrovestine profile image
Vincent Grovestine • Edited

Bash scripts => nano (vi only if I'm absolutely stuck on a system that's not mine)

.htaccess files and quick HTML/CSS edits => xed (aka gedit)

Markdown => Remarkable

Everything else => VS Code

Collapse
 
bhupesh profile image
Bhupesh Varshney 👾

Sublime text
😁😁

Collapse
 
ferricoxide profile image
Thomas H Jones II

vi has been a tough habit to break. I use it pretty much anywhere I can (thank you Cygwin/Moba). And, when I can't use it, I pray that, at the very least, I can install a copy of Notepad++ (harder, these days, now that Windows 10+ more-easily affords enterprise-managed systems the ability to allow only the installation of whitelisted tools).

Collapse
 
darrenvong profile image
Darren Vong

Nano or VS Code, with using only VS Code looking likely going forward after seeing some of the comments here. Slightly controversial perhaps, but I never bothered to learn vim since I just want to open something that works and code away, rather than having to learn another language before I can do that 😂

Collapse
 
arswaw profile image
Arswaw

Nano makes a lot of sense in its control scheme.

Collapse
 
bmann profile image
Boris Mann

For the longest time, my answer was nano.

Then, I’ve been trying to get better at using dotfiles across multiple operating systems — Mac, Chromebook, Linux servers.

This means I treat the files more like a program, so I use my usual editor, VSCode.

However, when I am editing on the command line, I’ve been using micro — think of it as an upgraded nano that also has mouse support and a bunch more features. Including that you just download the binary and don’t need admin access to use it.