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
2
votes
2answers
86 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
33 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
21 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
258 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
28 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
151 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
57 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
16 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-$&...
1
vote
2answers
219 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
226 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
37 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
46 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
37 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
2answers
187 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
93 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
33 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
52 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
63 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
45 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
72 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
84 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 ...
1
vote
1answer
48 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
31 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
16 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
196 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
92 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
55 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
40 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
74 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
87 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 ...
0
votes
1answer
26 views

have text longer than a vim windows displayed on several lines

I'm trying to have text longer than a vim windows displayed on several lines. For this, I tried to follow the advice of this blog by entering set wrap in the .vimrc file but nothing changes and the ...
0
votes
0answers
18 views

Syntax profile close to dosini but with extra highlighting between quotes

Unfortunately I've to work with a custom and weird file format every day. To make my life in Vim easier, I've tried several syntax settings and 'dosini' comes very close. However, the text in between ...
0
votes
2answers
60 views

Vim doesn't source $MYVIMRC

I thought that setting the environment variable MYVIMRC would make them use that as its rc file on startup, saving me from passing -u every time. It's set correctly :echo $MYVIMRC shows /c/Users/...
1
vote
1answer
17 views

<esc>v$ without trailing space?

I want to use $ in visual mode but it always includes a trailing space (even if there isn't one on the line). How do I make it so $ only goes to the actual last letter?
0
votes
0answers
30 views

=AutoPairsDelete() is inserted when using kite and auto-pairs in vim

I am currently using the vim editor. I am facing a problem right now. If I use kite and auto-pairs together in vim, =AutoPairsDelete() will be inserted when I press the Back space key repeatedly. I ...
1
vote
1answer
42 views

Autosave in vim causing side effects

I am trying to implement autosave in vim. I managed to put together these lines using this article - Understand Vim Mappings and Create Your Own Shortcuts! and added them to .vimrc " auto save on ...
1
vote
1answer
36 views

How to create mappings with a function?

I am trying to create a function in vim that is capable of creating mappings for me. This is so I don't have to type out very similar commands over and over in my vimrc. Take these two mappings as ...
0
votes
0answers
30 views

gVim wont open skeleton code when creating new file

I am currently using gVim to code in C++. I've recently made a skeleton file that includes imports, macros, etc., so that every time I make a new .cpp file it automatically adds the skeleton to it. To ...
0
votes
1answer
34 views

How to change this particular “deep blue” color that displays?

I'd like to change the color of a certain character set displayed in my terminal. I'm not sure if it's related to the terminal itself (xfce terminal) or to the colorscheme (distilled.vim) so I'm not ...
4
votes
1answer
349 views

How to stop Vim from sourcing a file halfway through? [duplicate]

I'm mostly a Neovim user and I would like to share part of my config with regular Vim. Here's the problem: my init.vim is organized in such a way that at the top there are the general Vim options, ...
3
votes
0answers
42 views

Unicode in vimrc no longer displaying correctly

I'm using VIM 8.1.2234 with +multi_byte and +multi_lang In my vimrc file, I have set listchars=tab:▸\ ,trail:· (Notice the "▸" and the "·") When I cat or less my vimrc, the text ...
1
vote
0answers
20 views

welcome message hidden by “exe” in timer function

My vimrc holds a script to change the color of the CursorLineNr conditionally based on the mode. My problem is that it hides vim's welcome message when it's launched without a file. I would like to ...
1
vote
1answer
35 views

pluging value to override vimrc

in my ftplugin, I have code: if executable('fprettify') au BufWritePre <buffer> :silent %!fprettify --silent else :let choice=confirm("fprettify doesn't exists! Install ...
0
votes
0answers
20 views

How to follow while searching regex in vim? [duplicate]

In my previous vim, when i typed /something and after reaching upto so vim started immediately following and with each letter typed i got into new word until i got the perfect. However this following ...
1
vote
1answer
58 views

Why cant i use `"+` in vim? [duplicate]

Previously, whenever I typed "+yy in vim, it yanked a line to the system clipboard. I reinstalled the OS again, and, when I try to do the same now the input disappears after entering +. Steps: I ...
2
votes
1answer
78 views

:terminal colorscheme inside Vim is different from either Vim or Host Terminal

I have a gruvbox theme applied to Vim inside my vimrc. The problem is that when I run the :terminal command inside Vim the colorscheme is different from either the Vim theme or the terminal emulator's ...
1
vote
2answers
67 views

Execute a vim command after entering vim

Is it possible to send a command to vim from the command-line? For example, to open the last file something like: $ vim -e "`0" # execute `0 after opening vim Or, if I need to run a ...
0
votes
0answers
102 views

Gruvbox theme for Airline resets every time Vim closes

I have installed gruvbox using vim-plug, then I installed Airline and set the theme following the recommendations. But every time I close Vim and open it, the theme for Airline is reset to default and ...
0
votes
1answer
67 views

How to paste/merge 2 blocks of text in vim

I search a way to paste/merge 2 block of text block A apple pear banana block B tomato beans potato to this apple tomato pear beans banana potato I'm looking for an easy way to do this using macros....
0
votes
1answer
26 views

Suggested to use recursive or non-recursive mappings to normalize mapping

What approach would be preferred to allow a cmd-s to trigger a save, regardless of mode: " Allow i,c to call normal mode noremap <leader>S :silent call SaveFile()<CR>asdfidfo ...

1 2
3
4 5
28