

Vim, tmux, and Fish
source link: http://tenderlovemaking.com/2023/01/18/vim-tmux-and-fish.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Vim, tmux, and Fish
2023-01-18 @ 11:23
I do most of my text editing with MacVim, but when I pair with people I like to use tmate.
tmate is just an easy way to connect tmux sessions with a remote person.
But this means that I go from coding in a GUI to coding in a terminal.
Normally this wouldn’t be a problem, but I had made a Fish alias that would open the MacVim GUI every time I typed vim
in the terminal.
Of course when I’m pairing via tmate, the other people cannot see the GUI, so I would have to remember a different command to open Vim.
Today I did about 10min of research to fix this problem and came up with the following Fish command:
$ cat .config/fish/functions/vim.fish
function vim --wraps='vim' --description 'open Vim'
if set -q TMUX # if we're in a TMUX session, open in terminal
command vim $argv
else
# Otherwise open macvim
open -a MacVim $argv;
end
end
All it does is open terminal Vim if I’m in a TMUX session, otherwise it opens the MacVim GUI.
Instead of putting up with this frustration for such a long time, I should have taken the 10 min required to fix the situation. This was a good reminder for me, and hopefully I’ll be better about it in the future!
Recommend
-
22
安装Powerline并配置Vim、Bash、tmux、IPython、pdb 2020-09-21 21:59:17 +08 字数:1546 标签: Bash
-
20
Table of Contents有一些 vim 主题(如 gruvbox 或 solarized8)在 GUI 和终端下效果不同,有可能是因为这个主题需要 true color (2...
-
25
Tmux and Vim: Copy and Paste on macOS Sierra Posted: 2017-03-22 - Last updated: 2019-06-05 Tagged
-
8
vim+tmux 真彩色256color配置 vim是我们最喜爱的编辑器,tmux是我们最喜爱的终端管理器,它们的搭配可以让你的工作效率提升到难以想象的高度。默认情况下,linux的终端是8位的彩色配置,也就说它的颜色过于单一,然而其实大部分情况下它都是支持...
-
11
Learn Linux, Vim, Git, Tmux, Gpg and more
-
8
Vim+Tmux配置Scheme编程环境 12月 11, 2017 发布在
-
7
1. Shell概论Shell是一个用C语言编写的程序,它诞生于Unix,是我们通过命令行与Unix/Linux交互的工具。笼统地说:Shell既是一种命令语言,又是一种程序设计语言。 而Shell脚本是一种为Shell编写的脚本程序,有的时候也被称为Shel...
-
26
Introduction If you write code in multiple languages you may have found it tiresome to maintain an IDE for each. After some experimentation I found the combination of Vim and Tmux to be the ideal solution for my case. T...
-
7
I’ve recently been asked to share my shell setup, which if you ask me, that’s one of the highest levels of praise you can achieve as a software developer 🤣 In this article, I’ll describe the setup I’ve been using for the past few years, and how to...
-
8
256 colors in putty, tmux/screen and vim · GitHub Instantly share code, notes, and snippets. 256 colors in putty, tmux/scr...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK