copy from vim into stackoverflow for example [closed] - vim

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have being trying to get crtl + V to select all lines of text and then using "+y and "*y but that doesn't seem to work when I try to paste into the forum.
Additionally, I have been to this post and tried changing Vims /.vimrc with the un-named clipboard option but that hasn't worked either.
How can I copy from Vim into a forum post without doing shift + crl + c and then having to remove the line numbers?

Make sure you are using a proper Vim build. The default Vim on most (if not all) Linux distributions is a "tiny" build that lacks clipboard support among other interesting features. You can verify that by running this command in your terminal emulator:
$ vim --version | grep clipboard
A + in front of a feature means that it's built-in, a - means that the feature is missing.
If your Vim has no clipboard support, you should consider upgrading it to a proper build. On debian-based systems, this is typically done with this command:
$ sudo apt-get install vim-gnome
At this point, you should be able to use "+y and experiment with :h 'clipboard.
However, this works only if your Vim runs locally. If you are using Vim on a remote machine, you can't have remote Vim talk to local clipboard unless you use the -X flag upon connection to enable "X11 forwarding" which comes with a variety of side effects and requirements.

Related

Execute my Shell and Bash scripts without starting my terminal in Ubuntu [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 a user of Ubuntu 12.04 LTS and in a future a user of Ubuntu 14.04 LTS.
I have a problem, when I run Ubuntu my .bashrc script doesn't work unless I open the terminal.
This is a problem because, for example, the paths I write doesn't work unless I execute the programs from the terminal.
Are there an user config startup file for Ubuntu and not for the terminal?
P.D.:Maybe I don't explain very well, in other words, I'd like to execute mi scripts on Ubuntu startup without using the terminal.
Shell initialisation files (.profile, .bashrc, etc.) are intended for preparing the user's (interactive) environment.
For standalone scripts, it's better to make them independent from the environment, including
$HOME, $PATH, etc.
If you need to share code (functions, configuration) with other scripts, store that in a separate
shell library that you source from a known location, either through a fixed path or from a
path relative to the script's own location.
you can add the line below at the start of your script file
source ~/.bashrc
grep '/etc/bashrc' ~/.bashrc
if [ -f /etc/bashrc ]; then
. /etc/bashrc # --> Read /etc/bashrc, if present.
by default /etc/bashrc gets loaded when opening a console.
What are you trying to do - if you want to do something without it being executed as part of a console and more to do with system startup ? then you need to look into modifying existing service or adding a new service.
If this is related to when users ssh or connect it via console then its be bashrc file

Issue running vim as a root [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
If this question is not considered to have this place in this forum, tell me I will remove it instantly !
I have installed on my ubuntu a vim plugin (called NERDTree). It works well when I open a file with a non-root status. When I run vim as a root and I try to launch the plugin with :NERDTree, I am told the command 'NERDTree' is unknown. Someone could help ?
Plugins placed in /usr/share/vim/vim7x will most likely be overwritten at the next upgrade. If you want your plugins to be available to root you should install them in /root/.vim.
That said, Vim comes by default with a file explorer plugin called netrw. You may try to learn how to use it (:h netrw) before installing any third party replacement.
Did you install the NERDTree plugin in your home ~/.vim/plugins directory? If so, then the root user probably doesn't "see" it. Move it to the global plugins directory and that should fix it.

where is the vim executable in vim-7.3.tar.bz2 [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I downloaded vim-7.3.tar.bz2, which is said containing source and runtime. I unpacked it but I cannot find the executable for vim program. Where is it?
The usual steps are:
$ ./configure --prefix=/home/username
$ make
$ make install
There are many ways to customize the whole process, you should do $ ./configure --help before anything to have an idea of what you can do.
The first step is where you define all the options used for building. $ ./configure without options just uses the default settings.
The second step is the building itself.
The last step is where the executable is moved to the path given at configuration time, /home/username/bin/vim in my example.
Another solution is to simply do $ make, move the executable where you want and make sure this location belongs to your path or create an alias.
Open source packages seldomly contain both sources and binaries, especially because Vim runs on so many different platforms.
Binary downloads are listed at http://www.vim.org/download.php
You didn't tell the operating system you're on; for Windows, the Cream project (http://cream.sourceforge.net/) provides up-to-date packages and installers; for Linux, it's best to rely on the distribution's package management.
To have a local user (vs. system / root) -install, you either have to hack around the package management (cp. https://serverfault.com/questions/23734/is-there-any-way-to-get-apt-to-install-packages-to-my-home-directory), or compile (with a custom install prefix) from the sources (which you have already downloaded!)
If you want to follow the latest and greatest Vim and continually update, check out its Mercurial repository and compile Vim from there.
Open your old version vim and then type:
:help install
You'll find everything you need there. There is even a section on installing in your home:
:help install-home

Use PSFTP on Linux [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am using Linux Suse 10 and I am a complete noob when it comes to using it that's why I really needed some help.
The scenario is simple. I need to transfer some files from my linux server to a windows pc.
I already did this using FTP commands written inside a .scr file. Here's the content of my Upload.scr :
ftp -n 10.*.*.* <<SCRIPT
user administrator drowssap
cd TESTDIR
binary
lcd /path/of/the/txt/file/
put TESTUpload.txt
bye
SCRIPT
And then I would call it from linux Konsole using :
bash Upload.scr
It was actually working and could successfully transfer files to my windows pc. However, what I need is to transfer the files using "psftp".
The original code which works from windows-to-windows transfer is :
ProcessStartInfo PSI = new ProcessStartInfo("CMD.exe", "/C psftp " + UserName + "#" + IP + " -pw " + Password + " -b UpLoad.scr");
I needed to do the same to my linux-to-windows transfer (i.e. I needed to use psftp instead of just ftp or sftp).
Whenever I tried to type "psftp" on linux Konsole it would display the ff :
bash: psftp: command not found
I know there's something missing. What should I do first to make it work? Should I install some application or .exe file into my linux server?
I really need help.
Thank you very much in advance! :)
psftp is PuTTY's SFTP utility.
OpenSSH has one too, named simply sftp (without the p). It is very likely already installed on your Linux machine.
If you want to install PuTTY's psftp, you just need to run:
apt-get install putty-tools
or equivalent for your distribution.

Linux console: git command not found on x64 Cent OS [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have a completely fresh install of 64 Bit Cent OS 5.7, this is in VirtualBox on top of 64-bit XP.
I'm trying to install SSU.
Problem: The command 'git' was not found. See "code" below please.
Have tried looking this up: /usr/local/git/ does not exist: git: command not found (on OS X 10.5)
I don't care about source code: I just want git to work so SSU will install so I can try to access the bank on what seems like a huge whim.
I am signed in to Gnome as root and seem to be able to access my computer normally without being harassed about passwords excessively and can create or edit files.
[root#localhost ~]# $ git clone https://github.com/wesabe/ssu
bash: $: command not found
Concerns
Unfortunately every single time I ask these kinds of questions and don't make clarifications I end up having to make those clarifications. So...
No negativity or rudeness intended what-so-ever: if the answer involves editing a text file or copy-and-paste actions please tell me the locations to do so in the file manager instead of console commands. I'm perfectly okay copying and pasting console commands for things that really should be done in the console though.
Note: there appear to be numerous "git" commands and numerous "ssu" commands. I do NOT know the difference between them and would really prefer someone who has solid expertise to answer so that I nor others end up accidentally trashing our copies of Linux as it's been very difficult to get anything to work and stay working thus extending my personal stay with XP.
I will be more than happy to both accept an answer and thumbs it up should it be helpful.
I would first try installing git. As root:
yum install git
According to here,
yum install git-core
If that doesn't work you could add the EPEL source. There are also RPMs for git.

Resources