Setting clipboard options from the vim console [closed] - vim

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm trying to use vim on a remote Ubuntu server and I'm noticing that the start up for vim is too slow unless I use the -X flag or have set clipboard=exclude:.* in my .vimrc.
When I use either options, vim starts up fast but the problem is I can't copy from vim to the system clipboard. I've tried numerous times to do :set clipboard=unnamed and the like from the console but it won't register anything because it seems to only connect to the x server if that line is in .vimrc.
How can I start vim with the -X option but start the x server afterwards (only if I need to copy stuff)? Or how can I change clipboard settings from within the console?

If you have to start Vim with -X, I don't think there's a way to later enable clipboard support. You either have to find and fix the root cause for the slowness of connecting to X, or work around this with external tools, e.g.
:3,5w !xsel --clipboard
or
:3,5w !xclip -in -selection clipboard

Related

how can I set my new new terminal to retain session of previous terminals? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
In linux, (on my mac, i can do this in the settings in iterm2) how can I set up my terminal emulator so that my session is maintained for each new terminal I open?
eg: if I am in ~/code/ folder in my terminal, the I open a new terminal, i should be in the ~/code/ folder in the new terminal too, not ~/
my usecase is that I don't lose context when working with i3
is there a setting or a recommended emulator that can do this, is it possible to complete this implementation programmatically?
I'm not sure why you want to do this, as you can simply reach a "frequently" cded directory by searching in the history of commands.
However, if you really want to do it, one (dirty?) trick would be adding this in your .bashrc:
# this is in ~/.bashrc
exit() {
sed -i '${
/^cd /{c\cd '"$PWD
"'q};a\cd '"$PWD
}" $HOME/.bashrc
command exit
}
What it does is (implicitly) printing all lines up to and including the second to last line, then on the last line ($) it checks if the last line starts with cd followed by space; if it does, it changes it to cd $PWD and quits; if it doesn't, the cd $PWD line is _aappended.

Speed up VIM cursor moving through j/k [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
On my friend new Mac, he scrolls from line #1 to line #100 using k in around 4 seconds.
On my Mac, it takes 10 seconds. Neither of us know what causes his MacVim scrolls that fast.
Any way that I can improve the speed of scrolling on my MacVim? I already enabled ttyfast and lazyredraw
The problem might be the difference in your keyboard settings instead of Vim. Try changing the Key Repeat setting in OS X' keyboard settings and see what happens. On my MacBook this setting affects the cursor movement speed when holding h, j, k or l.
As mentioned in comments some software such as KeyRemap4Macbook can override the system settings.
Also consider using commands ^U, ^D and G instead of hjkl when navigating around longer files.

How to open applications after booting a purely Command line interface of Linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
After booting linux in purly command line mode how can I open an application eg web browser or Libra Office?
For example if I use the command "play" with any audio file it starts to play it. I want to know commands for other applications
You have to start an X Window session before you can open those applications because they depend on it to render the GUI. To do this you can use the startx command.
There is a good description here on how to use startx.
However, doing it this way can be a lot of manual and tedious work. That's why most linux distros have packaged full window managers like Gnome, Xcfe, etc for you to install with a single command. If what you really want is a minimal one you might look at Fluxbox or Openbox. You can learn a lot about the guts of X by installing and configuring them on your own.
I suspect what you may really need is just to edit text files and get resources from the internet while logged into a Linux box that is command line only. If so, you can check out these command line only tools.
Lynx command line browser
WGet internet file retriever
EMacs text editor
Vim text editor

How to make xterm command line works like vim [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I'm working on RHEL environment, and using xterm.
My question is that how to make the xterm command line works like vim instead of emacs (eg, selection, copy, paste, keyboard shortcuts)
Thanks!
The bash command to turn on vim-style editing is
set -o vi
As it was already mentioned, this has nothing to do with the terminal(emulator) you're using. In case you use zsh, you can enable vi-like bindings with:
bindkey -v
The Emacs-style keybindings to which you are referring are actually a feature of the Readline utility.
While adding, set -o vi to the end of your ~/.bash_profile should suffice (if you're a bash user), this utility can also be controlled through the use of an ~/.inputrc file.
Create an ~/.inputrc if it doesn't already exist and append this:
set editing-mode vi
set keymap vi-command
The benefit of this approach over set -o vi is that this is read wherever readline is used include the MySQL command line interface and Ruby's IRB.
See this post for more Vim-related readline tips:
http://vim.wikia.com/wiki/Use_vi_shortcuts_in_terminal

Two questions about bash commands / Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I need answers for those questions:
How and where can I change default app in user profile in Linux?
How can I save changes in vi editor without exiting? I guess it's w q q! but I'm not sure.
How and where can I change default app in user profile in Linux?
I guess you refer to the editor. If so, use the following:
export EDITOR=vi #or whatever other editor
To make it permanent, add this line to the .bashrc file in the home of the user, that is in ~/.bashrc.
How can I save changes in vi editor without exiting? I guess it's w q q! but I'm not sure.
use :w to save. You have to be in the command mode (go there pushing Esc).

Resources