Issue with pine editor cursor offset - linux

In the Pine editor, the cursor if offset to the right by some characters. In my case, it is 5 characters at the beginning so a line, and over 20 at the end of the line. It seems that the spacing the cursor thinks it needs for a character is about 10% more than the spacing it should be using. I have tried KDE, Xfce, metacity, etc., and disabled/enabled GTK stuff in Chrome, and various browsers, but all exactly the same.
I have seen several similar complaints regarding GTK/Linux web editors so it is necessarily a Pine editor issue, but I have no problem with every other web-based editor, which is why I am asking here , as it is only a problem for me with the Tradeview's Pine editor.
Are there any users here who have experienced this same issues, and if so, was there a solution? In my case, I am using Arch/Manjaro Linux.
Alternativley, is there a reccomended editor for Pine?
Thanks

Related

Uniform code indents/spacing between computers

I frequently switch from working on my laptop to a school computer to a cluster machine Linux environment.
I get annoyed that code I write on Notepad++ on my laptop has different indents and spacing than the same code I open on my lab computer in Vim and vice versa.
For example, this code:
PetscInt xs,xw,ys,yw;
PetscReal lx,ly,dx,dy,dt,xp,yp;
PetscReal sim_time;
DM da,daKSP;
Vec gv,lv,bv,X,lX;
Becomes this code:
PetscInt xs,xw,ys,yw;
PetscReal lx,ly,dx,dy,dt,xp,yp;
PetscReal sim_time;
DM da,daKSP;
Vec gv,lv,bv,X,lX;
Is there a process I can adopt so that my code pretty much looks the same from computer to computer?
Thank you
Either make sure your softtabstop, tabstop, shiftwidth are the same as on your Notepad++, or make sure you use spaces, not tabs, for indentation (and set expandtabs in Vim).
I suggest adopting the latter solution, because tabs are a relic of the time when disk space was expensive, and because they are contextual and will mess up your code unless you have all the settings just right. Using spaces is foolproof, and all major editors support treating indentation spaces as if they were tabs anyway (e.g. deleting an indentation with a single backspace, converting Tab keypress into the appropriate amount of spaces, etc.) However, spaces vs. tabs is a matter of opinion/taste, and you might get the opposite recommendation elsewhere.
You can use http://editorconfig.org/ to maintain consistent configurations across editors and avoid such problems.

Using vim to develop instead of Emacs on Windows

I have used Emacs for a long time, say, 6 or 7 years. And it seems that I got Emacs Pinky somehow. Now I am trying to switch to vim, and it's a very good editor, just like Emacs, except that I wonder how you guys develop with it.
Using Emacs with a buffer running shell, I code, compile, debug, profile or do anything. But vim is just an editor. I still don't know how to quick edit in command mode, where everything go back to stone age. Should I use other tools, like screen, as the environment, and vim just the editor?
FYI, I mainly work on Windows.
For those Emacs users wishing to have a Vim experience in terms of keyboard shortcuts and certain functions specifically designed to duplicate Vim behavior, the original poster may wish to consider using evil-mode:
http://www.emacswiki.org/emacs/Evil
In addition, the user may wish to configure his/her own keyboard shortcuts that make more sense based upon any physical limitations (e.g., pain in certain digits, etc.).
Finally, there is no requirement that a user keep his/her hands on the home row and stretch for the control/alt/command keys with a pinky. It is possible to type 100 words per minute or faster, hit keyboard shortcuts using two hands away from home row, and return to the home row blindfolded.

IntelliJ terminal cursor shape

So, I am obsessed with Vim. I use vi mode everywhere - in all the editors and IDEs that support it. I use it it my browser (vimium, wasavi). I use 'hjkl' navigation everywhere thanks to awesome Karabiner. I use vi mode in my terminal via iTerm under zsh. Long time ago I found this little trick that changes cursor shape in the terminal depending of what mode you're currently in.
Now, although it perfectly works for iTerm, sadly it doesn't work in OS X's builtin terminal. I couldn't care less about that, except it also doesn't work in my favorite WebStorm. I thought I could trick it and instead of changing cursor's shape I could try tweaking its color. Still didn't work.
Please guys, help me to find a way to tweak cursor in IDEA's Terminal.
Thanks!
p.s.: Some may suggest to change the prompt depending the mode, but honestly I don't like that. I still believe there's a way to change cursor shape or color. Prob. just need to find the right escape sequence.
Unfortunately it looks like Intellij terminal draws it's own cursor without respect to bash or zsh settings.
Note I'm assuming community and pro editions of Intellij use the same terminal plugin
You can see the Terminal plugin source here
The terminal plugin uses Jediterm, a Java based terminal emulator written by JetBrains
Most of the drawing of the terminal window is handled in TerminalPanel.java and has a nested class called TerminalCursor
From the TerminalCursor class you can see that Java Graphics is used to draw boxes for regular cursors and blinking cursors.
Code that draws a rectangle for the cursor
I'm still not sure how the unfocused cursor is drawn since it's just an outline, and I can't find a handler for lost focus on the frame.
You can change the terminal cursor shape from the dialogue below:
Now, this is a lot prettier to work with:

