{% blockquote %} 能不用 /tmp 暫存 {% fa_inline file %} 就不用啊 {% endblockquote %}
tmux 好好用
也不知道從 screen 換過來 tmux 有多久了,雖然還是習慣使用 ctrl+a,
把 statusbar 關掉,覺得新增的 preview 也太花俏,
但以基礎功能來說也是個生活必需品等級的程式,沒有它會活不下去的那種啊。
講到把 statusbar 關掉這件事,其實也自己對於用電腦上的某種 philosophy,
大概是以前用的 {% fa_inline desktop %} 比較小, 覺得 rows 跟 cols 都很珍貴的緣故吧
最近 tmux 更新到 3.0 {% blockquote tmux 3.0 CHANGES, https://raw.githubusercontent.com/tmux/tmux/3.0/CHANGES %}
- INCOMPATIBLE: Add a new {} syntax to the configuration file. This is a string similar to single quotes but also includes newlines and allows commands that take other commands as string arguments to be expressed more clearly and without additional escaping. {% endblockquote %}
所以自己在用的 tmux.conf 也有一行出現問題,就參考人家的修正了一下:
- unbind %; bind-key % split-window -h -c "#{pane_current_path}"
+ unbind '%'; bind-key '%' split-window -h -c "#{pane_current_path}"
想說順便在 tmux.conf 上增加點方便的設定好了。
tmux url select
常常會有一些情況,會需要複製 tmux 畫面上的網址, 不管是要下載還是直接用瀏覽器打開,感謝 tmux 有好用的 copy mode , 可以輕易地搜尋 http,選取然後複製到 tmux 的 buffers 裡。
雖然方便是方便,也是要好幾個步驟,這時候就不禁令人想起之前 mutt 的 urlview。 想要再拿來裝一下的時候,發現 urlview 竟然是放在 AUR 上,另外 [termux] 上也沒有放這個套件。
install-urlscan
雖然 urlview 要裝也是都有,但上網找了一下另外有一個叫 urlscan,是 urlview
的替代方案好像也不錯用,只要用 pip install -U urlscan 裝一裝就好了,
而且進去選擇 urls 的時候,keybindings 也是很 vim 的喔。
雖然需要研究一下 -n -r/-p 有什麼不同啦
tmux-urlscan
其實 Arch Linux 的 Wiki Tmux 頁上面有寫個例子怎麼利用 urlview 開網頁喔,
{% blockquote Arch Wiki, https://wiki.archlinux.org/index.php/Tmux %}
To browse URLs inside tmux you must have urlviewAUR installed and configured.
Inside a new terminal:
TERMINAL -e urlview /tmp/tmux-buffer”
{% endblockquote %}
不不不不…要啊,開個檔案 /tmp/tmux-buffer,那萬一有好幾個人同時用怎麼辦, 當然是可以自己改在家目錄的啦,但總覺得就是要寫個檔案不太舒服。
所以自己改了一個可以掃之前所在 pane 畫面裡的 urls 並且複製到 buffers。
# url select
bind-key u split-window "tmux capture-pane -t ! -p | urlscan -H -p --run 'tmux load-buffer -'"
bind-key o split-window "tmux capture-pane -t ! -p | urlscan -H"
大概是這麼用的,請看請看
如此如此就可以這個為基礎兜出其他想要的應用了, 像是快速地串流聽聽用 rss 訂閱的 podcasts 之類的, (就有的 padcasts 很奇怪都不直接放 file path 的)。