DEV Community

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

Ben Halpern on May 25, 2019

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

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
 
pmsuntuwarg profile image
Mahesh Sunuwar

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

Collapse
 
pandaa880 profile image
Prashant Chaudhari

I do the same.. but i use nvim.

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
 
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.

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
 
bhupesh profile image
Bhupesh Varshney 👾

Sublime text
😁😁

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
 
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
 
murtezayesil profile image
Ali Murteza Yesil

Nano : if I am on terminal
IntelliJ : for practicing Java
Gedit : writing diary, editing files launched from file manager and just about everything else

BONUS : echo $TEXT >> $FILE_PATH for just adding a line at the EOF

Collapse
 
ascasson profile image
Anthony Casson

I do some hefty customization with my bash_profile, so opening up in VS Code (along with everything else) is nice. I don't use vim and nano would fine if I had a smaller file. It's not much to do code ~/.bash_profile.

Collapse
 
mrmlk profile image
Mike Lee

VIM, despite the fact I was a massive emacs fan back in the day.
Just because VIM is definitely going to be on every terminal I end up defaulting to it on the command line.

I don't use it anyway else, I'd prefer an IDE like InteliJ.

Collapse
 
mgh87 profile image
Martin Huter

You can also use Emacs in vi mode 😄

Collapse
 
arswaw profile image
Arswaw

Nano makes a lot of sense in its control scheme.

Collapse
 
jdorfman profile image
Justin Dorfman

.bash_profile = nano
else
VS Code

Collapse
 
redfred7 profile image
Fred Heath

I've recently switched to micro editor as my goto editor for everyday tasks, such as configuration editing, quick shell scripts, etc. It's brilliant.

However, I'm sticking with Sublime for any major development work, for the extra features and IDE-like convenience.

Collapse
 
vonheikemen profile image
Heiker

Vim.

I use Neovim/Sublime text for coding.

This is like the perfect use case for micro, it's a terminal based editor but it has the same keybindings that modern editors have like ctrl+s for save, ctrl+z for undo, ctrl+x for cut and it even has multiple cursor support. (If someone is getting it, download the nightly build)

Collapse
 
smonff profile image
🌌 Sébastien Feugère ☔ • Edited

I think it is important to use an editor that makes syntax colouring and apply rules of indentations and use of spaces/tabs coherent with the rest of the file. It even makes more sense if it is files like YAML for configuration.

By the way, I use Emacs for this. It is kind of the same than using Vim, except you can exit it.

Collapse
 
robertbernstein profile image
Robert Bernstein

VS Code for everything these days. I just started using the Insider Build so I could try out the Remote Development Extension Pack.

Collapse
 
swarupkm profile image
Swarup Kumar Mahapatra

Well I use visual studio code for this too.
All i need to is >code ~/.bash_profile

However inside servers, there is no other choice but to use VIM.

Collapse
 
pranay_rauthu profile image
pranay rauthu

I feel any editor which can open quickly is fine. If the editor can be opened from terminal it becomes really easy for terminal users. I generally use vscode. editors like vscode, sublime have fast load times & also they can be accessed from terminal

Collapse
 
aspittel profile image
Ali Spittel

Nano or VS Code depending on how many edits I want to make!

Collapse
 
ben profile image
Ben Halpern

Makes sense, Nano for speed, Code for going bigger.

Collapse
 
darkain profile image
Vincent Milum Jr

The closest thing to that is my .cshrc file. I used to edit it via nano, now I edit it through GitHub. Yeah, my console profile is a git repo now!

All of my actual work though is done in Sublime. Because Sublime is BEST!

Collapse
 
jmcp profile image
James McPherson

