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

'BufNewFile,BufFilePre,BufRead' or simply 'BufFilePre,BufRead' when detecting a filetype?

The following snippet is from the vim-pandoc-syntax plugin README: If you want to use vim-pandoc-syntax without vim-pandoc, you'll need to tell Vim to load it for certain files. Just add something ...
john c. j.'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
1 vote
1 answer
317 views

How can I open netrw in a split when opening a directory?

I have figured out how to open a file browser in a split, using the following in vimrc: let g:netrw_liststyle = 3 let g:netrw_banner = 0 let g:netrw_browse_split = 4 let g:netrw_winsize = 25 let g:...
Christoffer Reijer's user avatar
1 vote
1 answer
307 views

NerdTree... after using <m> bottom panel stays bigger and wont disappear [duplicate]

When using Menu in NERDTree to create a directory/file and toggle it off, will keep bottom window open.
Hernan Di Tano's user avatar
0 votes
1 answer
157 views

How to change editor options when switching to diff mode?

I have a few options I like to apply both when Vim is opened in diff mode and when it is switched to diff mode, e.g., when calling diffsplit. I have the following lines in my ~/.vimrc: command! -nargs=...
Matt's user avatar
  • 177
1 vote
1 answer
89 views

Certain commands in vimrc not being picked up anymore

I am having an issue where anything I enter into my .vimrc file is not being picked up, regardless of how many times I add it / close the file / re-open it, etc. Here is the most basic example of what ...
samuelbrody1249's user avatar
1 vote
1 answer
33 views

To not treat files like 'vimrc-tips.txt' as Vim Script files

There is a line in defaults.vim that enables Vim Script syntax for any .txt file with vimrc in its filename (for example, vimrc-tips.txt): au BufNewFile,BufRead *vimrc* call s:StarSetf('vim')...
user90726's user avatar
  • 113
0 votes
1 answer
212 views

'autocmd OptionSet' - How to make it work?

The following .vimrc snippet is by Martin Tournoij's answer posted here: How do I stop the colorcolumn from breaking into multiple pieces when there are wrapped lines? augroup wrappedcc autocmd! ...
john c. j.'s user avatar
1 vote
2 answers
62 views

Some settings don't work because of their arrangement. Is it possible to workaround this?

I try arrange settings in my .vimrc in the exact order and by using the same sectioning as if you click "Edit" (in the menu) and then "Settings Window". There is problem that when ...
user90726's user avatar
  • 113
0 votes
1 answer
281 views

To not wrap at 'textwidth' if 'filetype' is 'text'

I want to ask Vim to not auto-wrap text at the textwidth value. For this, I adopted a function from the following article: Vim: Set wrapping and indentation according to file type. The autocmd doesn't ...
john c. j.'s user avatar
0 votes
0 answers
703 views

Coc.nvim doesn't work correctly

Yesterday, I installed coc.nvim in vim on windows. I remember that it showed up the suggestion tab. But today, I removed go and visual studio, then it didn't show up anymore. I tried to reinstall Go, ...
Anh Nguyen's user avatar
1 vote
1 answer
123 views

"autocmd!" on a separate line vs. "autocmd! <the autocmd itself>"

From what I have read in a book by Steve Losh (chapter 14), it seems that to avoid performance issues, it is best practise to enclose autocommands, even the single ones, in autocommand groups: augroup ...
james's user avatar
  • 129
5 votes
1 answer
95 views

Is it possible to wrap and properly align inline comments?

set textwidth=60 let &colorcolumn=&textwidth set linebreak Is there a relatively simple way (that is, with using formatoptions only) to make Vim format inline comments (gq) from this: ...
john c. j.'s user avatar
0 votes
2 answers
54 views

Avoid "cannot find spell file" window

I have set spelllang=en_us,ru_ru in my .vimrc, and when I enable spell check by typing :set spell, Vim shows me a pop-up window that says that the dictionary for the second language is not installed. ...
john c. j.'s user avatar
2 votes
2 answers
370 views

Is it possible to modify default statusline without resetting it to blank?

Normally, if you add something like set setting+=value into your .vimrc, the value will be appended to the existing ones. For example: set formatoptions+=j " => tcqj However, it seems it ...
user90726's user avatar
  • 113
1 vote
1 answer
126 views

Remap CTRL-x in insert mode

I want to remap <C-x> in insert mode (I do not use the completion commands via this key). This is what I tried: inoremap <C-x> <Esc> :x <Enter> inoremap <C-x> <C-o>...
Tom's user avatar
  • 43
0 votes
3 answers
400 views

Vim copy/paste from clipboard while keeping indentation

