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

learn more… | top users | synonyms

4
votes
3answers
335 views

Open file with started vim from outside (in terminal)

I have a started vim. I suspended it (Ctrl+Z). So I was in terminal session and I would like to open some file with the same vim session (new tab). I can open the file in new vim session. Actually, ...
0
votes
1answer
33 views

vimdiff to compare output instead of files

I am trying to compare two command output (no files) vimdiff "$(tail /tmp/cachain.pem)" "$(tail /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem)" I tried playing with redirection, pipe, and vim - ...
0
votes
2answers
31 views

How to make a .vimrc command dependent on a file existing?

My .vimrc uses pathogen by doing execute pathogen#infect() However if I set up a new computer and haven't installed pathogen with mkdir -p ~/.vim/autoload ~/.vim/bundle && \ curl -LSso ...
2
votes
1answer
53 views

VIM with Python - Multiple # do not get colored as a comment

Something changed on my system and now VIM screws up syntax highlighting of commented lines. This makes having 'debug' lines very difficult as it looks like the line is still active based on the ...
0
votes
1answer
38 views

Show colors in gVim embedded terminal

Does anyone know how to show colors in the gVim embedded terminal? For instance when you do a !git diff file.c.
0
votes
1answer
22 views

syntax highlghting in vim

I have text files which have extensions *.sc. So to make syntax highlighting for some of the keywords in that type of text files I created ~/.vim/syntax/sc.cim. Below is the file content. user $ cd ...
2
votes
2answers
62 views

Screen - weird behavior after exiting Vim

I am facing problems with my configuring screen. My screen.rc is very simple and looks like this: altscreen on termcapinfo xterm ti@:te@ I wanted to configure screen to have the same behavior as ...
1
vote
1answer
38 views

Why CR sequence (\r) getting entered in .vimrc file?

Please look at my '~/.vimrc' file below. :map g :w :map g :w See, the same line repeated. After writing 1st line, I pressed the "Enter" key. Now see the output of the od command below. ...
0
votes
1answer
47 views

Color encoding for shell script

I using KSH shell as my linux environment. I am writing shell script for one of my project. Currently shell script does not shows color encoding for variable ,etc. It comes in black and white mode. ...
1
vote
1answer
49 views

Why do I have to press space after a command in Vim?

I frequently run into the situation that I have to press space to "actuate" the command I entered, e.g. after I hit ~ to swap case of a letter. Why is that?
0
votes
1answer
106 views

How to upgrade Vim 7.2 to 7.4 latest on Red Hat 6.6 the easiest way? [duplicate]

I'm a Vim user, and usually I just install vim via a one liner "apt-get install vim", but for red hat how can I update the 7.2 version to 7.4 with a one liner? I googled it and many places tell me to ...
4
votes
2answers
254 views

Set the bash display [while using GNU Screen utility] to not show the vim text after exit

Currently when I am not using screen utility, I am able to see the VIM content wiped out of the display when I quit VIM. However when I am using GNU Screen utility and opening a file in one of the ...
0
votes
2answers
28 views

Edit text with vim

I am trying to write command in Vim which can delete 9 and 11 symbols in third line. I did this 3s/9, 11/// but nothing happened as I expected it to be. It would be grateful to do this with your ...
1
vote
1answer
49 views

vim: Match WORD in current block with balanced brackets

When matching in vim there are words, WORDs and blocks among other things. Now for editing code, blocks are useful, words are somewhat useful, but WORDs are mostly useless, because they often include ...
0
votes
0answers
72 views

Tmux session name background color persists between sessions

I have tmux set to display the session name in the left status bar. The background color of the session is either red or green depending on if I have failing tests or passing tests. When I switch to ...
0
votes
0answers
47 views

How to run a command from vim and direct output to /dev/null

When writing a .tex file, I want to be able to view the pdf of the file. I remapped \e to show the pdf file in evince as below: nnoremap \e :!nohup evince %:r.pdf & >/dev/null ...
2
votes
1answer
75 views

Move one screen row up/down in a multi-line text