While my primary text editor is emacs (and I'm getting up to speed on VS Code), when I want to edit a config file I'm almost always going to use vim. It's minimal, I've frequently needed to do edits over trans-Pacific ssh connections and the edits I've needed to make are generally < 10 lines. I can also pretty much guarantee that vim or vi are available on the remote end, too.

Collapse
 
ennor profile image
Enno Rehling (恩諾)

It's either vim or jed, depending on what's installed.

For coding, I use IDEs with more language-specific support, either Visual Studio or PhpStorm. Never got into pimping out vim with plugins, or didn't find them to be as good when I tried.

Collapse
 
yaser profile image
Yaser Al-Najjar

Notepad++ ❤

I feel like VSCode is a bit too much for such files.

Collapse
 
ben profile image
Ben Halpern

Do you think this feeling is a matter of practicality and productivity or more of a personal taste/aesthetic/feelings?

Collapse
 
yaser profile image
Yaser Al-Najjar

Both actually 😁

VSCode has many extra features (side panel for git & file explorer).

But, notepad++ gives you just the text front of you so you can make changes or peek into the file as quick as possible... save & quit.

My thinking is generally like this: Do I need to open the whole folder and play with it?

  • Yes, open folder with VSCode
  • No, open that specific file with Notepad++.
Collapse
 
mallenjenz profile image
mallen-jenz • Edited

Same here, using Moba term which gives a File Explorer like interface in ssh connections, opens file in Notepad++ on my PC then saves back to same opened from directory on the remote server

Collapse
 
jsalvador profile image
Juanjo Salvador

I used to be a nano fan, but since I don't have nano at my company servers, I become a vim user. So, I'm gonna say vim.

Esc + :wq :P

Collapse
 
flrnd profile image
Florian Rand

:x (less typing 😂)

Collapse
 
shindakun profile image
Steve Layton • Edited

Just like @irreverentmike for quick edits to text config files I almost always use vim. Most other text type files I'll use vscode.

Collapse
 
jonathanspeek profile image
Jonathan Speek

If it's something quick, vim. If I'm doing a bunch of stuff, I'll use VS Code (my main editor).

Collapse
 
learnbyexample profile image
Sundeep

I don't have a usecase for IDE as of now

I use gvim (don't like vim on terminal) as my only editor. Even though I spent significant time learning many of its magic stuff, I've fallen off track since leaving my job. These days, I'm mostly using it for markdown files and short programs. No plugins.

Collapse
 
amanhimself profile image
Aman Mittal

Vscode and nano for terminal.

Collapse
 
tam360 profile image
Mirza

for files like .bashrc, i use bash's nano editor.

Collapse
 
gabedunn profile image
Gabe Dunn

I used to use nano for this, but more recently I've been using neovim. I've been using WebStorm for my main IDE, but I've been working to introduce neovim more often, and it is perfect for dotfiles. I also just saw someone in this thread mention micro, and that looks really cool as well.

Collapse
 
karlredman profile image
Karl N. Redman

vim with plugins

I don't edit anything outside of vim. It's just most efficient for me. I have no arguments about vim being good or bad for other people. I only know that I run circles around others when in group editing situations [even without plugins].

With that said, my first question to potential programming employees in the past has been "what editor do you you use?". I've never cared what the answer was beyond that there IS an answer.

Personally I hate mouse / cursor interaction. It's bothersome to me. But I'm not going to say that my method of interacting with clunky computers is better than others. The answer should always be, 'whatever works'.

Collapse
 
bugmagnet profile image
Bruce Axtens

Whatever's handy at the time: VSCode, Notepad++. Occasionally WEE. I use the first two interchangeably for software development.

Collapse
 
davefollett profile image
Dave Follett

vi or emacs

Collapse
 
stephanie profile image
Stephanie Handsteiner

Same. 😁

Collapse
 
flrnd profile image
Florian Rand

I use only neovim (vi) for everything, but I guess is old habits. If I recall correctly, in last stack overflow surveys, vim is more common around sysadmins/devops, which in a way confirm your suspicions.

Collapse
 
hugo__df profile image
Hugo Di Francesco

vim because it feels the most natural to open a path starting from the HK e directory

Although I guess I could use code ~/.zshrc I prefer vim ~/.zshrc

Collapse
 
briankephart profile image
Brian Kephart

I don't usually edit files like these, so on the rare occasions I do, I have to find them first. So, TextEdit from the Finder.

Collapse
 
ben profile image
Ben Halpern

This is close to how I am with these things, but I do think it pays to get in the habit of messing with these files when it's useful for your productivity in the long run.

Collapse
 
idoshamun profile image
Ido Shamun

Nano!!

Collapse
 
itsasine profile image
ItsASine (Kayla)

Nano, since env files and simple bash scripts feel far more at home in Terminal. Otherwise, I use an IDE.

Collapse
 
robertcoopercode profile image
Robert Cooper

I still use my main editor (VS Code for this).

I type change and it opens up my .zshrc file in VS Code.

Then I type update and it refreshes my terminal window with the newest .zshrc config.

Collapse
 
aritdeveloper profile image
Arit Developer

VIM! All the way! 😃 😄

Collapse
 
coreyja profile image
Corey Alexander

I use vim which is the same editor I use for all of my coding.

There are a few specific tasks I do still use a GUI editor for (multi cursor mode in Sublime for example). But they are getting rarer

Collapse
 
nancycantu profile image
nano-c

nano if I'm looking at something fast, Sublime Text is I will be using it for a while

I use Sublime for most of my development

Collapse
 
richiksc profile image
Richik SC

I use nano for them even though VSCode is my primary editor.

Collapse
 
olegthelilfix profile image
Oleg Aleksandrov

Nano and sublime text for huge files.

Collapse
 
jrpz profile image
Jaime Perez

I tend to use nvim for quick edits to one or two files. Anymore than that, I use VS Code.

Collapse
 
detunized profile image
Dmitry Yakimenko • Edited

If it's a regular file, then I'd use Sublime (via subl). It it requires sudo, then nano or now more and more micro (micro-editor.github.io/)

Collapse
 
derkwola profile image
derk-wola

vi and nano

Collapse
 
moopet profile image
Ben Sinclair

It's vim, and yes it's the same editor I use for the majority of everything.
It feels straight-up weird to see configuration files in VSCode.

Collapse
 
ben profile image
Ben Halpern

I do agree on the weirdness of seeing config filed in VSCode, even though I do it (about half the time)

Collapse
 
kpollich profile image
Kyle Pollich

Most of the time I use vim for config files like that. But if I'm making more involved edits I open them in VS Code via the code command.

Collapse
 
tedhagos profile image
Ted Hagos

vim before, but nowadays, I use VS Code for almost everything, including .bash_profile files

Collapse
 
rhymes profile image
rhymes

Emacs, nano or VSCode, there's no logic there :D

Collapse
 
sandordargo profile image
Sandor Dargo

On my local Ubuntu, I use Sublime mostly. Oddly, even if I could use the same Sublime for remotes, I just use vim.

Collapse
 
joehobot profile image
Joe Hobot • Edited

Vi and seldom do I use vsc (if it requires more than few lines of editing)

Update: Reading through commends I notice more people use vim than vi curious as to why?

Collapse
 
luchoster profile image
Lucho Suarez • Edited

Vim, but I use VIM for everything though :)

Collapse
 
sunnysingh profile image
Sunny Singh

For quick edits, nano

When setting up some complex multiline function, VS Code.

Collapse
 
waylonwalker profile image
Waylon Walker

💯 vim, nano confuses the heck out of me.

Collapse
 
doppelmutzi profile image
Sebastian Weber

vim because normally I have to do only minor changes. Therefore, my little vim knowledge is sufficient.

Collapse
 
dothtm profile image
dotHTM

I created both a shell script and a macro to open my bash config in Sublime Text.

I'm very proud of my modularized bashrc config: github.com/dotHTM/bash_hacks

Collapse
 
david_j_eddy profile image
David J Eddy

vim

Collapse
 
ben profile image
Ben Halpern

Same or different from the rest of your coding?

Collapse
 
iamandrewluca profile image
Andrei Luca

vim

Collapse
 
steveblue profile image
Stephen Belovarich

VSCode. Before that Vim.

code .bash_profile

Collapse
 
larizzatg profile image
Larizza Tueros

If it's a complex modification vscode otherwise vim.

Collapse
 
aturingmachine profile image
Vince

Vim! Anything outside of project files really goes through vim.

Collapse
 
ben profile image
Ben Halpern

Can you articulate your reasoning for the choices?

Collapse
 
pinotattari profile image
Riccardo Bernardini

emacs, always emacs (with 64 K of customization LISP source that I wrote myself... 😀). Occasionally gedit, for fast-and-dirty stuff

Collapse
 
mofiqul profile image
Mofiqul Islam

Its always Vim but Vscode is my main code editor

Collapse
 
ozzyogkush profile image
Derek Rosenzweig

nano, or if i happen to have an IDE open, i'll open it there

Collapse
 
ndom91 profile image
Nico Domino

Vim!

Collapse
 
andregtz profile image
André Gtz

vim

Collapse
 
rjshrjndrn profile image
Rajesh Rajendran

nvim and that's my default, still have to find an editor which is as fast and productive as vim. Atleast for me.

Collapse
 
johand profile image
Johan

Emacs for almost everything

Collapse
 
helpermethod profile image
Oliver Weiler

vi(m).

Collapse
 
kdien profile image
Khoa Dien

Nano. The GUI ones are typically too slow for this type of editing.
Still other specific IDEs for other development tasks though.

Collapse
 
areahints profile image
Areahints

I use nano for this, I use vscode and mousepad for everything else, does anyone have recommendations for a mobile code editor?

Collapse
 
wiz profile image
wiz

vim vim vim !!!!

Collapse
 
tanejaboy profile image
Ravi Kumar Taneja

I use gedit mostly but some time I use nano, but for projects it's phpstorm or vscode

Collapse
 
prafuldhabekar profile image
Praful Dhabekar

I use vim for opening files like .bash_profile and if I'm on windows I use notepad++.

Collapse
 
highcenburg profile image
Vicente G. Reyes

I use VS Code. Sometimes I use Atom if I feel like using it.

Collapse
 
gcugreyarea profile image
Barry Robinson • Edited

Learn to use vi! Editors like vs code are great, but when you need to do something in a remote system where you don’t have access, vi will be there.

Collapse
 
elabftw profile image
eLabFTW

I use VIM for everything. Code, writing emails, commit messages, make coffee, showering. VIM is LIFE.

Collapse
 
tootis profile image
Mohamed Anwer

Vim

Collapse
 
kasuken profile image
Emanuele Bartolesi

Visual Studio Code for everything. :)

