Questions tagged [linux]

For questions specific to the Linux operating system.

Filter by
Sorted by
Tagged with
29
votes
2answers
13k views

How do I get Vim to be able to run both python and python3 on a Linux system in the same session?

On Linux systems, packaged Vim typically has only one of either python or python3 enabled. It is possible for both to be enabled (using python/dyn and python3/dyn), but during a session, only one can ...
26
votes
2answers
9k views

Why is Vim for Debian compiled without clipboard?

I'm curious as to why the default Debian package for vim (the one you normally get by sudo apt-get install vim) isn't compiled with clipboard support? Neither the regular -clipboard or -Xterm-...
19
votes
1answer
6k views

How do I get +clipboard support in Fedora 20?

It seems to me that neither "+p nor "*p works for me. How can I know if my Vim is installed and set up properly to make them available? And if it's not set up, what can I do to set it up? I'm running ...
17
votes
2answers
5k views

Prevent Vim from clearing the terminal after exit

If I do: $ less file And press q to exit less, I stil see the same text as I had on the screen when less was still running. However, if I do $ vim file And :q, my terminal is blanked... ...
15
votes
1answer
12k views

How to change the space between lines in vim?

I'm wondering whether changing the space between lines is possible. How can I change "Line spacing"?
15
votes
1answer
19k views

How do I use the system clipboard with Vim in Arch Linux? [duplicate]

