Tagged Questions

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

learn more… | top users | synonyms

1
vote
1answer
34 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 ...
0
votes
0answers
29 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
23 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 ...
2
votes
2answers
57 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
429 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
43 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
58 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
55 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
69 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
79 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
59 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
89 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
51 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
91 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
116 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
331 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
512 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
208 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
274 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
18 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 ...
3
votes
1answer
106 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
89 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
289 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
481 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
744 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
338 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
107 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
560 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
174 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
96 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
149 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
256 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 ...
-1
votes
1answer
117 views

How to use colors/colorschemes/fonts in vim effectively so that the text is as readable as possible

I am trying to be more productive in vim and as part of this I am trying to make the text presentation i.e. colors etc as nice to the eyesight as possible. Although I managed to change the default ...
4
votes
1answer
152 views

Customised vimrc for subfolders and projects

I use vim in many different contexts ... actually, probably most people do: There is the editing of configuration files, programming, documenting, email and so forth. I very frequently found myself ...
3
votes
1answer
602 views

Vim powerline with broken encoding

I trying to learn using vim, I am enjoining a lot, but I copied the vimrc from github and I would like to understand what is causing the break of powerline encoding. . In the vimrc file I have: set ...
2
votes
1answer
127 views

Vim command mapping help

I'm a relatively recent convert to Vim, so I don't know a whole lot. My question is about mapping a multi-part command to a single key combo. In my .vimrc, I've got the following line: nnoremap ...
0
votes
2answers
69 views

Vim autocommand creates weird file

I've just set up slackware 14 on a virtualbox. As one does, I immediatly created/altered my .bashrc and, more importantly, my .vimrc files. To avoid writing huge lines of code, I usually add ...
3
votes
4answers
1k views

vimrc - how to block comment?

I don't want to comment lines of text in a text file or code. I am looking for inserting block comments in a .vimrc file. To insert a single line comment " is used, for example: " remove spaces and ...
6
votes
3answers
3k views

vi / vim - how to automatically strip trailing spaces on save?

Is there a .vimrc setting to automatically remove trailing whitespace when saving a file? Ideally (to be safe) I would like to only have this functionality for certain files, e.g. *.rb
1
vote
2answers
265 views

Why does Vim only activate my highlight configuration after I source my .vimrc manually?

I was cleaning up my vimrc today, splitting it into separate files to make it easier to maintain. On completion of these changes, all my configuration, mappings and plugins appear to be working, ...
0
votes
2answers
348 views

Calendar.vim E492: Not an editor command: Calendar

I am trying to install the calendar.vim plugin on mac osx snow leopard running gvim. I have pathogen.vim installed, so I followed the instructions on github to install calendar.vim from the terminal: ...
2
votes
1answer
3k views

How do I highlight the current line and the cursor in .vimrc?

I am trying to highlight the current line as well as the cursor position in Vim. Here's my .vimrc: set cursorline hi CursorLine ctermbg=8 ctermfg=15 "8 = dark gray, 15 = white hi Cursor ctermbg=15 ...
2
votes
2answers
803 views

gvim colors the same as is the terminal

Is there a command I can put in the .vimrc to make gvim look like vim's setup in the terminal? Same back ground, syntax highlighting, colors, and font. To add to my question, is there a may for gvim ...
4
votes
3answers
1k views

Can't open syntax.vim error when using vimrc

When I try to open my .bashrc file. then it shows these lines: Errordetected while processing /etc/vimrc: line 45: E848: Can't open file /usr/share/vim/vim70/syntax/syntax.vim Press ENTER or type ...
3
votes
1answer
131 views

Why does insert-mode map “<F4>” unpredictably inserts itself or executes intended key strokes?

In Vim 7.3.1-762, mintty 1.1.2 (xterm), cygwin, Windows XP, the insert-mode map <F4> executes the intended key strokes at one time but inserts itself at another time. This undeterministic ...
3
votes
4answers
957 views

Utilize a different user's vimrc as well as vim folder

First of all, to prevent an X/Y Problem, I'll just state that what I really want is: Run vim as the root user. Instruct vim to use my nice pretty color scheme and all my plugins. Do all this without ...
5
votes
2answers
194 views

How to consistently start Vim's command line to make a mapping work in any mode?

I try to normalize access to Vim's command line mode from any other mode in order to simplify my actual mappings. For example to make the <f6> key work from anywhere I define the following ...
3
votes
1answer
1k views

Saving with CTRL-s in vim

I have added this line in .vimrc so that pressing control-s saves the current file :nmap <C-s> :w!<cr> :imap <C-s> <esc>:w!<cr> But this is not working. Any ...
2
votes
1answer
544 views

Solarized color definitions in vimrc file

The solarized theme defines some base colors and assigns those to variables, as seen here. I would like to know how I can use these color definitions in my .vimrc file. Currently, I use pathogen to ...
3
votes
2answers
182 views

Vimrc, map control-; to an action

How do I map holding down Ctrl and pressing ; in Vim? It doesn't work on my Linux terminal. Ctrl-l works fine after putting <c-l> some_action in my vimrc, but <c-;> some_action does ...