vim (Vi IMproved) is a text editor supporting different editing modes.

learn more… | top users | synonyms

3
votes
1answer
27 views

Is there a FileType name for files without suffix in vim?

With my current knowledge, I can use command like autocmd FileType markdown colorscheme zen to set colorscheme for particular type of file. Now I have a need to use a colorscheme for all those files ...
1
vote
0answers
21 views

How may I reset a buffer index on Vim?

I'm using MiniBufExpl to manage buffers. In my workflow, I usually work on one thing at a time. I'm opening some files, coding, enjoying. Then, I want to clear my workspace to start with new ...
1
vote
2answers
36 views

Extract lines from a file using vim or teminal

I have the following in a file. I'd like to use Vim or terminal to extract title and its content like this. How can I achieve this? Topic 1 - Core: Algebra 1.1 Arithmetic sequences and series; sum ...
4
votes
4answers
924 views

How can I make shell aliases available when shelling out from Vim?

In my .zshrc, I declare some aliases. Eg, which dbstart shows the contents of that alias. If I open vim from that shell, it is a child process. In Vim, I can run shell commands with :! some_command. ...
4
votes
2answers
408 views

Don't expand command line mapping (cmap) until pressing enter in vim

I have cmap w!! %!sudo tee > /dev/null % in my .vimrc. When I type a w while writing in the vim command line (after :), the cursor stays over the w for a few seconds before moving right. This ...
2
votes
1answer
59 views

Delete from a character above current cursor until cursor position?

