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.

283 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6 votes
0 answers
494 views

How to get bold comments in vim

I am trying to add bold comments to my vim files. What i mean, is to be able to get something like this: I saw other articles like this that allow to toggle bold comment. The proposed solutions from ...
needle's user avatar
  • 181
6 votes
0 answers
4k 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 ...
tamlok's user avatar
  • 821
5 votes
1 answer
278 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 decide ...
Ujjwal Gupta's user avatar
5 votes
0 answers
2k 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....
jagjordi's user avatar
  • 161
5 votes
0 answers
607 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 ...
Luke Davis's user avatar
  • 1,397
5 votes
0 answers
2k 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 ...
Awl's user avatar
  • 51
5 votes
0 answers
239 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' '*...
BrianWilson's user avatar
4 votes
0 answers
1k views

Cannot set g:ale_fixers in ALE config on vim

I'm trying to config ALE in my vim and can't config the fixers, them aren't showing on ALEInfo. I'm setting the config for typescript files (with and without react) with prettier and eslint. What i'm ...
Wallace Coelho's user avatar
4 votes
0 answers
330 views

Unicode in vimrc no longer displaying correctly

I'm using VIM 8.1.2234 with +multi_byte and +multi_lang In my vimrc file, I have set listchars=tab:▸\ ,trail:· (Notice the "▸" and the "·") When I cat or less my vimrc, the text ...
LiamF's user avatar
  • 185
4 votes
0 answers
1k views

Vim adding blank line after each line when pasting from clipboard

When I copy-paste multiple lines from clipboard into my vim, it inserts a blank line after every line. But when I copy in into a text editor first and then copy-paste it into vim, the blank lines are ...
sh.3.ll's user avatar
  • 201
4 votes
0 answers
924 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 ...
Jay Lee's user avatar
  • 141
4 votes
0 answers
194 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 ...
john c. j.'s user avatar
4 votes
0 answers
744 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 ...
LastSecondsToLive's user avatar
3 votes
0 answers
85 views

How to use :PlugInstall intelligently

I have installed YouCompleteMe in the past, but don't remember how. I recently decided to sync my ~.vim directory over multiple computers via a cloud service and realized I was inadvertently ...
jdc's user avatar
  • 141
3 votes
0 answers
119 views

Safe configuration for editing pass entries

So I use the Pass program to store passphrases with gpg. To edit these entries you can use the $EDITOR environment variable. Now, I had set vim to store swap files and backup files with the following ...
Osinaga's user avatar
  • 31
3 votes
0 answers
139 views

How to remap deleting a word in insert mode?

My terminal emulator in which I use vim is alacritty, and I want the key combination control + backspace to do the same that control + w does when in insert mode (i.e. delete the entire last word). So ...
Richard's user avatar
  • 155
3 votes
0 answers
486 views

How to search the output of vim command line commands like `:ls`, `:browse oldfiles`

Back from emacs recently, in emacs I can list all the existing buffers in a emacs buffer, where I can do search, delete or jumping etc. In Vim, if I type :browse oldfiles, a long list may be returned ...
Yukun Du's user avatar
3 votes
0 answers
299 views

How to set rulerformat to align left and full width in vim?

I use ruler format like this, set rulerformat=%36(%5l,%-6(%c%V%)\ %f%)%* However, if the filename gets too long, it will be broken. So I like to align left, but It can't be align like statusline %=. ...
ryuta69's user avatar
  • 41
3 votes
2 answers
260 views

Prevent buffer loads within NERDTree

If I have many buffers opened and, if the cursor (focus) is within NERDTree, when I change the buffer with :bn or :bp, the content of buffer loads within NERDTree. There's a way to, before buffer ...
Diego Somar's user avatar
3 votes
0 answers
487 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 ...
haolee's user avatar
  • 275
3 votes
1 answer
2k views

Make YouCompleteMe open definition in vertical split even if buffer is not saved

