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
514 views

neovim lsp icons are not appearing in color

I am configuring native lsp of neovim. I have installed neovim-lsp and neovim-lspconfig plugins using vimplug. I have also installed hrsh7th/nvim-compe for auto completion suggestions. Functionally ...
user avatar
0 votes
0 answers
30 views

Mapping ´ to / not working

I'm trying to map ´ to / and ¨ to ? as follows: nnoremap ´ / nnoremap ¨ ? It works fine if the first letter behind de map key is not any of i, I, a, A, o, O... guessing is something wrong with the ...
user avatar
0 votes
0 answers
41 views

Can Vim bind a keystroke to a particular numerical prefix?

Some of my files are fold-heavy. I use the following to protect any fold configurations I have when I 'O' into a new line: nnoremap O O.<esc> I would like to know if adding the following ...
user avatar
0 votes
0 answers
52 views

Why does my syntax highlighting disappear after so many splits?

I can successfully run :sp *filename* several times per vim session, but after a seemingly-random number of splits (5-10) all future splits will no longer have syntax highlighting until I fully quit ...
user avatar
0 votes
1 answer
32 views

force close windows and last empty buffer

when i open multi windows like bellow: vim foo.txt bar.txt then , if i'm closing foo.txt by :bw then ,i'm closing bar.txt by :bw vim still open ! , i must close by :q i don't want vim open if last ...
user avatar
0 votes
0 answers
29 views

how to mkview *.cpp file if and only if a fold is made within the file?

My init.vim code cd ~/Documents/cp set backupdir=~/Documents/cp/vimtmp// set directory=~/Documents/cp/vimtmp// set undodir=~/Documents/cp/vimtmp// set viewdir=~/Documents/cp/vimtmp// augroup ...
user avatar
  • 121
0 votes
0 answers
32 views

How can I make vim recognize when to <Enter> on autocomplete?

Im using TabNine YCM fork vim plugin. I'm getting cool suggestions and all, but it's super annoying that it doesn't <Enter> when it should, instead, outputs NULL ASCII Code ^@ Is this related ...
user avatar
  • 1
0 votes
1 answer
116 views

YouCompleteMe doesn't complete functions from headers

After downloading YouCompleteMe from ubuntu repositories and installing it I have used this script as extra config. I suppose this config may help me with in-headers functions auto-completion. :...
user avatar
1 vote
2 answers
826 views

How to uninstall a plugin in Vim 8?

