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

learn more… | top users | synonyms

0
votes
0answers
5 views

Change colors of statusline in haskell-vim-now

I am using haskell-vim-now, which has many features I like when editing Haskell. However, it also sets a colorscheme I do not like. In my ~/.vimrc.local I already resetted to the default colorscheme. ...
0
votes
0answers
13 views

VIM function for creating new a file with a header including the filename and a timestamp

I have created a VIM function that generates a new file based on the arguments passed to it and based on some zsh variables I have setup. Is it possible to extend this function to insert some a ...
-1
votes
0answers
15 views

Can't locate Vim folder anywhere on linux mint system

I'll try to keep this short. I've been trying to install YouCompleteMe and have had a bunch of trouble, so consequently I have installed and uninstalled vim a few times. Now my problem originated ...
3
votes
2answers
45 views

What is the problem of giving the right to use sudo vim? [closed]

I'm using Mac OX 10.10. I would like to know what problems are caused by this: user ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf I think this is in /etc/sudoers. I also have Cent OS. Does this ...
0
votes
1answer
12 views

Not all Vim Text Transparent

I am using the following commands after setting the color scheme to make my vim transparent: highlight Normal ctermbg=none highlight NonText ctermbg=none highlight SpecialKey ctermbg=none However, ...
0
votes
2answers
14 views

how to locate vim which installed by brew?

I have installed a vim using brew, and it was installed to a very different place, and now I want to locate that vim, in a shell script, is there a good approach for this?
0
votes
0answers
26 views

vim frequently does not display text

My vim frequently does not display (some) text in terminal. It just shows blank area. If I attempt to select (either through mouse or keyboard), the text would appear. The issue is more severe in ...
0
votes
1answer
21 views

What is the format of the default statusline?

I read about how to update the vim statusline here. And I am able to update it successfully. But, I would like to retain the format of default vim statusline and just add some more info to it e.g. ...
0
votes
1answer
16 views

how do I install both neovim and vim plugins which are in the same .vimrc file?

I'm new to neovim and would like to know how to install both neovim and vim plugins which are in the same .vimrc file?
1
vote
0answers
25 views

Bash completion function for vim 'scp://' Paths

For easily editing remote files with vim, I currently use a few .vimrc and .bashrc additions to my environment. The bash-scripting side of it "misuses" the available standard _scp bash completion ...
0
votes
1answer
16 views

How to redirect the echoed code content of `:function FunctionName` into current file?

I've learnt how to put variable value to file with this Stackoverflow link. e.g. :let L = [1,2,3] :put string(L) [1, 2, 3] It seems the method mentioned in above link is dealing with the ...
-1
votes
0answers
47 views

Vim: how to search +

I need to search the character + in a file,how to do with vim? I have tried /+ /\<+\> But don't work Edit: my fault /+ works fine
0
votes
1answer
22 views

Why my dict methods works well without defining with extra `dict` argument ? [vim]

My piece of code looks like: :let ClassZ = {'author': "Juchen.Zeng"} :function ClassZ.Print_author_name() : echo self.author :endfunction :function ClassZ.Change_author_name(arg1) : let ...
0
votes
1answer
12 views

Is there another brief way to detect if an item in vim list other than `index(L, item)`?

Like in python, there is a syntax i in L to detect if a value in a list. Is there similar syntax in vim other than index() function?
0
votes
1answer
25 views

How to print a vim list to file in ['l', 'i', 's', 't'] format?

Today I learnt that I can use register = to print vim variables to file. However I got some trouble when trying to print a list to file. # Command mode :let L = [1, 2, 3] :echo L [1, 2, 3] # Normal ...
2
votes
1answer
22 views

vim how to unabbreviate

I have abbreviated main to '#include.....', I was looking to unabrreviate it for one vim session, and tried the following :una main I get error 'E24: No such abbreviation'. The problem is, it's ...
0
votes
0answers
29 views

vim no tab completion in bash

When in shell, running vim <anything> and pressing tab, doesn't auto complete or show the list of the available files. Although it auto completes for the directory names, but not the file names. ...
2
votes
0answers
16 views

System clipboard flushed out, once i exit vim

I use yy to access the system clipboard always. yy is mapped to a function as, function! Copy_ToSystemClip() .w !xsel -ob end function inoremap yy Copy_ToSystemClip()<CR> It copies to the ...
1
vote
1answer
459 views

How can I compile a C program that I've edited in Vi or Vim?

I'm trying to compile and run a c project from vim and vi #include<stdio.h> int main(void) { printf("Hello! This is a test prgoram.\n"); return 0; } and i get this output ...
1
vote
3answers
55 views

How to copy contents of a (large) vim file to the OSX system clipboard to paste in other apps?

I like to use vim to edit other (non-programming languages) stuff. So I paste the content into vim and make the changes. How can I copy all of the text back into the primary clipboard for pasting? ...
1
vote
1answer
24 views

How to search for <td>n in vim?

I can search for n with /n/ I can search for <td> with /\<td\>/ But how can I search for <td>n ? When I try /\<td\>n/ i get not found I'm trying to target the ...
1
vote
0answers
26 views

vim issue with tab/space in multi-line abbreviations in vimrc

