Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
0answers
25 views

Change/Set color to a string in statusline

I'll preface by saying that I am using Airline, plytophogy/vim-virtualenv plugin and gruvbox as the Airline theme. I am trying to change the color of some string in the status line to, say, orange. ...
0
votes
0answers
13 views

How can I get swap files for new/unsaved files/code in empty buffers? Any way to recover unsaved files?

I'm trying to configure Vim to make it so that if my system crashes I can recover my work from swap files set in set directory=. I tested this out on Vim in Windows using gVim. If I forcibly crash ...
0
votes
0answers
12 views

Disable E303 warning when swap directory isn't writeable

I sometimes run vim as another user than me, using my own vimrc. In this case the swp and undo directory aren't writeable, and vim warns me with E303. I don't care about not having swap file in this ...
-1
votes
0answers
24 views

How to configure VIM to drop all IDEs [closed]

So this is kind of a follow-up to this answer over on stackoverflow. I have been naivly using vim for quite some time now and recently finished my first small c++ project in production with it. I got ...
2
votes
0answers
48 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, ...
1
vote
0answers
39 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 ...
0
votes
1answer
15 views

Setting a list of tag files

Is there a way to set multiple default tag files, to be searched sequentially in my vimrc? My hope was that I would be able to have a local tags file that would be searched first and then, if nothing ...
0
votes
0answers
24 views

Integrating autocomplete and snippets

I'm trying to set up an autocompletion/snippet workflow that's a bit complicated. This is stemming from needing a better workflow for latex. Right now I'm using coc.nvim and UltiSnippets but I am ...
0
votes
0answers
20 views

don't use scrolloff=5 for mouse clicks

I use (neo)vim with mouse=a and scrolloff=5. Clicking on one of the top or bottom five lines with the mouse causes the screen to jump (so that the new cursor position is more centered), which ...
0
votes
0answers
23 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 ...
0
votes
1answer
33 views

Vim opens an empty buffer when I try to open an existing file

when I use: vim <file_name> vim opens an empty buffer with no name ([No Name]). But when I type: :tabnew <file_name> it opens the file properly. I tried :bdelete to delete the open buffer ...
1
vote
1answer
133 views

How to set if else for vim's “set background = ” for light and dark colorschemes?

For themes like One or PaperColor, there are dark and light versions. For dark or light theme, I usually add my own customizations like bracket color, comment color... etc. I tried to combine them ...
2
votes
0answers
32 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 * ...
1
vote
1answer
21 views

Retrieve color scheme colors to use for other plugin setting

I am trying to use a colorized parenthesis plugin. However, the colors don't match my current color scheme. The help page mentions ways to change the colors, but I don't know which magical words I ...
2
votes
1answer
43 views

Skip the quickfix list when buffer switching using :bn

Often when editing LaTeX files, you are constantly switching between your .tex, .sty and .bib files which are often in their own buffer. To navigate between those, I use the :bn and :bp commands ...
3
votes
1answer
31 views

Unable to get <M-Up> to work in insert mode

I am using Vim version 8.0 and I would like to use <M-Up>, <M-Down>, <M-Left> and <M-Right> for navigating from window to window during insert mode. I am unable to get this ...
1
vote
1answer
19 views

How to match file pattern, with extension, not containing a specific word?

I'm trying to use autocmd BufNewFile to like so: autocmd BufNewFile \(.*_spec\)\@!.rb 0r ~/vim/skeleton.rb autocmd BufNewFile *_spec.rb 0r ~/vim/skeleton_spec.rb So, I want the first ...
0
votes
1answer
61 views

Vim-Plug: Can't install plugins. Invalid plug directory

I'm new to vim. The problem happens when I type :PlugInstall I get: [vim-plug] Invalid plug directory: /Users/joqsan/.vim/plugged. Try to call plug#begin with a valid directory This is how I ...
0
votes
1answer
22 views

