I use Tera Term's console connect to Raspberry Pi 3 but the visible lines only 24.
Here is the environment variable
root#raspberrypi:~# export
...
declare -x LINES="24"
...
For expanding the visible lines, I remove the code "shopt -s checkwinsize" in the file "/etc/bash.bashrc" and I add code "export LINES=50" in the file "~/.bashrc".
Unfortunately, after the device reboot, the visible lines still is 24.
How to expand the visible lines?
It's my fault.
Just only to modify the .vimrc and add the line setting as below.
set lines=50
Now I can use vim to edit file with 50 visible lines.
Related
I'm a happy user of the Nvim-R plugin, but I cannot find out how to scroll up in the buffer window that the plugin opens with R. Say for instance that I have a large output in console, but I cannot see the top of it - how do I scroll up to see this? In tmux for instance there's a copy mode that quite handily lets you do this, but how is this done in the R buffer?
An example below where I'm very curious to see what's on the line above the one begining with "is.na(a)...". How can this be achieved?
I have scoured the documentation found here, but without luck.
The answer is apparently to use Ctrl+\ Ctrl+n according to this answer on the bugreports for NVim-R.
Here's what my output looks like when I output mtcars:
When I hit Ctrl+\ Ctrl+n, I can move the cursor and I get line numbers:
To get back to interactive, I just use i, the same way I normally would.
Apparently, if you are using neovim, then you can add let R_esc_term = 0 in your ~/.vimrc file and you can then use the escape key, but if you don't use neovim, you are stuck using the two ctrl commands ¯\_(ツ)_/¯.
As pointed out by ZNK, it is about switching to normal mode in Vim's terminal. This, however, can easily fail due to cumbersome keybinding. If such is the case, remap the default keybinding to something reasonable, say, by putting this in your .vimrc:
tnoremap jk <C-\><C-n>
This works for me in Linux running Vim 8.0 in terminal (e.g. does not require Neovim). As you can see, I use 'jk' to switch from insert to normal mode. One can use Esc instead of jk, however, this makes me unable to use up arrow to retrieve command line history as been reported elsewhere.
I have recently run into the following use case in LightTable:
I want to execute a command (for instance, duplicate a line)
I press "Ctrl-Space" and a list of commands shows up
I select the command I need
I want to repeat this command often, but there is no keybinding for this command
I go to user.keymap where I am supposed to add a line like [:editor "alt-shift-w" :editor.watch.unwatch]
But I have no idea what is the :editor.watch.unwatch-like key for the command I have just found. All I know is the displayed name of this command: Editor: duplicate line
Is there a way to add this keybinding without digging up the documentation and finding the key?
If you add the beginning of a line like this to your user.keymap:
[:editor "alt-shift-w"
and position the keyboard cursor at the end of the line you should be able to type duplicate line and the relevant command should be listed in a popup autocomplete menu.
i'm using zsh on my mac (oh-my-zsh) and i don't understand why at the end of my output there is always this character: "%"
If i don't put export TERM="xterm-256color" in my ~/.zshrc i haven't that character:
Usually a bold % (or # for root) with reversed colors is used to signify a "partial" line in the output. That is a line, which is not terminated with a newline character.
As it seems to depend on the value of TERM I suspect an incompatibility between that value and the settings of terminal emulator. Contrary to the warning shown in your second screenshot, you actually should not set TERM in your ~/.zshrc (or anywhere inside the shell session). TERM should always be set by the terminal emulator itself. Its value (in conjunction with the terminfo terminal capability data base) tells the shell and other programs, which features a terminal emulator supports and how to use them. If the value is changed in the shell, the terminal emulator will not know about it. This may lead to programs sending control codes the terminal emulator does not understand correctly or at all.
In order to change the value of TERM you should change it in the terminal emulator settings. According to the iTerm 2 FAQ the settings is to be found at Preferences->Profiles->Terminal->Report Terminal Type.
I personally placed export PROMPT_EOL_MARK='' inside my ~/.zprofile and hide the character.
I've removed and added a few times now the following line to ~/.tmux.conf:
set -ga terminal-overrides ',xterm*:smcup#:rmcup#'
Which according to the person who provided it does the following:
to fool the multiplexers into thinking that the terminal has no "alternate screen" mode (such as that used by pico, mutt, etc). This is accomplished by setting termcap commands for the session.
The 'xterm*' part of the command should be set to whatever your terminal-emulator is declared as.
The end result is that the overflow ends up in the terminal's scrollback buffer instead of disappearing. Of course, since this is one static buffer, things will get messy as you switch between screen or tmux windows, but this is handy for quickly flicking up to see the output of an ls command or the such.
I don't quite understand the bolded section (emphasis added), but guess this is the source of what I'm seeing. It's causing some weird sort of unicode overspill upon exiting tmux.
Pasted as plaintext this text won't show up, but the symbol [001B]112 appears alongside the usual [exited]:
]112[exited]
(FWIW I think it has pasted in that line, but isn't displaying)
I followed this advice ("Use terminal scrollbar with tmux"), and while it does work, this is just ugly/annoying to see that upon exiting. Can anyone advise how to fix or avoid the output message?
Offhand, I would get the unwanted "message" is some hard-coded application (or script) which is helpfully resetting the xterm dynamic text cursor color. See XTerm Control Sequences in the description of Operating System Controls:
The dynamic colors can also be reset to their default
(resource) values:
...
Ps = 1 1 2 -> Reset text cursor color.
So... somewhere there is some script doing the equivalent of
echo -n -e '\e]112\a
The results probably depend most on what particular terminal emulator you are using. Both screen and tmux filter out escape sequences that their developers did not care to implement, and pass through those that the terminal "should" handle.
Just take a look at sentence you provided: "The 'xterm*' part of the command should be set to whatever your terminal-emulator is declared as."
In my case, the $TERM has value xterm-256color and the corresponding line in ~/.tmux.conf looks like:
set -g terminal-overrides "xterm-color256:smcup#:rmcup#"
Here's what happens. I'm using Vim + LaTeX-Suite to edit TeX files in Vim. This could be in the Terminal or in MacVim.
I happily
Insert lots of $\LaTeX \commands$ etc. I love using the $\backslash$.
TeX works great. No problem.
Then I go and open up a .R file in the same window (different tab). R-Plugin for Vim uses the <Leader> key (mapped to \ as per usual) to execute commands, e.g. I type \sa to send the selection to R and execute and move the window down. Life is nice.
Problem: even though while editing an R file, Vim is nice enough not to bug me in insert mode when I type \, for some reason when I switch back to the tab to edit the TeX file, then type \ in insert mode, it moves the cursor left of the \ and pauses as though waiting for the rest of the command, before then re-moving to the right of the \ and moving on as I type.
Below shows what happens just from typing \ in insert mode; obviously I could reproduce this by moving the cursor to the left with the arrow keys, but that's not how this happened--the cursor just moves left for a split second as though waiting for the R command to finish being input.
So: how can I stop the annoying behavior in the TeX file insert mode, without sacrificing other functionality? Note, (a) I don't expect mapping <Leader> to a different key to help since then that key will just have the same left-cursor-move problem in TeX; (b), I like the leader as \ anyway so I don't want to change it.
Put this line in your vimrc (requires Vim-R-plugin >= 0.9.9.2):
let g:vimrplugin_insert_mode_cmds = 0
If the problem persists, you can do the following in Normal mode to know what are the keyboard shortcuts in Insert mode:
:imap