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

learn more… | top users | synonyms

0
votes
1answer
39 views

How to change the word to be inclined in vim? [closed]

Is it possible to write a word in italic format in Vim?
0
votes
1answer
626 views

Trying to use portsnap to install vim in FreeNAS

I am trying to install vim in FreeNAS but when I try to use portsnap, I get "command not found". When I tried using pck_add -r portmaster I get the following: pkg_add -r portmaster Error: Unable ...
0
votes
2answers
118 views

Vim capitalize only first letter of first word

On Vim i have this txt file stringa1 minuscolo stringa2 minuscolo stringa33 minuscolo stringa44 minuscolo I want become Stringa1 minuscolo Stringa2 minuscolo Stringa33 minuscolo How to do in ...
1
vote
1answer
97 views

Why is vi (but not cat) showing ^[[31m[^[[m^[[31m" after I use sed and output to a file I then edit? [closed]

When I use cat Variables/user-extensions.js | sed -e 's/css/XXX/' on an input file of the form storedVars["css_body"] = "css=body"; storedVars["css_main"] = "css=main"; I see output such as ...
1
vote
1answer
35 views

Different behavior of `vim -R` and `view`

Manual page on vim ($ man vim) states: view Start in read-only mode. You will be protected from writing the files. Can also be done with the "-R" argument. But, they have major differences....
3
votes
0answers
371 views

ViM and Python says the encoding is ANSI_X3.4-1968

In ViM, the following command (using Python 3.4.3) outputs ANSI_X3.4-1968: :!python -c "import sys; print(sys.stdout.encoding)" However, I want UTF-8 everywhere. In .vimrc, I do have set encoding=...
1
vote
0answers
26 views

How to save/reload split windows in vim?

How do I get the same split-settings back if I exited vim with :qa?
1
vote
1answer
95 views

How to change default vim colon commands?

I know how to remap keys in .vimrc, but that's not what I want to do. I want to change a colon command; specifically, I want to change or remove :X (that's a capital "X"). I always type it when I'm ...
4
votes
2answers
248 views

What does the '!' really do when it's added to an ex command (:wq! | :w! | :q! )?

I understand that it means force to do something. When doing $ vim -R file I enter in read-only mode, but this works as preventive mode only -R Radonly mode. The 'readonly' option will be set for ...
1
vote
0answers
60 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. ...
1
vote
1answer
161 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 on some zsh variables I have setup. Is it possible to extend this function to insert a header into this ...
3
votes
2answers
57 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
61 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
117 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
40 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 ...
2
votes
2answers
580 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
87 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
1answer
107 views

Bash command-line completion function for vim and emacs 'scp://' remote file paths

For easily specifying remote files for editing with vim or emacs from the shell, I would like to have tab-completion like available for scp. Completions for scp work well and fast, if your .ssh/...
0
votes
1answer
22 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 ...
0
votes
1answer
25 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 self....
0
votes
1answer
15 views

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

In python, there is a syntax i in L to detect if a value is in a list. Is there a similar syntax in vim other than index() function?
0
votes
1answer
46 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
45 views

vim how to unabbreviate

I have abbreviated main to '#include.....', I was looking to unabbreviate 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
74 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
47 views

System clipboard is 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
687 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 madona@madona-...
1
vote
3answers
395 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
32 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 <td&...
1
vote
1answer
142 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> \^M#...
1
vote
1answer
40 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 = a:...
3
votes
1answer
36 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
73 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 ...
3
votes
1answer
97 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
32 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
60 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
288 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 ...
1
vote
1answer
87 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 ...
2
votes
3answers
691 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
54 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 this....
0
votes
1answer
105 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 ...
2
votes
1answer
117 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
46 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 ...
3
votes
1answer
287 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 ...
4
votes
3answers
46 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
311 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
146 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
144 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
33 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
45 views

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

With my current knowledge, I can use commands such as autocmd FileType markdown colorscheme zen to set a colorscheme for a particular type of file. I have a need to use a colorscheme for all those ...
1
vote
0answers
89 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 buffers....