Questions tagged [vimrc]

.vimrc is the primary configuration file for the VIM text editor

Filter by
Sorted by
Tagged with
3
votes
2answers
1k views

Vim automatically clear the command line

When using vim I like to keep my command line (the line where messages, warnings and errors are printed) empty, so after saving a file I usually issue a <C-l> to redraw the screen and clear it. ...
6
votes
4answers
3k views

Naturally scroll past end of last line in vim

I'm a bit of a vim novice, but I'm having difficulty finding resources to help me with this problem. When I move my cursor to the bottom of my file, I want it to keep going past the final line, ...
0
votes
0answers
43 views

Ctrl-D doesn't close the terminal inside VIM after piping the output of cat to clipboard (needs :q)

It's a very specific problem, so I'll try to provide everything that I think might be relevant. I have these two aliases in my ~/.zshrc for copying and pasting the output of commands: $ grep xclip ~/....
0
votes
0answers
111 views

How to remap CapsLock to Esc in Vim, installed on Ubuntu (console only, no Desktop Environment)?

The goal is to remap CapsLock to Esc in Vim, installed on Ubuntu (console only, no Desktop Environment). This Ubuntu system is installed on Virtual Private Server. I'm logging to this server using ...
0
votes
1answer
78 views

Which $TERM renders bold text in vim as well as display status line?

I am looking for a $TERM which displays bold text in vim and display airline statusline too. To know what I mean,I have screenshot of two identical files opened by vim but using different terms by ...
8
votes
3answers
6k views

Disabling vim visual mode in /etc/vim/vimrc does not work

I found plenty of questions regarding disabling visual mode in vim but none that tackles my particular problem: I added set mouse-=a to my /etc/vim/vimrc file to disable visual mode for good. Thing ...
2
votes
1answer
2k views

Vim FoldColumn color different on Debian / Ubuntu

I sync my .vimrc file between two machines, one running Debian testing and the other Ubuntu. On Debian everything works fine. On Ubuntu, the fold column is gray instead of black, even though black is ...
4
votes
1answer
3k views

Vim powerline with broken encoding

I trying to learn using vim, I am enjoining a lot, but I copied the vimrc from github and I would like to understand what is causing the break of powerline encoding. . In the vimrc file I have: set ...
0
votes
0answers
20 views

How to Migrate Neovim from Windows to Linux

This seems like a pretty simple question, but I can't find a solution. I have Neovim configuration on Windows with a custom init.vim as well as plugins and color schemes. I am able to get Neovim on ...
1
vote
2answers
49 views

Vim: run commands depending on file directory

In my init.vim, I want to run certain commands only if the current file is under a certain hierarchy. Pseudo-code: if current_file_directory == ~/some/path/here autocmd <whatever> set <...
0
votes
0answers
100 views

Map Escape to caps lock in vim not working in Fedora 34

I am new to Fedora and I have installed Fedora-34 couple of days ago. Well, when I used ubuntu, I mapped my Esc to CapsLk in vim using following lines in ~/.vimrc file au VimEnter * silent! !xmodmap -...
1
vote
0answers
140 views

Icons are not displayed in vim airline and NERDtree

I've just installed plugins for my neovim using vim-plug. The plugins are working perfectly but its the icons within them thats haunting me. I ve provided screenshots of them below. They look very ...
7
votes
3answers
13k views

Disable viminfo completely

I'm trying to disable viminfo completely, I tried to add something in the ~/.vimrc, I tried 3 different methods, none of them works set viminfo='0,:0,<0,@0,f0,n~/.viminfo set viminfo= set viminfo=...
6
votes
6answers
8k views

Can't open syntax.vim error when using vimrc

When I try to open my .bashrc file. then it shows these lines: Errordetected while processing /etc/vimrc: line 45: E848: Can't open file /usr/share/vim/vim70/syntax/syntax.vim Press ENTER or type ...
8
votes
3answers
1k views

Can vim syntax highlight HTML color codes with their color?

It it possible to setup syntax highlighting in vim so that an html color sequence is colored in that color; e.g. #FF0000 would show up as red. I'd also be okay with it underlining the text that color ...
1
vote
1answer
98 views

Vim/nvim <BS> and <C-w> delete entire line in (terminal mode from a command) instead of a single character

I'm creating a mapping which is supposed to navigate to a specific window (call TEST_WIN), focus in on the terminal and then delete a single character. The mapping looks like this: noremap '; :let ...
0
votes
1answer
34 views

Vim: Default Colour Scheme Permission Issues