Collapse
 
guy profile image
Guy

ed/vim

Collapse
 
thefern profile image
Fernando B 🚀

is either vim or nano lol depending on the day.

Collapse
 
samwho profile image
Sam Rose

Hilariously, vim in a vscode integrated terminal. I don't know why.

Collapse
 
biros profile image
Boris Jamot ✊ /

I use neovim to modify such files and bat to just view them.
I try to use nvim as my favorite IDE but I have still so much things to learn to be able to replace Intellij..

Collapse
 
nanohard profile image
William Antonelli

Micro for editing files in the console. It's like nano, but better.

Collapse
 
bluesmoon profile image
Philip Tellis

vim, which is what I use to edit absolutely everything.

Collapse
 
thehanna profile image
Brian Hanna

Sublime for my .zshrc locally, but if I'm on a remote machine, vim

Collapse
 
rahilwazir profile image
Rahil Wazir

I've been using vi but now I'm using micro editor. github.com/zyedidia/micro

Collapse
 
j_mplourde profile image
Jean-Michel Plourde

No surprise: vim. It's just so easy.

Collapse
 
alexandreramosdev profile image
Alexandre Ramos dos Santos

I'm using vscode for my project of frontend but when I want code a one filer in So. In my case is Archlinux I use vim.

Collapse
 