How to show all LaTeX code but still have set conceallevel=3 for vim-devicons and NERDTree?

How can I adjust my .vimrc so that set conceallevel=0 is specific to just LaTeX documents? The plugin vim-devicons requires the following conceal level with NERDTree: set conceallevel=3 However, ...
0
votes
0answers
32 views

Delete key isnt working in vim [closed]

Using vim on my Mac via iterm, and whenever I try to use the delete key, it doesn't delete but move down by a bunch of lines (sorry, couldn't find out what exactly its doing to jump down so much). And ...
1
vote
1answer
27 views

Conceal initially ignored

I'm just trying to get conceal working, so I've created a simple test case. I have a clean .vimrc file with only the following lines: set conceallevel=2 syn match Conceal /syn/ conceal cchar=+ ...
1
vote
1answer
25 views

How to change color of unselected tab?

Hello I am a pretty new user to vim, and am using nvim with ayu theme. The tabs dont look that great so I decided to edit the ayu.vim, and so far I changed the TabLineFill property to fit my ...
0
votes
0answers
33 views

How can I get the autocompletion databases on VIM using YouCompleteMe?

I just wanted to add the completion functionality on vim. For that reason, I went for YouCompleteMe plugin. It worked well with the following configuration on my .vimrc file: execute pathogen#infect()...
2
votes
1answer
31 views

vim line number digit group separator

Is there any way to have a digit group separator for line numbers in vim? i.e., if I am on line 1234567 it would become 1,234,567, where , is a delimiter.
0
votes
1answer
21 views

remap esc key introduced remove behave

I'v remapped esc key by double jj for insert mode and command line mode. When I using it in command line mode it removes the word where the cursor is highlighted cnoremap jj <esc> nnoremap rr ...
0
votes
1answer
24 views

If else statement vimrc for custom key mapping [duplicate]

So, I can create custom key mapping for specific directories like this: autocmd BufNewFile,BufRead <name of directory>* map <key> :! <command here> This only executes the command ...
1
vote
2answers
68 views

How to execute selected lines in bash and print the output in the next line?

