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
0 answers
24 views

Replacing text in non selected lines

I have \begin{thm} in a lot of my .tex files. Whenever I am not in the selected line I would like this to be rendered as Theorem. I have tried using conceal but it is limited to rendering a single ...
Maths Wizzard's user avatar
1 vote
1 answer
119 views

Error when using vim-plug from git-bash

I just installed vim-plug to use the doxygen plugin. Added call plug#begin() Plug 'vim-scripts/DoxygenToolkit.vim' call plug#end() to the .vimrc (_vimrc because Win10..). Using the doxygen plugin ...
Max's user avatar
  • 113
0 votes
1 answer
17 views

Convert sequence of external commands to a Vim custom command

To reformat Markdown tables, I use the following sequence of external commands (e.g. after visually selecting my table lines): :<,>! sed 's/[[:space:]]\{1,\}\|/\#\|/g' :<,>! column -t -s '\...
gjherbiet's user avatar
0 votes
1 answer
50 views

MacOS - Vim overriding my highlight config in ~/.vimrc

~/.vimrc: set backspace=2 set nocompatible set clipboard^=unnamed,unnamedplus syntax on set expandtab tabstop=2 shiftwidth=2 set smartindent set hlsearch set incsearch set ignorecase set number ...
ray's user avatar
  • 1
1 vote
1 answer
47 views

I want to see my vimrc code but instead, runtime vimrc text is shown

I wanted to upload my .vimrc file to GitHub and while doing that, I think I broke something. After that process, when I type vim ~/.vimrc on my terminal, the only thing I see is runtime vimrc instead ...
Kerem's user avatar
  • 11
1 vote
1 answer
34 views

How to configure my own highlight for Vim editor in Linux using ~/.vimrc and ~/.vim/colors/mycolors.vim files? [closed]

I want to configure and customize my own syntax highlight for Vim editor in Linux Ubuntu 20.04. In my home directory, I created two files, ~/.vimrc and ~/.vim/colors/mycolors.vim. Here is the full ...
morris's user avatar
  • 11
1 vote
2 answers
75 views

Why is Vim ignoring my `expandtab` setting?

In my vimrc, I have set expandtab. When I edit a Tex file, however, Vim inserts tab characters , instead of spaces , when I press tab. I figured noexpandtab must be set by the TeX ftplugin for some ...
Wil's user avatar
  • 21
1 vote
1 answer
41 views

How to generate random string with required length in Vim?

I am using this code for console log nmap cll yiwocll<Esc>p I wanted to add some random string inside this console log, assume 10 characters symbols length. How to achieve this?
hden mila's user avatar
0 votes
1 answer
18 views

Disable a specific case provided by cindent when enter a colon `:`

