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.

Filter by
Sorted by
Tagged with
1
vote
1answer
26 views

How to put quotation marks (') in the content of a vim macro?

I use :%s/'/"/g to replace all single quotes ' with double quotes " in a plain-text file but when I want to put this command in a vim macro in .vimrc let @r=':%s/'/"/g' opening vim will give me ...
0
votes
0answers
25 views

How to disable super key from opening help.txt? [closed]

I would like to disable help.txt from opening when I press the super key, I use window manager and super + h/j/k/l to get around. It's really annoying to have the help open when I'm trying to move ...
2
votes
0answers
18 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
22 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><...
0
votes
1answer
32 views

Change color of CoC suggestion box

I successfully installed CoC in my Vim to have some code-suggestions/completions while coding in Rust. It works fine, but I want to change the color and basic looks of the suggestion box. I tried ...
1
vote
1answer
49 views

Configuring CoC — open suggestion-box with shortcut only

I successfully installed CoC in my Vim to have some code-suggestions/completions while coding in Rust. It works fine, but I want make the suggestion-box only show up when I press a key-shortcut (E.g ...
0
votes
0answers
34 views

Trouble sourcing YAML syntax highlighting

I'm doing some Ansible work (on RHEL 8), so I want the YAML configs for vim. I have a yaml.vim file containing the syntax/etc, and a ~/.vimrc file: autocmd BufNewFile,BufRead *.yaml,*.yml so ~/.vim/...
0
votes
1answer
23 views

Tabs and only tabs for any file type

I would like vim to only ever insert a space character when I touch the space bar. Instead vim decides that sometimes tabs should be 4 spaces. How do I force vim to always and forever use tabs ...
1
vote
1answer
31 views

Can you use plugins inside of your vimrc?

I recently learned the very hard way that vim-plug will only load plugins AFTER the vimrc is completely sourced: https://stackoverflow.com/questions/21322520/why-wont-vim-recognise-a-plugin-command-in-...
1
vote
1answer
21 views

vimrc command not working - vmap <F9> :'<,'>s/</\&lt;/g | '<,'>s/>/\&gt;/g

I want to replace in highlighted text the angle brackets < and > with &lt; and &gt;. The following line in my .vimrc doesn't seem to work: vmap <F9> :'<,'>s/</\&lt;/g ...
2
votes
2answers
72 views

Get the dir of $MYVIMRC and concatenate a different file path

Within some run time files I would like to source a file relative to the $MYVIMRC file. My best efforts have lead me to this (which does not work): source expand("$MYVIMRC:p:h") . "/vimrc/env.vim")
0
votes
2answers
34 views

I can't get solarized plugin to work in vim (I am using vim-plug)

I just started using vim. As I understand it, using a plugin manager is the easiest way of installing plugins for vim. So I thought I would try vim-plug which I installed using curl as explained here....
0
votes
1answer
26 views

Vim ignores `filetype indent off`

I don't have a personal vimrc. I use /etc/vimrc. The last 2 lines are: let testvar=999 filetype indent off I confirmed execution at the vim prompt using :echo testver, which displays 999. I tried ...
0
votes
0answers
25 views

Can't have a proper version of vim with Python

I am on Mint 18.3 Sylvia. I tried to install different versions of vim to have python support, following diverse advices (vim/vim.bacic/vim.gnome/vim.gtk/vim.gtk3/vim compiled from git). I have now ...
1
vote
0answers
44 views

Can't figure out where this mapping comes from

For more than a year, I have unmap <C-X> in my .vimrc because I can't figure out where this mapping comes from. I used verbose map <C-X> as suggested in another topic, it returns v &...
1
vote
3answers
48 views

Create a mapping for a “smart” Home key

With other text editors, if you press Home, it first takes you to the indent, then all the way to the left. Is this possible with Vim?
1
vote
0answers
20 views

How to use powerline fonts in wintab

I cannot for the love of me figure out the configuration needed to use wintabs powerline in vim wintabs. Please help me. I want to make my vim look beautiful.
2
votes
1answer
65 views

vimrc error E33 and syntax highlighting

All I was trying to do is enable syntax highlighting on my local machine that matches the syntax highlighting on my remote. I googled around and someone explained that all that was needed was a ...
1
vote
1answer
51 views

VimPlug, Vim won't load plugins: E117: Unknown function : plug#begin;

On Macbook Pro, Terminal, standard Vim, VimPlug When I start vim I get the following message: Error detected while processing /Users/me/.vimrc: line 159: E117: Unknown function: plug#begin In my ....
1
vote
1answer
37 views

Mouse click on VIM tab to create new window

In VIM when I execute set mouse=a, then I can use mouse to navigate. That's good. And when I need a new window for editing, I can double click on a tab. VIM will open an empty window for me. However, ...
0
votes
0answers
31 views

Vim not displaying character values correctly

I opened up vim and noticed that nothing is displaying properly. mI have no idea of the cause as last time I was in vim there was nothing of the sort. I have tried setting the encoding
1
vote
1answer
46 views

Disable automatic whitespace marking in red

I am experiencing a behavior as depicted in the picture below: vim marks the redundant spacing in red. I would like to completely remove this behavior. At the moment my .vimrc file reads as: set ...
3
votes
3answers
60 views

How to get the previous session every time I start vim? [duplicate]

Say I have a couple of .py files open in vim. How do I ensure that the previous setup will be opened as it is every time I start vim(Just like VS code).
0
votes
0answers
25 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 ...
2
votes
0answers
29 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 ...
1
vote
1answer
43 views

Comment highlight group does not work without reloading .vimrc

The following line in my ~/.vimrc: hi Comment ctermfg=gray does not take effect unless I start Vim and then use :source to reload .vimrc. As far as I can tell, all of the other hi commands work ...
0
votes
1answer
35 views

Deleting comments from the beginning of selected lines

I have written a vimscript function to toggle comments on/off on lines selected in visual mode. The function successfully adds comments but freezes when I try to uncomment selected lines. The ...
4
votes
2answers
48 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
1answer
86 views

Problem remapping key bindings in command line mode

To make it easier to edit my ~/.vimrc file, I set up the following: :cnoremap ev :<C-u>vsplit $MYVIMRC<cr> So, to open ~/.vimrc in a split I just enter command mode and enter ev. However,...
2
votes
1answer
36 views

Listchar for Preceding Indentation Space

At the moment, I'm trying to highlight the spaces/tabs used for indentation and the end-of-line with special characters. Although I prefer tabs over spaces I also need the spaces highlighted in order ...
1
vote
1answer
61 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 ...
3
votes
1answer
57 views

How to override ftplugin set commands in Neovim

One thing I hate about a lot of the default Vim plugins is that they add o to formatoptions. In Vim I would get around this by using au FileType * set formatoptions-=o in my vimrc, but for some reason ...
1
vote
2answers
51 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
2answers
67 views

How to delete a character that is present between two specific characters from every line in VIM?

I have a CSV file in which data in a row are present in following way: ID, Name, State, Score, Rank In the Name Column, data are in "some Name" form. But there are many entries in which a comma is ...
1
vote
1answer
74 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
23 views

Problem copying form vim to system clipboard [duplicate]

I usually do this with "*y (from visual mode), but on the linux box I'm working with (lubuntu) when I press * after " in visual mode, vim doesn't insert * (it just ignores the whole "*). If I check * ...
2
votes
2answers
66 views

Do not delay mapped keys with common prefix

What I want to do is have two mappings. One mapped to <s-k>, and one mapped to <s-k><s-k>. What happens right now is that if I press <s-k> vim delays for timeoutlenms, and if ...
1
vote
1answer
40 views

How to turn on airline theme's background in vim?

I just started using vim and I installed tpope/vim-pathogen and then vim-airline/vim-airline-themes plugin to use these themes. Then I changed my .vimrc to set up the papercolor theme, powerline fonts ...
1
vote
2answers
39 views

How to start search `/` from a mapping?

I'm trying to do the following mapping in my vimrc: nnoremap <silent> / :call <SID>FooFunction()<CR><BAR>norm! / But when I press /, instead of running the function and then ...
4
votes
2answers
92 views

Howto enable only one plugin to test?

I need to test a vim plugin. The problem: I already have my vim setup in current env, so ~/.vimrc is occupied. I want to issue a command like vim -u <blah..blah> that maybe specifies the plugin ...
1
vote
1answer
55 views

Why does this autocmd not work

I write this line to the ~/.vim/ftplugin/c.vim file, but nothing happens when I create a new C file: autocmd BufNewFile *.c read ~/skeleton/c Afterwards, I added this line to $MYVIMRC: autocmd ...
2
votes
1answer
189 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
63 views

How to enable part of my vimrc to only apply in gVim?

I run Vim using both gVim and in terminal. Basically, I want to enable a certain colorscheme in my vimrc but only when in gVim, as the theme looks terrible in terminal. How do I accomplish this?
1
vote
0answers
50 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 ...
0
votes
2answers
45 views

Recursively source files under a folder except *.bak

As title howto source all files under a folder recursively except files that end with .bak
3
votes
1answer
20 views

Use mapped shortcut without timeout

I have these in my .vimrc: set notimeout nnoremap <leader>n :set rnu!<CR> nnoremap <leader>h :<C-u>call Toggle_colorcolumn()<CR> <leader>n works instantly; <...
2
votes
1answer
38 views

Why does this binding break the quickfix window? [duplicate]

If I have this vimrc: set nocompatible nnoremap <C-m> ^^ When I try to open a file from the quickfix window by pressing enter nothing happens. If I comment out the last line, so the vimrc is ...
0
votes
1answer
33 views

How do I receive an alert message indicating that persistent undo will be ignored?

I am using Vim 7.4. According to vim's help on persistent undo: An undo file is also ignored if its owner differs from the owner of the edited file. Set 'verbose' to get a message about that when ...
3
votes
2answers
122 views

How to change location of ~/.vim

I have Vim 7 installed from my distro's package manager, and I compiled Vim 8 from source. Vim 8 is all in /usr/local. Then I created a new directory in $HOME called ".vim8". I have all my Vim 7 stuff ...
3
votes
2answers
90 views

`system()` can't get output of shell command in vimrc

I want to enable some configurations only when the distribution is Fedora. Here is my code. let s:os = system("sed -n 's/^NAME=\(.*\)/\1/p' /etc/os-release") echo s:os if s:os == "Fedora" " ...

1
2 3 4 5
21