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
0answers
7 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 ...
0
votes
0answers
13 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 ...
0
votes
1answer
12 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. :...
0
votes
2answers
59 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 (...
1
vote
1answer
24 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 ...
0
votes
0answers
33 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 ...
0
votes
1answer
50 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 ...
-1
votes
0answers
23 views

To show in vim, which lines of working file are changed on disk

related to this thread, How can vim tell me which buffer is changed on disk among multiple buffers? My vimrc code set autoread autocmd FocusGained,BufEnter,CursorHold,CursorHoldI * if mode() != 'c' | ...
1
vote
0answers
41 views

Cricle through brackets mapping

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 ...
0
votes
0answers
18 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 ...
0
votes
0answers
29 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,...
0
votes
1answer
23 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' |...
1
vote
0answers
69 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 ...
0
votes
0answers
15 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 ...
0
votes
0answers
24 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
0
votes
1answer
36 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 && ...
0
votes
0answers
14 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 ...
0
votes
0answers
31 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 ...
0
votes
1answer
44 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 ...
0
votes
2answers
41 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 ...
0
votes
1answer
18 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 ...
0
votes
1answer
54 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 ...
1
vote
0answers
20 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 ...
0
votes
0answers
18 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 ...
0
votes
0answers
14 views

How to process file path before open file under cursor?

We're using alias import in your Javascript project. So when I import file like @/components/button, the @ means the project root path (like /home/myuser/project/foo) How can I configure my Vim to ...
0
votes
1answer
32 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 ...
0
votes
1answer
38 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 ...
0
votes
0answers
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 ...
0
votes
1answer
30 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 ...
4
votes
0answers
68 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 ...
1
vote
1answer
25 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 (...
1
vote
0answers
50 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. ...
2
votes
0answers
57 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 <...
0
votes
0answers
21 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&...
2
votes
2answers
70 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 ...
1
vote
1answer
33 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+...
0
votes
1answer
31 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.
0
votes
0answers
12 views

Default javac Compiler Plugin Does not Display Shell Output

I want to compile and run a generated java executable inside of Vim quickfix. My .vimrc: function! Make(script) if &ft ==# "c" || &ft ==# "cpp" compiler gcc elseif &...
0
votes
2answers
54 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: ...
1
vote
0answers
46 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 ...
0
votes
1answer
22 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' ...
0
votes
1answer
31 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 ...
1
vote
0answers
25 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 ...
0
votes
0answers
23 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, ...
0
votes
0answers
18 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 ...
0
votes
2answers
57 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 ...
0
votes
1answer
29 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 ...
0
votes
1answer
47 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">...
2
votes
1answer
47 views

Passing arguments function with --argument or -a format

Is it possible to pass arguments to Vimscript functions with the --argument or -a format, similar to arguments in the command line? I am writing a command that submits a job in a remote machine. I ...
0
votes
1answer
73 views

Setting conceallevel in .vimrc does not work in .tex file

I've set conceallevel=0 in .vimrc, but the text is not shown normally after opening .tex file. I have to type it again while the file is open and it works. From my .vimrc: "vimtex config set ...

1
2 3 4 5
30