I am using Putty on Windows to connect to a Linux server. On the Linux server I am using Vim to edit code files. I am using my mouse to select an area to copy and then right click to paste the copied ...
Subzero123's user avatar
0 votes
0 answers
39 views

'set fileencoding' for new files. Vim says it won't work, but is it really so?

set encoding=utf-8 set fileencoding=cp1251 set fileencodings=ut8-8,latin1 set laststatus=2 set statusline=%{(&fileencoding)} Vim help says that only global value of fileencoding won't for new ...
user90726's user avatar
  • 113
3 votes
2 answers
272 views

Make Vim _really_ work with both spaces and tabs

Here is what I use for indentation: set autoindent set breakindent set expandtab set smarttab set shiftround set shiftwidth=2 softtabstop=-1 " or maybe shiftwidth=2 softtabstop=8 " https://...
john c. j.'s user avatar
0 votes
1 answer
61 views

Different highlighting between foldtext and "the line number on the folded line"?

Can I control the highlighting of the foldtext separately from the color of the line number on a folded line? I want the foldtext to be quite visible while keeping my chosen line number color
Aaron Parisi's user avatar
0 votes
1 answer
115 views

.vimrc in local folder

Can I have a .vimrc file in local folder, so that each time I open files in that folder, vim will automatically load that .vimrc file? so that I can have different settings in different folder?
Jiang Yuanhao's user avatar
0 votes
1 answer
55 views

Set location to be same as path

I keep a vimrc file stored on Dropbox and use symlinks to point to this so my vimrc is always synced up. Recently I got a new laptop and the location of some utilities are different from that of my ...
Lockjaw's user avatar
  • 145
0 votes
0 answers
36 views

How do I disable syntax highlighting in the changelist?

I want syntax highlighting off in menus like the changelist (accessed via :changes). Is there a setting for this?
Aaron Parisi's user avatar
1 vote
1 answer
67 views

Why is my changelist not working? [closed]

I'm using homebrew-installed vim My changelist looks something like this: 10 250 0 nmap <leader>rn <Plug>(coc-rename) 9 266 11 set report=0 8 267 20 set display+=...
Aaron Parisi's user avatar
0 votes
1 answer
48 views

Why is this mapping deleting text?

I'm using these two binding for indentation and dedentation of a visual selected block of text. " Indentation vmap <TAB> >gv " Dedentation vmap <S-TAB> <gv When I ...
hmaier's user avatar
  • 113
1 vote
1 answer
149 views

How to remap :bn and :bp [closed]

I have these remaps for buffer switching in my .vimrc let mapleader = ' ' nnoremap <leader>bk :bw<CR> nnoremap <leader>bn :bn<CR> nnoremap <leader>bp :bp<CR> If I ...
Shawn's user avatar
  • 11
1 vote
1 answer
99 views

How can I turn off syntax highlighting for man pages?

I open man pages in vim, per export MANPAGER="vim -M +MANPAGER -" in my zshrc. However, vim has syntax highlighting enabled when it opens a man page. Is there a way to ensure man pages ...
Aaron Parisi's user avatar
1 vote
1 answer
62 views

Why are incsearch and hlsearch disabled when opening a .csv file?

I like the incsearch and hlsearch options in Vim, so early on in my .vimrc file, I have the following lines: augroup allfiles autocmd FileType * :set nocindent noexpandtab incsearch hlsearch ...
Gern Blanston's user avatar
0 votes
2 answers
354 views

Can vimrc 'tell' if syntax is on or off?

I want to write a simple function that will toggle syntax highlighting, I imagine it'll just be a simple if-else. Is there a condition I can check? If "syntax is on"?
Aaron Parisi's user avatar
0 votes
0 answers
23 views

Arrow characters are left behind on the screen

