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

C# neomake linter

I would like to use nvim more for C# however I am having a maker error I can't fix. My Omnisharp didn't work either but I still have 'YCM' as a backup for now. The MSBuild in my path is from the VS ...
0
votes
1answer
29 views

Vim Fugitive not loading

I have recently been trying to separate my neovim config into multiple files. After moving everything involving vim-fugitive and vim-gitgutter into a separate file, git-gutter is not loading and I ...
1
vote
1answer
59 views

How to toggle relative number for all opened windows?

I have this in my .vimrc: nnoremap <C-a> :set relativenumber!<cr> This toggles the relative number feature only in the current window. Is it possible to toggle it in all opened windows ...
1
vote
1answer
24 views

Is there a function which returns the filepath at the cursor?

I'm looking for a function(probably doesn't exist) which can return the filepath under the cursor. I know that there is a command/shortcut gf that helps me jump to that file if the file exists. But I ...
2
votes
1answer
19 views

Vim autocorrection problem

I am having a problem with vim autocorrection. I got this line from a website, which is: inoremap <C-l> <Esc>[s1z=`]a The problem is that whenever I press Ctrl+l to correct something, it ...
0
votes
2answers
33 views

Vim+Tmux unfocus airline when switching away

I'm using Vim with tmux and I wanted to know if there was a signal or something to 'deactivate' the vim window (like when you switch between vim windows) but also when you switch between Vim and Tmux. ...
1
vote
1answer
43 views

Vim-latex not starting automatically for .tex files

I have Vim on Ubuntu 18.04 and I am trying to use the vim-latex package. By typing :set rtp? on Vim I get the following output: runtimepath=~/.vim,~/.vim/pack/bundle/start/vim-latex-1.10.0,/var/lib/...
2
votes
1answer
27 views

Finding where one word is close to another word: parametrized command in vimrc

I asked this question, about how to find where one word is close to another word, and Quasimodo gave the very fine answer: /\vaid(\W+\w+){,3}\W+country Now I want to parametrize this command into ...
2
votes
1answer
19 views

Setting vim spelllang for Italian

I need to enable the spelllang of vim for Italian as well, but I can't understand how to tell vim to check for Italian words as well. This is what I have in my init.vim, if it can help you: I tried ...
0
votes
0answers
22 views

Displaying sloc (source lines of code)

Is there a plugin that can display sloc? I have searched every where and all I get is how to display total lines or how to show line numbers...
3
votes
1answer
40 views

How can I make a new line in my _vimrc after using the normal i command?

I'm very new to Vim and I have some ASCII art in my _vimrc. I've inserted it there using normal i, but it doesn't display properly, because the normal i commands don't have a line break at the end. I'...
2
votes
0answers
25 views

gvim on ubuntu breaks the console when calling system command in vimrc

I use this version VIM - Vi IMproved 8.2 (2019 Dec 12 kompiliert am Aug 29 2020 14:11:37) Inklusive der Patches: 1-1539 Verändert von jonathon.fernyhough@york.ac.uk Übersetzt von jonathon.fernyhough@...
0
votes
1answer
21 views

How do I turn off specific listchars in my current file?

In my .vimrc file I have listchars set to showing tabs and trailing spaces. set listchars=trail:~,tab:>- How do I change my settings for the file I currently have open to stop showing the tabs?
1
vote
1answer
33 views

Vim filter command not using line-wise selection

I may have seen this question before on Vi Exchange but I'm having trouble locating it while searching now. If it's already been answered, please let me know the duplicate and I can find that. I have ...
5
votes
1answer
71 views

How often and when is foldexpr evaluated?

I want to toggle foldmethod between expr and manual because if we always set foldmethod=expr, then the cursor tends to move slowly in vim. I think that foldexpr is evaluated just after switching ...
2
votes
1answer
24 views

Required to write gvimdiff file1 ..\..\..\file2 to diff correctly

I'm trying to diff two files using gvimdiff file1 file2. This works in certain parts of my file system, but if I'm several directories deep, it stops working. Instead, it'll open three files and one ...
3
votes
2answers
34 views

Is there a way to insert documentation comments into a VIM macro definition?

I have found VI / VIM macros extremely obtuse to understand even a week after I've written them. The syntax of a .vimrc file supports comments on lines beginning with a doublequote character (") ...
2
votes
0answers
89 views

YouCompleteMe unavailable: unable to load Python [duplicate]

I have done PlugInstall but it gives: YouCompleteMe unavailable: unable to load Python. The same error happens while loading UltiSnips: E370: Could not load python36.dll My vimrc: set rnu set nu ...
0
votes
1answer
23 views

map jump shortcut for Vim insert mode

I wan't to map jump shortcut for insert mode such as imap <A-w> <Esc>wi imap <A-b> <Esc>bi Even though <A-b> works perfectly. <A-w> appear to not work properly. ...
1
vote
1answer
30 views

get vimrc or init.vim defined by -u switch in vim/neovim

According to :help starting, we can specify a specific vimrc file using the following command $ vim -u /path/to/vimrc How can I access the path of that vimrc/init.vim file in vim/neovim? I have ...
1
vote
1answer
35 views

VIM mouse scrolling on Konsole show ^[OA at the top and ^[OB at the bottom of the page

function! GitBranch() return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'") endfunction function! StatuslineGit() let l:branchname = GitBranch() return strlen(l:...
0
votes
1answer
29 views

changing fonts in vimrc

The last pic is the info I got from Hacking Vim. How do I solve the error - the top pic is my vimrc.
-1
votes
1answer
20 views

How to use vi to batch match characters and paste after the matched characters

I want to use vi to quickly edit text. there is the format on lines m to n of the file. .lut_da_25, .abc_we23, ... .yy_ewe, I want to edit the above lines to the following ....
1
vote
1answer
129 views

Error in editing vimrc

I wrote :e $MYVIMRC to edit my vimrc and after adding my edits. I wanted to save and exit :wq but then it says: E505: C:.... is read only press ! to override so I write :wq! but it doesn't exit the ...
1
vote
1answer
9 views

Changing default comment characters in NERDCommenter

I've asked a similar question in the past but haven't been able to solve it in too nice a manner. the only way I've been able to figure out how to change the delimiter is by modifying the ...
1
vote
1answer
32 views

Cannot Edit ~/.vimrc file without both E297 error and E667 From Appearing

I am SSHing into an Ubuntu machine where I use Bash as the shell. I used to be able to edit my ~/.vimrc file very easily. Now, whenever I try to write to it, I get a warning E297 write error in swap ...
1
vote
1answer
31 views

Copying vimrc does not work — plugins don't install and only throws errors

I watched tons of vim setup videos, for example this is last one and this person claims it takes 10 seconds to setup vim anywhere. He just opens vimrc file and it immediately installs all the plugins (...
0
votes
0answers
14 views

CTRL-X CTRL-] does not work but CTRL-X CTRL-$ does

To autocomplete using tags, I saw the combination <CTRL-]> in vim help :help ins-completion. However, for some reason it does not work. I don't know how but I figured out that hitting <CTRL-$&...
0
votes
2answers
45 views

Vim command to open zathura immediately after a latex compile?

I have the following line in my nvim configuration file: map <leader>c :w! \| !compiler <c-r>%<CR>\| !zathura $(echo %:r".pdf") && disown<CR><CR> The ...
1
vote
1answer
29 views

Vim plugin installation saying that I have to check my access rights

I'm using a plugin manager Vim Plug and I'm trying to install YouCompleteMe but I keep on getting this error and I don't know what to do with this. I use VIm8 x YouCompleteMe: Cloning into '/home/...
1
vote
0answers
33 views

How to make Vim not be a line editor

Vim is famously (or infamously) a child of line-based editing. For many cases this is acceptable. But I wish to use it primarily as an academic tool with large amounts of text. I want the experience ...
0
votes
2answers
29 views

How to iterate over a directory of files in vimscript?

I have a directory ~/.vim/rc.d/ that houses various configuration files. I like this pattern for configuring various things in my homedir because it modularizes configuration options. The problem is ...
0
votes
1answer
32 views

Reloading syntax on vimrc change

My vimrc has a function that extends the default-provided syntax for C: function! Bx_c_syntax() "{{{ "A faked version of the real thing let b:match_words= \ '\<...
0
votes
1answer
40 views

How to Keep Syntax Color but Disable Highlighting in Vim?

I recently activated auto-complete using YouCompleteMe and syntax color in Vim. However, a red highlighting color appeared. I tried to disable syntax color with syntax off, but this highlighting ...
0
votes
1answer
59 views

Navigation in insert mode with soft wrap and showbreak

I’m having trouble with hjkl movement in insert mode. The issue is that I have changed hjkl movement to move by display line. I have 'wrap' on. The cursor should normally move line by line, not move ...
1
vote
1answer
31 views

How would I make this into a keybinding?

When I want to find out what might be causing lag within vim, I use the following commands :profile start ~/profile.log | :profile func * | :profile file * <do actions that cause lag> :profile ...
1
vote
1answer
44 views

Color themes listed as available in Vim not changing upon :colo [themename] command

I am trying to install themes using V8+ Vim (8.2) on a Windows 10 OS. I first tried following the standard instructions listed on the Dracula theme site here. Unfortunately, the naming conventions for ...
0
votes
1answer
27 views

“Error detected while processing /Users/mycomputer/.vimrc:” when I try to open a file

New to vim. I'm on MacOS and every time I do vim something.txt, it gives me Error detected while processing /Users/mycomputer/.vimrc: line 128: E471: Argument required Press ENTER or type command to ...
1
vote
0answers
33 views

gvim remove menu and toolbar, but keep original geometry

I start gvim with this entry in .bashrc alias G='gvim -fg white -bg black -geom 80x45 ' and have in .vimrc set guioptions=aeik which works as expected and gives me a gvim that looks like vim in a tty, ...
0
votes
0answers
34 views

vim open very slow when the current directory is on nfs mounted remote disk

I mounted a remote dist to my local directory via mount -t nfs and then I tried to create file and write file to it touch file.txt echo dddd > file.txt The latency is not much time, and not ...
1
vote
1answer
25 views

Syntax in autocmd command to compile and run cpp code

From this post here: https://stackoverflow.com/questions/540721/compile-directly-from-vim One of the answer is: autocmd filetype cpp nnoremap <F4> :!g++ % -ggdb -o %:r <CR> autocmd ...
0
votes
0answers
40 views

Vim opens another file instead of source (Syntastic?)

I have been using vim for a while now and have some plugins including syntastic. I got a project with fileA.cpp fileA.h fileB.cpp fileB.h While debugging, I run vim fileA.cpp, and it will open fileB.h....
2
votes
0answers
28 views

How to delete the previous buffer when loading new result from quick-fix window?

In the quick-fix window, if I'm loading new results, the previous buffers stay which I don't want. I want only those buffers to stay which I open intentionally (e.g. to write new code, do diff of ...
2
votes
0answers
15 views

VIM remap Ctrl-w SHIFT-[h,j,k,l] [duplicate]

I'm trying to remap in my vimrc the keys Ctrl+w Shift+[H,J,K,L] to Ctrl+Shift+[H,J,K,L]. I'm using gnome vim version 8.1 This is what I have " Easy window positioning "nnoremap <leader>...
1
vote
0answers
62 views

Cannot set g:ale_fixers in ALE config on vim

I'm trying to config ALE in my vim and can't config the fixers, them aren't showing on ALEInfo. I'm setting the config for typescript files (with and without react) with prettier and eslint. What i'm ...
3
votes
1answer
67 views

How to show list characters with red color?

I have set listchar in .vimrc as below: set list lcs=tab:→\ ,space:·,nbsp:␣,eol:¶ How can I display these characters →\ , · , ␣ , ¶ with red color? Here is my failed attempt: hi! set list lcs=tab:→\...
1
vote
1answer
36 views

Is there a way to use different vimrc file for different directory?

I want to use different config files for different directories. For example, if I want to use different plugins(via a plugin manager) or use different color themes. Is there a way to do so?
0
votes
1answer
35 views

Python script not running through vim but runs on Windows CMD

I have recently switched to vim from VS Code. I have Vim 8.2. I have put these lines in my _vimrc file so that I can run python in vim by pressing F9:- autocmd FileType python map <buffer> <...
1
vote
1answer
40 views

Is there a way to map (Alt - Shift - Control - Any key) in vimrc?

The ergodox keyboard I use has two dedicated modifier keys ( Alt - Shift - Ctrl ) and ( Alt - Shift - Ctrl - Windows) I would like to use the modifiers in my vimrc to do more specific tasks. nnoremap &...
2
votes
1answer
49 views

Conflict between system compose key and insert mode meta key mappings

I use the right alt key as a compose key on my system, to easily draw diacritics and accent characters. In Vim, I unlock alt key mappings with this (from stackoverflow): " Allow <alt> key ...

1
2 3 4 5
26