.vimrc is the primary configuration file for the VIM text editor

learn more… | top users | synonyms

0
votes
1answer
17 views

Highlight Vim escape characters e.g. \n

I'm using the Jellybeans vim colorscheme but it doesn't highlight any escape characters. For example if I'm using C++ and have the following... std::string word = "hello\n"; ... the whole string ...
0
votes
0answers
34 views

Trying to execute vim function from plugin - can't get syntax correct

I found a pretty neat VIM plugin which adds functionality for managing Perl scripts; it's called Perl-Support. I got it installed fine, and I'm trying to take advantage of all the custom functions/...
1
vote
1answer
52 views

Vim color scheme not being applied

I am installing this theme using these instructions. $ vim --version VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr 08 2016 11:38:28) Included patches: 1-1689 Here is my ~/.vim/colors: xxx@xxx:~/...
1
vote
0answers
17 views

How to disable vimplugins while invoking vimdiff command

I added few vim plugins like sytastic, nerdTree. They change the status line and other UI elements, which works fine while editing files. But when I invoke vimdiff on 2 files, the nerdTree pane also ...
0
votes
0answers
18 views

vim how to insert template of codes quickly/smoothly in current file at current position

I managed to write a single template file, which would be populated if i started a new cpp file autocmd BufNewFile *.cpp -r ~/.template.cpp But, with increasing pieces of template codes like for ...
0
votes
0answers
25 views

vim: map capital 'Y' in .vimrc does not work

If I try to map capital 'Y' in my vimrc, this is getting ignored. For example, if I put something like nmap Y :w<CR> in my vimrc, this has no effect. However if I run vim and I enter :nmap Y ...
0
votes
2answers
68 views

disable cursor color in putty client ssh terminal when in vi

I use putty.exe in windows 7 to connect to my Linux system. I use vi. I would like the cursor in vi to remain white all the time, and not change to green or blue around my if statement { } brackets ...
0
votes
1answer
75 views

Vim color scheme not being applied

I'm trying to use this color scheme: https://github.com/Konstruktionist/vim/blob/master/colors/Kafka.vim Here is my ~/.vim/colors: xxx@xxx:~/.vim/colors$ ls -l total 16 -rw-rw-r-- 1 xxx xxx 15245 ...
-1
votes
1answer
28 views

Specify cursor position and mode when opening file in vim

I want cursor to be in the last character of first line, in INSERT mode when I open a file in vim. It should work in all cases:: Open file from CLI, like, $ vim fileName Open file from inside vim, ...
2
votes
1answer
101 views

vim sudo hack auto reload

I've installed and aliased some a newer version of vim and aliased vim to call that version. I also aliased sudo so that it can just call the system default vi when I need to edit a file as sudo but ...
1
vote
1answer
46 views

vi needs two <enter> keystrokes instead of one

If I want to open a file using "vi", it needs two <enter> keystrokes instead of one. Any idea, how to fix it? Just few hours back it was working perfectly. I have been searching on the net ...
0
votes
2answers
37 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
68 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
0answers
74 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>&1<...
1
vote
1answer
196 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 ...
1
vote
0answers
54 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
149 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 ...
0
votes
1answer
60 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
1answer
84 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
134 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
2answers
29 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? ...
2
votes
1answer
38 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 ...
6
votes
1answer
142 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. ...
2
votes
1answer
473 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?
3
votes
1answer
609 views

Using 256 colour themes not working in vim/putty

PuTTY shows the the correct xterm-256color. Colours section shows "Allow Terminal to specify ANSI colours" and "Allow terminal to use xterm-256-colour mode". Yet when I use themes, they don't work, ...
0
votes
0answers
46 views

Glitch with auto chmod line in .vimrc

I found a useful line for my .vimrc file from here that makes any file beginning with #! on line 1 executable when I save it. Here's the line: au BufWritePost * if getline(1) =~ "^#!" | silent !chmod ...
0
votes
1answer
56 views

Why these two vim autocmd overlap each other?

I got these two autocmd config in my .vimrc autocmd FileType python highlight OverLength ctermbg=red ctermfg=white guibg=red autocmd FileType python match OverLength /\%80v.\+/ autocmd FileType ...
0
votes
1answer
224 views

How should I split a string with no spaces in vim script?

How should I split a string with no spaces in vim script? All the options which I see are to split a string with spaces. I even tried split(string_name) without a delimiter , but it doesn't work.
1
vote
1answer
106 views

Vim auto line-breaking not working as expected (update: problem with neocomplete)

I'm trying to configure vim so that the text breaks automatically at 80 characters. I know the way to do this is with set textwidth=80 However, the lines don't automatically break when I typed ...
1
vote
2answers
155 views

Is there a sudoedit equivalent for vimdiff?

I'm trying to get into the habit of editing root-owned files with sudoedit, instead of sudo vim. This has a few advantages, one of which is that it uses my user's ~/.vimrc. Is there an equivalent, ...
0
votes
1answer
24 views

