Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
13 views

Emacs like narrow to region

Is it possible to narrow the text to a region, or function, and widen it as needed, as is possible in emacs via narrow-to-region ?
1
vote
1answer
26 views

How to stop “tab” key indenting whole line

In one version of VIM that I run, when I hit the "tab" key in insert mode, it indents the whole line, regardless of the cursors position in the line. Here is what I believe to be the only modified ...
1
vote
1answer
34 views

Check if key is already bound in vimscript / Map key only if not mapped already

I'm wondering if it is possible to check in vimscript if a key (or key combination) is already bound? I know about the :map command which lets me see visually which keys are bound to what actions, ...
2
votes
1answer
62 views

Using Pandoc with vim keybindings

I am trying to define a keymapping in vimrc to compile my markdown file with Pandoc. So I am using this: autocmd FileType markdown nmap <F9> :!pandoc % -o %:r.pdf <cr> But, in markdown ...
0
votes
1answer
32 views

Disable highlighting for tex files with texvim

I want to use vimtex and enable highlighting for all filetypes, except tex files. For tex files I explicitly want to disable highlighting. How could I do that? Important: The solution should allow ...
0
votes
2answers
44 views

How to disable insert-mode popup-menu mappings?

I'd like to disable the popup menu scroll mappings <C-n> and <C-p>, so that I can use <C-j> and <C-k> instead. However, when I enter imap <C-p> <Nop> imap <C-n&...
-1
votes
0answers
24 views

tabs in IDE and vim [duplicate]

