Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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
1answer
27 views

Vim command 0 goes to second column instead of first one

When I press 0 in Normal mode, the cursor goes to the second column and not the first one. This is not the normal behavior stated in vim's :help 0. I have tried disabling the remaps to move between ...
0
votes
2answers
17 views

VIM How to enable .ts .tsx .js (for front-end) code highlight?

I have .vimrc plugins " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'VundleVim/Vundle.vim' Plugin 'nanotech/...
0
votes
0answers
20 views

Two lines in command area how to make a single line

I have two lines in the command area. How to make a single line?
1
vote
2answers
41 views

Make a buffer active by its number

I'm configuring a terminal buffer and now I have the following problem. I have only one terminal buffer and I need to make it active by its number to avoid lots of CTRL-w j/k/l clicks. Here is what ...
2
votes
2answers
27 views

Map CTRL-& in vimrc

I'm trying to re-map tagbar toggling with <C-&> that I get used to when working with IDEs. But setting execute "nnoremap <C-&> :TagbarToggle<CR>" does not have the ...
0
votes
2answers
30 views

Enable cursor blink in all modes for terminal Vim

I am relatively new to vim and tried to understand this article and also read :help guicursor and inserted this line in my .vimrc set guicursor+=a:-blinkwait175-blinkoff150-blinkon175 But it didn't ...
1
vote
1answer
32 views

How to set custom shortcut in vim?

I want to make use of Shift+Tab to left-shift (unindent) a block of text, instead of Ctrl+d. How to do it?
2
votes
1answer
46 views

Syntax highlighting stopped working

I was just started with Vim. While experimenting with basic customization techniques, it began to behave differently. Somehow the default configurations changed to very basic for both GVim and ...
1
vote
1answer
33 views

Toggle terminal buffer vimscript function

I'm new to vimscript and writing a function to toggle a terminal buffer. Here is what I tried: let g:toggle_term = "<C-j>" let g:term_buf_nr = -1 function! ToggleTerminal() if g:...
3
votes
1answer
35 views

Sourcing vimrc duplicates statusline in nvim

I'm new to vim so I'm not sure if this is intended behavior or not, but it seems like a bug. Desired Behavior After sourcing vimrc from within nvim, don't duplicate the contents of my statusline. Or ...
0
votes
1answer
25 views

Is it possible to make a terminal frame to be appeared on the bottom, not on the top?

I'm using :term bash to show a terminal buffer as it is specified in :h terminal-use. But the problem is that it is appeared on the top of the currently active vim buffer. Is there a vimrc ...
1
vote
1answer
26 views

Autoreload vimrc when writing to vimscript files

I wanted to have my vimrc automatically update when I write to a .vim file using this autocmd: autocmd BufWritePost *.vim,$MYVIMRC source $MYVIMRC But for some reason when I have this enabled and ...
0
votes
0answers
19 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....
1
vote
2answers
51 views

Is there a way to paste at multiple locations/lines in vim?

I use :copy a fair bit. So like range :12,15 copy 20 will paste a block of text from 12 to 15 lines at 20th line. But when I want to paste a line at multiple places it doesn't work. For example :24 ...
0
votes
0answers
44 views

How to control .cache folder location?

Is there an option to control .cache folder location in Vim? Is there a setting or a variable for this?
2
votes
1answer
40 views

Is there a 'toggle' :set option?

In my $VIMRC I have: nnoremap <leader>A :set formatoptions+=a<cr> nnoremap <leader>a :set formatoptions-=a<cr> What I'm wondering is if there's something more like: nnoremap ...
2
votes
0answers
30 views

Issues in changing font size in vim

I using konsole terminal emulator and I am facing some issue with changing the font size in vim. If I add the following snippet into my .vimrc. In the vim application, the font size will snap back to ...
1
vote
1answer
22 views

How to use matchadd to add exact word?

Referring to answer from this link.. Adding two groups, :highlight MyGroup1 ctermbg=green guibg=green :highlight MyGroup2 ctermbg=blue guibg=blue Then adding two words foo and bar into specific ...
0
votes
1answer
28 views