vim color changing between | |

I'm editing some rst files. In the math section, the color changes between | |. Why is this so? How can I change my rst.vim file to not change color between | |? Thank you in advance.
4
votes
1answer
569 views

Disable or remove default vim keybinding

Is there a way to disable or remove a default vim keybinding? For example, if I wanted <S-k> (shift-k) to do nothing, how would I achieve this?
3
votes
4answers
107 views

vim edit a file with a user-vimrc but still load all previous initializations

Checking the man page for vim says it's -u switch that lets me choose a different vimrc file -u {vimrc} Use the commands in the file {vimrc} for initializations. All the other initializations ...
2
votes
1answer
486 views

on osx vim 7.3 set number set relative number not working

I'm using OSX Mavericks. Using VIM 7.3, I can't seem to get the "hybrid" line numbers to work. I was reading a tutorial stating that if both set number and set relativenumber were included in the ....
2
votes
1answer
50 views

How to update a date in a file if applicable and increment the last digit by one if one writes to the file using Vim?

Aim The aim is to update a number in a file if one writes to a file using Vim. If the date resides in the file the date part should be left unchanged, but the last digit needs to be incremented by ...
0
votes
1answer
71 views

Vim mappings stop working

Some of my Vim mappings have stopped working, even though :map <keys> shows that the mapping has been registered. One example is map <S-CR> O<Esc> in my .vimrc, which does not work ...
8
votes
2answers
636 views

Can .vimrc be divided into multiple files?

Say I have some hundred custom re-mappings with iab for Java and some other hundred or so re-mappings for Haskell, then I'd want do divide these into different files to make it more manageable. What I'...
1
vote
1answer
366 views

.vimrc does not working as expected

I've been trying new color schemes and I set: colorscheme gotham256 set background=dark set t_Co=256 highlight Normal ctermbg=NONE highlight nonText ctermbg=NONE but these thing ...
1
vote
0answers
155 views

NERDTree don't create window on open when file is not saved

Is there a way to convince NERDTree to always hide editor window? Because when I open file and I have unsaved changes in previous one, NERDTree will open new window, so it is opened in split. I don't ...
1
vote
1answer
43 views

Vim command to turn hard wrapped lines into visually wrapped lines with preserved formatting

Given the following strings each on a separate line (which I indicate by prefixing line numbers) with syntax specific indendation: 1 Standard string with only text or code from some programming ...
4
votes
2answers
275 views

What's a smart way to use/maintain two separate bash_profile's and vimrc's

I have two different setups I like to use in terminal and vim. One uses a light background and a somewhat fancy airline statusline in vim. The other uses a dark background and a more barebones vim ...
4
votes
3answers
582 views

Switching among cli and vim and other files workflow

I saw some kind of workflow in vim: Vim had a file open. Then some combination of keys made vim disappear and the user was in the command line working in cli mode, then opened another file and then ...
5
votes
2answers
182 views

Color coding html color sequeces in vim

It it possible to setup syntax highlighting in vim so that a html color sequence is colored in that color, e.g. #FF0000 would show up as red. I'd also be ok with it underlining the text that color ...
3
votes
3answers
73 views

Keymaping for re-indent source code in Vim

I have key mapping in my ~/.vimrc file that re-indents edited source code on the fly. It looks like as follows: " press F4 to fix indentation in whole file; overwrites marker 'q' position noremap <...
1
vote
0answers
478 views

Vim FoldColumn color different on Debian / Ubuntu

I sync my .vimrc file between two machines, one running Debian testing and the other Ubuntu. On Debian everything works fine. On Ubuntu, the fold column is gray instead of black, even though black is ...
0
votes
1answer
509 views

(Vim) How to use TAB for indentation in all file types?

I'm using only TAB for indent, so I configure Vim for using only them: set autoindent set noexpandtab set tabstop=4 set shiftwidth=4 But some files (.py) still using spaces. I've search for it and ...
4
votes
1answer
174 views

How do I highlight commas not followed by a space in vim?

I've gotten into the habit of not appending spaces after commas in lists, when coding. To break this habit, I thought I'd get vim to highlight any comma (,) that is not followed by a space. So I've ...
2
votes
2answers
492 views

Highlight extra white spaces and fixed length column in VIM

I want to highlight extra white spaces and fixed length column (e.g., 80 character in a line) using VIM I created two vimrc rule in my .vimrc file highlight ExtraWhitespacea ctermbg=darkred guibg=#...
0
votes
2answers
99 views

can't define command which executes Explore command

I wanted to make an easy way to open a directory. My first try was like this: command! RootDirRubyOpen :e ~/.rbenv/versions/2.0.0-p247<CR> But it didn't work. "Okay then," I thought. And ...
1
vote
2answers
614 views

How do I make a vim command run automatically with .vimrc?

I run the following vim command to change the colour of highlighted columns to something more palatable than the default red: :highlight ColorColumn ctermbg=235 guibg=#2c2d27 rather than run this ...