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

learn more… | top users | synonyms

1
vote
2answers
20 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
18 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
59 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. ...
0
votes
1answer
38 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?
2
votes
1answer
65 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
25 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
30 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
44 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
63 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 ...
0
votes
2answers
48 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
0answers
34 views

How to generete allegro5 tags for vim with ctags?

I was recently working on project with GTK2 in vim (with OmniCppComplete plugin). so I generated tags with ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --sort=yes /usr/include/gkt-2.0/ I did so ...
0
votes
1answer
19 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.
2
votes
1answer
104 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
53 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
171 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
44 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
44 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 ...
4
votes
2answers
165 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 ...
1
vote
1answer
98 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
83 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
32 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 ...
3
votes
2answers
110 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
523 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 ...
0
votes
0answers
288 views

Folding in vimrc does not work as expected

I added these to my vimrc: set foldenable set foldmethod=syntax set foldlevelstart=1 let javaScript_fold=1 " JavaScript let perl_fold=1 " Perl let php_folding=1 ...
5
votes
2answers
107 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
60 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 ...
0
votes
0answers
196 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
212 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
95 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
259 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 ...
0
votes
2answers
75 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
277 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 ...
4
votes
1answer
222 views

Remap Up and Down arrows to gj-gk in vim input mode without using <c-o>?

I have mapped my arrows keys to move in a visual-line mode, leaving the hjkl keys for normal, logic line movement: " Visual movement with the arrows and End-Home nnoremap <Down> gj nnoremap ...
4
votes
3answers
446 views

Any way to provide a separate vimrc file just for 1 session

I would like to know, if there is a way in vim/vi to provide a different vimrc file. I am looking at managing 2 different vimrc files. For the contents I checkout/checkin in version control I want to ...
2
votes
2answers
1k views

vim colors not automatically loaded (probable Vundle conflict)

I've been trying to port my Windows .vimrc to Linux, to use on the command line (on gnome-terminal). Everything works fine, except for the colorscheme. It looks like it's loaded (:colorscheme returns ...
2
votes
1answer
294 views

Auto indent C++11 lambda functions Vim

Is there any way to get Vim to auto indent C++11 lambda functions correctly? I have tried many different permutations of smartindent, cindent, etc. in .vimrc.
7
votes
1answer
376 views

VIM: folding bullet points

I'm quite new to VIM, but have been trying to teach myself over the past week, yet I'm encountering a problem which has proven to be quite frustrating: Currently I'm mostly using VIM to take notes, ...
0
votes
1answer
25 views

vimrc specify more than 1 file extensions in autocmd

I know a little bit of autocmd and use it for few things. Currently, I have au BufNewFile,BufRead *.inc set filetype=sql au BufNewFile,BufRead *.tbl set filetype=sql Reading the man page, the ...
4
votes
1answer
204 views

vim - Store a backup before each write

I want to create a backup of the file I'm editing before each write. For example, if I am editing some file.txt, when I go to write the file with :w, I want vim to first save a backup of file.txt ...
0
votes
2answers
138 views

Map a shell command to execute it into vim

I want to map, in my ~/vimrc file, the key <F4> in vim in order to execute the indent program on the file which I'm currently editing. How can I do it? If I do this,the compatibility with vi ...
2
votes
1answer
497 views

How can I set check interval for set autoread option in VIM

How can I set check interval for set autoread option in VIM? Is it possible?
0
votes
2answers
830 views

(g)vim - NerdTree and tagbar above each other left to edited file?

Any chance to get (g)vim displaying NerdTree and tagbar above each other left to edited file? +-----------+-------------+ | nerd tree | edited file | | contents | | +-----------+ ...
3
votes
1answer
1k views

How to insert both vimscript variable and string into vim search and replace

I've only just found out about Vimscript's existence as of today, so forgive me if this question is more basic than it seems, but I've been struggling to find an answer to this question for the better ...
5
votes
1answer
543 views

How can I jump to files from vim opening them in a separate tab?

I have installed tags so I can jump to a function body in another file via CTRL + ] I know that I can do gf to jump to another file. I know that I can do CTRL-w s to split the vim window. What I don't ...
1
vote
1answer
130 views

Why is this copy/paste in vim configuration not working properly?

I have the following in my .vimrc vmap <C-c> y imap <C-p> <esc>P So that I can do my classic sortcut for copy/paste. It works fine on Cygwin but not in my ssh session to ...
10
votes
5answers
594 views

VIM commenting out what I paste

I got this when trying to copy this gist on vim: https://gist.github.com/w0ng/3278077 I notice the same behaviour everywhere: If I paste something that includes a comment, everything that follows ...
1
vote
1answer
348 views

VIM map not working

I'm trying to map <c-y>, (from zencoding-vim) to <c-m>. I tried: map <C-m> <C-y>, map <C-m> <C-y>,<cr> But doesn't seems to be working. Maybe it's ...
2
votes
1answer
99 views

What is this VIM plugin?

It's a modified vim bar that includes current path and current git branch. I've been looking around but couldn't find anything. Found in: https://github.com/w0ng/vim-hybrid
0
votes
1answer
248 views

Vimrc autosourcing not working

My vim configuration lives in $HOME/.vim/vimrc, which is symlinked to ~/.vimrc. Inside my vimrc I have: if has("autocmd") autocmd bufwritepost vimrc source $HOME/.vim/vimrc endif But is not ...
2
votes
1answer
324 views

vim and tmux are conflicting. How can I fix this? [duplicate]

I'm having a painful experience with tmux. I'm using solarized in vim but when I run tmux then my vim configuration does not work. It's as if solarized is not configured in my .vimrc. Out of tmux ...