On Linux, how to uninstall a plugin in Vim 8 other than removing the plugin code using a Linux command line rm command? That is to say, is there a way to remove a plugin while in a Vim 8 session and (...
user avatar
1 vote
1 answer
135 views

how to tabdo all the visible buffers without changing the current tab?

My init.vim code: cd ~/Documents/cp nnoremap <leader>lcd :tabdo lcd %:p:h<cr> suppose, i have 4 tabs opened in nvim via using nvim -p A.cpp B.cpp C.cpp D.cpp A.cpp B.cpp C.cpp D.cpp ...
user avatar
  • 121
0 votes
0 answers
276 views

How do I make sure terminal vim has syntax highlighting with 'cursorline' and 'termguicolors'?

I searched this issue on the web to no avail and it's most likely not here too. The issue I'm facing goes like this I am trying to switch to vim since I find it cool. I was writing my vimrc and ...
user avatar
0 votes
1 answer
61 views

smart single or multiple character deletion of x

I want vim to ignore whitespace copy Default cut x will work same but When i cut one whitespace character or a visual block of whitespaces with x, vim register won't copy like this thread, Vim ...
user avatar
  • 121
1 vote
0 answers
50 views

Cricle through brackets mapping [closed]

I'm using bracket a lot and I'm trying to quickly circle through the bracket in both back and forth with the following mapping: nnoremap 0 f) nnoremap 9 F( Unfortunately, it does not work. Any ...
user avatar
  • 111
0 votes
0 answers
19 views

how can i define g:errorMessageString as a List?

related to this thread Multiple error messages in vim message history How can i define g:errorMessageString as a List? Can anyone help me fix this? i am using this code in my vimrc but i don't know ...
user avatar
  • 121
0 votes
0 answers
38 views

How can vim show multiple files are changed on disk?

How can vim tell me which buffer is changed on disk among multiple buffers? related to this thread, @b-layer helped me my current vimrc code: set autoread autocmd FocusGained,BufEnter,CursorHold,...
user avatar
  • 121
0 votes
1 answer
40 views

How can vim tell me which buffer is changed on disk among multiple buffers?

I am using this code in my vimrc if a file is changed outside vim, it shows File changed on disk. Buffer reloaded. set autoread autocmd FocusGained,BufEnter,CursorHold,CursorHoldI * if mode() != 'c' |...
user avatar
  • 121
1 vote
0 answers
73 views

Mysterious auto edit of .vimrc

I have a mysterious, troubling, and extremely irritating problem with what might be called auto-edits of my vimrc file. It only happens when I open vimrc file from buffer list (ie there are a number ...
user avatar
  • 21
1 vote
0 answers
64 views

How can I track the event of opening a file in netrw in an autocommand?

I'm trying to solve this problem by creating an autocommand which will track when a new buffer is opened through netrw, and will then immediately close netrw once the buffer is closed. How can I track ...
user avatar
  • 11
0 votes
0 answers
44 views

should i use getcwd(-1) or getcwd(-1, -1) in neovim?

related to this vi.stackexchange post How do you go back to your to global current directory after inheriting an lcd what should i use in my neovim? @mass @elliottcable
user avatar
  • 121
0 votes
1 answer
333 views

Jumping to last position when reopening file: how to place line in center instead of bottom?

Currently my vimrc has the following: " Uncomment the following to have Vim jump to the last position when " reopening a file au BufReadPost * if line("'\"") > 1 && ...
user avatar
  • 165
1 vote
1 answer
377 views

How to set the diagnostic level for neovim lsp

By default the lsp has set the diagnosticLevel to Hints, i wanna set this to information level. I tried looking at various places but couldn't find much. I am using LunarVim config if that gives extra ...
user avatar
  • 11
0 votes
0 answers
35 views

How can I make this comment script work for certain filetypes?

I got this code from voyeg3r's gist @d-ben-knoble helped me add a feature I wanted in this QA. Now I want this code to support commenting out certain filetypes like conf, mail, tex and so on. My ...
user avatar
  • 121
0 votes
2 answers
54 views

How can I change this comment plugin to work at the start of the line?

I got this from voyeg3r's gist He and @dave-kennedy made it 3 years ago. I am here because I couldn't contact them Can someone help me add a feature such that this vimscript code puts comment out ...
user avatar
  • 121
0 votes
2 answers
234 views

How can I prevent vim from auto-opening the first quickfix list item?

Basically, I'd like the same type of behavior as when you use :grep! vs. :grep. I'm using a find-files plugin that outputs to the quickfix list and I don't want vim to automatically open the first ...
user avatar
  • 101
1 vote
1 answer
25 views

How to match two parts of error message and concatenate them?

I try to read :h errorformat: %m error message (finds a string) I try to read it, but I practically found that it's impossible to specify %m twice: E372: Too many %m in format string I ...
user avatar
  • 173
1 vote
1 answer
2k views

How to make VIM automatically insert closing delimiters and new lines like SUBLIME TEXT?

While using Sublime Text, when I type the first parenthesis, bracket, or curly bracket, Sublime Text automatically does the second one for me. if(){} if() { Code } And while making an if ...
user avatar
1 vote
0 answers
86 views

Project local keyword highlighting

I want to enable syntax highlighting for custom types in C files. So, in order to highlight a type name MyCoolType, I add the following line to ~/.vim/after/syntax/c.vim: syn keyword Type MyCoolType ...
user avatar
  • 111
0 votes
0 answers
63 views

Font size NOT changing through .vimrc but can inside vim

I can change the font size with set guifont=FixedsysTTF Monospace:h13 inside Vim and works perfectly. However when I put this inside ~/.vimrc it stays the same font size no matter what size I set it ...
user avatar
  • 1
2 votes
1 answer
334 views

Mapping <Shift>-Insert to paste in gVim search field

In gVim (not terminal Vim), I want to be able to paste from <Shift>-Insert (a.k.a. C-V) into the text input field of a search. I.e. when I press "/", and go into search mode, I want ...
user avatar
0 votes
1 answer
155 views

mouse to highlight text puts vi into some kind of Visual mode

only on osx (not on Ubuntu ) when I hightlight text while in a terminal ( iterm2 3.4.8 ) vim shows some kind of notice saying Visual and then across top of terminal a banner appears saying Looks ...
user avatar
0 votes
0 answers
15 views

vim colorscheme not apply clearly [duplicate]

I apply colorscheme by writing in _vimrc file, but colors are working Partially. I brought source code of colorscheme from code-dark using Plugin Vundle. For explanation, upload the pictures. First ...
user avatar
0 votes
1 answer
131 views

manually set syntax highlighting works from command-line mode but not from .vimrc/init.vim

The gruvbox colorscheme and syntax highlighting for C++ doesn't highlight some elements such as: string vector I have this: So I decided to change the colors manually using in init.vim syn keyword ...
user avatar
5 votes
0 answers
155 views

How to get bold comments in vim

I am trying to add bold comments to my vim files. What i mean, is to be able to get something like this: I saw other articles like this that allow to toggle bold comment. The proposed solutions from ...
user avatar
  • 171
2 votes
1 answer
207 views

Netrw - Lexplore is not an editor command

I was trying to configure vim to have a file explorer on the side with no plugins. I found the following script: function! ToggleNetrw() if g:NetrwIsOpen let i = bufnr("$") while (...
user avatar
1 vote
0 answers
60 views

colorcheme in vim is partially working. how can I apply the theme successfully?

Thank you for all yours advise that for help to improve my question. I'm not find yet how to resolve this problem in here. I'm really appreciate If you left the link about answer of this problem. ...
user avatar
2 votes
0 answers
298 views

Does vim-easymotion only work in neovim?

I was wondering if the easymotion-overwin was compatible with vim, or does it only works in neovim? I have my .vimrc's keymaps setup like this for easy-motion "----- Easy-Motion ----- map <...
user avatar
  • 171
0 votes
0 answers
27 views

`echohl` not highligthing with custom color, but its working with the defaults

in my init.vim (.vimrc) file i have this: hi TerminalGreenColor guifg=#6bd676 function! EchoInitVimReloadedSuccessfully() echon " -- [ " echohl Identifier echon "init.vim&...
user avatar
2 votes
2 answers
805 views

Why does my lightline status line not show up right away?

Currently when I open a file (NerdTree appears automatically as well), the light line status line plugin I installed does not show up right away. It only shows up after I switch tabs into NerdTree and ...
user avatar
1 vote
1 answer
305 views

Problem with compiling/running a file in neovim

When I try to run a file with Neovim it shows me this: It doesn't allow me to type any input. How can I type some input using Neovim ? This is my script for compiling: g++ -static -DLOCAL -lm -s -x c+...
user avatar
0 votes
1 answer
37 views

How do I get the line numbers to permanently appear in vim [duplicate]

I keep wanting to customize vim, how do I get the line numbers to show up everytime i open up VIM.
user avatar
0 votes
2 answers
112 views

cryptic error since Big Sur upgrade, :PlugInstall doesn't work, and none of my plugins work

Error: Error detected while processing BufWinEnter Autocommands for "*"..function <SNR>3_LocalVimRC[322]..BufWinEnter Autocommands for "*"..function <SNR>3_LocalVimRC: ...
user avatar
1 vote
0 answers
60 views

Getting the half of a glyph

while trying to add a unicode font, I am getting the half of the font, like in line 239 and 240 in the screenshot: I have, in my vimrc: set history=700 " How many line Vim ...
user avatar
  • 387
0 votes
1 answer
46 views

Assign value based on filetype [duplicate]

I want to assign value based on filetype. I am using UltiSnips plugin and want to have one set of bindings for one filetype and another set for everything else. Something like if &ft='vimwiki' ...
user avatar
0 votes
1 answer
95 views

Make Line Numbers Appear in Documentation

I have set number in my init.vim (I am using neovim) and it works fine for any buffers I'm editing. However, I have to enter :set number into the command line to make line numbers appear in the ...
user avatar
1 vote
0 answers
71 views

Center-align command bar and/or tabs bar

I'm often using vim fullscreen on an extrawide monitor (multiple splits, including terminals). Because both the command bar and the tabs bar span the full terminal width and are left-aligned, commands ...
user avatar
  • 333
0 votes
0 answers
83 views

How to apply existing indenting rules to new file type?

I've been happily using vim for years for C and C++ projects. My code formatting/indentation rules have been cobbled together over the years based on solutions to at-the-time needs...which is to say, ...
user avatar
0 votes
0 answers
27 views

Creating vimrc kills my plugin

I have the following ~/.vim/filetype.vim: augroup filetypedetect au BufRead,BufNewFile *?Script.sml let maplocalleader = "h" | source /home/gergely/HOL/tools/vim/hol.vim " recognise ...
user avatar
  • 221
0 votes
2 answers
304 views

Keyboard shortcut space for :noh [closed]

I tried to set a keyboard shortcut for :noh using space key, without success: .vimrc nnoremap ,<space> :noh<CR> Expected behaviour: / to highight text press space: clear highlighting ...
user avatar
  • 119
0 votes
1 answer
225 views

How to disable configuration display at nvim startup?

When typing nvim in CLI, nvim opens with a screen that contains all my configurations (the picture bellow). I have to press <s-g> and then hit Enter in order to open the file i wanted. The same ...
user avatar
0 votes
1 answer
224 views

vim-surround not working properly in macro (ideavim)

vim-surround not working properly in macro: I want to change all li's <li><a href="/">home</a></li> <li><a href="/stuff">...
user avatar

1
3 4
5
6 7
34