There is something I cannot do with YouCompleteMe that I could do when just using tags to navigate to a definition or declaration. The desired behaviour is (taking into account that , is my leader ...
user2891462's user avatar
2 votes
1 answer
407 views

Cannot open terminal ini nvim

I installed Plugin terminal using the vim-terminal plugin and try to execute :TerminalSplit bash but before the terminal open I got a warning message. Python 2 interface is not installed, using Python ...
Muhammad Fhadli's user avatar
2 votes
0 answers
219 views

How to configure cursor shape in visual, visual block modes?

I configure cursor shape in normal, insert, and replace modes with the following in my vimrc let &t_SI = "\<Esc>]50;CursorShape=2\x7" let &t_SR = "\<Esc>]50;...
Aaron Parisi's user avatar
2 votes
0 answers
764 views

Disable underline for Markdown links

If you have set wrap and there is hyperlink that is located in the "bad" place, you may see a long trailing underline after it: Is it possible to disable underline for Markdown hyperlinks ...
user90726's user avatar
  • 113
2 votes
2 answers
690 views

Plugin conflicts over BufWinEnter Autocommands

I have vim-markdown and nerdtree installed. And everything was working fine until I added the following to my .vimrc (verbatim from the nerdtree readme) " Open the existing NERDTree on each new ...
ghostshell's user avatar
2 votes
0 answers
1k views

Neovim - blend transparent highlight colors

I am trying to make the NvimTree background a different color than the main neovim window, while retaining transparency set by Alacritty. The desired panel can be made fully transparent with :...
NeovimNoob's user avatar
2 votes
1 answer
897 views

Remapping Ctrl+backspace in insert mode to delete one word back

I want to bind Control+Backspace in insert mode to delete a word. I'm able to bind Control+Del in both insert and normal modes, but I can only seem to bind Control+Del in normal mode. I've checked ...
User's user avatar
  • 21
2 votes
0 answers
486 views

Does vim-easymotion only work in neovim?

I was wondering if the easymotion-overwin was compatible with vim, or does it only works in neovim? I have my .vimrc's keymaps setup like this for easy-motion "----- Easy-Motion ----- map <...
needle's user avatar
  • 181
2 votes
0 answers
154 views

Nerdtree display current opened file after jumping into a tag

I'm not sure if this is possible, I have my nerdtree opened for file let's say main.cpp. Then I use tag jump to one of the definitions which is in a different directory but nerdtree window still shows ...
JZ67's user avatar
  • 55
2 votes
1 answer
1k views

Vim to highlight functions and user-defined types

I have two scenarios where I want vim to highlight those items. Currently my fix for these are to add the return types directly into the after/syntax/c.vim file, but this gets incredibly tedious. Here ...
David542's user avatar
  • 2,365
2 votes
0 answers
61 views

gvim on ubuntu breaks the console when calling system command in vimrc

I use this version VIM - Vi IMproved 8.2 (2019 Dec 12 kompiliert am Aug 29 2020 14:11:37) Inklusive der Patches: 1-1539 Verändert von jonathon.fernyhou[email protected] Übersetzt von jonathon.fernyhough@...
slash's user avatar
  • 73
2 votes
0 answers
79 views

How to delete the previous buffer when loading new result from quick-fix window?

In the quick-fix window, if I'm loading new results, the previous buffers stay which I don't want. I want only those buffers to stay which I open intentionally (e.g. to write new code, do diff of ...
Haris Muzaffar's user avatar
2 votes
0 answers
210 views

Vim folding very slow on large file

I have a large python file (~ 4k loc) and even if I do one manual fold in the code, it seems like all actions take about 3x longer to do, regardless of whether it's in or out of the fold, close or far ...
David542's user avatar
  • 2,365
2 votes
0 answers
2k views

Understanding local (s, l, and a) variables

From the docs, local variables are defined as: script-variable s: Local to a :source'ed Vim script. function-argument a: Function argument (only inside a function). local-variable l: ...
David542's user avatar
  • 2,365
2 votes
0 answers
267 views

Resource for highlight syntax debugging

I’ve been developing a Vim syntax file for ISC Bind 9.15+ The stock named.vim that came with Vim is quite outdated (V9.4) About 89 syntaxes out of 498 have been completed so far to catch up. But ...
John Greene's user avatar
2 votes
0 answers
68 views

How to disown a process opened by plugin? (vim-rmarkdown)

as I said in the title I'm talking about vim-rmarkdown, I have this in my init.vim (I'm using neovim) to compile the .rmd file to a pdf. autocmd Filetype rmd nnoremap <F5> :w<Space><...
r1amu's user avatar
  • 66
2 votes
0 answers
252 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 ...
Matteo Riva's user avatar
2 votes
1 answer
1k 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 ...
Me.'s user avatar
  • 43
2 votes
0 answers
95 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 ...
Sean's user avatar
  • 121
2 votes
0 answers
59 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 ...
Thunderbeef's user avatar
2 votes
0 answers
85 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, ...
Spiffidimus's user avatar
2 votes
0 answers
354 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 * ...
anti-destin's user avatar
2 votes
0 answers
119 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 ...
j4nd3r53n's user avatar
  • 141
2 votes
0 answers
3k views

Exclamation mark after autocommands

I'm trying to understand what does exclamation mark after autocommands mean. Sometimes it is possible to see something like this: function! LangSpecificOptions() if (&filetype == 'markdown' || ...
john c. j.'s user avatar
2 votes
0 answers
145 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>...
Greg Nisbet's user avatar
  • 1,839
2 votes
0 answers
66 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 ...
guestuser001's user avatar
2 votes
1 answer
4k views

NeoVim: colorscheme won't work in init.vim; requires command to be typed

I'm new to NeoVim and just getting started. My init.vim file under NeoVim\share\nvim\runtime\plugin\init.vim successfully sets everything except for the colorscheme and background. As seen in the ...
ei2's user avatar
  • 59
2 votes
0 answers
2k 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 [email protected] ...
scrapy's user avatar
  • 91
2 votes
0 answers
490 views

DelimitMate plugin for vim not working

I am new to vim, so I installed the plugin DelimitMate to my vim. But it is not working in my vim -version 7.4.1689.My plugin manager in pathogen.I searched on everywhere to solve this problem but ...
Shivam's user avatar
  • 21
2 votes
0 answers
385 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 ...
solalito's user avatar
  • 363

1
2 3 4 5 6