Say I have: void SomeFunc () { //stuff } If my cursor is where the { is, how can I "delete up to )" ? In other words, how can I get : void SomeFunc (){ //stuff }
1
vote
1answer
17 views

vim: Automate context-sensitive parenthesis replacement with surround.vim

I am using vim with the surround.vim plugin and want to replace all occurrence of sin(...) with sin[...] in a (very long) mathematical expression (containing matching parenthesis). Example input: ...
0
votes
0answers
6 views

redirect help info to vim [duplicate]

I use this kind of commands to redirect help info to vim, for example: man ls | col -b | vim -R - but for some help info highlighted with color: celery -h there is a mess in it. How to make it ...
35
votes
8answers
31k views

How to copy text from vim to an external program?

I'm trying to copy-paste some text from vim. I'm doing v to enter visual mode, then y once I selected my block. It appears to copy the text into vim's clipboard, because p will paste it. But in ...
0
votes
0answers
11 views

Synchronize strings copied on vim with the xserver clipboard [duplicate]

How to copy a string in vim under terminal and get it available in the main clipboard? Seems that by default, is not possible to copy from vim to my browser, for example
1
vote
0answers
73 views

Fetch patches from mailing list with mutt and vim

How can I fetch patches from a subscribed development mailinglist with mutt and vim so that they can be applied with "git am" or "git apply" command easily? Is it either possible to save it ...
3
votes
1answer
96 views

terminal color theory

TLDR: What is the theory behind terminal colors? I have a fixed value of LS_COLORS in numbers: ...
16
votes
2answers
302 views

How do I save the changes to my vim buffer as a patch file?

Is there a way to save the changes I made to my vim buffer as a patch file for the original file, without saving it as a separate file and using diff?
35
votes
5answers
25k views

vim - better colors so comments aren't dark blue?

Mostly I edit ruby files, although shell script file comments are also # Currently my comments show as dark blue on black which is really hard to read. See screenshot. How can I change their color? ...
1
vote
2answers
72 views

Installing VIM with Python support locally without sudo

I'm trying to install VIM with Python support on Linux without sudo, but for some reason VIM always gets installed without python ( -python in vim --version ) I first installed Python locally by ...
8
votes
2answers
1k views

Match word containing characters beyond a-zA-Z

To match a word one can use \v(\w+) From the vim help :h \w: \w word character: [0-9A-Za-z_] This works exactly as described in the manual. However, I want to match words that contain ...
1
vote
2answers
20 views

Cursor points to bottom when a zip file is opened with vim

I am trying to open a .zip file via vim. By default the cursor points to the bottom of the file once it opens. How can I bring the cursor to the beginning of the file as soon as I open a zip file? ...
3
votes
0answers
41 views

mutt: how to display emoji characters correctly?

I'd like to be able to see emoji characters properly in mutt, but e.g. 💗 shows up as ^J in mutt's pager. Running :set pager=view and re-opening the message displays the character correctly with ...
9
votes
3answers
668 views

How to scroll large datafile while keeping header

Suppose I have some large datafile, which overflow the screen in both vertical and horizontal direction. How can I browse this file, while the header-lines stay on the screen? For the moment, I am ...
2
votes
2answers
48 views

Insert “return 0” between all braces in a file?

I'm setting up a fairly large (~50 functions) test library in C++. I forgot that the functions have to return integers. I actually forgot to put a return type at all, how dumb is that? I added the int ...
1
vote
1answer
23 views

How do you downgrade multiple packages in arch linux?

I am trying to downgrade the vim package on arch linux to an earlier version (as I need to use an earlier version of ruby which breaks it [ref]). running downgrade vim and selecting the version ...
1
vote
1answer
25 views

Pasting with vim squeezes content in between previous content and margin

I'm learning my way around the vim and got around to copy-paste. Or yank-paste. Now when I try to paste a yanked piece of text, it pushes previous content to the right and squeezes in on the left. I ...
0
votes
0answers
30 views

Vi help problem with / in command mode

Hope someone can guide me in the right direction. I have an issue with the vi text editor, when in command mode after I enter ":" and want to use "/", the forward slash does not come up. What I get is ...
1
vote
3answers
115 views

VIM solarized color scheme looks wrong when using tmux

I am trying to use the solarized color scheme in VIM using gnome terminal (Ubuntu). When I run vim without tmux, it looks great, see below: If I add the following commands to my .bashrc # tmux ...
1
vote
3answers
859 views

Unmet dependencies [closed]

I am trying to compile vim and install with "--enable-pythoninterp" flag, which needs the python-dev package. INFO I obtained the vim source from ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2 Vim7.3 ...
1
vote
0answers
52 views

Installing a light vim colorscheme on gnome-terminal

I'd like to install a light color scheme for my vim, but it never seems to work (I tried several now). What I'm trying to obtain is something like you can see in this screenshot of mayansmoke: ...
3
votes
1answer
985 views

vim: hide status line in the bottom

Sometimes I work with really small terminal windows and need every piece of space available. So I want to hide the vim status line. I already set laststatus=0 this hides one of the status lines. But ...
3
votes
1answer
1k views

ls and vim color on SunOS 5.8/Solaris 8

I want to use ls and vim with color on Sunos 5.8 SunOS 5.8 Generic_117350-11 sun4u sparc SUNW,Sun-Blade-2500 I have installed ls (GNU coreutils) 6.9 and vim 7.2 In ~/.cshrc: setenv TERM sun-color ...
1
vote
0answers
31 views

How to use vim-slime from within a single tmux session?

I'm trying to integrate ipython and vim through a single tmux session using the popular vim plugin "vim-slime." The problem is that while I can get it to work fine provided that vim is opened in a ...
19
votes
3answers
14k views

How can I set “vi” as my default editor in UNIX?

I believe I can do something like export EDITOR=vi, but I'm not sure what exactly to enter, and where. How can I set "vi" as my default editor?
2
votes
1answer
49 views

How to clear search and command history in Vim?

If you search something in Vim by prepending searchterm with a forward slash, e.g. /searchterm, Vim puts that searchterm into the search string history table. You then are able to navigate through ...
2
votes
1answer
18 views

Setting up a secondary Vim environment

I've setup the YADR dotfile repo on one of my machines, and find it very powerful/useful. Though it's definitely slower than my present Vim setup with all its plugins, I'd still like to be able to ...
-1
votes
2answers
39 views

Vim,how to escape &?

Simply question,i want to search & as exact word,how to do in vim? I had try \& and \<&> but doesn't work
6
votes
1answer
59 views

How can I make `sudo crontab -e` use my `sudoedit` environment?

I've started using sudoedit <file> instead of sudo vim <file>. One of the advantages is that it uses my local ~/.vimrc. However, when using sudo crontab -e, it uses /root/.vimrc instead. ...
0
votes
1answer
17 views

Vim - inconsistency between :tabnext N and :tabprev N

From Vim's :help tabs: :tabp[revious] {count} :tabN[ext] {count} {count}<C-PageUp> {count}gT Go {count} tab pages back. Wraps around from the first one to the last one. While ...
0
votes
1answer
22 views

Create parameterized keybindings

I'd like to map +Ngt and -Ngt to :tabnext N and :tabprev N. I can create key bindings such as: nnoremap <buffer> <silent> +1gt :tabnext 1 nnoremap <buffer> <silent> +2gt ...
1
vote
1answer
696 views

Vim colorscheme background not filling terminal

I am using vim with lxterminal, and the colorscheme kolor, and I am experiencing an issue where vim's background color does not fill the entire terminal. It can be seen clearly at the bottom of ...
6
votes
2answers
1k views

Can vim display ASCII characters only, and treat other bytes as binary data?

I already know vim -b, however, depending on the locale used, it displays multi-byte characters (like UTF-8) as single letters. How can I ask vim to only display ASCII printable characters, and ...
0
votes
1answer
31 views

How can I expand directories by default in Vim's netrw tree view?

I can make netrw use the tree view by default by adding this to my vimrc: let g:netrw_liststyle=3 But I can't figure out how to expand sub-directories by default, is there a way?
1
vote
1answer
56 views

White terminal cursor and yellow Vim searches

I have a blinking block cursor in the XTerm. The goal is to always be able to tell my current position. It usually works fine, but it fails when I place my cursor on a background similar to the cursor ...
17
votes
5answers
2k views

Vim interface on web browser input fields?

I am looking for a browser plugin which inputs textin of input boxes with the same keyboard interface of the Vim text editor. I have adopted Vimium which makes general navigation much more effective, ...
1
vote
1answer
35 views

Cannot get vim to recognize unicode

I am having the most trouble ever getting vim to recognize unicode. At the top of my vimrc I have set encoding=utf-8 set fileencoding=utf-8 and LANG shows echo $LANG en_US.UTF-8 but when I open ...
1
vote
0answers
37 views

does vi have a bug which changes spaces in unedited lines, or is there an option to turn this “feature” off?

I changed a file by just adding a few lines, then ran a git diff and found changes strewn throughout the file resembling as shown in the image above: an extra space at the end of a line in the ...
26
votes
4answers
2k views

How do I remotely edit files via ssh?

I have to edit some files placed on some server I could reach via ssh. I would prefer to edit these files in customized vim on my workstation (I have not rights to change vim settings on remote ...
1
vote
4answers
66 views

Comparing files with vimdiff from a script

I'm writing a script to compare two directories recursively and run vimdiff when it finds a difference: #!/bin/bash dir1=${1%/} dir2=${2%/} find "$dir1/" -type f -not -path "$dir1/.git/*" | while ...
0
votes
1answer
24 views

vim: multiple substituons like sed

Simply question,with sed is possible to do a multiple substitution sed -e s/uno/due/ -e s/uno/due/ Is possible something similar with VIM internal substitution? :'<,'>s/445/53/a/444/53/g ...
2
votes
2answers
97 views

How to escape correctly this word on vim?

I want to substitute this word ${ARRAY1[@]} with $1 on vim substitution command I did :%s:\$\{ARRAY1[\@]\}:\$1:g But give me error about number of repetition,i try also "" but doesn't work How to ...
1
vote
2answers
133 views

Set makeprg to gradlew

First a bit of context for those who don't know gradle. It's basically like make except that you don't have to have gradle installed on your computer. It ships with projects as a file called gradlew. ...
0
votes
0answers
19 views

Plugin to fix vim's key bindings in terminal

Is there somewhere a plugin for vim which fixes all (most of) the keys issues related with using vim in terminal? If no could you recommend anything which could automate this feature? May be ...
0
votes
3answers
41 views

Vim replace in a visual mode

In a block of test like this cron.allow cron.deny I want to substitute cron with at,only in the range selcted by visual mode(ctrl+v) So i press ctrl+v : and appear the ! prompt ok I do sed ...