multi-column terminal multiplexer?

Let me explain what I'm looking for, hopefully for the terminal, but if it exists in an IDE, i'll take that too.
I have a laptop with a 1366x768 resolution screen; I use vim for code-writing, and I use a fairly small font in my terminal (~7pt). So, as you might imagine, there's a lot of "wasted" horizontal space, especially when coding in a compact language like python.
I just checked and found that with a 6pt. font, the maxyx of my terminal is 82 rows x 271 columns. What I'd like to have, essentially, is a single terminal with the dimensions of 246 rows x 90(89?) cols, split into 3 panes and displayed side by side. But, they would need to behave as one contiguous vertical pane, i.e., when i scroll in my editor, all three of them scroll synchronously.
Does anyone know of a hack or anything to accomplish this? Maybe for vim/screen/similar?
Patching screen might be a fun project, but I don't have time to chase that rabbit. If someone out there does, though, I'll order them a pizza or something ;)
(although if i get around to it first, i'll have to order myself a pizza)
I had the very same desire and others want this as well. Lacking any options I implemented my own two column virtual terminal. See the --columns option for selecting a different number of columns than two.
EDIT: based on comments, I now understand the requirement better. i.e. viewing one text file in a newspaper-like multi-column format.
It seems more like an editor feature rather than a multiplexer feature (because the 2 editors should be linked). Thanks to #romainl for mentioning :set scrollbind. This seems capable of doing the job in combination with some additional vim magic.
Here's an superuser q&a showing how to use scrollbind for your purposes: https://superuser.com/questions/243931/how-do-i-maintain-vertical-splits-with-scrollbind-in-vim .
Original answer:
vim and [recently] screen both offer vertical-split, as does tmux.
I don't know about any way to scroll simultaneously, but tmux's 'synchronize-panes' does offer simultaneous input. Can be useful!
For vim, use :vsplit
For screen (recent versions), use C-a |
Alternative to screen, I use tmux. It offers (default keys)
C-b %, then you can use C-b :setw synchronize-panes for
simultaneous input across panes.
Hope this helps.

Whack vim screen drawing errors

Something extremely weird is happening when I open files in vim, and I can't remember doing anything that would have caused it.
Weird behaviors include:
no text being visible until I highlight it in visual mode, at which point it is visible from thereon. ":redraw!" does not make anything visible.
line 1 missing
occasionally the cursor appears one line below where it is editing
statuses become permanent and scroll up from the bottom, rather than just redrawing at the bottom
the vim text not extending to the bottom of the vertically maximized window
I lack the reputation to post screenshots but I'll happily provide any other information that could help in a diagnosis.
ETA: Ah! My .vimrc specified a column/row size. I've removed that line, and so far things are behaving well. Thank you!
vim is terminal based, and errors like this happen when the terminal you are using does not match the terminal vim thinks you are using. Most people use vim with terminal emulators. This kind of thing can happen when you resize the emulator window and vim does not find out about it, or more rarely, when the terminal-identifying-string specified in the environment does not match the terminal emulator you are running.
Without more details about the platform on which you are running vim, it is hard to be more specific-- but as a tip: don't resize the emulator window after it is created but before running vim.
Terminal emulators are supposed to communicate size changes back to the program running within them, but this is not 100% foolproof, especially when you are logged in to a remote machine within the emulator.
If you're doing this from a UNIX (Linux et al), try running :!resize to force your terminal to re-adjust its size parameters. At the very least it'll tell you what the system thinks your window is sized to, which may not match its actual size.
I had a similar problem when using vim with bash. When I switched from bash to zsh, it gave redraw errors where, while I typed, the cursor or screen would appear to go down one row for every 10 characters I typed. Scrolling with arrow keys also caused major display problems along the same lines, but worse.
I had this line in my previous .vimrc, I believe it was to set the color for vim
set t_256
I changed it to set term=xterm=256color and the problem went away.

Resources