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
50 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
50 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
395 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
134 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
22 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,462
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
26 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
76 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
  • 317
1 vote
3 answers
520 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 ...
Bog's user avatar
  • 469
2 votes
1 answer
171 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
  • 131
0 votes
0 answers
113 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
36 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
345 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
-1 votes
1 answer
61 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
  • 91
1 vote
2 answers
223 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
  • 21
1 vote
1 answer
221 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
166 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
  • 202
1 vote
1 answer
116 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
3 answers
140 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
83 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
1 vote
1 answer
322 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
  • 175
0 votes
0 answers
95 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
148 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
  • 771
1 vote
3 answers
74 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
  • 265
0 votes
1 answer
164 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
  • 265
0 votes
2 answers
276 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
296 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
112 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
104 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
30 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
125 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
366 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
234 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
104 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
  • 127
0 votes
0 answers
46 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
275 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
1 answer
181 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
703 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
1 vote
1 answer
668 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
163 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?
minseong's user avatar
  • 2,323
0 votes
1 answer
55 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,462
1 vote
1 answer
57 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,...
minseong's user avatar
  • 2,323
1 vote
0 answers
94 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} ...
minseong's user avatar
  • 2,323
0 votes
1 answer
30 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 vote
2 answers
468 views

Vim in Alacritty and inside tmux cannot display italic text

I am trying to have a better visualization while editing Markdown file in vim, I try to visualize the italic and bold text. However, I found the bold italic text work, while the italic itself doesn't ...
Solarisending's user avatar
1 vote
1 answer
246 views

Find git root directory in key mapping

I would like to find the git root directory and use it as argument for :FZF in a key mapping like this: nnoremap <Leader>eg :FZF `git rev-parse --show-toplevel`<CR> Unfortunately, this ...
MaxGyver's user avatar
  • 231
0 votes
2 answers
180 views

How to set all files under a folder to a specified filetype?

I have some zsh function files that I should not add extensions to for the convenience of calling, i.e. my_func instead of my_func.zsh. But this causes an issue that Neovim cannot detect their ...
NeoZoom.lua's user avatar
  • 1,462
0 votes
0 answers
51 views

Creating a local vimrc for a large LaTeX project with selective plugins, settings, and mappings

This is related to my previous question that you can find here: I am currently working on a large project (a PhD thesis with multiple chapters, each consisting of around 30 pages) and have found that ...
Mafsi's user avatar
  • 225
1 vote
1 answer
549 views

When to use "set exrc" and local '.vimrc' in Vim, and how to manage plugins with multiple 'vimrc' files for large projects?

I'm using Vim for a project that has a lot of pages per chapter, and Vim is a little bit slow. I want to create a local '.vimrc' file for this project with only the plugins I need, and I'm trying to ...
Mafsi's user avatar
  • 225

1
2
3 4 5
37