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.

186 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
13
votes
0answers
223 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
909 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 ...
4
votes
0answers
48 views

Vim ignoring a very long line

I have an html file that I am editing. It includes about 1MB of css and stuff from another site, which is all contained on one minified line, which I've folded: It also causes any jumps 'around' line ...
4
votes
1answer
112 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 ...
4
votes
0answers
196 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
0answers
42 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 ...
3
votes
0answers
331 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 ...
3
votes
0answers
476 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 ...
3
votes
0answers
515 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
27 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.fernyhough@york.ac.uk Übersetzt von jonathon.fernyhough@...
2
votes
0answers
29 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 ...
2
votes
0answers
52 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 ...
2
votes
0answers
45 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 %=. ...
2
votes
0answers
39 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 ...
2
votes
0answers
38 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><...
2
votes
0answers
47 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
0answers
77 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
51 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
408 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....
2
votes
0answers
51 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
62 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
1answer
2k 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 ...
2
votes
0answers
156 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
72 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
84 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
0answers
87 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
45 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
1k 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
285 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
1k 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
354 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
621 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
250 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
804 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
0answers
26 views

Typing colon character in Insert mode undoing changes?

I am really curious as to why this is happening. I have this line in my .vimrc file (I am using WSL2 on windows and this line helps support copying from vim to the system clipboard): set clipboard=...
1
vote
1answer
36 views

Copying vimrc does not work — plugins don't install and only throws errors

I watched tons of vim setup videos, for example this is last one and this person claims it takes 10 seconds to setup vim anywhere. He just opens vimrc file and it immediately installs all the plugins (...
1
vote
0answers
35 views

How to make Vim not be a line editor

Vim is famously (or infamously) a child of line-based editing. For many cases this is acceptable. But I wish to use it primarily as an academic tool with large amounts of text. I want the experience ...
1
vote
0answers
33 views

gvim remove menu and toolbar, but keep original geometry

I start gvim with this entry in .bashrc alias G='gvim -fg white -bg black -geom 80x45 ' and have in .vimrc set guioptions=aeik which works as expected and gives me a gvim that looks like vim in a tty, ...
1
vote
0answers
82 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 ...
1
vote
0answers
18 views

welcome message hidden by “exe” in timer function

My vimrc holds a script to change the color of the CursorLineNr conditionally based on the mode. My problem is that it hides vim's welcome message when it's launched without a file. I would like to ...
1
vote
1answer
60 views

:terminal colorscheme inside Vim is different from either Vim or Host Terminal

I have a gruvbox theme applied to Vim inside my vimrc. The problem is that when I run the :terminal command inside Vim the colorscheme is different from either the Vim theme or the terminal emulator's ...
1
vote
0answers
18 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 ...
1
vote
0answers
26 views

Only close first fold when file is opened

When I open a file, I want to automatically fold all outer most folds, so no nesting. Here is what I currently have in my config: set fdm=syntax set foldnestmax=20 set foldenable " set foldlevel=99 ...
1
vote
0answers
39 views

GitGutter sign not working

I have airblade/vim-gitgutter installed via Vundle. Somehow even with minimal .vimrc vim-gitgutter signs aren't working. My minimal .vimrc is given below, is there any problem there? Any help will be ...
1
vote
0answers
68 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 ...
1
vote
0answers
37 views

Re-mapping Swedish letters

On a Swedish keyboard to the right of the keyboard one has: O, P, Å L, Ö, Ä [ and ] are extensively used by Vim, and hard to reach on my keyboard, so therefore I've mapped these to Ö and Ä in my ....
1
vote
0answers
40 views

Is there anyway to check if cursor is on pumvisible suggestion or not?

I wrote the function below, https://github.com/ryuta69/dotfiles/blob/master/dotfiles/.vimrc#L129-L146 fun! DeoEnter() if !pumvisible() return "\n" endif if vsnip#available(1) ...
1
vote
0answers
48 views

How to set vim keymappings?

I am tryng to use https://github.com/terryma/vim-multiple-cursors, " Default mapping let g:multi_cursor_start_word_key = '<C-n>' let g:multi_cursor_select_all_word_key = '<A-n>' let ...
1
vote
0answers
14 views

Aspect-ratio-dependent configuration

I'm currently using ALE and pretty much enjoying it. By default, it puts its loc-list at the bottom of the screen. This is great on a vertical monitor, but when I'm using my laptop, I want it to be at ...