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

learn more… | top users | synonyms

0
votes
1answer
299 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
296 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
30 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
51 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
102 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
69 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
115 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
100 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
144 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
84 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
34 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
80 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 ...
3
votes
0answers
171 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
60 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
55 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
61 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
12 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 ...
3
votes
2answers
342 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
98 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
34 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
60 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
521 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
86 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
82 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 ...
3
votes
0answers
306 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
24 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
83 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
238 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
48 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
142 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
56 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
90 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
37 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
413 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
83 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
78 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
21 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 ...
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
43 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
41 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
60 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
45 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
650 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
288 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 ...