So I tried to change the default colour scheme of vim to desert thinking it was going to be a simple task but I ended up getting caught in a rabbit hole. I normally create a web pages using sudo ...
0
votes
1answer
133 views

How to make nested indentation in vim?

I would like to make if-fi statement in vim, where the iabbrev will "autocomplete" the if-fi clause: autocmd Filetype sh iabbrev if if<esc>ma<cr>ifi<esc>`ak which upon if ...
0
votes
1answer
41 views

Scroll, instead of move cursor, if at end of file

I find myself unintentionally hitting j (or some other downward cursor movement key) when I'm at the bottom of a file. Then the next thing I do is to hit Ctrl-E to scroll the current line up - I may ...
0
votes
1answer
575 views

Disable auto tabs when putting your first comment in a yaml files with VIM editor?

Example of text before changes: First line Second line Third line When you put a comment on a line it will auto tab once that line. This happens every time you switch from ESCAPE mode to INSERT mode ...
0
votes
1answer
127 views

Remap <leader>q to exit vim

I'm relatively new to vim rebinds; I am trying to map <leader>q to exit vim, but the following rebind does not seem to work: map <leader>q :q<cr> However, all of the following seem ...
0
votes
1answer
115 views

How can I make vim only write to file after buffer has been modified?

I have this function which sources my .zshrc only if it has been modified in vim but I recently reinstalled Windows and WSL and then used my old .zshrc and .vimrc to get my setup back but this ...
1
vote
1answer
131 views

Vim Plugin - Easymotion isn't starting automatically

I'm trying to improve my neovim with plugins and the best plugin that I found is Easymotion. However, it do not start automatically. I need to do :source ~/.vimrc every time that I launch a file. How ...
-3
votes
1answer
63 views

How to import tmux setting for vim to normal vim?

When using tmux my color/font/syntax highliting in VIM gets improved. How can i import that red/yellow/white combination of color in .vimrc file. I want that. VIM ON TMUX: AND THIS IS MY NORMAL UGLY ...
2
votes
2answers
3k views

gvim colors the same as is the terminal

Is there a command I can put in the .vimrc to make gvim look like vim's setup in the terminal? Same back ground, syntax highlighting, colors, and font. To add to my question, is there a may for gvim ...
4
votes
5answers
11k views

Problem with vim when logged in as root

When I login as root or edit a file by sudo mode all of the options in my /etc/vimrc are not working (e.g. highlight line-number etc.)
1
vote
1answer
73 views

vim display message on execution of mapping

I have mapped a key shortcut to copy all lines to system clipboard, which is working fine nnoremap <localleader>o :silent %w !pbcopy<cr> I would like to display the message as 'Copied' ...
2
votes
2answers
1k views

Delete to end of command line in Vim

I like to use shell style shortcuts in insert and command-line mode, such as CTRL-K to delete to end of line. This mapping works in insert mode: inoremap <C-K> <C-O>D But I can't figure ...
38
votes
3answers
25k views

Opening a vertical terminal in Vim 8.1

Vim 8.1 added the :terminal command, which opens up a new bash terminal as a split. However, it always seems to be a horizontal split, and I prefer vertical splits. Is there a way to open a terminal ...
1
vote
2answers
73 views

Vim is displaying medium dash as �~@~S and long dash as �~@~R

I'm using vim on a shared Bluehost server. When I try to type —, Vim inserts �~@~R. And when I try to type –, Vim inserts �~@~S. The problem is not specific to any particular file. It seems to ...
0
votes
2answers
3k views

Difference beetwen default.vim and /etc/vim/vimrc [closed]

What is the difference between $VIMRUNTIME/default.vim and /etc/vim/vimrc? Why is $VIMRUNTIME/default.vim started first? Shouldn't /etc/vim/vimrc leave first? (Debian 9)
3
votes
2answers
893 views

Conflict Ctrl-I with TAB in normal mode

I recently noticed that in normal mode when I type Ctrl-i (command for jumps) it is "confused" for the TAB key. In particular, I have this mapping: nnoremap <Tab> :tabnext<Enter>
5
votes
1answer
242 views

Make the Shebang of a script different color than comment lines for vim

Currently I have my .vimrc set to produce blue comment lines, I was wondering if it was possible within the vim framework to make the color of line that start with #! a different color than those that ...
1
vote
1answer
741 views

expand tab is not working on vim

I set the expandtab option to on, but still I don't get spaces when I click tab, but I get actual tab. This is how I set it: set expandtab set shiftwidth=4 set softtabstop=4 First I thought as ...
5
votes
2answers
1k views

Remap Up and Down arrows to gj-gk in vim input mode without using <c-o>?

I have mapped my arrows keys to move in a visual-line mode, leaving the hjkl keys for normal, logic line movement: " Visual movement with the arrows and End-Home nnoremap <Down> gj nnoremap &...
1
vote
2answers
351 views

Is there a .vimrc setting that will cause vim to open files at the first line?

I'd like vim to automatically open files at line 1 instead of where it left off the last time. I tried putting gg in .vimrc, but that didn't work. There's must be some way to do this.
0
votes
1answer
137 views

Empty string syntax inside vimrc defined via nix home-manager

I want to use home-manager to declare my vim configuration inside a nix-expression with the extraConfig option. I'm trying to run the example .vimrc configuration from coc.nvim and one line reads: ...
1
vote
0answers
23 views

map "j" another character (specifically to a non-latin1, utf-8 character)

I am using a non us keyboard layout. I would like to map "j" to Turkish "ü" character, but also "k" to "j" since it is more convenient and natural for me. (I know this may be bad in the long run etc.,...
5
votes
5answers
1k views

vim edit a file with a user-vimrc but still load all previous initializations

Checking the man page for vim says it's -u switch that lets me choose a different vimrc file -u {vimrc} Use the commands in the file {vimrc} for initializations. All the other initializations ...
1
vote
1answer
126 views

Using set paste disables imap jk <Esc>

I use the following line in ~/.vimrc to allow me to press jk instead of Esc. :imap jk <Esc> It works fine until I add a :set paste: " Pressing jk is same as pressing Esc :imap jk <Esc> ...
10
votes
1answer
3k views

Stop vim pasting selections as text!

I have been using VI and VIM for years (30 or more) (in xterms, not its own window, gvim) and I have a huge library of vim commands that I give vim using the mouse middle button as a selection. For ...
4
votes
1answer
304 views

How to disable vimplugins while invoking vimdiff command

I added few vim plugins like sytastic, nerdTree. They change the status line and other UI elements, which works fine while editing files. But when I invoke vimdiff on 2 files, the nerdTree pane also ...
1
vote
1answer
119 views

vim: command map to two commands gives E488

I'd like a Build command that starts a build independent of what build system is used. command! -nargs=* Build :Makeshift<Bar>MakeshiftBuild <args> gives me E488: Trailing characters ...
1
vote
1answer
112 views

vim find claims to have many files but it is not

If I type ls in my directory, I get: README.md lib sdf.t t.t t1.t t2.t tt.t I am in vim, and if i type: :find *.t, I get:too many file names What is that happening? If I ...
0
votes
4answers
958 views

vimdiff - Weird Issue comparing 2 files

When I compare the below 2 files its comparing it wrongly. How to compare? All the rows are available in the file2 but its not working. When I do a "vim -d a b" its showing like the values are missing ...
2
votes
1answer
822 views

How to debug `Error while processing function` in `vim` and `nvim`?

TL;DR How to find where exactly vim or nvim error started (which file?) when I'm interested in fixing the actual issue and not just removing the bad plugin? Anything better than strace and guesswork ...
0
votes
0answers
212 views

Vim statusline shows ^[[2;2R^[[>41;330;0c^[]10;rgb:e5e5/e5e5/e5e5^G^[]11;rgb:0000/0000/0000^G after mapping Capslock to Esc

I added au VimEnter * silent! !xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape' au VimLeave * silent! !xmodmap -e 'clear Lock' -e 'keycode 0x42 = Caps_Lock' to my .vimrc to map Capslock to Escape. ...
19
votes
2answers
36k views

How do I highlight the current line and the cursor in .vimrc?

I am trying to highlight the current line as well as the cursor position in Vim. Here's my .vimrc: set cursorline hi CursorLine ctermbg=8 ctermfg=15 "8 = dark gray, 15 = white hi Cursor ctermbg=15 ...
2
votes
1answer
3k views

.vimrc does not working as expected

I've been trying new color schemes and I set: colorscheme gotham256 set background=dark set t_Co=256 highlight Normal ctermbg=NONE highlight nonText ctermbg=NONE but these thing doesn'...
0
votes
2answers
2k views

Vim: set "cursor keys" hjkl to wasd [closed]

I wish to overwrite/remap the basic vi/vim (and gvim) "cursor keys" hjkl to the ordinary "gamer layout" wasd (w-up, a-left, s-down, d-right). Moreover: I know that "w", "a", "s" and "d" are important ...