How to enable horizontal scroll on vim with trackpad/mouse? - macos

How to enable horizontal scroll on vim using the trackpad on macOS (I guess is the same as mouse on other OS)?
I tried
:set sidescrool=1
I noticed the window moves if I hit z left or z right.
I noticed macvim has it.

You can try this, it may work. Open system Preferences (under the apple menu) and then select general. About half way down that window are options related to the scroll bars. Select one of these and see if it works.

Related

Use non-native fullscreen window mode in PhpStorm on macOS

How can I configure PhpStorm to use the "non-native" fullscreen mode? I'd like PhpStorm to be fullscreen (without the macOS top menu bar, etc), in the same window (without creating a new window that I have to scroll between).
The terminal for macOS iTerm2 have this setting. You can choose to remove the tick from "Native full screen windows". When this tick is removed, the fullscreen mode will simply take out all space in the window, without creating a new separate window.
Native fullscreen example
Notice how a new separate "window" is created called "PhpStorm"
Non-native fullscreen example
Notice how theres still one window called "Desktop". The iTerm window fills out the whole screen though.
the only way you can do it at the moment is by adjusting the dock in mac to hide menu automatically and then spread the editor to wider and higher setting
click right on the dock in mac and goto settings and hide menu works for me
i am suffering from same issue lol after i saw iterm2 :P

On MacOS Catalina, how can I turn off yellow highlighting and popup "Look up" windows when I e.g. try to select code from Terminal?

At present, I am using a Linux VM on my Mac for certain purposes, because it is now very difficult to select and copy a segment of code from a Terminal window without some token being highlighted in yellow and a popup window with a definition etc. pops up, disrupting my effort to highlight code.
Under System Preferences, "look up" highlights Spotlight and Trackpad. Turning off Spotlight does not seem to have mitigated this behavior.
How can I copy and paste code from a Terminal window? I have a workaround for some of the issue in that I can View Page Source from Brave and select it there, but it would be really nice to have the ability to select and copy code from a Terminal window normally.
I found it here:
System Preferences > Trackpad > Turn off "Look up & data detectors"

how to use the trackpad to scroll in nano using iterm2, the way it works in terminal.app?

I am used to editing in nano, and with terminal.app it's easy to quickly move up and down the file using the scroll gesture. I am trying out iTerm2, but now the scroll gesture just makes iTerm scroll upward in history, the nano work area scrolling off the bottom. in Terminal, scrolling in nano simulates moving the cursor up and down, and results in a nice ability to move through the file. How can I get iTerm2 to do this also?
It's a configurable preference (like xterm's alternateScroll resource). In iTerm2, that's in the Advanced tab:

vim + iterm: how to use mouse for everything EXCEPT selection?

Ok, have a very specific setup question. I'm using Mac OS X, iTerm, and vim. I really like using my mouse for clicking tabs in normal mode, scrolling in normal mode etc. (e.g. I already have the mouse working within iTerm/vim).
However, I dislike using visual mode for selecting. I just want to use OS X selection not vim's visual select. The next logical step? Disable visual selection in the mouse options:
set mouse=nicr
The problem with this is that when I try to select (using the mouse) vim intercepts the mouse click and doesn't allow me to select at all!
Anyone know how deal with this issue? It feels like its solvable if one knew the proper character/control codes (which I obviously do not).
Goal: use the mouse in vim for everything except "select". Let iTerm/OS do the selection.
I don't have a Mac, but under Linux holding Shift while highlighting allows you to use the mouse to copy with the mouse settings you mentioned.
See the "Note:" in :h mouse

Scrolling inside Vim in Mac's Terminal

I've been googling around trying to figure out if it's possible to use my mouse wheel to scroll while inside Vim in Mac's Terminal, with no luck. It seems as if only X11 or iTerm support this.
Before I give up, I thought I'd try the geniuses here to see if anyone knows a way to do this. So, does anyone know if I can set that up?
Or should I seriously consider using a different terminal application?
And if you're using iTerm, add this to your vimrc
:set mouse=a
http://bitheap.org/mouseterm/
Use MouseTerm (and do make sure to install SIMBL first!) and scrolling will work like a charm, even remote, using Mac Terminal.
You need to fully quit the Terminal application (Command+Q) and then launch it again after installing MouseTerm.
This is an old question, but a top hit on google, so I feel compelled to provide an updated answer.
Running OSX El Capitan 10.11, vim mouse and trackpad scrolling just worked(TM) for me in Terminal.app by default. However occasionally the mouse/trackpad input stopped manipulating the vim buffer, and started scrolling the terminal buffer. The answer was Command+R or Menu View --> Allow Mouse Reporting. Turning that on allowed the mouse/trackpad scroll operations to move the cursor in vim.
Termanal Menu > View > Allow Mouse Reporting
Terminal Menu > Preferences >
Keyboard > Scroll alternate screen
If the mouse functionalities still do not work properly take a look at my answer in this post How to let vim behave on Mac OS X as on Ubuntu?, just add to your .vimrc
set ttymouse=xterm2
You can read this article, but I'm pretty sure since the default terminal in Mac OS X has a built-in scrollbar, the mousewheel commands automatically go to it. You could definitely use gVim as suggested in the previous answer. I find that I don't generally want to use the mouse in Vim though as it takes my hands off the keyboard.
I just use 50j to go down and 50k to go up. Not exactly scrolling, but it works pretty well.
Make sure the terminal is xterm & not ansi in Terminal Menu > Preferences > Profiles > Advanced. I accidentally broke scrolling by changing the term type in a naive effort to get coloring to work over ssh.
Use gVim, which gives you a text editing environment in a window you can scroll. Terminal is not involved when using gVim.
I'm using xterm in X11 (XQuartz 2.3.4) and vim works very fine with mouse and also suport 256 colors.
Here is the ~/.Xresources I use to make my xterm nicer in X11:
XTerm*faceName: Lucida Sans Typewriter Regular
XTerm*faceSize: 9
XTerm*utf8: 1
xterm*saveLines: 1000
xterm*jumpScroll: true
!xterm*awaitInput: true
!xterm*multiScroll: true
XTerm*scrollBar: false
xterm*scrollbar*thickness: 16
xterm*rightScrollBar: true
XTerm*foreground: white
XTerm*background: grey10
!XTerm*background: black
XTerm*cursorColor: yellow
xterm*visualBell: false
xterm*loginShell: true
Little tips, to remove the bell sound in X11's xterm type this command:
xset b 0
I would recommend using iTerm - it has so many advantages over Terminal eg Mouse support, 256 colors, sensible copy and paste (auto-copy, word/url selection with double click, middle click paste)...
When using iTerm create a .vimrc file (if not already there) in your home folder and add the line:
:set mouse=a
Scrolling down in vim to view a file works after this.

Resources