Questions tagged [vimrc]

Vim reads initialization commands from a file called vimrc on startup. This can be used to set settings, define functions, execute autocommands, and more.

134 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
13
votes
0answers
205 views

Using <C-,> causes “<80>ü^D,” to flash in the showcmd area?

I've mapped <C-,> as well as some other special keys (<C-Enter>, <C-S-Space>, ...) in my vimrc like, :set <F13>=^[[44;5u :map <F13> <C-,> :map! <F13> <C-...
6
votes
0answers
748 views

What is the best practice in vim8 for wrapping with indentation aka breakindent

To have proper paragraph wrapping with indentation in vim (after vim7.4) we could use this: " Wrap the text with identation isntead of the old way set breakindent set showbreak=\ \\_ Since vim8 ...
5
votes
0answers
863 views

Configure custom key mapping for commenting

I am using https://github.com/scrooloose/nerdcommenter/ plugin to comment the code. It's working fine, but I would like to do a modification. Currently these are the default mappings: <leader>...
5
votes
0answers
310 views

Is it possible to get the rule (cinoption) that govern the indentation for a specific line in vim

I have the following code: namespace { template<typename T> struct One // This is the odd line { // impl details } template<typename T> struct Two { // impl details } }...
4
votes
0answers
164 views

Set line breaks, word wraps and word searching for Thai and other non-latin languages

I can set the text width and can manually line break imported paragraphs with the following as an example. set textwidth=72 gqq I can also navigate English text files with the standard 'w' 'b' 'e' '*...
4
votes
0answers
3k views

Using GNU GLOBAL and gtags-cscope in vim

Now I am learning how to use GNU GLOBAL in vim. I have installed gtags.vim. I have gtags the kernel source directory. The .vimrc includes the following lines: set cscopetag set csprg=gtags-cscope ...
3
votes
2answers
41 views

How push a vimrc change to all open windows without doing anything extra each time?

Is there a way to push out a vimrc change to all open windows and instances of vim without having to write/change any buffers or reopen vim? I'd like vim to be able to behave like a modern day IDE for ...
3
votes
0answers
50 views

Maps literally read < and > instead of the actual character

Here's the situation: Entire .vimrc: inoremap a <CR> Action: user types ia to enter INSERT mode and type a Expected result: a CARRIAGE RETURN is entered into the document Actual result: the ...
3
votes
0answers
468 views

Can't get autocmd with two events to work

I have the VIM Clang Format Plugin and I would like to format my code every time I save it. This is in my current .vimrc: " map to <Leader>cf in C++ code autocmd FileType c,cpp,objc nnoremap ...
2
votes
0answers
24 views

gVim very slow start with guioptions-=T

I'm experiencing the problem with gvim taking ~20 secs to start when I have guioptions-=T in my .vimrc. Tried both version 8.1.0875 and 8.2.0121 I found this bug report which is now closed, but the ...
2
votes
1answer
80 views

Toggle Vim background transparency: how to setup?

I'd like to map a button to toggle Vim's background between transparent (to see stuff on other apps) and dark. My current settings I'm using onedark theme. There's currently no other background ...
2
votes
1answer
46 views

Can't use special characters in listchars even if setting scriptencoding to utf-8

Here is my .vimrc file: set encoding=utf-8 scriptencoding utf-8 set list set listchars=tab:→· When I open vim, it will show an error message E474: Invalid argument: listchars=tab:→· My vim is Vi ...
2
votes
0answers
41 views

Adjust terminal size using a system call from within Vim

All, I have a little function I'm trying to fix. I'd like to change my terminal Vim window size using the ASCII escape sequence \e[8;40;130t so that my writing window size stays the same when I use a ...
2
votes
0answers
45 views

Is it more efficient to use one function instead of multiple autocommands?

I have a lot of lines with with filetype-specific autocommands defining mappings and abbreviations, which looks like this: augroup vimrc au! ... au FileType blah nnoremap <buffer> aa bb au ...
2
votes
0answers
187 views

How do I setup Mypy with Neomake

I'm trying to use Mypy with Neomake, but without success. I am currently using flake8 with Neomake, and it works seamlessly, e.g.: def foo(bar): return 1 foo(1) > E305 expected 2 blank lines ...
2
votes
0answers
58 views

Unwanted extra indentation of multi-line statements

How can I make continuation lines indent 1 tab instead of align with the some text? With the default cindent options, I get the following: static int A = 0, B = 0, C = 0; But, ...
2
votes
0answers
75 views

Jump to last position when using vim netrw to open a file

I am looking to jump automatically to the last position in any file that I open. I have in my ~/.vimrc file: autocmd BufReadPost * ...
2
votes
0answers
51 views

vi -u doesn't seem to work?

As system administrator I have to work under several user IDs, some of which are shared with others. We all have different tastes in what we like in terms of settings for our vi, so I am looking at ...
2
votes
0answers
77 views

Preventing autocmds from being redundantly repeated

I'm trying to figure out what is the proper way to prevent autocmds from being redundantly repeated. Here are articles which I have already read: Remove augroups around autocmds in .vimrc (related ...
2
votes
3answers
133 views

Can I define something in .vimrc to speed up pasting of large amounts of data?

Occasionally, I paste large amounts of data into vim, using Ctrl+v in my terminal emulator (in Linux). This takes several seconds before vim is responsive again. I have tried two other methods, which ...
2
votes
0answers
62 views

display list of buffers `ls` without scrolling down

Is there a way to display output at the bottom of the screen like ls does, but without scrolling down to accomodate the output? The Vim Wiki (no https) has the following snippet :nnoremap <A-n>...
2
votes
0answers
42 views

Extending the true line width to enable screen readers to see what blind users cannot

Vim is outstanding. It holds a lot of potential for blind users. I still have one out-of-the-box problem when using vim with screen readers (tested with both NVDA and System Access). But that surely ...
2
votes
0answers
764 views

Why — ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y) Pattern not found?

vim --version VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 30 2017 18:21:38) Included patches: 1-197, 322, 377-378, 550, 703, 706-707 Modified by pkg-vim-maintainers@lists.alioth.debian.org ...
2
votes
0answers
454 views