I have a multiline text in my Vim editor as, One line of text is spread across multiple lines as shown above. For editing, i would like to move up/down one display line (screen-row) at a time. But ...
0
votes
1answer
52 views

How can I change my tmux color scheme based on the time of day?

I just implemented a few lines into my .vimrc that changes the color scheme from SolarizedDark to SolarizedLight based on the time of day. " Solarized light during the day, solarized dark during the ...
1
vote
1answer
60 views

Where to find the .vim directory?

I'm trying to find out my .vim file which is a hidden file and that should be in my home , I want to install a vim plugin and for that i need to access the plugin folder which is in .vim file. I'm ...
0
votes
1answer
56 views

vim won't open with plugins installed the pathogen way

I recently found out about vim-pathogen, and installing vim plugins on my Mac has been working great. I tried using vim-pathogen on an external Linux cluster, but as soon as I clone a plugin ...
0
votes
0answers
26 views

Nano: Rember cursor position at start

Can Nano save the current position of the cursor at exit and, when you reopen the file, restore the old cursor position, like vim does?
2
votes
2answers
57 views

Vim: copy from file to clipboard [duplicate]

I ask a simple question: how to copy from a text file using vim,and paste to clipboard? If i use yY I can paste,but only on vim file(using p),on clipboard i can't paste content. If i use "+Y paste ...
2
votes
0answers
113 views

tmux causing bold fonts in vim

I have installed tmux with vim, using the solarized colorscheme and airline plugin. All is good until I start tmux, where all the font turns bold and the airline status bar is looking weird. I have ...
2
votes
2answers
42 views

Keep transparency at end of file vim

I am using urxvt, when using vim the transparancy after the end of the file I am editing isn't working it is just a solid color with '~' on each line. This problem only happens when using a custom ...
0
votes
1answer
50 views

executable bit on files created by vim

Is there any setting for vim create new files with full permissions? that is falling just under the umask restrictions, and only on files created by vim. It shouldn't modify the bits of an already ...
1
vote
1answer
54 views

Vim how to reset the screen before editing?

On Linux, if I do a command with long output, for example dmesg and then edit a file with vim the screen is like after reset command. On HP-UX, if I do a command with long output, for example dmesg ...
0
votes
0answers
11 views

Periodic problems with openssl.vim with correct password

For those who doesn't know, there is a great script for vim that allows to store encrypted by openssl passwords using vim to acceses and edit them. About a year ago I've started to observe problems: ...
0
votes
0answers
32 views

Is it possible to recover deleted sudoers file without recovery mode? [duplicate]

I deleted the sudoers file by accident, and I am trying to enter recovery mode, but no matter which flash drive I use, it says 'an unexpected error has occured.' I want to recover it from within the ...
2
votes
2answers
193 views

How to effectively add a file to the args list for vim from within vim?

Really I just have a confusion between a few terms, some of which may be synonymous: buffers tabs files windows I want to understand these terms fully and any pointers in that direction would be ...
2
votes
2answers
81 views

How to replace each occurrence of a string with an incrementing counter in vim?

I have 203 instances of the word ubuntu in a file, and I want to replace each one with UBUNTU_X, where "X" is an incrementing counter. In other words, the original file is: ubuntu xxxxxxxx ubuntu ...
4
votes
2answers
29 views

Interactive, tabbed live tail of multiple files?

I'm often tailing multiple files, and even with a terminal multiplexer (ie tmux or screen) it's still annoying to have multiple windows/shell sessions dedicated to watching multiple files. Is there ...
3
votes
1answer
45 views

Vim - navigate between paragraphs (by blank lines)

Are there built-in commands in VIM that navigate to the next/previous blank lines?
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
286 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
60 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
66 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
33 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 ...
3
votes
0answers
164 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 ...
1
vote
0answers
22 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
60 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 ...
3
votes
2answers
215 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 ...
0
votes
0answers
38 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
102 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
55 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
44 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
54 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
36 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 ...
1
vote
2answers
175 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
71 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
51 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 ...