i am trying to write a vim abbreviation to create a template program in c I have given the abbreviation as below in the .vimrc abbr main #include<stdio.h> \^M#include<string.h> ...
1
vote
1answer
35 views

How to express “There is a specified symbol in the following unknown numbers of characters” in regex(vim)?

I have many python code examples in my markdown files, which should be prepended with >>> symbols. So I write a vim function to do this job: function AddShellPrompt() range let lnum = ...
2
votes
0answers
11 views

Why in “:normal”command ^[ seems doesn't work with A? (vim)

Today, I learnt a bit of vim normal command, and below is my experiment: :normal i Insert ^[ yyp :normal A Append ^[ yyp # RESULT OF EXECUTE FIRST COMMAND FOR SEVERAL TIMES Insert Insert ...
2
votes
1answer
30 views

Vim pausing randomly for a minute or so at a time

I'm running Linux Mint Maya 13.2 on a laptop from a USB stick, and SSHing onto that install from my own work computer. When i'm editing a file with Vim, i keep getting a pause of about a minute where ...
2
votes
1answer
39 views

Vim cursor highlights wrong position

I'm having some weird vim cursor behavior which I'm unable to solve. While I was editing a file, suddenly the cursor marker moved one or more spaces to the right while the cursor actions still ...
0
votes
1answer
26 views

Is it able to echo parallel negative numbers in vim?

In h vim-script-intro. It says - will be interpreter as minus or negative depends on the situation. Thus echo -1 1 will result -1 1, and echo -1 -1 will result -2. Drove by my curiosity, I tried ...
0
votes
3answers
44 views

VIM: What's the quickest way to return from typing :w<enter> in insert mode?

Sometimes I forgot to press ESC to return to command mode and enter :w<enter> in some line I was editing. So I get the following: some line of code:w I was typing ^ cursor position So ...
2
votes
3answers
63 views

Copy vim selected text to system clipboard

My vim is not compiled with clipboard feature. So, i use xsel as suggested by Gilles to copy/paste the contents. I use :.w !xsel -b for selecting the current line and, :w !xsel -b to select the ...
2
votes
1answer
25 views

Strange characters after pressing numeric keyboards in VIM editor

I'm running VIM under GNU screen. When I'm in insert mode and press e.g. asterisk symbol on numeric keyboard, instead of asterisk I get <F3>, when I press e.g. 4 I get t followed by newline. My ...
1
vote
2answers
57 views

Trailing spaces when copying from console

It's this annoying behavior I've been experiencing here and there occasionally: when you select text with mouse in console (that is, copy it), paste it, and realize you've got extra spaces at the end ...
1
vote
1answer
43 views

Write before the cursor

In Vim, I have a #write after cursor A #write after end line I #write at start of line I want to write before a word, for example I want to edit this line My cursor is at the position after ...
0
votes
1answer
24 views

Python feature disabled vim-nox

I have installed vim-nox version 7.4 package in my Debian Wheezy machine from backports. I am confused that the python feature still does not work as shown from vim --version command as -python as ...
1
vote
1answer
28 views

How to insert named register from vim commandline

Using vim I have some troubles inserting the value of a specific register using commandline mode. When in normal mode I can enter the sequence "*p which will put the value of register "* beneath the ...
0
votes
0answers
21 views

writefile() to file descriptor produces output with alignment issue

The command that produces weird output: $ vim -ec 'call writefile(["line1","line2"],"/proc/self/fd/9") | qall!' 9>&1 1>/dev/null 2>&1 line1 line2 $ Same command ...
2
votes
1answer
45 views

How to get clipboard support on a Linux server without X11

I have a virtual Linux development environment running under VirtualBox and Vagrant. I use tmux and vim to setup multiple open vim instances. I'd like to be able to copy and paste between those ...
0
votes
0answers
14 views

Weird UI glitching in VIM adjusting split bar

i just installed gvim on linux mint and I'm experiencing some weird UI glitch when adjusting the split bar and it also seems to happen when making changes to files in the editor. I have similar ...
4
votes
2answers
31 views

Edit columnar data in vim

Data Name Age Madhavan 29 saravana<Tab Press> ! How can i edit this data in vim in a tabular fashion? When i press tab key from column 1 in row 3, ...
0
votes
3answers
47 views

Restore a screen session after shutdown

Not concerned with conventional attaching and detaching, I'm talking about restoring a screen session after shutting down my system entirely. I usually have changed to various directories depending ...
-2
votes
1answer
47 views

ls: No such file or directory [closed]

I have been messing around trying to install macvim to a higher version of 7.4. I finally got it working but now I get the error ls: No such file or directory when looking for a directory. I can ...
2
votes
1answer
76 views

Editing multiple files simultaneously with vim/gedit

I'm trying to save some work by editing multiple files with the same name located in different directories: $ mkdir -p directory_{0..10}/results How may I create files with the same name in all ...
0
votes
1answer
29 views

Wrap all lines with character sequence in vim

So basically I copy/pasted some code, and I need to prepend and append some more code to each line. Each line is a function call, and is getting added to a switch statement as it's own case. Right ...
3
votes
1answer
34 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
28 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
41 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 ...
2
votes
1answer
71 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
19 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 ...
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
3
votes
1answer
133 views

terminal color theory

TLDR: What is the theory behind terminal colors? I have a fixed value of LS_COLORS in numbers: ...