Syntax highlighting: what is the difference between :syntax match and :match?

Simple question -- what is the difference between the two? When I try, for example, to highlight characters on every line after the 80th with highlight link OverLength Error (OverLength being an ...
2
votes
0answers
263 views

Custom highlights not working in visual splits

I'm a tabs kind of guy, so I highlight leading and trailing white spaces with the following commands in my .vimrc: highlight whiteSpace_trailing ctermbg=red guibg=red highlight whiteSpace_leading ...
2
votes
0answers
897 views

Vim Equivalent of Spyder's Variable Explorer

I am used to coding python in Spyder IDE and wanted to change to vim. I started using vim not long ago, but I miss the variable explorer implemented in Spyder. For those not familiar with Spyder, the ...
2
votes
0answers
310 views

Make vim version 7 edit xml files

I'm using old Debian linux an vim version 7.1.314. I would like to edit eclipse .cproject file that build using XML syntax. Currently vim shows not colored information. I found vim plugin that I hope ...
2
votes
0answers
551 views

what is the correct codepage to use with vim airline?

Ok so I have setup my .vimrc as followed but I'm still experiencing a few problems with it: let $VIM=/usr/share/vim/vim74 let $VIMRUNTIME=/usr/share/vim/vim74 execute pathogen#infect() " air-line" ...
2
votes
0answers
235 views

Enhancing Vim gf command for ruby: include module syntax

I am looking for a way to enhance vim gf command class Myclass include Mymodules::HardToFind end I have started with installing tpope/rails-vim: Easy navigation of the Rails directory structure....
2
votes
0answers
739 views

How to set vim theme in Vagrant?

I installed Vagrant within Windows, box is ubuntu server 14.04. My vim script: set t_Co=256 colorscheme solarized " colorscheme molokai But it doesn't works, and I got no solutions with Google. ...
1
vote
1answer
33 views

vim-airline tabs don't work. resetting airline theme when switching tabs

I faced an issue As you can see on the screenshot, vim does not show tabs with specified airline theme and it shows me this annoying X button at the end of the tabline. Here's my .vimrc: execute ...
1
vote
1answer
27 views

Can I make left Alt act the same as shift key using key map?

I would like to swap my left shift key with my left alt key, and I would like to know if it’s possible to achieve this with vim key mapping. Maybe not swapping but copy the whole shift key map to ...
1
vote
1answer
73 views

How can I decide whether a file can be opened in VIm or not?

I want to make a script with FZF (Fuzzy Finder) and I want to show only those file which can be opened with VIM. So, I don't want to list mp4, jpg, pdf etc files in FZF. So, is there any way to ...
1
vote
0answers
31 views

Add to statusline

I'm using vim-airline plugin for my statusline. Now I want to install kite which suggests adding a section to the statusline. I tried adding using: set statusline+=%{kite#statusline()} but that ...
1
vote
0answers
97 views

How could I customize preview window coloring with results from Ripgrep and fzf?

I am just getting into vim and I'm trying to get the preview window for my Rg results to show up with nice looking colors. Currently I have most of the stuff looking nice; here is a picture of where I ...
1
vote
0answers
84 views

ftplugin not loading

This is my .vimrc set nocompatible " be iMproved, required filetype off " required " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle....
1
vote
0answers
36 views

vim doesn't load syntax for a single file

I was toying around with my .vimrc editing it, and then checking in another file whether my changes worked or not. But now I ended up in a state where opening one file with vim file1.tex (this was ...
1
vote
0answers
38 views

How to make “view” read vimrc?

view is the readonly mode of vim. I would like view to read the exact same .vimrc file for its initialization as vim already does. view does not seem to read ~/.vimrc by default (I checked by adding ...
1
vote
0answers
44 views

How to use actual window size to control vim settings?

Background: neovim with tagbar plugin installed Goal: when starting nvim, if current window size is larger than 100, open tagbar and set auto-open for new buffers. Currently I use the settings below ...
1
vote
0answers
32 views

Vim unknown colored block

My vim on WSL has some unknown colored blocks. The weird thing is it happens randomly and some colored blocks would disappear when I pass them using cursor. The following is my .vimrc settings: ...
1
vote
0answers
38 views

Vim go into insert mode when as a macro starts

When doing <ESC>qq you can record a macro into the q register (still in command mode though). How can I make <ESC>qq go into insert mode right away (without having to type i)? map qq qqi ...
1
vote
0answers
46 views

How to avoid dialog box when using echo in vimrc/gvimrc file?

If there is a echo/echom sentence in the vimrc or gvimrc file, a dialog box is popped out when gvim starts. How to avoid this?
1
vote
0answers
29 views

Remove spacing column begin line

I have an annoying problem that I have no idea how to fix it. Every time I open a specific log file for some weird reason the window starts with 2 spaces column. This happen only with this specific ...
1
vote
0answers
37 views

How to externally trigger [neo]vim to reload an edited file?

I have a file, /tmp/file.txt that is being edited by vim (or neovim), as well as some other external process. I wish the external app to notify vim, in such a way that vim takes that notification to ...
1
vote
0answers
105 views

Simple .vimrc takes a very long time to save

Saving a file with :w takes several seconds for me, and I can't figure out the culprit. This is my .vimrc " Specify a directory for plugins " - For Neovim: ~/.local/share/nvim/plugged " - Avoid using ...
1
vote
0answers
94 views

Does explicit setting of $MYVIMRC imply its execution as private vimrc?

Vim manual says: "The $MYVIMRC environment variable is set to the file that was first found, unless $MYVIMRC was already set and when using VIMINIT." Does this also mean that setting of $MYVIMRC (e.g. ...
1
vote
0answers
63 views

Syntax highlighting - help me find the bug

I have a bug and I can't figure out the solution. Perhaps you esteemed folk can be of aid. I want to extend a syntax file (julia syntax in polyglot package). I want to include the following patterns ...
1
vote
0answers
45 views

In Vim, how to enable Meta in all keybindings?

In case it's relevant, this is on MacOS and iTerm. How do I use key mappings that involve the Meta key, e.g. <M-e>? For example, the auto-pairs plugin has a keybinding that allows you to ...
1
vote
0answers
344 views

YCM is not working with .ycm_extra_conf nor compile_comands.json on Windows

I have problems using YCM plugged for C-family languages. Here are what I have done: project layout -- build -- src -- source file dir0 -- include main.cpp -- source file dir1 ...
1
vote
0answers
101 views

Pylint symbols and line numbering issue

I have an issue as the image shows where the linting symbols on the left are corrupted. I can't find why this happens. But it appears only in python scripts. I suppose this has something to do with ...