I know that with this command: :yyp!!bash I can execute current line and print the output in the next line (actually it copies the current line to the next line, executes it, and replaces it with ...
1
vote
2answers
29 views

Vim Syntax Highlighting for an Object's Method Call

I would like an object method call to be syntax highlighted in Vim. For instance, in an expression that contains person.getName(), I would like to match getName and give it some syntax highlighting. ...
1
vote
1answer
25 views

gVim python continues to indent after function ends

I'm seeing strange behavior in my windows gvim -- it will continue to indent after a function ends, even once characters in column 0 have been entered: def foo(k): return 42 """Still indenting""" ...
1
vote
1answer
31 views

Importing project-specific rc files in Neovim

Vim probably did this by default, whenever I invoke files from a project that has its own .vimrcs it's auto-sourced. Neovim, however, doesn't import vimrcs. How can I make Neovim scan and use project-...
2
votes
1answer
19 views

Silence errors from colorscheme, silent! and try/catch not working

I modified a colorscheme file which generates E419/E420 errors when loading, but I would like to ignore them silently. silent! and try/catch aren't working for me. My .vimrc is shown below. All the ...
5
votes
1answer
77 views

How to make vim text bold?

In order to have my vim text always bold, I found this config in stackoverflow: :hi MyGroup cterm=bold :match MyGroup /./ But somehow, it has messed up search highlighting. It is no longer ...
0
votes
1answer
36 views

How to change color of the splits counter in a 'tabline'

I can have multiple splits in a new tab. To change background and foreground of active and inactive tabpages, I can do the following: hi TabLineSel term=bold ctermfg=White ctermbg=DarkBlue hi TabLine ...
0
votes
1answer
23 views

initialization .vim directory base contents

I deleted every files and dir in ~/.vim/. I know some dir and files is needed. Fortunately I have my vimrc file. But I don't know which files and dir are needed. Can I create theme automatically?
2
votes
2answers
53 views

Understanding how “vi” finds its global configuration file

On my Ubuntu OS, I see this in /etc/vim/vimrc.tiny: $ cat /etc/vim/vimrc.tiny " Vim configuration file, in effect when invoked as "vi". Here's the partial output from :version: system vimrc file: "$...
1
vote
1answer
19 views

vim -u ~/.vimrc gives error

When I start just vi which is alias to vim: $ which vi alias vi='vim' /usr/bin/vim my ~/.vimrc is used which is great, every configuration and all plugins are being properly loaded and etc. However ...
1
vote
1answer
33 views

<Alt> to enter normal mode on Windows

I'm new to vim, and I find using <Esc> to enter normal mode to be slow. I'm on Windows. I seldom use the <Alt> keys (left and right) when I'm editing text. It should be convenient to use &...
0
votes
0answers
64 views

Vim Airline no GitBranch name [doing echo fugitive#head() shows correct branch]

I have Fugitive vim and Airline vim installed via Vundle. I installed them as follow: Plugin 'https://github.com/tpope/vim-fugitive.git' Plugin 'vim-airline/vim-airline' Airline status works fine. ...
1
vote
0answers
24 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
1answer
59 views

override /etc/vimrc.local

I am working on a machine where I do not have root access, and I do not like some of the global vim settings (in /etc/vimrc.local). How can I disable these in my personal .vimrc? Specifically, the ...
1
vote
1answer
48 views

Why does terminal vim enter replace mode with my vimrc file?

I mostly use MacVim, but sometimes I'm in the terminal and use the CLI vim. I recently decided to clean up my vimrc file, retaining only what I knew I wanted. It works fine with MacVim, but when I ...
1
vote
2answers
59 views

Run processes in shell while editing in Vim

I am a new Vim user. I can do : :! <some command> in Vim to run a bash command in Linux. After that bash command is executed, I can press Enter to go back to Vim. What happens if the bash ...
0
votes
0answers
14 views

How to diagnose configuration---:w doesn't always work [duplicate]

I've somehow introduced a problem in my Vim configuration and I don't know how to track down where the problem is. Sometimes (most times) when I do :w then the buffer is not actually written; ...
1
vote
1answer
34 views

Vim open a certain size but return to terminal window size when closed

so my terminal window size on MAC OS is 100 columns and 30 rows. When I open vim like this vim filename.txt I want the size to open to whatever size is specified in .vimrc (this works). The size in ...
1
vote
0answers
23 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 ...
0
votes
1answer
20 views

How to create a enum for command parameters for build integration

There are many build targets in the project, I would like to create a command, for example BuildFor. The idear is, the alternative parameter will present one by one while keep pressing the Tab key ...
1
vote
1answer
35 views

tabs after pastetoggle instead of spaces

Using following .vimrc " Just to see tab/spaces/endline clearly: set encoding=utf-8 set list set listchars=tab:▸\ ,eol:¬ nnoremap <F5> :set list!<cr> " Tab to spaces settings set tabstop=...
1
vote
1answer
33 views

How to map key to command-line mode command

I want to add a config line to my .vimrc so that when I select a grouping of lines in visual mode I can easily call :norm i# and norm x on them (to comment/ uncomment in python. The desired workflow ...
0
votes
0answers
34 views

Mapping Buffer Movement [duplicate]

How can I configure Vim and MacVim to respond to control-arrow and meta-{h,l} key-presses? The configuration below is ignored by both. I'm using iTerm2 (version 3.2.7), Tmux (version 2.8), and Vim (...
4
votes
2answers
54 views

Command works in ex mode but not during init (call)

When I run this command in ex mode it works without a problem: :call deoplete#custom#source('ultisnips', 'rank', 1000) However, when I put it in my vimrc I get an error: Error detected while ...