what's the right way to use sublime in multiple X11 sessions? - sublimetext

On my redhat 6 machine:
I opened 2 sublime windows on one of my X11 session, with display :0.
Went to a new X11 session with display :5.
I issued sublime (also tried "sublime -n"), nothing happened.
I ran "ps -ef |grep sublime", then killed all sublime processes.
Now, I issued sublime again, I got new sublime window on my display (:5), also additional 2 sublime windows as I had in display :0.
My question: any better way to have multiple sublime windows in my difference X11 sessions? I would like to still keep my old sublime windows in :0, and have new sublime windows in my :5.

Related

copy text from tmux inside VSCode

I use VSCode on macOS, I ssh into Linux remote station and here I run tmux (inside VSCode integrated terminal). However, I am not able to copy any text from tmux into system clipboard when used like this. I am not even able to select the text using mouse - when I select any the selection highlight disappears immediately.
The copying to system clipboard works if:
I run tmux inside separate window of iTerm2
I run normal zshell inside VSC integrated terminal
How to copy text from tmux inside VSC integrated terminal?
That is because vscode terminal does not support osc52. We gotta wait for this issue to be resolved https://github.com/xtermjs/xterm.js/issues/3260
OSC 52 (OSC stands for Operating System Command, a category of ANSI escape sequences which instruct the terminal emulator to perform certain actions) is a terminal sequence used to copy printed text into clipboard, without which copying from remote machine will not send the result to your local clipboard. Applications like tmux support it (actually, tmux is kinda forwarding it), iterm2 support it but not vscode
Solved using the mouse while holding Alt (Option) key. This way I can copy text from Tmux inside VSCode.

How do I more easily copy and paste all the content in open file on remote server over ssh using tmux and iterm2?

Problem: I'm on a mac running a tmux server. Within my local tmux session, I connect to a remote linux server and open a file with vim. The text I want does not fit in a single pane without having to scroll. I want to grab the text in the file and copy and paste all of it to my local machine's memory.
Current Solution:
My current procedure for copying and pasting is very convoluted:
Zoom on the pane with ctl-b z
Turn off numbering in vim with :set nonumber
If the file or text I want does not fit in entire pane, I hit cmd - until the text is small enough to fit in the entire pane
Select text I need with my mouse while holding down the option key.
Hit cmd-c to copy to my local machine.
Better Solution?
My current solution is tedious and I'm tired of wondering if there is a better way. Anyone got a better solution?
Ideally, I'd love to be able to select the text with vim and have iterm2 somehow detect what has been selected in a pane and run a single keystroke to copy to my local machine. Not sure if that's possible or not.
OK, I went with the solution at github.com/wincent/clipper which works on my mac running macos 11.2.3.
The install instructions seem to be a little dated and are a bit confusing if you don't read them carefully. It took some trial and error to figure out how to get this working with vim on the remote machine:
Install with brew on your mac
Launch clipper as a daemon with brew services start clipper
On the remote machine, add the following line to your vimrc file:
nnoremap <leader>y :call system('nc -q 1 localhost 8377', #0)<CR>
Note: I had to add the -q 1 in there because I found vim would hang otherwise. The -q 1 arguments are not in the official documentation.
In your mac's ~/.ssh/config file:
Host *
RemoteForward 8377 localhost:8377
Make sure your remote server has port 8377 open!
On the remote machine, open a file with vim. Yank some lines. Then hit <leader>y.
Note: It took a while before it finally dawned on me that just <leader>y doesnt' work by itself. It's a two-step vim command process: 1) yank the text with a vim command 2) send the copied text to your mac with <leader>y.
That's it. My life feels so much better now. :)

How can I select text in git bash terminal in Windows 7 without mouse?

I am on Windows 7 and I have Git Bash at my disposal after installing Git for Windows.
I found mouse inconvenient to select-copy-paste in terminal window. What is the shortcut for text selection (like Shift+←, Shift+→ in Notepad editor)?
I have seen many irrelevant verbose replies to this question, but all, what I am looking for is just an appropriate shortcut (like Ctrl+Insert for Copy and Shift+Insert for Paste).
It is best to install a CMD enhancer like ConEmu.
From there, you can type "bash", and you will see in that Git bash session, that simple CTRL+C, Ctrl+V are enough for copy/paste.
And for selecting the text (in a ConEmu session), Shift+←, Shift+→ works too. For W7 or W10.

tkdiff from terminal on mac opens in dock instead of window

I followed the instructions here:
How to run TKDiff from the terminal on mac os
to get tkdiff working from terminal in mac os. The problem is when I run "tkdiff file1 file2 " on the terminal it does not open up a window. Instead, app Wish appears "hidden" in the application dock and I have to click on it in order to display the diff window. After clicking on it everything is fine. But I'd rather the diff window to pop open as soon as I run tkdiff. Anyone know if there is a setting I need to change, or if I'm doing anything wrong?

Emacs editor "locks" out terminal when being used

The issue I am having is when I open a file via emacs it will open another window in the emacs text editor, but lock out the terminal. What I mean by lock out is that the terminal seems to be linked to the window of emacs that had opened up. When I first downloaded the software I did not have this issue and was able to open multiple emacs windows at once but now I have to close out of the current emacs window to open another. Any suggestions on fixing this?
It sounds like you want to have the file pop up in a window when you open it, rather than fill the whole terminal.
If that's the case, you should
install a graphical version of Emacs from http://emacsformacosx.com/
put alias emacs=/Applications/Emacs.app/Contents/MacOS/Emacs in you ~/.bashrc
open files with emacs file.txt &. The file will open in a separate window and you can keep using your terminal

Resources