12 ms·
How I use my terminal
- jonjacky 1y agoThe article title is actually "How I use my terminal"
- Hard_Space 1y agoThought that this was going to be a 'There Will Be Blood' spoof. (In case not obvious, current title is 'I use my terminal')
- fitsumbelay 1y agonoticed this too after skimming the post, feels like the full title = "I use my terminal (and so should you )" Plus one for pro-terminal posts. As a chromebooker I've found that all I need is terminal and browser. Switching to my Mac OS seems kinda maximalist and I rarely use much outside of the terminal and, you know, more browsers
- babelfish 1y agoHN will automatically trim some common prefixes and suffixes from title submissions
- progbits 1y agoThis is a HN "feature" removing How if it's the first word in the title. It serves no purpose other than generating confusion, with mods saying this somehow stops clickbait. How, you wonder? Nobody knows.
- littlerbooks 1y agoWeird. I see a post titled "How to store Go pointers from assembly" literally three posts below this one.
- happytoexplain 1y agoI believe the submitter can manually reject the auto-modified title, but they have to notice that it was modified. (I could be wrong about that)
- Stratoscope 1y agoYou are correct.
- indigodaddy 1y agoNot quite reject exactly, you can just edit the title afterward for some X amount of time.
- deleted 1y ago[deleted]
- Stratoscope 1y agoReminder to anyone submitting an article: you have two hours to edit the title to fix these alterations.
- rbanffy 1y agoI believe these changes are intended to defang some clickbaity titles, but you are right that it maims some perfectly good ones.
- 1y ago
- osmsucks 1y agoI thought this was going to be a blog post about somebody using a terminal emulator they wrote.
- philwelch 1y agoAnd I thought this was going to be a blog post about someone hooking up an old fashioned hardware terminal to their PC.
- enricozb 1y agoFantastic. Been meaning to put something up like this myself. I feel like I gain so much information from just watching someone work, and having them open themselves up to questions.
- pxc 1y agoIf you don't want to write a giant regex like this yourself, there are some ready-made tmux plugins that add things like this to copy-mode. https://github.com/tmux-plugins/tmux-fpp https://github.com/tmux-plugins/tmux-fpp https://github.com/tmux-plugins/tmux-copycat https://github.com/tmux-plugins/tmux-copycat https://github.com/Morantron/tmux-fingers https://github.com/Morantron/tmux-fingers https://github.com/tmux-plugins/tmux-urlview https://github.com/tmux-plugins/tmux-urlview Any configuration or plugin that leans on the built-ins is probably going to be faster, so consider that w/r/t tmux-copycat. I also really like tmux-resurrect, which saves and restores sessions for you; tmux-continuum, which runs those automatically; and the tmux-zen plugin for Oh-My-Fish: https://github.com/tmux-plugins/tmux-resurrect https://github.com/tmux-plugins/tmux-resurrect https://github.com/tmux-plugins/tmux-continuum https://github.com/tmux-plugins/tmux-continuum https://github.com/sagebind/tmux-zen/tree/master https://github.com/sagebind/tmux-zen/tree/master It's pretty easy to get a very nice tmux setup going!
- jynelson 1y agoyeah, i got the original regex from tmux-copycat. but a) that regex doesn't handle `:` and b) copycat builds its own "viewer" abstraction on top of saving and restoring the pane state, which means that you can only have one action per search. my thing allows you to use normal tmux configuration syntax to bind actions to the files that are highlighted, because it reuses tmux's built-in search. note how all these plugins are either only supporting copy/paste or building their own "modes" on top, because tmux gives you very little control over highlights unless you use the built-in search.
- pxc 1y agoThat's great info! Thanks for filling me in. I used tmux for everything many years ago, but when I started the current job, I decided to try to do everything natively with Kitty instead. (IIRC one of my main reasons was that Kitty supports macOS' "secure input" features.) But tbh I never got around to making my Kitty setup as nice as my old tmux one. I think I may switch back soon. It sounds like I may want to set things up differently in light of these new features!
- happytoexplain 1y agoThe entire blog post being in lowercase distracted me more than I thought it would.
- gouggoug 1y agoIt's also interesting to see that the author themselves are clearly fighting against their own instinct to use uppercase: the first 2 items in the "here's what happens in that video:" list use uppercase.
- jynelson 1y agothat's voice-to-text on iOS, i haven't found a way to turn off the auto-caps yet.
- latexr 1y agoBut why are you doing it in the first place? This is a genuine question, what do you gain by actively fighting against proper writing rules which aid in readability and comprehension? What’s the rationale for making it harder for users to follow your post? I know I’m far from alone in having skipped your post entirely upon opening. Nothing personal, but I have yet to find a single post by anyone written in this style where the content was worth the effort of parsing non-existing capitalisation. You go through the trouble of adding aids like syntax highlighting, lists, coloured titles, and even differentiated notes and timestamps. Presumably those are there to help the reader. But then you throw away a lot of readability by making everything lowercase.
- incognito124 1y agoHuh interesting, I didn't even notice that
- RestartKernel 1y agoIt's a stylistic choice you sometimes see people commit to. Porter Robinson (a DJ) does the same thing, and it's always struck me as a bit indulgent.
- yobibyte 1y agoI have a similar setup, but most of the functionality is coming from vim: grep/find, quickfix lists and temporary buffers: https://news.ycombinator.com/item?id=44282908 https://news.ycombinator.com/item?id=44282908
- bilalq 1y agoI've shared similar frustrations with VSCode's vim plugin. These days, I often run Neovim from within VSCode's terminal for complex editing tasks where I might need to use macros or use fugitive or whatever.
- robenkleene 1y agoI love this, I've been iterating on workflows like this for something like a decade now. Over time I've tried to peel back as many of my custom layers as possible, because all of those layers have a maintenance cost. Stock Vim (without `tmux`) can actually do most of what's shared in this post with `rg --vimgrep restore_tool | vim -c cb -` (`vim -c cb -` is my favorite feature in Vim; I find it strange that it's so rarely used or talked about). (Since re-running the `rg` search can be undesirable, and I often like to analyze results in a terminal before opening them in Vim. I use a custom `tmux` command to copy the output of the last command [using this trick that involves adding a Unicode character to your prompt https://ianthehenry.com/posts/tmux-copy-last-command/ https://ianthehenry.com/posts/tmux-copy-last-command/], then I send that into Vim with e.g., `tmux saveb - | vim -c cb -`.)
- radlad 1y ago> (`vim -c cb -` is my favorite feature in Vim; I find it strange that it's so rarely used or talked about). Care to explain what it does? Trying `ls | vim -` and `ls | vim -c cb -` I don't immediately see a difference.
- robenkleene 1y ago`cb[uffer]` processes the current buffer as a compile buffer, which will find `grep` format matching lines (i.e., at a minimum starting with `<path>:<line-number>:<column-number>`) and populate the quickfix list with them, and jump to the first match. E.g., your example doesn't do anything because `ls` doesn't output `grep` format lines. So try piping the output of `grep` (you'll need flags for the line number and column number with `grep`, hence the `--vimgrep` flag above) matching the above format (or you could try `ls | sed 's/$/:0:0/' | vim -c cb -`, which will hack `ls` output to grep, and is occasionally useful). (Note that the above hints at another useful tip, `grep` parsing is only part of what `cb[uffer]` does, it can also parse compile output, e.g., something like `gcc foo.c | vim -c cb -` will jump to the first compile error in your program and put the rest of the errors in the quickfix list).
- WorldMaker 1y ago
- klntsky 1y agoIt is sad that we have to know how to configure tens of small utilities just to be productive. I ended up using emacs with some packages that I configure minimally, after spending a few hundreds of hours on ricing the shell, file managers, tmux, etc
- agentultra 1y agoEmacs is why I can't go back to terminals.
- vyaa 1y agoI haven’t delved into emacs yet. Don’t you still have it configure it and all its tools?
- School-Cotton 1y agoemacs is a lot easier to configure than anything else IMO because it’s self-documenting. If you want to know how to use or configure some command it’s trivially easy to jump to the source code of that command and just see how it works (or modify it, step through it with a debugger, etc). You can’t do that in any other environment as far as I’m aware. That said, yeah, it certainly doesn’t Just Work out of the box the way something like vscode does.
- jynelson 1y agoyes!! i would love an environment where every binary carries a mapping from the exe back to the source code, DWARF is kinda this but there's very little tooling around it and distros often don't ship it by default. i want something like gdbserver but built into the editor and terminal.
- School-Cotton 1y agoThat is also my dream; doing as much as possible inside emacs, using plugins written in emacs lisp, is basically the closest you can get to it today.
- tomsmeding 1y ago> Escape for some reason doesn't get sent as the escape key if it shows up next to any other keys??? Welcome to ANSI escape sequences. The left arrow key, for example, is really just <Esc>[D . You can see this stuff for yourself by running `cat >/dev/null` (cat isn't actually doing anything useful here, it's just allowing you to type without the shell getting in the way and actually, you know, making an attempt to interpret the keys you press). Press backspace to figure out which bytes are represented by 1 and which by 2 characters. 2-character sequences where the first is a caret (^) can be produced by ctrl + the second character, and correspond to the second character in ASCII minus 64. Hence ^A is byte 0x01. The escape key sends ASCII ESC, number 27, and is written ^[ . https://en.wikipedia.org/wiki/ANSI_escape_code https://en.wikipedia.org/wiki/ANSI_escape_code Software distinguishes between a bare Escape key press and an ANSI escape sequence by waiting a couple of milliseconds and seeing if more bytes arrive. The number of milliseconds is often configurable, with e.g. the 'escape-time' config key in tmux and the 'ttimeoutlen' setting in vim.
- jynelson 1y agothis is all true but it's not related to the bug in my post. this is input being sent via `tmux send-keys`, escape-time isn't relevant.
- tomsmeding 1y agoAh, but I suspect it still is: not the tmux config option indeed, but the vim config option. After all, I think with that `tmux send-keys`, you're sending input to vim, aren't you? And vim itself does escape sequence interpretation.
- aftbit 1y agoI do all of this from vim. I have \a bound to repeat my last / search using ripgrep in the current directory, and open the matches in a panel below. I have \gd bound to go to the definition/declaration of a symbol.
- positr0n 1y agoSearches in a directory.. do you mean files or file contents? What do you do for his example of navigating to a file from the rust tool output?
- aftbit 1y agoI have Ctrl-p bound to use `fzf` to fuzzy find files by name, just like in VSCode or Sublime. \a uses `rg` to search file contents. I don't use rust much, but if I wanted to go to a specific line in a file, I would probably just use C-p to open it with fuzzy find, then :(lineno) to navigate to the correct line. I do tend to just run tools in another terminal, rather than keep my terminal in vim. If I'm on a remote machine, I sometimes use tmux to run multiple panels, but I'm more likely to just open two instances of alacritty and ssh in twice. With ControlMaster set up, the second ssh session gets multiplexed over the first connection, so there's very little additional latency to open a terminal with C-<return> and then ssh in with `C-r ssh <return>`, which uses fzf to search my history in most-recent-first mode.
- gertlex 1y agoI really appreciate this method of sharing workflows. Well catered to the audience. Actually was slightly hoping there'd be sound to the vid, too, but reading the list of actions after-the-fact was reasonable. I learned a few things I could do and/or approach differently in my own flows. You mentioned the arcane keyboard shortcuts of tmux. I'm curious if you or others here have tried/use byobu (which I think of as a wrapper around tmux, basing most commands on the F# row). I was shown it a decade ago and have used it since (after a couple prior years of primitive tmux use).
- jynelson 1y agoglad you've enjoyed it :) i was trying to find something that was clear while still being easy to skim. > You mentioned the arcane keyboard shortcuts of tmux. oh, i've remapped almost all the shortcuts in tmux. `ctrl-k` is not the default prefix and `h` is not the default key for "select pane left". i haven't tried byobu but from skimming the readme i expect it not to have a ton other than nicer default key bindings, and i'd rather not add more layers to my terminal.
- gertlex 1y agoGotcha! My main reason for advocating for byobu is it's more beginner/defaults-friendly. I've never customized it, nor fully learned its hotkeys. In my case, we have dev robots with byobu installed, and it's much easier to train non-SW engineers (i.e. HW folks, technicians, QA) on its use (primarily for remote session persistence). (This is also why I don't do much/heavy customization these days: for uniformity between local and robot machines...)
- midtake 1y agoI use my terminal too, but VSCode runs fast enough for me. Maybe it's because I'm a mid 30s year old boomer now, but I figure if it's caching symbol tables then the lag isn't the end of the world. But for whatever reason, I'd rather vimdiff when I have to resolve conflicts on rebase. What I really hate about VSCode currently is how huge pylance is though, and how it's all up in my grill when I am trying to manually code.
- thom 1y agoEvery vim/tmux user has created an ad hoc, informally-specified, bug-ridden, admittedly probably quite fast implementation of half of Emacs.
- b0a04gl 1y agovim+tmux setups usually lean on system primitives = pipes, files, signals, scrollback so the tooling tends to stay transparent across environments. that gives them an edge in portability and debugging, especially over ssh or in constrained shells. it's just lets your workflows shaped around different guarantees so natively, it naturally makes building your own vim config an obvious choice
- iLemming 1y ago> especially over ssh Emacs has TRAMP mode - stands for “Transparent Remote (file) Access, Multiple Protocol", it lets you: - Edit files as if they were local: /ssh:user@host:/path/to/file - Chain connections: /ssh:jumphost|ssh:target:/file for bastion hosts - Access Docker containers: /docker:container:/etc/config - Edit Kubernetes pods: /kubectl:pod:/app/settings - Sudo seamlessly: /sudo::/etc/hosts or /ssh:host|sudo::/etc/config - And even combine them: /ssh:server|docker:container|sudo::/etc/nginx/nginx.conf What you get? Transparent integration - Dired, Magit, etc, they just work. There's no context switching - you stay in your configured Emacs environment. Your keybindings, packages, customizations remain the same. It's multiprotocol: Supports SSH, FTP, SMB, ADB (Android), and more.
- onetom 1y agoyeah, magit via TRAMP kinda works, just slow af: https://news.ycombinator.com/item?id=44356346 https://news.ycombinator.com/item?id=44356346 not really TRAMP's fault, of course... it also doesn't quite work with macOS remotes usually. again, not purely TRAMP's fault, but a default config and habits issue with ~/.zshrc vs ~/.zprofile and maybe /etc/sshd/config settings, i think. i hasn't fully figured it out yet. using this kind of "full-screen terminal screen sharing" approach has a more predictable experience, because of the amount of data transferred is usually 1 screen worth of characters (and colors) max, on most keystrokes. that's both a pro and a con. it imposes a fixed, network connection dependent input lag and the output is also often redrawn by retransmitting the same data over and over again...
- b0a04gl 1y agoterminal scrollback is the only UI we don't treat as queryable state. op's setup shows how much context we're missing away a lot of rg output, file paths, stack traces, build logs they're all already right there in cluttered state. if shells exposed a scrollback api with line refs and structural tagging, we could annotate paths, link to buffers, diff last two runs, all without re executing anything. that would cut through half the indirection in current workflows. tmux's regex jump is a hack but it hints at a deeper model. scrollback should be its own memory layer
- jynelson 1y agoyes!! one of the things i really want from a terminal is structured metadata, it allows you to build so much on top. right now anything remotely close requires parsing a bunch of ansi escapes.
- Analemma_ 1y agoPowerShell got so close to doing this, and then they fumbled it right at the finish line by having terminal objects be binary data instead of structured objects in some kind of serialized format. PowerShell is honestly awesome for a bunch of reasons and getting to query pipe objects instead of parsing them is great, but the binary blobs hold it back from being perfect. Several attempts have been made to do similar things in Unix, but there's a massive ecosystem problem: four decades of classic tooling has to be totally rewritten to get this kind of support. I don't see it happening without some kind of industry champion who can throw their weight around to force it on people.
- gricardo99 1y agoThe one thing pulling me towards VS code, and away from terminal workflows is Copilot and the Agent workflows. Being able to seamlessly chat with AI models and then see/review its code changes is the biggest change to my workflow and productivity in years. I’m guessing some people already have these capabilities integrated into terminal workflows and I’d love to see a demo/setup.
- msgodel 1y agoWow really? That seems like it should move you towards language oriented tools and away from GUIs. I use aider + neovim FITM plugin (with qwen coder.) It's nice because it not only can help me with code problems but the often more frustrating tool problems.
- kashnote 1y agoTotally agree. I'm a big fan of neovim but didn't find a good AI solution that compared to Cursor. Even though I miss some of my neovim plugins, Cursor + Vim plugin is pretty hard to beat.
- Ringz 1y agoimo Claude Code beats all of them. It sucked me completely back in my terminal and I love that. Combine CC with MCPs, Tasks and subagents if you really want to „up the game“. I am on CC pro but I think to get the 100 or 200$ abonnements.
- timewizard 1y agoI miss the console terminal where Alt-F# directly selects a terminal by index. So: bind-key -n M-F1 select-window -t :0 bind-key -n M-F2 select-window -t :1 bind-key -n M-F3 select-window -t :2 bind-key -n M-F4 select-window -t :3 bind-key -n M-F5 select-window -t :4 bind-key -n M-F6 select-window -t :5 bind-key -n M-F7 select-window -t :6 bind-key -n M-F8 select-window -t :7 bind-key -n M-F9 select-window -t :8 bind-key -n M-F10 select-window -t :9 bind-key -n M-F11 select-window -t :10 bind-key -n M-F12 select-window -t :11
- naikrovek 1y agoSo use a terminal emulator which lets you set this up.
- jynelson 1y agoi see a bunch of people saying things like "you can do this in vim or emacs". it's true, you can do fuzzy finding and panes/tabs in an editor. but then you are in a box. anything that involves interacting with the terminal requires either a dedicated plugin or opening another nested terminal emulator (e.g. `:terminal` in vim). one of the things i get from my setup that's not mentioned in this post is that i can hit `git show HEAD` <highlight files and choose one> <tab> and that will put the file name in the command. this works for arbitrary commands, not just git, because it works by doing meta-processing on the terminal.
- School-Cotton 1y agoJust to be clear, although you can use emacs from a terminal, it’s not the default and not what most people do. So a terminal emulator opened in emacs isn’t really “nested”
- jynelson 1y agosure. this still ties you to emacs as an editor though. the interesting part of emacs to me is the meta-programming with buffers, not the editor itself; i want to be able to plug-and-play editors and keep the meta-programming.
- markasoftware 1y agoto be pedantic, if you're using `tmux`, you're already in a "box" and are using what amounts to a "nested terminal emulator" Emacs and Vim are perfectly capable of taking arbitrary strings (which can be lines from the same terminal buffer that match a given regex) and putting them onto the command line of a terminal buffer. And more importantly, you can customize that whole process without writing C.
- gloosx 1y agoWhen you're working with a computer, you are in a some kind of a box by definition. >interacting with the terminal requires either a dedicated plugin or opening another nested terminal emulator This is not true, you can run any terminal command in vim's command mode like :!git show HEAD, you can autocomplete it, pipe output where you need it etc without ever getting away from the file you're currently editing. You can also use % to substitute the current open file path in the command like :!git add %
- indigodaddy 1y agoThis is cool and fine, but I just use a browser accessible Linux desktop using KASM for a Docker image-based/isolated/ephemeral (except for homedir/profile persistence) “local development with full Linux desktop” environment that I can use from anywhere. And for package persistence I have an extra configuration to use Brew. It all works beautifully and very fast/no noticeably latency on a capable VM/vps etc: https://docs.linuxserver.io/images/docker-kasm/ https://docs.linuxserver.io/images/docker-kasm/ https://gist.github.com/jgbrwn/3787259bc7d00fce3fdd4b5bd579ca5c https://gist.github.com/jgbrwn/3787259bc7d00fce3fdd4b5bd579c... https://gist.github.com/jgbrwn/28645fcf4ac5a4176f715a6f9b1702ab https://gist.github.com/jgbrwn/28645fcf4ac5a4176f715a6f9b170...
- jynelson 1y agoone of the things i want from a terminal is to run things in a dev container by default and have an explicit button for syncing the changes in that container to the host. the difference between this and messing with docker is that it uses the host system as the base layer.
- indigodaddy 1y agogotcha, so more of a develop locally in a docker container and then push/deploy to Prod kinda thing. I like it. Could actually do same workflow with a KASM workspace using a Docker Rootless image which allows you to use docker.
- benreesman 1y agoThis is a nice setup. It's got tmux and fzf and rg and zoxide and clean-looking nvim. I'd recommend atuin, starship, bat, glow, duf, dogdns, viddy, gum/sesh, dust, btop et all if you don't have them, there's a long tail. The Awesome Terminal XYZ lists on Github have them all. atuin is make-or-break, its a bigger deal than zoxide and being a coder without zoxide is like being an athlete with shoes for a different sport. asciinema is a better way to do terminal videos. Its weird that this is weird now: having your tools wired in used to be called "being a programmer". VSCode and Zed and Cursor and shit are useful additions to the toolbox, you gotta know that stuff by heart now too and you have to know which LLM to use for what, but these things are the new minimum, they aren't a replacement for anything. Even with Claude Code running hot at 4am when the PID controller is wide open, sometimes its going to trash your tree (and if it doesnt youve got it on too short a leash to be faster than gptel) and without magit? gl. If you think you're faster than OP with stock Cursor? Get them to make a video of how to use an LLM with chops.
- kragen 1y agoBeing a programmer is not about configuring your development environment. It never has been. I know a relatively accomplished programmer whose preferred development environment is Unix with the ex editor, and plenty of beginners whose whizbang IDEs completely fail to compensate for their lack of understanding. That's not to say that tooling doesn't matter at all. Just that, historically, it's been a relatively minor factor. Maybe LLMs have changed that, or are about to. An athlete with shoes for a different sport might run 5% slower. In a winner-takes-all competitive environment, that's fatal; a sprinter that ran 5% slower than the gold medalist is just another loser. Most programmers, however, win by collaboration, and on a relatively smooth fitness landscape, not a winner-takes-all spike. Even in winner-takes-all regions like startups, failure always results from bigger errors. I think nobody has ever said, "My startup would have succeeded if we'd used Dvorak keyboards instead of QWERTY", or vim instead of VSCode, or vice versa. It's always things like feuding cofounders, loss of motivation, never finding product-market fit, etc.
- deafpolygon 1y agoRefreshing to see logic among the sea of your shell "bros".
- inetknght 1y agoI use Linux practically exclusively, and use my terminal. It's apparently black magic, according to team members. But it's extremely productive to be able to develop in a terminal. Not only is it extremely productive, but it's also extremely extensible -- you can export your workflow in a script and use that same workflow in CI/CD. Running the same thing in the cloud and on your local workstation is... beyond productive. tl;dr: learn how to use vim (or emacs, you heathen!) and you will get waaaaay better at writing software. You'll start to miss having pipes when you're forced to use GUI apps.
- add-sub-mul-div 1y agoThe title is messed up. It's the most HN-coded thing to take something that isn't a problem and overconfidently apply automation to it and make it worse.
- 90s_dev 1y agoWhy use consistent punctuation but not consistent capitalization? Seems like an odd intentional choice.
- _Algernon_ 1y agoAnother victim of the HN removing "How" from the title. What even is the point of that? "I Use My Terminal" is a very different title to "How I use my terminal".
- tripdout 1y agoAre there any terminal emulators that do server-side session management without needing Tmux?
- gloosx 1y agoThis tmux stuff is just silly. Everything what is does nvim does out of the box.
- commandersaki 1y agoI do most of this but via neovim using Telescope & live_grep, works well enough.
- gylterud 1y agoReminds me of Plan 9 with its plumber! Especially when combined with Acme, win and right clicking to search backwards.
- politelemon 1y agoIs this only possible with tmux? Is there a step learning curve with tmux?
- magarnicle 1y agoIf it is not possible with GNU Screen it would be the first feature I've seen that Tmux has over it.
- hiAndrewQuinn 1y agotmux probably takes about a day to learn the basics of. If all you get out of it is the ability to split your terminal screen even inside a remote SSH connection I'd say it's worth it. You can fall down an unexpectedly vast rabbit hole with its customisability, however, since multiplexers see so much of what's going on in a very general way (by design).
- cryptonector 1y agoI use: - one top-level tmux - with a window for each workspace - running a nested tmuxsession, one per- workspace - for any codebase that can be indexed by cscope(1) I run cscope on window #0 of each nested tmux session, with - CSCOPE_EDITOR set to a script that launches $EDITOR in a new window in the same session, titled after the basename of the selected file - that CSCOPE_EDITOR script exits as soon it runs the `tmux new-window` command so that cscope gets focus back This lets me use tmux+cscope as a poor-man's mouse-less IDE.
- chis 1y agoThis stuff is beautiful. I still don't understand how nobody has built a nice AI typeahead for the terminal yet. Cursor tab would legit be perfect but they'd don't allow it in terminal. I'm almost tempted to just hack together a product where the terminal gets piped to a fake file and fed into cursor for now.
- knlb 1y agoMy similar trick is to rely on the tmux scrollback and pipe tokenized output into fzf so I can easily autocomplete in zsh against anything on the visible tmux screen https://www.threads.com/@kunalb_/post/C6ZQIOVpwMd https://www.threads.com/@kunalb_/post/C6ZQIOVpwMd https://gist.github.com/kunalb/abfe5757e89ffba1cf3959c9543d9ac0 https://gist.github.com/kunalb/abfe5757e89ffba1cf3959c9543d9... which has been really useful.
- tra3 1y agoFantastic. Thanks for sharing!
- dustypotato 1y agolove it!
- ttsiodras 1y agoI have been using xterm's default dabbrev-expand to do the same via "Alt-/" ( https://github.com/ttsiodras/dotfiles/blob/master/.Xresources#L30 https://github.com/ttsiodras/dotfiles/blob/master/.Xresource... ) - which works regardless of what shell you're in. But I was curious for your approach... so I asked Claude to convert it to bash: https://claude.ai/public/artifacts/01a49347-1617-4afe-8476-06eb505855b2 https://claude.ai/public/artifacts/01a49347-1617-4afe-8476-0... Works like a charm - pinned it to Ctrl-k, which was free in my setup. I guess I don't have to depend on XTerm for this any more :-) Thanks!
- brohimx 1y agoSo, he uses tmux on Windows? How does that actually work? Can someone elaborate on it?
- hiAndrewQuinn 1y agoI believe he is remoting into a Unix system to do his actual work. The Unix system can have tmux installed and running on it perfectly fine. I've done this too, to the extreme of SSHing into my own Virtualbox VM just to get that perfect compatibility layer that WSL still can't quite match. Indeed, this is one of the strongest arguments for tmux versus other approaches to this problem. It can run on the server you're remoted into and still do its job. https://hiandrewquinn.github.io/til-site/posts/tmux-is-worse-is-better/ https://hiandrewquinn.github.io/til-site/posts/tmux-is-worse...
- kazinator 1y agoBacked out at C:\users ...
- naikrovek 1y agoWell at least you’re not judging the book by its cover.
- hiAndrewQuinn 1y agoThe golden mean between "customize literally everything" and "never stray from the basics", imo, is to pick and maintain a stack of blessed +2 vorpal binaries that work well even without any of your dotfiles or n=1 designs being present. That's why I build off of the programs my Shell Bling Ubuntu [1] installs. Not everything I use in an average day is in there, but everything I find myself shocked not to have on a new Ubuntu VM out of the box is. [1]: https://github.com/hiAndrewQuinn/shell-bling-ubuntu https://github.com/hiAndrewQuinn/shell-bling-ubuntu
- redsky880 1y agoWindows? didn't expect that
- codethief 1y ago> i don't use Nix partly because all my friends who use Nix have even weirder bugs than they already had, and partly because i don't like the philosophy of not being able to install things at runtime. Huh, I install things at runtime all the time.
- Kiyo-Lynn 1y agoI’ve tried all kinds of tools but I always end up back at the terminal. It’s simple, direct, and helps me stay focused which makes me work more efficiently. Being productive isn’t always about using the newest tools. It’s about finding what really fits your rhythm. The terminal might look basic but it’s a minimal and powerful way to get things done.
- bitbasher 1y agoYou do know vanilla vim can fuzzy search and autocomplete file names? I can’t imagine copy pasting filenames…
- eviks 1y ago> terminals are stupidly powerful and most of them expose almost none of it to you as the user. Well, they aren't really, and given the fundamentally flawed foundation of all text as the lowest common denominator, that power is not exposed. For example, your regex path detection logic is invariably flawed, and while there are ways to mark the output with extra codes as paths so you could just click on them to open in whatever editor, that requires the whole processing pipeline to stray from the plain text (and might still not allow you to search for files only by type)
- pjmlp 1y agoAs someone that was happy that I could finally afford owning computers with a graphics display on them, this going back to the terminal doesn't stop surprising me. We still do horses, but hardly anyone is favouring them for travelling around the continent delivering mail. Kudos to the people that would rather experience that, I guess.
- mcdow 1y agoZoomer terminal maximalist here. My thing is that most UIs use such poor use of the screen real estate. I get it, pretty is the priority. But when I want to do work, the padding on everything gets to be excessive. Additionally, it’s really nice to be able to host my dotfiles in GitHub and I can be in a 100% familiar environment within a couple minutes. I have a variety of machines I work on. Same thing goes for mouse usage. I’m much faster operating the keyboard, whereas I switch between mice and trackpads and sensitivities when I switch devices. Keyboards are mostly the same. Maybe it’s a skill issue on my part but oh well ;)
- orbital-decay 1y agoMy issue with the terminal is the exact opposite, everything is monospaced, hard to read, and space-inefficient due to that. Keyboard use is not a terminal-only thing either, it's a problem with some modern UIs that are hostile to power users. I feel it's at least partly because power users that create their own tools removed themselves from serious GUI development and are too busy with fancy TUI doodads and dark themes instead.
- qn9n 1y agoI feel like the point of monospace is to be easier to read in text dense environments. I find it much easier to read a monospaced font in the terminal and it makes editing commands much nicer to work with.
- orbital-decay 1y agoThe point of monospace is easy vertical alignment in code, tables, logs, and many other types of text. But you definitely lose fast visual shape acquisition and potential density of proportional fonts. CLI is fine conceptually, I'm talking about TUI which is different.
- UnreachableCode 1y agoCan somebody help me, a CLI layman, out? How can I easily navigate printed directories like he does, in zsh, and paste them right into my prompt, e.g. for Git use? Is that where the tmux regex stuff comes in? Can I use that in iTerm 2?
- setopt 1y agoIf you’re on iTerm2, then perhaps the Cmd-; completion shows what you want. Otherwise, it sounds like he’s using `tmux-fingers`, but I can’t confirm as the video doesn’t play on iOS / Safari.
- UnreachableCode 1y agoHm, Cmd+; seems to work! I will try it more out in the wild. Thank you!
- eisbaw 1y agoI made my own fuzzy ripgrep, rgf. Works like rg but then pipes into fzf. When selected, your editor pops up on that line. Pretty handy. rgf is a function rgf () { ( unset rg; function rg_normalize () { sed -E 's#-(\x1b\[[0-9;]*m)*([0-9]+)(\x1b\[[0-9;]*m)*-#\1:\2:\3#g' }; rg --color=always "${@:-${RG_LAST_ARGS[@]}}" --with-filename --line-number | rg_normalize | fzf --ansi --multi > /dev/shm/.tmp.fzf ); cmd_fuzzy_editor $(cat /dev/shm/.tmp.fzf | awk -F':' '{file=$1; line=$2;} {print file, line}') > /dev/shm/.my_editor.source; source /dev/shm/.my_editor.source } type cmd_fuzzy_editor cmd_fuzzy_editor is a function cmd_fuzzy_editor () { ( set -eu; { local file="$1"; local line="$2" } 2> /dev/null; export EDITOR="${EDITOR:-vim}"; export FUZZY_EDITOR="${FUZZY_EDITOR:-${EDITOR}}"; case "$FUZZY_EDITOR" in "vi" | "vim" | "gvim" | "nvim" | "neovim" | "spacevim") echo "$FUZZY_EDITOR" "${file}" "+${line}" ;; "emacs") echo "$FUZZY_EDITOR" --no-splash "+${line}" "${file}" ;; "nano") echo "$FUZZY_EDITOR" "+${line}" "${file}" ;; "nedit") echo "$FUZZY_EDITOR" "${file}" -line "${line}" ;; "sublime_text") echo "$FUZZY_EDITOR" --new-window "${file}:${line}" ;; "code" | "vscode") echo "$FUZZY_EDITOR" --goto "${file}:${line}" ;; "notepadqq" | "nqq") echo "$FUZZY_EDITOR" -line "${line}" "${file}" ;; "kate" | "leafpad" | "mousepad" | "gedit") echo "$FUZZY_EDITOR" "${file}" ;; *) echo 'No FUZZY_EDITOR found!' 1>&2 ;; esac ) }
- kat529770 1y ago[dead]
- deleted 1y ago[deleted]
- buf 1y agoI've been using a very similar setup with vim/tmux for about 20 years. I've tried all the new IDEs but still keep coming back. With AI, I thought I was going to have to change until Claude code. Now I'm back in my happy place.
- absolute_unit22 1y agoSame! So relieved Claude Code and Aider exist now - I almost bought into the Cursor hype
- huimang 1y agoHi Jyn. "i don't use Nix partly because all my friends who use Nix have even weirder bugs than they already had and partly because i don't like the philosophy of not being able to install things at runtime." The first part is mostly true. Nix installs things in a readonly store (/nix/store) so regular dynamically linked binaries don't work. Packaging takes a different approach and when things break, it can be difficult to work around. That said, I've run NixOS for over a year now and I find the benefits are far preferable to these downsides. It's not often I run into bugs, let alone show-stopping ones. What is annoying is how many tools are distributed without the source, so I have to run patchelf on them or use something like nix-ld. As for the latter part, I think that using Nix will change that mentality. (Note that you can do `nix-env -iA $pkg` but it's not recommended). See, I don't even install things like rust at a global level anymore. I can always do `nix-shell -p $pkg` for an ephemeral shell if I need that, or I encode that dependency directly in the project's flake.nix. If I end up using that program a lot I will make the effort to add it to my NixOS config.
- aequitas 1y agoI use Nix exactly because it doesn't allow installing things at runtime. This keeps me from hitting surprises where the runtime environment changes from under me. Containers can partially solve this problem as well but have their own usability issues. Nowadays I start every project with `nix flake init --template templates#utils-generic`. And put everything in that related to the project. I even had some projects where I had to put 'ssh' as a pinned package as it was used in some scripting and the default macOS and Linux versions accepted different flags. I also do love that I can do something like `nix run nixpkgs#nmap` on any machine I'm on to instantly run a program with worrying where to get it from. I also use this feature in some of our projects so you can click a link in the admin web interface which is a 'command url' for iTerm2[0] like: `nix run gitlab.com/example/example/v1.0 -- test http://example.com http://example.com` which will prompt to run that specific version of the command in your terminal, without have to checkout the source repo. In this case it is to rerun specific task locally for debugging purposes. [0] https://iterm2.com/documentation-command-selection.html https://iterm2.com/documentation-command-selection.html
- jynelson 1y ago
- rutchkiwi 1y agoHow was the async loading of zsh config accomplished? Just says it did it.. but how?
- pech0rin 1y agothis is cool but acting like this is some insane usage is funniest part for me. emacs and 100 other tools can do this easily and have been doing it for 30 years
- mickey475778 1y ago[dead]
- curtisszmania 1y ago[dead]
- suyash 1y agoWhich video player is that ? I like the time coded videos as links.
- wkat4242 1y agoThis seems to be Powershell though so not that relevant for me unfortunately. I'd love to see this about zfs
- kwbr3000 1y agoYou should check out vim's remote functionality to open files in an already running instance https://vim-jp.org/vimdoc-en/remote.html https://vim-jp.org/vimdoc-en/remote.html Edit "file.txt" in server "FILES" if it exists, become server "FILES" otherwise: gvim --servername FILES --remote-silent file.txt
- TrapLord_Rhodo 1y agoWould fig not fit this usecase? I seem to be misunderstanding the post a bit. It seems like he's going through great lengths not to use cursor? This regex must of been gnarly to write ># i am so sorry > # see `search-regex.sh` for wtf this means ># TODO: include shell variable names bind-key f copy-mode \; send-keys -X search-backward \ '(^|/|\<|[[:space:]"])((\.|\.\.)|[[:alnum:]~_"-]*)((/[][[:alnum:]_.#$%&+=@"-]+)+([/ "]|\.([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?)|[][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)(:[0-9]+)?)|(/[][[:alnum:]_.#$%&+=@"-]+){2,}([/ "]|\.([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?)|[][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)(:[0-9]+)?)?|(\.|\.\.)/([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?))' This is pure quantum flux