Whenever I press and hold any arrow key (e.g. h, j, k or l) they appears on screen as such: The same kind of thing happens whenever I accidentally scroll, where ^[OA are displayed if I scroll up and ^...
Some Guy's user avatar
0 votes
0 answers
81 views

How do I do a keybind involving <C-ñ>?

I use a keyboard layout designed for Spanish speakers and I've remapped hjkl to jklñ because those are the main home row keys. With hjkl I have to be constantly moving my hand to the left in order to ...
Katie And's user avatar
0 votes
1 answer
129 views

How can I open a vim fold so that it is not affected by `foldclose=all`?

In my config file I have set foldclose=all so that folds get automatically closed upon cursor leaving them. However, sometimes, I want a specific fold not to close for a while. Because folds below ...
lobelk's user avatar
  • 21
1 vote
1 answer
108 views

Why is nvim updating the clipboard on start?

I use set clipboard=unnamed in my configuration. When I open nvim with nvim, the clipboard is left unchanged but if I open with nvim . the latest entry of the clipboard is always something unexpected. ...
mathieux51's user avatar
0 votes
1 answer
36 views

How do I type an insert mode command?

I've recently read that some people put inoremap jk <Esc> on their vimrc to exit insert mode without having to move their hands away from the home row. But then how do you type the letters jk? ...
Katie And's user avatar
0 votes
0 answers
755 views

How do I configure NeoVim in termux?

I install neovim in termux And run these commands:- cd ~ mkdir .config cd .config/ mkdir nvim cd nvim/ nvim init.vim I put set number in the init.vim file and save it. Nothing happens.
Mohd Saad's user avatar
  • 101
0 votes
1 answer
630 views

Indent changes when using CoC, how do I stop this?

I have set up my init.vim file to always use tabs as indentation by adding this to it: set tabstop=4 set shiftwidth=4 set noexpandtab Ever since I installed CoC to use Rust's language server, it ...
Katie And's user avatar
0 votes
1 answer
591 views

how to accept tabnine suggestion?

I'm using tabnine and COC. I have a ~/.vimrc with the following lines: inoremap <expr> <C-j> pumvisible() ? "\<C-N>" : "j" ...
CIsForCookies's user avatar
0 votes
1 answer
262 views

Vim Autoindent does not work [closed]

I'm configuring my Vim editor. Now I want it to automatically indent when I press enter after a parenthesis (like in modern IDEs) function test() { | } I already have autoindent and smartindent ...
ttatoni26's user avatar
1 vote
0 answers
235 views

How to map keybindings only for specific file type?

In vimwiki, <C-x><C-o> provides available tags in autocomplete dropdown. I am attempting to map that key mapping to something easier like (ctrl+alt+space) and only when I am in a markdown ...
haku's user avatar
  • 111
0 votes
1 answer
276 views

Disabling a plugin loading when launching Vim from `git commit`

Is there a way to disable a plugin only on occasions where Vim was launched from another program? I have set Vim (Neovim, more specifically) to be the default core.editor of my git configuration and ...
manoelpqueiroz's user avatar
1 vote
0 answers
119 views

In MacVim, I want to make it so the cursor does not blink

In my vimrc file, I have the two lines let &t_SI="\033[6 q" " start insert mode (steady bar, xterm) let &t_EI="\033[2 q" " end insert mode When I am in the ...
user42457's user avatar
1 vote
2 answers
93 views

Where did I find this organization scheme?

Some time ago, I organized my vimrc in a particular way, modeling it after what I am pretty sure I remember to be one of the documents in the :help. But I've looked for an hour now and can't seem to ...
MDeBusk's user avatar
  • 363
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
1 answer
208 views

How to delete backwards till whitespace in Insert mode?

Hope you're doing well. Input: let firstDate = src[0][0]|.toString(); ^ cursor in Insert mode Desired output: let firstDate = |.toString(); ...
kohane15's user avatar
  • 143
1 vote
1 answer
45 views

AutoPairsDelete() noise with vim plugins

I have been a vim user for years... I recently added a lot of plugins (see my ~/.vimrc) and I keep hitting a problem where I type a word (in this case, a string called cisco) and vim a) sees an ...
Mike Pennington's user avatar
0 votes
0 answers
14 views

How do i configure neovim to remember open tabs when opening a directory? [duplicate]

Basically, I'd like to emulate the same behaviour as VSCode. When I open a directory in VSCode, it automatically, opens all the previously open tabs. This way, every time i open up an old project, I ...
Jay Pillai's user avatar
2 votes
1 answer
284 views

ModuleNotFoundError: No module named 'pylama'

I am taking errors whenever open python code and then press a movement key. Just only have these error in .py extensions. Even not in the pyc Error detected while processing CursorMoved Autocommands ...
maxemilian's user avatar
1 vote
1 answer
390 views

Changing Airline-Vim z section

Currently my z section looks cramped. Is there any way I could add a bit more separation between the symbols? I would like to separate "≡" from the "%"
Peter Petigru's user avatar
1 vote
2 answers
69 views

What's the configuration used to make vim remember modifications after closing the file?

I've recently started using SpaceVim which is basically vim that comes with some extra plugins and pre-done configurations. However, it has a default behavior that bothers me... It remembers changes ...
raylight's user avatar
  • 525
1 vote
1 answer
127 views

How to get total width of Vim with vertical splits?

winwidth(0) returns the width of the current window. However, if vim has multiple vertical splits, forming multiple windows, winwidth(0) would only return the width of the current window. For example,...
Terry's user avatar
  • 61

1 2 3
4
5
37