Unix as IDE (2012)
sanctum.geek.nz
sanctum.geek.nz
For example, VSCode Remote container development. The IDE is split into client and server portions, with the server living in a container (or group of containers) of your definition. So your host environment is clean, but you still get tools that are a PITA or impossible to run remotely, like certain debuggers or linters. And best of all, the configuration is saved in the repo. Commit it, and everyone in your project gets a "one button option" to use the same developent environment as everyone else.
It's not IMPOSSIBLE to do something similar with vim+Unix. Docker compose and enough automation will get you most of the way there. But not without a tremendous amount of work and time spent maintaining it for everyone's unique environment. And certainly not in a fashion that i could call "one button".
There are a few features like that. So I stopped spending hours (and hours and hours) maintaining a collection of hacks that approximated a modern development environment, and started using software for what it was designed to do. Vim is still my superpowered editor of choice, but when i'm working on a significant codebase, I use an IDE.
But it's a mixed bag, like I can use vim and do something complex in an instant, e.g. replacing a column of characters with something else, but I'm too used to the regular expression replace all mode of vscode. Or the file manager on large projects, I'm pretty much used to using one file at a time with vim.
I feel no shame xD
Learning a new commandline tool has almost always been something that paid back for years: CLI cares much more about backwards compatibility than a GUI because it's used in shell scripts. And that's another advantage: you are only one step away from automating stuff. A homogeneousness set of keybindings over all applications are just the icing on the cake.
VSCode is good for working in TypeScript codebases—I couldn't find any way to show helpful and long TS compiler errors in Vim nicely.
However, VSCode’s terminal is semi-broken and sessions do not persist, so for other kinds of work that might involve grepping around, running builds and one-off data migration scripts, etc., Tmux+Vim (with respective shortcuts to unify pane navigation) work perfectly.
And you get all the IDE stuff as well. Pretty much a win-win there. (if the vim functionality is good enough for you)
It's not perfect, but I like how I can basically swap any component out (except tmux itself).
I despise autocomplete and will not use things that force it on me. IntelliJ has options to make it not aggressively, in-your-face annoying, so I can live with it, and do use it for access to some tooling we built at $dayjob.
But after spending a day turning off all the bullshit, installing vim bindings, etc. I get... a slow, memory-pig semi-substitute for my shell environment that still is less flexible.
Progress.
Could you elaborate on why that is? I feel similiar but I cant just tell why
There's also the visual noise - I hate it for the same reason I hate tool tips and similar. Popping up flyovers on top of whatever I'm trying to focus on is utterly infuriating and I've never understood why people think that's good UI. It is like shoving your hand in my face if I look at you.
With neovim you can have autocompletion, error checking, git integration, project file navigator, and many other IDE like features but without the cruft.
Performance and stability is stellar compared to the IDEs I have experience with (eclipse, visual studio, xcode, and PHP storm). Especially if you use a terminal that uses the GPU to render the screen. With startup times there is no competition, tmux can keep your terminal session alive even after quitting the terminal which means their is essentially zero startup wait.
I just could not stand the mouse behavior, ultimately. Switched to screen for some things. Sometimes its just easier to use the trackpad to scroll than page up/down or select text with the cursor vs. with the keyboard. Can't do both in tmux; either you can scroll in programs and not in the shell, or loose 'modern' copy paste and select behavior with the mouse as well as scrolling in programs to get scrolling in the shell. I just couldn't figure out how to have it both ways like the native shell.
In newer versions of tmux
set -g mouse-mode on
# make scrolling with wheels work
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -MThat's the thing with these .tmux.conf hacks you see floating around github and stack overflow. The tmux devs changed the relevant settings practically every other release and offered no compatibility, so most of what you find just doesn't work with your build.
But even those snippets that do work with my builds, you can't have it all. Either scrolling up takes you past the panes and into the std output of the native shell, or you enable mouse mode and can scroll in your shell but loose the ability to scroll in editors like nano and programs like less.
Maybe if there was a way to automatically turn off mouse mode when running programs and flick it back on when exiting to the command line, but I'm not well versed enough in the .tmux.conf syntax to figure it out without too much trouble.
[0] https://github.com/antirez/kilo
[1] https://github.com/dylanaraps/fff
[2] https://www.youtube.com/watch?v=SlJto75auCA
It took a while to find out that `Host *` should be at the end of the file if you want to override things.
Funnily, I have made the opposite path, moving from a tiling WM to tmux into a simple xterm. Tiling wm are overrated, since tmux gives you the same functionality, and you can detach your session easily.
What I'm sorely missing is a way to "freeze" all my tmux processes so that they can be recovered in the case of a system reboot.
Google brings [1] but I haven't tried it yet.
https://github.com/maaziz/cryopidI know the numbers off by heart so can switch without looking.
Unless you're browsing HN on Lynx I suspect you'll have at least a graphical browser running, which means you still need some way to manage graphical windows, because that is simply something that tmux does not do.
Also proper WM is unsurprisingly more capable/flexible for window management because it's not limited by a fixed character cell grid and other idiosyncrasies of terminals
I actually use elinks to read HN and many sites, but I also use regularly a web browser.
However, I try to keep web-browsing usage as sparse as possible. I launch firefox from the terminal, browse tho wherever I need, and then close the browser window. I abhor to have a browser "always open".
You can have 1 tmux server running locally with many sessions (let's say 1 session per project).
Then each session can have many windows (separate terminals that are full screen).
And then each window can have many panes (splitting that window however you see fit).
But if you went with a tiling WM alone without tmux, the WM's workspaces become sessions and your terminal becomes a window. So now you're stuck having to lean on your terminal emulator for tabs and splitting windows, but you're also on the hook for it having buffer searching, copying URLs, scrolling and other things. Most terminals are really bad at those tasks but tmux is great with them when combined with something like xterm (a low input latency terminal).
Plus with tmux you have the option to easily save and restore everything with tmux-resurrect, and you can take your whole set up and replicate it on Linux, MacOS and even Windows with WSL and it all works the same as long as you find a good light weight terminal on each platform.
I think there's a lot of value in using both a tiling WM and tmux together. tmux basically super charges any terminal into having world class support for everything a terminal needs to do. Even if it didn't persist sessions, it would still be really valuable. IMO it's severely underrated. People's eyes widen and still get impressed when terminal emulators add basic tab support. If they only knew what was lurking around the corner with tmux!
If you have tiling wm, why would you want tabs or especially splitting in terminal emulator?
> Most terminals are really bad at those tasks
Just don't use bad terminal emulators? And good terminal emulators are better at those tasks than tmux
Splitting is useful so you can see more than 1 thing at a time. You know, tiling. :D
This is especially true if you have a high resolution display such as 2560x1440 or 4k. You can fit a ton of info at once across multiple panes.
> Just don't use bad terminal emulators? And good terminal emulators are better at those tasks than tmux
I've tested dozens across multiple operating systems and haven't found one that that has as low input latency as xterm along with having a better implementation of tabs, splits, searching, being able to name windows, zoom toggle into windows, and everything else tmux does. None of them were even in the same ballpark.
I love tmux, but I prefer vscode to vim, and I'd rather just keep tmux as the place where I keep all my terminal panes/windows. A lot of people look at my tmux screen and assume that I'm using vim or emacs.
In every C/C++/Java workspace I run cscope on tmux window #0, with a CSCOPE_EDITOR script that launches the real $EDITOR in a new window in the same session, with the window named after the basename of the file being edited.
This makes it trivial for me to find my way around all my shells and running $EDITORs.
Altogether this allows me to avoid using the mouse a great deal.
My editor of choice TextMate is usually launched from the terminal. I work a lot in a REPL environment and when I get a stack backtrace my terminal program iTerm2 automatically identifies paths in the stack backtrace, so I can mouse click them and open in TextMate at the correct line.
I use a separate git GUI client called Tower a lot, but I also use the git command line. I mix and match a lot.
I really dislike monolithic tools. If you try to do absolutely everything from the CLI you get many of the same problems as in a IDE GUI: You get too much complexity in your interaction. Too many special keystrokes and commands to remember.
I quite like the old NeXT idea of an IDE, kind of how the old xCode was when interface builder was a separate program. As you integrate more tools complexity just grows.
We already have a multitasking OS with windows. We where meant to use multiple tools and not just sit in one big maximized monolithic program.
My issue is, I need an editor that knows that a field annotated with @Resource with a type and name of SomeService foo is injected by a DI framework and makes it easy for me to navigate to implementations of SomeService with a name of `foo`.
Sure, I could put hundreds of hours into half-way replicating what an IDE does. Or, I could just use an IDE that was written by people who've felt the same pain as me. TextMate might be good for the occasional Ruby or Python script, but even then - do I have to manually manage virtualenvs while working on this script, or can my IDE do it for me? (Spoilers: Intellij can)
I feel like there’s a weird power thing some people get sucked into that ends in forcing everyone around them to use their preferred (often IntelliJ or vscode) editor often via the argument that the linter configuration only works in it.
That sounds super convenient! How do I learn more? A quick search didn't turn up anything relevant. What should I be searching for?
What you should use instead is “inotifywait” [2] to execute your program(s) whenever there is a change. This way the program will run, for example, every time you save your changes. There are many utilities that make use of inotify (the library that powers inotifywait) some of them are fsnotify [3], fswatch [4] and watchexec [5].
[1] https://linux.die.net/man/1/watch
[2] https://linux.die.net/man/1/inotifywait
[3] https://github.com/fsnotify/fsnotify (written in Go — golang)
[4] https://github.com/emcrisostomo/fswatch (written in C++)
[5] https://github.com/watchexec/watchexec (written in Rust)
I only found out about it few days ago, but it seems nice so far.
A good idea would be to at least run the script in some kind of sandbox, so you don't accidentally do something dumb.
Also a real IDE does much better debugging. Using Visual Studio for debugging your program is much easier than using GDB, which is probably why the more Unix programmers use printf debugging rather than try to fire up GDB.
int fun(void*);
And grep -r fun *.h
Will tell you everything you needNever had to handle multiple languages in one project though, I find vims builtin completion enough for the rest.
But personally I don't like IDE style completions that much. In editors I often prefer completions based on what is in the file I am editing. But I also work a lot in a REPL environment.
I personally think a good REPL is a much better debugging tool than most IDE debuggers.
> Using Visual Studio for debugging your program is much easier than using GDB, which is probably why the more Unix programmers use printf debugging rather than try to fire up GDB.
That does not really have anything to do with IDE vs command line. My experience as a C++ developer for many years on Linux is that debuggers just don't work that well. Many of the issues has to do with the complexities of C++ and how gcc stores debug information.
Most IDE style debuggers on Linux are quite crappy, because they are slow and undependable. Printf is faster, more dependable and gives more flexibility in how you display data you are interested in.
That has been my experience on Linux. On Windows, Visual C++ debugger works amazingly well.
a) The ability to do an end-to-end build with one click (we've lost that with cloud being part of the equation)
b) Guranteed buildability
c) Intellisense/autocomplete
d) Widgets that can be moved into any which way.
I feel that we're missing a trick with CI/CD if IDEs can do a end-to-end build with one click, there's some technology to be shared or extracted here from desktop IDEs.
Not much else, the ability to jump to code is the primary benefit.
Navigating from a symbol to another symbol (e.g. from a variable use to its declaration) requires more than simple pattern matching.
The editor needs to know (or be able to find out) the symbolic meaning of every word on the screen to do that. If syntax hihglighting isn't just basic regex matching, e.g. if you want different colors for mutable/immutable fields etc, then the editor needs to know the syntactic meaning of everything not just when navigating but when displaying.
Isn't that what "make" is for? A Makefile and an IDE project file are quite similar in structure.
I use "bazel test ..." to build stuff on the command line and my CI system runs "bazel test ..." to build stuff in CI. They can even share the same cache, and the cache actually works. (I admit for that 90% of go stuff I just use their build tool, though.)
I think IDE-integrated build systems are an artifact of times where people didn't write multi-language projects and there weren't good open source build systems. Things have changed a little, and now you can have your cake and eat it too.
(Autocompletion has also moved out of IDEs and into things maintained by languages themselves.)
Building as little as possible and having quick iteration is the hard bit when you have statically typed languages and large projects. If I edit a file and change the name of the function, the call sites should all light up with red squiggles. In a statically compiled language. Without requiring a recompile.
which is what all IDE support ? most even allow you to automatically fix it nowadays
Many IDE's manage this but far from all languages (compilers) do, simply because their compilers are simple batch compilers.
Being able to dive into any source by clicking, and also full awareness of unused or incorrect code is very valuable.
Nano actually can do well over half of the things mentioned…
It's not outdated or limited, it's extremely convenient and powerful. Yes, there's some learning involved, but after learning a few keystrokes, you become extremely productive with vim.
nano or other editors can't even come close, because vim allows to edit the text with the speed of your though without pressing a lot of keys.
How is UNIX an IDE?
"The primary rationale for using an IDE is that it gathers all your tools in the same place, and you can use them in concert with roughly the same user interface paradigm, and without having to exert too much effort to make separate applications cooperate. The reason this becomes especially desirable with GUI applications is because it’s very difficult to make windowed applications speak a common language or work well with each other; aside from cutting and pasting text, they don’t share a common interface.
The interesting thing about this problem for shell users is that well-designed and enduring Unix tools already share a common user interface in streams of text and files as persistent objects, otherwise expressed in the axiom “everything’s a file”.
Pretty much everything in Unix is built around these two concepts, and it’s this common user interface, coupled with a forty-year history of high-powered tools whose users and developers have especially prized interoperability, that goes a long way to making Unix as powerful as a full-blown IDE."
https://github.com/samsquire/ideas#98-the-desktop-is-an-inte...
I simply open sufficient xterms on one or more virtual desktops to cover all of my needs.
Ferinstance: I can have the warnings and errors of the last compile displaying in one xterm, I can be editing the relevant xxx.c source file in a second xterm, the associated yyy.h header file being edited in a third xterm, and the man page for a library function showing in yet another fourth xterm.
All of them immediately visible, and all of them interactive.
Unix as IDE 'just works' for me.
Maybe don't use Wayland then. Or, at least, suffer the slings and arrows of outrageous fortune with some grace. You chose to use Wayland, making you a minority (Wayland users) of a minority (Linux users). All power to you to make your own choices, but to paraphrase an old favourite - "Freedom may be mankind’s natural state, but so is sitting in a tree eating your dinner while it is still wriggling."
TL;DR - you choose to use tech not supported by Jetbrains, so please feel free to eat your dinner while it's still wriggling.
This is a treasure trove, there are quite a few tools I wasn't aware of that I shall start using consistently now.
Rule #2: vim is all you need.