I am using Vim on Arch Linux through urxvt. Since there is no "Ctrl-V" or "Ctrl-Shift-V" support in urxvt, there is no way for me to paste things I have copied from my browser (let's say) into my vim ...
14
votes
3answers
11k views

How do I tell if Vi or Vim is installed on my Linux distribution?

I use Kubuntu 14.04 with its default installation (bash, Konsole). I want to learn a powerful, all-keyboard, text editor, and settled on one of these: Vi, Vim, Emacs, (and I'll learn Nano since it's ...
13
votes
2answers
429 views

Raise window holding swap file

From time to time while working on multiple projects, and / or what ever, it leaves me with (too) many Vim instances open – as happens, I open a file which already is opened elsewhere, leaving me with ...
12
votes
7answers
12k views

how to change python interpreter used by jedi-vim

I have Anaconda (including python3.5.2), VIM (7.4) and Jedi-VIM installed on my system. There was also a python installed on the linux system by default. The autocompletion is working on base ...
12
votes
5answers
17k views

How to copy across terminals?

I'm using Linux system. Two vims are opened in two terminals. Now I'd like to copy text from A to B. One way to do so is to select text in A, use mouse to copy, then switch to B, in the insert mode, ...
12
votes
1answer
2k views

Spell mistakes have weird coloring

I am using spell checker in vim, and I find one feature very annoying: errors are being highlighted with some weird color, which is nowhere to be found in gnome terminal settings: I would like to ...
12
votes
1answer
1k views

How to use backtick-expansion to populate the arglist?

From help :help backtick-expansion: On Unix and a few other systems you can also use backticks for the file name argument, for example: :next `find . -name ver\\*.c -print` :view `ls -t *....
10
votes
3answers
1k views

How to delete till the end of the previous line?

An example (The ^ is the cursor position): Before: a bc def ghi j k l mn o p q rs ^ After: a bc def ghimn o p q rs ^ or at least: a bc def ghimn o p q rs ^ I know I ...
8
votes
2answers
4k views

How can I build vim with just python 3 support?

I'm on Arch, and recently the vim-python3 and gvim-python3 packages were removed, so I'm working on building vim from source such that the :python command will act as python3. Specifically, I'm doing ...
7
votes
1answer
2k views

Run bash command on writing a file with a particular extension?

I want to run a bash command on writing a .less file, saving it and generating the corresponding .css file with the same name and in the same directory. I do have the bash command which generates the ....
7
votes
2answers
2k views

gvim window looks bad

I don't know why my gvim windows looks like this in linux. Is there anything I need to add to my vimrc file in addition to this? execute pathogen#infect() syntax on filetype plugin indent on set ...
7
votes
1answer
10k views

How to build vim from sources with GUI support?

I am trying to build vim from source, especially gvim, to get some of the bug fixes that have been plaguing me in the office repository. I can compile vim fine but gvim is not being generated due to ...
6
votes
3answers
952 views

How can I print from vim using the native KDE print dialogue?

I'm using vim from a terminal emulator, and I'd like to be able to print using KDE's native print dialogue. This would let me select options such as printer, collating, number of copies and pages per ...
6
votes
1answer
647 views

vim, vimdiff, ex, view, rvim and rview: How do they start in a different way when they are symlinks to the same binary?

I just installed version 8 of Vim and notice in the bin directory of the install location that all the above mentioned programs point to the same binary – vim. Then, how does it know when I invoke ex ...
6
votes
1answer
219 views

In Linux, on an extremely long running vim session, calls to system() fail with E484 “can't open file /tmp/<tempfile>”

I've noticed this only on long running vims in my Linux server. I've narrowed down the E484s to lines of my vimscript that call system. I just wonder if there is a way to deal with this because so ...
6
votes
1answer
6k views

How to resolve E303 (Unable to open swap file) on Linux machine?

I get E303 (Unable to open swap file for "{filename}", recovery impossible) when I open a file in vim in my Ubuntu system. I see that the backupdir and directory environment variables are set ...
6
votes
1answer
319 views

How to prevent accidentally piping text to Vim?

I use Vim to edit the output of shell commands all the time. Appending the dash in this line is second nature: $ ./some-command | vim - But every once in a while I get distracted and forget: $ ./...
6
votes
1answer
841 views

How to use a specific vimrc file and still load the usual files?

I'd like to automatically set my Vim preferences on the root account, when I use it (throught a sudo bash or sudo su-like command), without changing the default configuration of the root account (...
5
votes
2answers
3k views

How can I check if Vim is 32 bit or 64 bit? (On Linux!)

How can I find out if the vim I'm using is 32 or 64 bit? I'm using Ubuntu so this doesn't apply to me, I think. Also I checked :version and got this output: VIM - Vi IMproved 7.3 (2010 Aug 15, ...
5
votes
3answers
1k views

How do I open file under cursor, when the filename has a trailing dot?

There is a file with name ./folderA/folderB/file.. And there is text: ./folderA/folderB/file.:abcdefg When I move the cursor on letter B and type <c-w>f, it says E447: Can't find file "./...
5
votes
2answers
591 views

How to change location of ~/.vim

I have Vim 7 installed from my distro's package manager, and I compiled Vim 8 from source. Vim 8 is all in /usr/local. Then I created a new directory in $HOME called ".vim8". I have all my Vim 7 stuff ...
5
votes
1answer
1k views

Weird vertical bar to left of line numbers

Couldn't find anything on this by searching, so hopefully it's not super obvious. Every now and then, through some accidental sequence of keys, a solid bar appears to the left of my line numbers. I ...
5
votes
1answer
2k views

Why does `set nocompatible` result in vim saving extra, all-numeric temporary files?

I've narrowed down a bug in a program I'm working on to (surprisingly) some vim behavior! The program contains a file watcher. When I write a file with vim -u NONE and all the default settings, the ...
5
votes
1answer
59 views

What are the methods of speeding up parsing of a big file using Ex?

I did recently some performance test where I've created artificially 1GB of random text file by: $ hexdump -C /dev/urandom | rev | head -c1G | pv > file which has around 13mln of lines starting ...
4
votes
1answer
1k views

Why does gvim read /usr/share/vim/vimrc instead of ~/.vim/vimrc

:help startup states, under 3. Execute Ex commands, from environment variables and/or files that (for Unix systems) $HOME/.vimrc or $HOME/.vim/vimrc is read and that The files are searched in the ...
4
votes
1answer
4k views

Using vim-addon-manager

I just downloaded and installed vim-addon-manager using sudo apt-get install. I'm not sure what to do next, I entered vim-addon-manager at the bash prompt (Ubuntu 14.04). Here is the output: ~$ vim-...
4
votes
1answer
49 views

Why does spell-check work poorly on my system?

I'm using VIM7.4.488 on ubuntu 15.04 system. I use command :setlocal spell spelllang=en_us for spell checking. It can capture some spelling error as well as words like htb, Cref, iffalse. However, it ...
4
votes
1answer
13k views

Change a font in Vim/GVim in a simple way

I merely want to change a font in Vim/GVim. That's it. This doesn't work: font=Monaco\ 14 I've done a google search and I wonder, why is for such a elementary task there's no simple answer which ...
4
votes
1answer
118 views

Is loadview conflicted with readonly mode?

When i used following code to keep my folder view, it seemed that vim -R and view don't work at all (Only [readonly] was shown but it didn't work at all). Is there any misunderstanding about it? " ...
4
votes
2answers
448 views

how to stop vim suspending when using gx

When I press gx over a link in vim, it opens it in an external application, when it does this it also suspends Vim. How do I prevent it from suspending Vim, so that I can use Vim while browsing ...
4
votes
1answer
503 views

Understanding :help set-termcap

I would like to define some mappings involving key combinations like <S-F1> or <A-d>. For example something like this: nnoremap <A-d> :echo "hello world!"<cr> However, on my ...
4
votes
1answer
3k views

How to redirect the output of a command as the quickfix list to a vim server / function?

When I click on a link in thunderbird and firefox is already running, it doesn't open a new window, just a new tab. I want the same thing for vim: no matter where I am and how I send a bunch of files ...
4
votes
1answer
2k views

How to debug a segmentation fault?

I assume this is coming from a Vim plugin, but I get no leads on where to look. What's the best way of debugging it? Vim: Caught deadly signal SEGV Vim: Finished. [1] 8119 segmentation fault
4
votes
0answers
57 views

gvim: Make the mouse follow CTRL-W_j and CTRL-W_k

I run a Linux/GNOME laptop where the focus follows the mouse, and I have vim's mousefocus feature turned on, so the selected viewport follows the mouse, too. But when I try to switch viewports using ...
4
votes
0answers
333 views

How to remap <C-[> on linux [duplicate]

I have the same vimrc file for both Windows and Ubuntu environments. It works fine on both platforms, except for one difference. The line: nmap <C-[> <C-t> is working fine on Windows, ...
3
votes
2answers
2k views

Why does “set ruler” get reset to noruler?

I have set ruler in my .vimrc. If I run vim and then :verbose set ruler? to check the status of this setting, on Ubuntu Linux it says : noruler Last set from ~/.vimrc At the bash prompt, ...
3
votes
3answers
1k views

How to show all unsaved files opened in vim?

I'm not sure if I should ask this problem on vim or on Linux/Ubuntu forum. The thing is, I opened multiple terminals on my desktop, and several of them opened various of *.txt files. Not all of them ...
3
votes
4answers
207 views

Vim search and replace “/” only from string between round bracket [duplicate]

I have string lets say count number of elecment when tra(XYixe0/en_in/old)='mid/2' rise='corse/2' I want to replace / from (XYixe0/en_in/old) to . My output string should look like count number of ...
3
votes
1answer
37 views

GUI support will not compile in latest from github

I'm using CentOS 7.5. I just did a git pull in my clone of the vim repo to the latest: last tag v8.2.2340. I'm trying to compile. No matter what I do, it will not compile for the GUI (which it's ...
3
votes
1answer
216 views

How to escape filename containing single and double quotes mix?

Let's say i create a filename with this: xb@dnxb:/tmp/test$ touch '"i'"'"'m noob.mp4"' xb@dnxb:/tmp/test$ ls -1 "i'm noob.mp4" xb@dnxb:/tmp/test$ Then vim . to go inside Netrw directory listing. " ...
3
votes
1answer
3k views

Backspace inserts “^?” in vim

I'm using vim editor in linux and every time I type backspace it inserts a "^?" instead. I DID edit the .vimrc file to include backspace=indent,eol,star but it did not help. I also tried backspace=2 ...
3
votes
1answer
83 views

Maps literally read < and > instead of the actual character

Situation Entire .vimrc: inoremap a <CR> Action: user types ia to enter insert mode and type a Expected result: a carriage return is entered into the document Actual result: the characters &...
3
votes
1answer
385 views

How can I securely restrict vim access to a single file?

So first, I realize that this question is slightly out of the ordinary for this site. I will explain the backstory to avoid the XY problem. Over on Programming Puzzles and Code Golf, lots of users (...
3
votes
2answers
356 views

Using vim as manpager: works on Linux, fails on macOS

:h manpager describes how to use vim as a manpager: Works on: - Linux - Mac OS - FreeBSD - Cygwin - Win 10 under Bash Untested: - Amiga OS - BeOS - OS/2 For bash,zsh,ksh or dash ...
2
votes
3answers
5k views

How do I turn Vi colors off in Ubuntu Linux 14.04

How do I turn vi colors off? I was using vim-tiny on on Ubuntu 14.04. Installed vim-nox. Version is version 7.4.52. Once I installed that, I got all these syntax colors by default. I have my Terminal ...