As title. What I have currently after entering : after the std: std::memset(tempArr, 0, MAX_LEN_CASE*sizeof(int)); for (int i=0; i<MAX_LEN_CASE; ++i) { std: } What I expect is: std::memset(...
NeoZoom.lua's user avatar
  • 1,232
0 votes
1 answer
31 views

Custom highlight not effective unless sourcing vimrc

I customed comment and search highlight in my vimrc, but they are not effective every time I entered vim. I have to source vimrc to make them effective. How can I make them always effective? highlight ...
Kalei's user avatar
  • 1
0 votes
0 answers
21 views

Why does <esc> on empty, indented line, jump to beginning?

I'm trying to do something very simple, enter normal mode and ALWAYS be able to somehow put the normal mode cursor where it was in insert mode, whether through a mark, or otherwise. I'm doing this ...
Tallboy's user avatar
  • 177
0 votes
1 answer
42 views

Run a Vim command _after_ loading vimrc, but _before_ opening the file?

Is there a way to tell Vim from command line to run a specific command after running the vimrc, but before loading a file? E. g. vim --cmd <cmd> <file> runs <cmd> before loading ...
intelfx's user avatar
  • 295
1 vote
3 answers
435 views

Quit Vim when Buffer has no name (not :wq or :q!)

There must be a way to change the init.vim / .vimrc so I can quit Vim without saving first (:wq) nor force quitting (:q!). But I only want that behaviour when the Buffer has no name. Why? Because a ...
Pixelbog's user avatar
  • 325
1 vote
1 answer
41 views

Disabling Syntax Highlighting for Rust Files in Neovim 0.9.x

Please find the refined version below: In the attached images, the top one displays the syntax highlighting performed by the rust-analyzer Language Server Protocol (LSP), while the bottom image shows ...
Hyunsoo's user avatar
  • 123
0 votes
0 answers
57 views

Github Copilot indentation

Has anyone had any luck getting a good .vimrc configuration to work with GitHub's Copilot insertions? I seem to have two mutually exclusive cases. My normal .vimrc indents everything as expected when ...
topher217's user avatar
  • 109
0 votes
0 answers
13 views

NERDTree window change during tab switch

Currently, when using NERDTree, I hit Ctrl-ww to navigate to my NERDTree window from my editing window. Then, I navigate to a file I want to open, and hit t to open it in a new tab. Now, when I want ...
cz1's user avatar
  • 1
1 vote
1 answer
64 views

How to disable the ability to undo even after restarting Neovim?

I made some changes in files using Neovim. I close the vim and terminal. When I open the file again with Neovim, I am still able to undo the last things I changed before closing the terminal. I simply ...
Sugam Sharma's user avatar
0 votes
1 answer
46 views

How to Vim multiply symbol "a" with a number from clipboard?

I need to multiply symbol "a" with a number from clipboard. For example 3a = aaa In clipboard register is @+. May be to do that throw command line mode, but don't understand how.
serii 's user avatar
  • 59
0 votes
2 answers
68 views

ALE Code Action for python

I have a working linter with the ALE plugin. Plugin 'dense-analysis/ale' let g:ale_virtualtext_cursor = 0 let g:ale_python_flake8_options = '--extend-ignore=E501' nnoremap <leader>ar :ALERename&...
Surya's user avatar
  • 11
1 vote
1 answer
142 views

What is `normal! zvzz` in vimscript?

I found here the following command normal! zvzz But I don't know what it does.
linrongbin's user avatar
1 vote
2 answers
122 views

Vim with terminal inside, I have to quit using a vim cmd as the terminal will prevent me from exiting, so I can't do :wq

Since I have a terminal inside vim I can't do :wq or I get 'job' running. I got around this using: vim --clean "+term" "+qa!" Then I'd have to do :w then :qa! In my ~/.vimrc I then ...
Nickotine's user avatar
  • 133
0 votes
1 answer
59 views

Simple way to go to definitions

I use this simple approach to jump to definitions in C++, which works fine for me. In my vimrc: autocmd BufRead,BufNewFile *.c,*.cpp,*.cc set path+=/Library/Developer/CommandLineTools/usr/include/c++/...
ranemirusG's user avatar
0 votes
2 answers
86 views

How to jump to the last non-blank character in soft wrapped long line in vim?

I have those setting in .vimrc setlocal textwidth=0 wrap formatoptions=tc2n linebreak noremap <buffer> j gj noremap <buffer> k gk noremap <buffer> $ g$ noremap <buffer> ^ g^ ...
Solarisending's user avatar
2 votes
2 answers
62 views

Apply local setting to .vimrc

Is it possible to overwrite a .vimrc setting with a local one? For example: I have set background=light in my .vimrc file And then, while editing another file I decide to change that setting, so I run ...
ranemirusG's user avatar
0 votes
1 answer
120 views

How to pass an argument for glob in fzf.vim Rg to support searching in specific files?

I am using fzf.vim plugin with ripgrep. Fzf comes with the command :RG and :Rgright out of the box that lets me to search for keywords in files. However, often I need to search for keywords in ...
Iggy's user avatar
  • 165
0 votes
0 answers
54 views

automatically execute zz after register jump?

whenever you are jumping between marks some of the marks are placed at the bottom of the screen and you have to do zz to bring them to the middle. Is there a way to auto-execute zz after each jump ...
sourcevault's user avatar
0 votes
1 answer
103 views

How does vim color theme set highlight groups?

Usually, I edit a highlight group like this: hi typescriptAliasDeclaration guifg=#b58900 But when I look inside an exampleColorTheme.vim, I cannot see any mention of these highlight groups. So how do ...
Vinn's user avatar
  • 627
0 votes
2 answers
36 views

How do I configure Vim so that the color is different according to the first line, and the other lines wrap automatically?

For some context, I'm talking about Git commits specifically. The Linux server that I use for work changes the color of the first line starting from column 53 (since 52 is the recommend commit title ...
Sean's user avatar
  • 235
0 votes
1 answer
76 views

My Linux server doesn't have a .vimrc file but Vim has a lot of configurations

Not sure if this is the appropriate place to ask, but at work I use a laptop to SSH into a remote Linux server and do some work from there. I want to use the server's .vimrc file for my own laptop as ...
Sean's user avatar
  • 235
0 votes
2 answers
108 views

Writing a bash script to startup Vim in a particular configuration for a project

I want to write a bash script that starts up a Vim session using a specific configuration. For instance consider a C project with the following structure project_dir - src - file1.c - file2.c ...
Sina's user avatar
  • 115
0 votes
2 answers
121 views

ftdetect, ftplugin not working as advertised -- what am I missing?

I've been reading documentation and trying experiments to register a new filetype in vim, and apply desired indentation rules -- all to no avail. As an example, say I want to register *.test as ...
StoneThrow's user avatar
1 vote
1 answer
52 views

How to use 'includeexpr' with relative paths?

Imagine there is a file src/main.js with import like this: import { A } from '_components/A'; And _components/A in turn has export { A } from './B'; I configured includeexpr to expand _ to src so ...
whysoserious's user avatar
0 votes
0 answers
62 views

Strange behaviour with vim-lsp+clangd+asyncomplete-lsp

here is my .vimrc: call plug#begin() Plug 'prabirshrestha/vim-lsp' Plug 'mattn/vim-lsp-settings' Plug 'prabirshrestha/asyncomplete.vim' Plug 'prabirshrestha/asyncomplete-lsp.vim' Plug 'piec/vim-lsp-...
Cart3sianBear's user avatar
0 votes
1 answer
25 views

Strange behaviour go to definition shortcut when ~/.config/nvim is symlink

I have strange behaviour for gd shortcut but only when ~/.config/nvim directory is symlink to nvim -> /home/user/dotfiles/nvim I have ls-zero config and shortcut for current buffer lsp.on_attach(...
Marcin's user avatar
  • 1
1 vote
2 answers
81 views

Unable to connect to a client server

Description Vim does not connect to a clientserver, which causes issues using VimTex and zathura. Upon opening any file in an Ubuntu terminal, the following error is displayed: Error detected while ...
James Pagan's user avatar
1 vote
1 answer
144 views

How do I automatically open/close location or quickfix lists when they are populated by ALE?

I'm switching from the syntastic plugin to the ALE plugin. In syntastic there was an option g:syntastic_auto_loc_list that would automatically open the location list after it had been populated. If ...
FalcoGer's user avatar
  • 149
1 vote
2 answers
168 views

How do I remap `%` with `K` in visual and normal mode in `init.vim` (and vice-versa)?

I have the following in my init.vim: nnoremap K \% " Swap K with % in [n]ormal mode vnoremap K \% " Swap K with % in [v]isual mode xnoremap K \% " ...
M.A Shahbazi's user avatar
0 votes
0 answers
15 views

Help me remove feature in NVim [duplicate]

I've just used NVim lately and install some plugins Plugin List And every function have some params name behind it . Anyone know where this comes from and how to remove it ? Thanks!
Max's user avatar
  • 1
0 votes
1 answer
88 views

Hide the list of plugins show almost each time at a file open [closed]

When I open some file I see a list of plugins shown on the whole window (screenshot below). I get tired of wasting my time to press few keys to hide this list: several times Space each time. No error ...
Artyom's user avatar
  • 107
0 votes
0 answers
28 views

What's controlling Vim paste behaviour?

What's controlling Vim paste behaviour via Vim over ssh using putty with right-click paste set to Linux host? To start we have: VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Mar 27 2023 00:00:00) ...
chipfall's user avatar
  • 103
0 votes
1 answer
105 views

Why is Vim telling me that 'no plugin to install' when I have installed a plugin manager (vim-plug)?

call plug#begin() plug 'https://github.com/AndrewLockVI/dark_ocean.vim' plug 'https://github.com/ErichDonGubler/vim-sublime-monokai' plug 'https://github.com/rafi/awesome-vim-colorschemes' call plug#...
Artisan's user avatar
  • 31
0 votes
0 answers
46 views

How to set timeoutlen for a specific key?

My config inoremap jk <Esc> I want to use set timeoutlen=350 for this specific keymap and no other. How can I do that?
Mega Bang's user avatar
  • 121
0 votes
1 answer
111 views

Lightline and airline with neodark.vim

I have installed the neodark.vim plug-in by Keita Nakamura following this answer. Currently my .vimrc looks like this:\ But the lightline theme doesn't appear on the status bar: What is wrong here ...
Atharva's user avatar
  • 25
2 votes
2 answers
402 views

How to install Vim configuration from github?

I am new to vim and Linux in general. I am using Vim on Windows Subsystem for Linux with ubuntu as OS. I really like this neodark.vim theme and wish to use it for my Vim editor. I would like to know ...
Atharva's user avatar
  • 25
0 votes
1 answer
283 views

Nvchad: Is it possible to reuse existing .vimrc file?

I checked the documentation but couldn't find an answer to this basic question: Is it possible to reuse my existing .vimrc file in Nvchad? Currently, nvchad ignores my settings in .vimrc file.
Mert Nuhoglu's user avatar
0 votes
1 answer
72 views

How to set the mode from a vimscript?

If I save the result of :call mode() in a variable, how can I restore that mode later?
theonlygusti's user avatar
  • 2,189
-1 votes
1 answer
46 views

What is the meaning of command `:4w`?

As title. I just read a post that people accidentally delete(wipeout) their unsaved work by trying the command :4w. A bloody lesson to him, but I also want to prevent this from happening to myself. ...
NeoZoom.lua's user avatar
  • 1,232
1 vote
1 answer
28 views

How to escape commas in au patterns and comma separated lists?

How do you specify a comma literal in the kinds of comma separated lists that are ubiquitous in vim configuration? The first example I can think of off the top of my head is in autocmds: au! BufRead,...
theonlygusti's user avatar
  • 2,189
1 vote
0 answers
48 views

How to manually implement autochdir?

'autochdir' 'acd' boolean (default off) global {not in Vi} {only available when compiled with it, use exists("+autochdir") to check} ...
theonlygusti's user avatar
  • 2,189
0 votes
1 answer
21 views

Toggle NERDTree in seperate window

I want to toggle vim in a whole new window and as I searched, I can open vim in new window using: :NERDTree | only So I set this in my vimrc: nnoremap <C-n> :NERDTreeToggle <bar> only<...
Reyomi's user avatar
  • 3

1
2 3 4 5
36