Language:
switch to room list switch to menu My folders
Go to page: First ... 103 104 105 106 [107]
[#] Sat Sep 13 2025 17:12:26 UTC from IGnatius T Foobar

Subject: Tip 'o the day

[Reply] [ReplyQuoted] [Headers] [Print]


Despite its microsoftian origin, I do find myself enjoying VS Code for software development. Not without some tuning, of course -- the thing that really made it usable for me is the extension that makes the editor use vi (vim) keybindings. But one thing that kept being a problem was that I still habitually type "vi <filename>" in the terminal to start editing. And now you're editing in the terminal, not in the editor.

Yesterday I learned the fix. Put something like this in your ~/.bashrc or equivalent:

if [[ "$TERM_PROGRAM" == "vscode" ]]; then
alias vi='code'
alias vim='code'
fi

It turns out that if you run "code" and the name of a file from inside the terminal of a connected session, it won't start a new session; instead, it does-the-right-thing and opens that file in a new editor tab. What's more, this even works when VS Code is operating on a remote host through SSH, which happens to be how I always use it.

Go to page: First ... 103 104 105 106 [107]