Suppose I have the following tabs : geany (It's a light IDE) has dynamic tabs such as eclipse or so on. I want to have same tabs in vim. Can I have tabs?If I can, How to?
-1
votes
1answer
35 views

E464: Ambiguous use of user-defined command: Plug 'rdnetto/YCM-Generator' , { 'branch': 'stable'}

I have the following vimrc file : syntax on set nocompatible " be iMproved, required filetype off " required if has("autocmd") au BufReadPost * if line("'\"") > 1 &...
1
vote
0answers
32 views

NeoVim: colorscheme won't work in init.vim; requires command to be typed

I'm new to NeoVim and just getting started. My init.vim file under NeoVim\share\nvim\runtime\plugin\init.vim successfully sets everything except for the colorscheme and background. As seen in the ...
1
vote
1answer
34 views

vim process memory consumption increase with time

Folks, I am running my vim-8.1.1 compiled in my debian stretch system. The vim process slowly eats up to 40% of my system memory in about 4-5hours. No big files opened. ~4 tabs opened (each with 2 ...
1
vote
0answers
22 views

How could I map Alt on linux [duplicate]

I am trying to map the key Alt+j in vimrc to adjust the height of the window: tnoremap <A-j> <C-\><C-n>5<C-w>-i nnoremap <A-j> <C-\><C-n>5<C-w>- But ...
0
votes
1answer
59 views

Cannot set (let) mapleader and use <leader> in global vimrc

I'm using basic version vimrc from https://github.com/amix/vimrc. No problem if I put the vimrc file to /home/{user}/.vimrc, but if I put it in /etc/vimrc (arch) or /etc/vim/vimrc (debian), it became ...
0
votes
0answers
13 views

Syntax highlighting for variables and function arguments in python [duplicate]

Is there a way to highlight variables, function arguments and function calls in python files in vim. I have tried multiple syntax files for python but i guess none of it worked for me. I guess ...
0
votes
1answer
28 views

How could I turn off the terminal line number while keep the editor line number in vimrc

I want to show line number in the editor, thus I use set nu in my vimrc. But when I open the embedded terminal with :ter, there are also line numbers there which I feel not comfortable. How could I ...
1
vote
1answer
29 views

Is there a setting that hides the last colon-command entered?

Is there a setting I could add to my vimrc file that would hide the last entered colon-command that stays visible on the bottom of the screen after I hit enter? For example, if I type ":3" to go to ...
1
vote
0answers
31 views

Cannot map <C-j> sequence in vim [duplicate]

I used to be able to navigate vim splits using nnoremap <C-j> <C-w>j nnoremap <C-k> <C-w>k nnoremap <C-l> <C-w>l nnoremap <C-h> <C-w>h but now I ...
1
vote
2answers
55 views

Keep the full visual selection after indenting in easy mode vim

What is the best way to indent multiple lines in insert mode? Here is what I have currently: vmap <Tab> > vmap <S-Tab> < The problem is that it doesn't properly handle selection ...
1
vote
1answer
22 views

Why does placing echom in vimrc as part of a mapping cause it to echo on load?

As a test, I have created a one line .vimrc file and have an empty .vim/ directory. The .vimrc file is: nnoremap <leader>fed :e ~/vimrc.test<CR> | echom "opening vimrc . . ." On vim ...
0
votes
0answers
20 views

Auto source fail when saving shell and tmux runtime configuration

I am auto source the vimrc file whenever I save the file by autocmd! BufWritePost .vimrc source % I would like to apply this to all file needed to source, however the following lines seems not ...
1
vote
1answer
29 views

Does FileType only works when vim acctually knowns the type by default?

I need to mapping some action only for the feature file (which end with .feature) I've tried autocmd FileType feature nnoremap .... in the vimrc, but it won't work when I editing the feature file ...
5
votes
1answer
106 views

How to break a long mapping line into several short lines in vimrc mapping

I have a very long vimrc mapping to deal with for example nnoremap <space>e :exe "!tmux send-keys -t.- 'cd $TEST' Enter"<Cr> :exe "!tmux send-keys -t.- 'source $TEST_NT/bin/activate' ...
1
vote
1answer
62 views

Sending command to different tmux pane from vim

behave test language need to execute different lines of the behave feature file, for example, if I want to test the line number 99, I'll need to input the following line in the terminal behave ...
1
vote
1answer
80 views

Vim 8.1 Globally custom highlight colors

Problem I'm finally getting around to upgrading from Vim 7.4 to Vim 8.1, but my global custom highlight colors have stopped working. I am aware similar questions (such as this one) have been asked, ...
0
votes
1answer
17 views

Vundle not instaling Plugins / Ignoring

I installed Vundle via git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim, and have my .vimrc as: set nocompatible " be iMproved, required filetype off ...
0
votes
0answers
23 views

Does Vim in console/tty have same colors set as in terminal/xterm-256color?

When I setup vim for colors in terminal, I'd like it has the same as in console, so Does console support 256color? as I'm using xterm-256color in a terminal right now?
0
votes
1answer
18 views

[no]foldenable / foldmethod for each buffer but keep those settings persist for each buffer

I have two opening buffers and one has foldenable and foldmethod=indent, other has nofoldenable and foldmethod=syntax. I need that when I move between buffers, each buffer has it own fold settings ...
0
votes
1answer
23 views

How to keep Ag (the silver searcher) open when no matches are found?

I do use Ag as my grep replacement. My problem is that when I search for something that does not exist (search result empty) my quick fix windows closes automatically. Is that normal? Would it be ...
1
vote
0answers
17 views

inoremap ctrl h to move left in insert mode not work (it delete the left character exactly) [duplicate]

my mapping is .vimrc inoremap <C-h> <left> inoremap <c-l> <right> inoremap <c-j> <up> inoremap <c-k> <down> But, if I press ctrl+h in insert mode, ...
0
votes
0answers
28 views

Vim still create backup/swap/undo folder under .cache when set nobackup/noswapfile/noundofile [duplicate]

I got a strange behavior of vim 8.1 1-279 / archlinux 4.17.14 This is vim under console but I believe there's no different. Vim force create ~/.cache/vim/{backup,swap,undo} folders even I set ...
1
vote
1answer
33 views

The `expand('<cWORD>')` Returns Empty String in `inoremap`

I'm trying to define an insert mapping like this: inoremap <expr><buffer> ; (Test(expand('<cWORD>'))).";" in which the Test function is defined as: func! Test(a) echom "cword:...
1
vote
1answer
47 views

Highlight whitespace using matchadd

I'm trying to use matchadd to highlight different occurrences of whitespace. However, sometimes it doesn't work for some reason. Here is the code: highlight GroupA guibg=lightgreen highlight ...
1
vote
0answers
16 views

Highlight semicolmns when editting lua files [duplicate]

I program in both C and Lua and therefore sometimes add a semicolmn in my Lua files. This is allowed by the standard, but my company's guidelines forbid semicolmns in lua code. Therefore, I would like ...
0
votes
1answer
38 views

Match pattern and highlight it in modeline for a specific filetype

I need to match Issue in .conf filetype and highlight it with custom color but set in mode line instead of a fix in syntax/conf.vim file. The use-case is for each kind of document I need to highlight ...
0
votes
0answers
13 views

Terminal Vim scrolls up once when I release the scroll wheel after having scrolling down

It is a weird behavior, and it's only happening on one of my laptop (they're both provisioned with the same script) which is the reason I'm having troubles identifying where does this come from. I ...
1
vote
0answers
53 views

Neovim not showing correct background color

I'm running neovim from a uxterm on arch linux with the solarized color scheme. The issue is that on scrolling only the characters which are non-whitespace are displaying the correct background. ...
0
votes
1answer
30 views

Vim multi-line substitute/insert once on selected text

I tried to make a function function! WrapSelect (front, back) "puts characters around the selected text. execute '''<, ''>s/\%V\(\_.*\)\%V\(\_.\)/'.a:front.'\1\2'.a:back.'/' nohl ...
1
vote
1answer
30 views

how to know if the current file in the buffer is a (.)dotfile using vimscript?

I changed vim backup directory to be stored on .backup folder in my dotfiles local repo set undodir=$HOME/.dotfiles/backup//. it works well as expected but i want to separate actual dotfiles ...
1
vote
0answers
56 views

CursorLineNR highlight not working

I have a vim configuration file (~/.vimrc) with the following settings: colo delek syntax on highlight clear CursorLine highlight clear CursorLineNR highlight clear LineNR highlight LineNR cterm=...
1
vote
1answer
20 views

Do not apply settings for non-modifiable popup windows

I have the following in my .vimrc: :set colorcolumn=81 This sets the background color of every window's 81st column to red. I would like to disable this for "pop-up" windows like syntastic's error ...
1
vote
0answers
27 views

Set different values for non-current and current statuslines

When vim is split into different panes horizontally, each pane has its own statusline. It's easy to highlight the statuslines differently based on current and non-current panes. BUT, I cannot figure ...
0
votes
1answer
29 views

How to isolate what is changing `set noshowmode` to `showmode` upon startup?

In my .vimrc file I have set noshowmode However, upon starting vim, :set noshowmode? returns showmode. Something must be adjusting this setting upon startup (perhaps a plugin?). What's the best way ...
0
votes
1answer
27 views

Option set in vimrc is overwritten - nvim

I'm trying to disable autochdir in nvim by adding the following in init.vim: set autochdir! but when I start nvim, I check the value of this option by echo &autochdir and find it equals to 1. I ...
2
votes
1answer
90 views

Expand all folds created by vim-latex when opening a LaTeX file

I want all my folds to be expanded when I open a LaTeX file. As per web search I added the following at the end of .vimrc set nofoldenable set foldlevelstart=99 set foldlevel=99 But even now its ...
0
votes
1answer
34 views

How to apply a custom highlight file?

I'm playing with Vim highlight, so I made the following (syntax.vim): hi Comment ctermfg=DarkGray hi LineNR ctermfg=DarkGray hi CursorLineNR ctermfg=Red hi String ctermfg=Gray hi PreProc ctermfg=...
1
vote
1answer
26 views

In visual mode, how do I bind a key so that the selected text generates “%s/<SELECTEDTEXT>/<CURSORHERE>/g”?

In visual mode, how do I bind a key so that the selected text generates %s/<SELECTEDTEXT>/<CURSORHERE>/g ? Preferably ; considering I never use it otherwise. Thanks.
0
votes
1answer
27 views

How to start recording a macro, using commandline mode?

If I wanted to start recording a macro using command-line mode, how would I do this? Additionally, if I wanted to bind this action to a key, how would I do that in my .vimrc?
2
votes
1answer
60 views

After closing a file, how do I remember/return to the previous line?

I'm not talking about the previous line I was on while still editing a file but after I close a file and then enter vim again, I want to go to that line. How do I enable this? Steps to 'reproduce': ...
1
vote
1answer
22 views

Put error into quickfix window

I can customize some error display in my file like highlight all white space at the end of each line by: :match ErrorMsg /\s\+$/ Can I put all the error I found into quickfix windows that I can go ...
1
vote
0answers
18 views

How to set up vim tags for JavaScript using vim-easytags

I use YouComplete plugin to do language completion but I can't seem to get tags to work for my own files/functions. I use xolox/vim-misc and xolox/vim-easytags and installed Exhuberant ctags. my ....
1
vote
1answer
87 views

Remap Esc key in Vim

Is it possible to remap the Esc key to another key in Vim? When I'm using Vim in a full screen VMware vSphere web client console window and I press the Esc key to exit edit mode, it also takes me out ...