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
1answer
24 views

How to set a colorscheme that still shows spelling errors?

How to set a colorscheme that still shows spelling errors? I am looking for two combined effects that I can acquire separately but not yet together. Set Colorscheme alone: OK. If I want highlights ...
2
votes
1answer
15 views

Swapping two vim mappings

I have added the following the mappings to my vimrc. I want K to take me to the top line of the window and H to take me to the first non-empty character of the line. nmap K H nmap H ^ nmap J L nmap L ...
1
vote
1answer
37 views

What is the difference of using `au BufNewFile,BufRead *.py` and `au Filetype python` in .vimrc?

As I am setting .vimrc, I found these two code blocks have the same functionality. au Filetype python set \ tabstop=4 \ softtabstop=4 \ shiftwidth=4 \ textwidth=79 and au ...
0
votes
1answer
31 views

Need to run PlugInstall on each open

I have a .gvimrc file created to configure MacVim. I'm using Plug for package management. My .gvimrc looks as follows: call plug#begin() Plug 'tpope/vim-sensible' " sensible defaults Plug 'joshdick/...
0
votes
1answer
18 views

defaults for version 8.0.1766 go away once I define ~/.vimrc [duplicate]

Evidently Ubuntu 18.10 is using a new version of vim ( 8.0.1766 ) which gives cool defaults I really like ( immediately jump to search matches while I type in more characters when doing a :/...
-1
votes
0answers
27 views

Why 'set showcmd' added to vimrc does not work

I have added the set showcmd to my vimrc file, but it does not affect the vim. I need to put in vim :set showcmd to see what command I am currently typing. Is it is possible that some plugin is ...
1
vote
0answers
44 views

How to define a varialbe and refer to it later

I need to define variables who can hold number or strings. Those variables would be used later in the key mapping for example let bookMark=Lib7 //:echo boomMark do give out Lib7 nmap gb :<c-u>...
0
votes
1answer
17 views

How to combine 2 actions for different mode into one mapping

I wonder is there any pipeline style combination key mapping in vimrc. For example: The command to open the NERDTree is :NERDTree and press capital B will open the bookmark list. How can I combine ...
0
votes
0answers
13 views

Map ^M or CR to Enter and Ctrl-Enter to 'new line'

With xterm terminal all work file, default enter is to ^M and default ctrl-enter is to \n or ^J or new line. But I use st terminal and it lacks bunch of maps and bring weird behavior with vim (not ...
0
votes
0answers
32 views

Vim doesn't understand <Tab>, <Enter>

I have UltiSnips plugin's options in .vimrc: let g:UltiSnipsExpandTrigger="<Enter>" let g:UltiSnipsJumpForwardTrigger = "<Tab>" let g:UltiSnipsJumpBackwardTrigger = "<S-Tab>" With ...
0
votes
0answers
16 views

Multiline search like with f and F [duplicate]

I'm using vim for C programming and I have a question about jumping to the next/previous character. I can use f or F to jump to the next or previous character correspondingly. But this does not work ...
3
votes
2answers
104 views

Why can't I paste commands into vi?

I've been using vi for 40 years. A week ago I upgraded; Disaster struck! The upgrade was to VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 4 2018 23:38:28) I run this on xterm under Cygwin (...
1
vote
2answers
22 views

Different shiftwidth in .html and .md files

I use gvim8.1. My settings file contains these 2 lines: set expandtab, set shiftwidth = 4. I have a file 'html.vim' in '~\vimfiles\after\ftplugin\'. The file is listed below: set expandtab setlocal ...
2
votes
0answers
24 views

Extending the true line width to enable screen readers to see what blind users cannot

Vim is outstanding. It holds a lot of potential for blind users. I still have one out-of-the-box problem when using vim with screen readers (tested with both NVDA and System Access). But that surely ...
1
vote
0answers
109 views

How to close splits automatically when changing file or closing VIM?

I am trying to create my own IDE like setup inside of VIM. This is what I have. I am also using Tmux here if you wonder about the bottom terminal screen. If I change file to another CPP within ...
2
votes
1answer
44 views

How do I execute normal commands from an autocmd?

I am trying to do some window management in VIM where I create certain windows such as two or three vertical splits with different sizes. At the moment, I only know how to change panes with <C-w&...
1
vote
1answer
39 views

How to move to parent directory with LeaderF?

When I'm browsing folders in LeaderF is there a way to move to the parent folder? Background: I'm building a vim (Neovim) profile and looking at file/buffer explorers, and LeaderF seems useful. (I've ...
0
votes
0answers
16 views

Alt+key mappings don't work in Vim [duplicate]

I added the following lines to my vimrc: " Easy window switching (Alt-h instead of Ctrl-w-h, etc..) nnoremap <a-h> <c-w>h nnoremap <a-j> <c-w>j nnoremap <a-k> <c-w>...
0
votes
2answers
52 views

no longer can underline current cursor

I built vim from source. But for some reason I can no longer underline my current line when vim loads .vimrc. I have to type underline commands manually which makes it work. Here is the output of my ...
0
votes
1answer
32 views

Make a command to open c files next to the corresponding header

I would like to have commands like :ce and :ctabe that open a tab with a vertical split with the .c file on one site and the corresponding .h file on the other. How can i accomplish this behaviour?
1
vote
1answer
39 views

How can I make my Vim setup (with plugins) portable without leaving artefacts on a given system?

On my work project VM, I have a relatively common Vim set-up, with various files a in ~/.vim folder and a medium size ~/.vimrc file. Plugins installed from VimPlug store files in various folders, such ...
0
votes
1answer
30 views

Why Backspace key do not work in insert mode in shell file by default in Cygwin?

I am using cygwin to run "linux command line" on windows 10. But here, backspace key doesn't work in insert mode. I had to edit my .vimrc file by setting "nocompatible and "bs=2" to make it work (by ...
0
votes
1answer
36 views

Why is my small SQL comment not backed up in the .swp file?

Problem: The changes I make in files before closing are not saved in .swp files As I understand it, the swap file should save any changes if they are at least 200 characters long or nothing has been ...
1
vote
2answers
47 views

set rtp in a function does not work

I have the following configuration for OCaml development which works fine: " --------------- OCaml ----------------------------- " Merlin let g:opamshare = substitute(system('opam config var share'),'...
1
vote
0answers
23 views

Define new text object for snake case

I recently discovered iskeyword as in set iskeyword-=_ so that I can change just part of a snake case word, like changing character_idx to char_idx using ciw. This was working great, except sometimes ...
1
vote
1answer
33 views

how to disable displaying of filename in the command bar when opening files in vim/nvim?

Everytime I open a file vim displays the filename in the command bar, for example I run this: vim test.test vim will start with a statusline like this: "test.test" [New File] ...
0
votes
1answer
20 views

Read the first line of the current file to process it in a command (Emulating %TeX root)

Currently I have the line :nnoremap <leader>c :w<CR>:!arara %<CR><CR> in my $MYVIMRC. If I press <leader>c, it will save the current file and run the command arara on ...
3
votes
1answer
62 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
42 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
40 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
136 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
34 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
52 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
1answer
60 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
64 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
38 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
23 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
73 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
17 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
32 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
34 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
66 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
27 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
27 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
107 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' ...
2
votes
1answer
79 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
174 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
25 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 ...