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
0
votes
0answers
13 views

How to disable super key from opening help.txt?

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 ...
0
votes
2answers
56 views

ctrl-n - should not insert text

When I am using the ctrl-n functionality (autocomplete word), it just inserts the text. I do not want to do that, instead, I would want to choose a word from the dropdown list, which I may then want ...
6
votes
1answer
916 views

Configure custom key mapping for plugin actions

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>...
1
vote
0answers
17 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 ...
0
votes
1answer
46 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
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 ...
2
votes
2answers
108 views

How to format quotes, so that Vim breaks long lines into multiple quotes on multiple lines?

For example, suppose I have this line of JavaScript: console.log( "This is a really long line that I want to format, and it is inside of a quote" ) I'd like to select the quote line in VISUAL-...
19
votes
4answers
2k views

How can I suppress the “reading from STDIN” message from within Vim?

When using Vim to read from stdin, it prints a informative message: $ echo foo | vim - Vim: Reading from stdin... $ This is just an example. The actual use doesn't allow shell constructs. vim <(...
1
vote
1answer
466 views

Mapping doesn't work for tabs

I have several files opened in tabs in Vim. I want to switch between tabs, so I use Ctrl+left to move left (previous) and for next also. But my mapping doesn't work. :map <C-Left> :tabprevious&...
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 ...
3
votes
1answer
57 views

Maps literally read < and > instead of the actual character

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 characters &...
2
votes
0answers
20 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
0answers
30 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/...
1
vote
1answer
62 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=...
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 ...
2
votes
2answers
71 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")
1
vote
1answer
20 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 ...
1
vote
0answers
26 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-...
0
votes
1answer
28 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
47 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?
0
votes
1answer
158 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 ...
2
votes
1answer
172 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 ...
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 ...
0
votes
2answers
109 views

Cursor in middle of the screen at start and end of file

I'd like to keep the cursor at the middle of the screen wherever I am in the file, without scrolling. This mean to have blank space above the file when I'm at the start of the file, and have blank ...
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, ...
4
votes
2answers
1k views

Sending command to different tmux pane from vim

behave test language need to execute different lines of the behave feature file, for example, if I want to test the line number 99, I'll need to input the following line in the terminal behave ...
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
60 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
46 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
60 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 ...
2
votes
0answers
56 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 ...
0
votes
1answer
146 views

How to set tabs in vimrc (Vim 8.1, Windows 10)

I thought this was straightforward i.e. put the command that works in the buffer viz "set ts=4" in vimrc but this does not seem to work if I also want the functionality provided by vimrc_example, ...
2
votes
2answers
1k views

set backupcopy=yes doesn't still writes the file twice

I'm trying to understand and eventually fix the following behavior: when I save a file using VIM, it triggers the change/write event twice. I'm using Ubuntu 16.10, and I created an empty .vimrc file ...
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
1answer
44 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
2answers
94 views

How do I disable a a key in Tagbar

I've mapped 'L' and 'H' to change buffers in vim. I often end up hitting these keys in NERDTree and Tagbar. I'm able to use NERDTreeAddKeyMap to make NERDTree ignore keys. Tagbar only allows the use ...
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
3
votes
3answers
59 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
3answers
806 views

Sourcing Vimplug plugins in a separate file

I am using the minimalistic Vimplug as the plugin manager for Vim. Installing plugins through Vimplug involves putting the following code inside the vimrc file. call plug#begin('~/.vim/plugged') ...
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 ...
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 ...
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 ...
2
votes
3answers
135 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 ...
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 ...
1
vote
1answer
140 views

/usr/share/vim/vimrc taking precedence over ~/.vimrc for textwidth

Here is my ${HOME}/.vimrc : set textwidth=0 set history=100 (FWIW, inverting their order has no effect, as one would expect.) It is read by vim (:echo $MYVIMRC returns the correct path), and indeed ...
7
votes
0answers
414 views

Unable to Enable Vim Conceal [closed]

I'm running ArchLinux using the xfce4 terminal with vim-latex. Using this setup, I tried to follow the instructions here to conceal latex commands with unicode. However, after much effort, I still ...
4
votes
2answers
89 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
2 3 4 5
21