How to create a custom colorscheme in which define custom highlight group each of containing set of words?

Let's assume we want to create a custom colorscheme. For example, content of a custom colorscheme file ~/.vim/colors/mytheme.vim are as follows, " syntax highlighting groups hi Comment guifg=#007f7f ...
1
vote
0answers
26 views

vim doesn't load syntax for a single file

I was toying around with my .vimrc editing it, and then checking in another file whether my changes worked or not. But now I ended up in a state where opening one file with vim file1.tex (this was ...
1
vote
1answer
59 views

Gvim 8.1 on Windows 10 won't source $HOME\_vimrc

I have a $HOME\_vimrc present, but it doesn't show up in the output of :scriptnames. And when I run gvim -V, it reports: could not source "$HOME\_vimrc" The only thing in my $HOME\_vimrc is the ...
1
vote
1answer
24 views

I'm using a colorscheme installed with vim-plug, how can I change the color of the line numbers?

I'm using this colorscheme, how can I change the color of the line numbers? I think that the colorscheme will overwrite anything I'll put in .vmrc.
1
vote
1answer
29 views

Why can't I install this colorscheme properly?

I'm trying to install this colorscheme. They instructed to use a package manager so I've used vim-plugged: Plug 'rakr/vim-one' While my colours on vim did change, it really does not look like the ...
0
votes
0answers
35 views

Send keystrokes and string to gdb terminal

I started debugging a c program inside vim with: :packadd termdebug :Termdebug with vim 8 and and gdb > 8.3 installed. In order to set a breakpoint, I would like to send the following string while ...
0
votes
0answers
32 views

Center current line to the center of screen when opening a file

I would like to execute 'zz' to center the current line to the center of the screen when opening a new file. I have tried the following, but it does not seem to be working for some reason: autocmd ...
0
votes
2answers
50 views

Making operator insert and append repeatable

Is there an insert and append operation that can be followed by a text-object? I've found this plugins: https://github.com/deris/vim-operator-insert https://github.com/mwgkgk/vim-operator-insert ...
1
vote
1answer
41 views

Underscore suddenly a word boundary

I now have Vim version 8.1.2102 from Sep 30 2019 15:45:59 on Fedora 30. For some reason the word boundary in C++ code now also includes the underscore somehow, so I see this: When I have the cursor ...
1
vote
0answers
33 views

How to make “view” read vimrc?

view is the readonly mode of vim. I would like view to read the exact same .vimrc file for its initialization as vim already does. view does not seem to read ~/.vimrc by default (I checked by adding ...
0
votes
1answer
56 views

Keep indentation after multiple newlines

I've got a problem where in insert mode, if I type something like { that will cause indentation, then press enter twice, then match that bracket (such that there is a line in between the opening and ...
2
votes
1answer
196 views

Efficient Syntax Highlighting

I am using VIM as a note taking application and have created syntax highlighting to assist with readability. See below or the repo for all the files. syntax match Timestamp /^\d\d:\d\d \d\d[/]\d\d[/]...
0
votes
2answers
41 views

How to remap Autocomplete on Control+N, to Control+Space?

I am trying to remap this functionality: to Ctrl+Space, by using this line in .vimrc inoremap <C-Space> <C-n> However, I can not seem to get it to work. If I press Ctrl+Space after ...
1
vote
0answers
35 views

How to use actual window size to control vim settings?

Background: neovim with tagbar plugin installed Goal: when starting nvim, if current window size is larger than 100, open tagbar and set auto-open for new buffers. Currently I use the settings below ...
2
votes
0answers
43 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 ...
1
vote
1answer
29 views

Vim - swaping the curly braces and brackets, breaks the plugin shortcut

I want to swap curly braces and brackets. The problem I encountered is that some plugin shortcuts dont trigger. Here's example. If I put this in my config file: nnoremap { [ nnoremap [ { then ...
0
votes
0answers
27 views

How to remove blank line at the very bottom of the UI

To make things easier to explain, please see below a screenshot of VIM running on my computer. How can I get rid of that blank line at the very bottom, i.e. below the "n lines, p characters written" ...
3
votes
2answers
113 views

Multiple vimrc files for different file types in vim?

I'm a vim beginner. I want to handle multiple programming languages. I find great resources for how to perfect vim for one programming language by putting ton of stuff in one vimrc file. This is ...
0
votes
0answers
20 views

Auto-insert C++ comment only on <shift+enter>

The comment auto-insert feature is often very helpful and otherwise very annoying, depending on the kind of comment I am writing. Is it possible to bind the auto-insertion of // exclusively to <...
0
votes
0answers
49 views

VIM suddenly highlighted the spaces in my file how do I turn this off?

I just recently used Vim as my code editor. It was working fine then suddenly when I opened a file to edit my code this happens. When I open the file nothing is highlighted. But when I start scrolling ...
0
votes
0answers
26 views

How can I complete both words and WORDS? [duplicate]

I found this question, but mine is a bit different. When I write code dealing with arrays or classes like $myArray['myElement'] or document.getElementById("myElement"), I get annoyed because I have ...
2
votes
1answer
36 views

How to disable arrows in insert mode VIM

I want to disable my VIM-arrows in VIM, to get used to move the cursor using hjkl. I have tried a lot of different approaches found on this forum, however, i can't seem to disable the up and down ...
0
votes
2answers
53 views

What's the fastest way to open up .vimrc?

I'm just getting into Vim, and, as one might expect, I'm constantly adding things to my .vimrc. At the moment i'm using :tabe ~/.vimrc and I was just curious if there was a quicker command for getting ...
1
vote
1answer
33 views

Search for more then one numeric value in vim

I am trying to search for numeric values in files. I use / command to start my search (/34587). However I need to add more then one search criteria (i.e. finding value 3487 and 09087 for instance). ...
1
vote
0answers
29 views

Vim unknown colored block

My vim on WSL has some unknown colored blocks. The weird thing is it happens randomly and some colored blocks would disappear when I pass them using cursor. The following is my .vimrc settings: ...
0
votes
1answer
37 views

Syntax Question for exec (executing two commands)

In my .vimrc, I have the following exec command: inoremap <C-f> <Esc>: silent exec '.!inkscape-figures create "'.getline('.').'" "'.b.vimtex.root.'/figures/"'<CR><CR>:w<CR&...
1
vote
1answer
69 views

Same plugins for every .vimrc file (vim-plug)

I have a question regarding the following situation: I want to use a default .vimrc and a vimrc (name it .vimrc2) for a special purpose. However, when I start vim with vim -u ~/.vimrc2 I have the ...
0
votes
2answers
52 views

Reload complete configuration from within vim

Every now and then I update my ViM configuration, and I would like to have a way to reload everything. I know that I could use :source ~/.vimrc and I could run it similarly for all the modified ...
1
vote
2answers
48 views

Moving the cursor a large number of times in a nnoremap

I have a shortcut in my vimrc to search for a string through my repository: nnoremap <leader>gg :vimgrep // **/*.py \| clist I want the cursor to be between the // characters ready for a ...
2
votes
1answer
62 views

Helptags gives: E488: Trailing characters

I am relatively new to vim. I made my .vimrc file watching different tutorial in order to use vim mainly as a python IDE. I am using pathogen as plugin manager and I have recently installed python-...
5
votes
1answer
484 views

How do I remap “å” to type “å”?

I recently came over some use for letters like æ, ø, and å. For context, these are available on my keyboard, and work fine in other programs. It's also a Norwegian keyboard if that's relevant. With ...
1
vote
1answer
37 views

In Vim how to keep markers per session?

I use sessions to separate projects in my workflow. - info.txt file that I always mark "I" - log.txt file that I always mark "L" But when I switch sessions, my markers are kept from the last ...