eayurt profile image
Ender Ahmet Yurt

Sublime 3

Collapse
 
nekofar profile image
Milad Nekofar

When I'm working from the shell, most of the times vi and sometimes nano. Otherwise, it would be the VS Code.

Collapse
 
aswathm78 profile image
Aswath KNM

I use a tool called Micro(golang) for non sudo purposes. micro-editor.github.io/

Else nano or sublime

Collapse
 
ddhogan profile image
Donna Hogan

VSC, for gratuitous luxury

Collapse
 
infominer33 profile image
⧉ infominer

micro-editor.github.io/

Check this out^

Collapse
 
jrop profile image
Jonathan Apodaca

Either VI (NeoVim) or VSCode

Collapse
 
defman profile image
Sergey Kislyakov

In most cases when I'm editing this kind of files, I'm in a terminal session already so vim (or neovim). But I use an IDE for anything else related to code (with Vi mode, though).

Collapse
 
pavonz profile image
Andrea Pavoni

I use VsCode for development sessions.

I use vim and other CLI tools for the remaining tasks (quick edits, git, etc).

Collapse
 
abgeo profile image
Temuri Takalandze

VIM

Collapse
 
danielkun profile image
Daniel Albuschat

I use Vim for everything, for about 15 years now.

Collapse
 
asyrafhussin4 profile image
Asyraf Hussin

I prefer nano

Collapse
 
prathaprathod profile image
Prathap Rathod

Vim is best for editing files like .bas_profiles and it is very easy than nano editor.

Collapse
 
perigk profile image
Periklis Gkolias

I am using vim. Having a UI editor for single digit changes is a bit overkill to me

Collapse
 
nelo_mf profile image
Manuel Fernandez • Edited

Nano was my prefered option, until I realized I could open Sublime Text with the exact same amount of characters, so "sudo nano .bashrc" became "sudo subl .bashrc"

Collapse
 
saschalalala profile image
Sascha

Most of the time, I use vim, sometimes VS Code for yaml/json like configs. I don't use vim at all for any other job.

Collapse
 
brandonskerritt profile image
Autumn

Nano!

Collapse
 
boseriko profile image
Bos Eriko Reyes

I use vim for any edits I do. Then nano to take random notes just to get that different feeling. haha

Collapse
 
heraldofsolace profile image
Aniket Bhattacharyea

Vim of course, and yes, I do majority of my software development in Vim

Collapse
 
zeitchef profile image
Scott Voyles

(Neo)vim for absolutely everything.

Collapse
 
cereal84 profile image
Alessandro Pischedda

I use VIM for everything, sometimes I use pycharm for python and VS code for Golang.

Collapse
 
ywatchman profile image
Yvan Watchman

VIm, use it for everything if it's not needed to open a dedicated editor with a project.

Collapse
 
xowap profile image
Rémy 🤖

If it's outside a project, vim (and variants)

Collapse
 
srebalaji profile image
Srebalaji Thirumalai

vim.

Collapse
 
sudiukil profile image
Quentin Sonrel

I use Vim which has been my main editor (even for code) for years before I switched to Atom, so I keep using it for small tasks.