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

Apply the new setup of .vimrc to the file open to the other tab in the terminal [duplicate]

I have two tabs on my terminal. The first one is where I'm doing my project (html & css). On the other tab I'm working on my .vimrc. I added a new plugin (nerdcommenter) and it works on the .vimrc ...
0
votes
1answer
364 views

set shortcut depending on filetype [duplicate]

For some markup and programming languages I use VIM and the usual procedure for me checking if my code works is :w and !<compile>. Depending on the filetype <compile> can be very different ...
0
votes
0answers
71 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
30 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 ...
0
votes
0answers
152 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
0answers
242 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 ...
0
votes
1answer
347 views

NerdTree Toggle seems to overwrite my set columns=80

This is my .vimrc configuration: set columns=80 set linebreak It works as expected but when call NerdTree Toggle the lines expand to fix the terminal window size. Even when NerdTree is deactivated ...
0
votes
1answer
142 views

“-u {vimrc}” not working as expected

I am trying to set up vim so I can get different functions in with different files (i.e. x.lisp and x.scm) and in the manual it says starting with the option "-u ufile" uses "ufile" as the vimrc My ...
0
votes
0answers
54 views

Highlight block of injected code [duplicate]

windows 10/ gvim 1-1802. I use Javascript and there are sometimes blocks of HTML code that need to be inside a particular region that can be indicated by """, for example . I have a similar ...
0
votes
0answers
294 views

Fold show first line of docstring, keeps other folds intact

Following this article, fold show first line set foldtext=getline(v:foldstart+1), it does but other folds in file look bad, see pics: When set foldtext=getline(v:foldstart+1) Without set foldtext=...
0
votes
1answer
115 views

Is there any diff between these opions in behaviour?

Actually I set these options in my vimrc: set tabstop=4 set expandtab But everywhere I saw (esp in vim.wikia) they set different tab option as mine. like: set shiftwidth=4 set softtabstop=4 set ...
0
votes
1answer
690 views

How to make <S-A-Left> and <S-A-Right> work in vim within Mac Terminal

I'm using these keyboard shortcuts to navigate/manipulate tabs in MacVim " tab navigation nnoremap <silent> <S-Left> :tabprevious<CR> nnoremap <silent> <S-Right> :...
0
votes
0answers
1k views

Change runtimepath of Gvim on Windows 10

This's kind of odd question but I can't change the runtimepath of gvim to comply the same manner like under linux (plugins put under .vim) I tried to append .vim at the begin of runtimepath like: set ...
0
votes
0answers
400 views

How to map shortcut to double square brackets using the leader key

I'd like to assign [[ to leader[ and ]] to leader]. I've tried the obvious: let mapleader=" " nnoremap <leader>[ [[ nnoremap <leader>] ]] but the former mapping doesn't work. I've ...
0
votes
0answers
11 views

“set background=dark” masking highlight command [duplicate]

If my .vimrc file has this: set background=dark highlight Comment term=bold ctermfg=white ...comments are white as expected. But if I reverse the order of the statements: highlight Comment term=...
0
votes
1answer
376 views

Line length mark in Python files [duplicate]

I'm new to Vim and I'm trying to include a line length marker, but only in Python files. As far as I know, this line length marker can be added to Vim by using set colorcolumn=<number> in the ....
0
votes
0answers
73 views

when vim isnt run as just vim, getting no colors

I recently started using :set termguicolors which enables 24 bit colors. However, this (along with the rest of my config) causes vim to display absolutely no colors whenever it is started in a ...
0
votes
3answers
1k views

Sourcing Vimplug plugins in a separate file

I am using the minimalistic Vimplug as the plugin manager for Vim. Installing plugins through Vimplug involves putting the following code inside the vimrc file. call plug#begin('~/.vim/plugged') ...
0
votes
2answers
2k views

vim under tmux looses color scheme in iterm2

OSX - sierra iterm2 3.0.13 tmux 2.3 vim 8.0.176 colors work fine in bare iterm2: but under tmux: iterm2: echo $TERM xterm-256color tmux: echo $TERM screen-256color tmux config vimrc I'm ...
0
votes
1answer
146 views

enable NERDTree only when editing h/c/cpp files

if (&filetype=='c' || &filetype=='cpp' || &filetype=='h') autocmd VimEnter * NERDTree autocmd VimEnter * wincmd p " class outline viewer : F8 nmap <F8> :TagbarToggle<CR&...
0
votes
0answers
565 views

How to color the column right after the line numbers and before the beginning of line?

Would be nice to color the single column just left of the beginning of the line, but I don't think it has a group name like CursorLine. Anyone have any ideas? Maybe some simple macro would do, using ...
0
votes
0answers
290 views

Matchit Plugin: issues when resetting regular expressions in “b:match_words” for detecting Matlab file keywords

I'm trying to implement a custom regexp string to be used by matchit.vim for identifying matching keywords that can be jumped between with %. I found a utility from FileExchange (in the ftplugin ...
0
votes
0answers
197 views

Forcing bracket to go under cursor

So I am trying out javascript on vim. It is great that it automatically indents the braces for me when I close them etc.. But I was typing some JS and got into a bracket muddle. Here is what I had: ...
0
votes
0answers
53 views

Create project specific mappings and abbreviations [duplicate]

When I'm working in a project it would be useful to be able to set some abbreviations / mappings that are specific only to that project. I know that I can have file specific mappings in ~/.vim/after/...
0
votes
1answer
4k views

How to add Plugin in .vimrc file? [duplicate]

I am a new user of vim and want to add a plugin SuperTab for autocompletion. I searched for the plugin from vimawesome and it says Place this in your .vimrc: Plugin 'ervandew/supertab' I've created ...
0
votes
1answer
223 views

Airline does not display correctly unless I source _vimrc

I have airline plugin installed with pathogen. It displays <bf><bf> etc instead of showing normal characters. If I source my _vimrc, airline displays everything normally. I sometimes have ...
-1
votes
1answer
51 views

Pause execution in vim

Is it possible to do something like this in vim: function MyFunction echom "Part 1" raw_input('...') # python equivalent (or input(...) in python3) echom "Part "2" endfunction That is, a ...
-1
votes
1answer
99 views

Setting localleader

I've tried setting localleader using: :let localleader="]" And it seems to be 'working': :let localleader localleader ] However, when I try and run a command using localleader, it doesn'...
-1
votes
1answer
782 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
votes
2answers
323 views

Shortcut for automatic execution

I've found the following command to execute Python or Matlab or any other language as far as I understand to execute code nnoremap <buffer> <F9> :exec '!python' shellescape(@%, 1)<cr&...
-1
votes
1answer
44 views

What is 3kA in this mapping?

I'm trying to understand how to make mappings in vim (particularly neovim). Searching, I’ve managed to do some of the things that I want, but I can't learn what everything means. Example: a latex ...
-1
votes
1answer
142 views

How to compile a program and open the output in a vertical terminal window?

How can I write a command that does the following? With one mapping, compile and/or run a program based on the filetype (*.c, *.cpp, *.js, *.py, etc.), and open a vertical terminal window with the ...
-1
votes
1answer
281 views

Why Error E172 on Execution?

Code "" http://vi.stackexchange.com/a/7787/2923 function! OpenSelectionAsTabs() range let tabnr = tabpagenr() for line in range(a:firstline, a:lastline) execute "tabedit " . getline(...
-1
votes
1answer
25 views

mapping to delete and yank multiple lines e.g. d4y instead of d4d

In my vimrc I have nnoremap d "_d nnoremap yd dd to not save lines when I delete. Is it possible to create a mapping that when I press e.g. d4y it will cut 4 lines and save them into buffers? I ...
-1
votes
2answers
54 views

Get GUI name for different settings in neovim

I am deciding between using either goneovim vs neovide, both on windows, but each uses the font height differently, so I a wanted to make something like: if has(goneovim) "goneovim specific ...
-1
votes
1answer
93 views

vimrc for ale is creating confusion: is my augroup wrong?

My vimrc: https://paste.fedoraproject.org/paste/Wl5jvebADSDoAI4HbIX-hA and my corresponding python file is: https://paste.fedoraproject.org/paste/g60mU7xBqGaEuKKWkZ6Rnw The problem is, with ALE, as ...
-1
votes
1answer
231 views

Modify the vim configuration

In the vim editor, the buffers look like l/t/l/c/admin.py for loanwolf/test/loanwolf/customers/admin.py. My point is I want to see something like admin.py (cus). How could I modify the .vimrc config ...
-1
votes
1answer
73 views

How to check if total number of lines are bigger than 10 in Vim? [closed]

I want to check if number of lines are bigger than 10 in Vim. I tried to use this code in vimrc file: if line("$") > 10 colorscheme currentline endif Edit: I made a colorscheme with ...
-1
votes
2answers
53 views

How can i make this autocmd BufEnter command work?

i am setting the default vim-statusline, and i made this line on my colorscheme: hi MyStatusLineDevIcon ctermfg=7 ctermbg=0 cterm=NONE So i can color the devicons on my statusline.vim config I call ...
-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
votes
1answer
648 views

vimrc is not the ultimate configuration file

I have to make explicit source file, eg: vim -S ~/.vimrc whatever.md otherwise it's either ignored or superseded by other configuration files. I've found running with strace the following order in ...
-2
votes
1answer
680 views

Is vim suitable for professional development inside a company? [closed]

How commonly is Vim used in professional software development today, inside a company? By Vim, I mean the actual Vim editor, not a Vim/vi plugin/setting or usage within Eclipse. Has Vim hindered your ...
-2
votes
1answer
3k views

Why vim highlight some specific words? [duplicate]

Why my vim highlight some specific words? As showing in the following screenshot picture. How can I locate my problem? There is my .vimrc file. set nocompatible " be iMproved, required filetype ...
-2
votes
1answer
166 views

Call the function only once when Vimrc is loaded without using global variables

I would like to call my Vim function once when vimrc is sourced. I could put some global variables in my vimrc file and set them to be 0 or 1 etc.. In fact, that is what I'm doing for many functions....
-2
votes
1answer
48 views

autocmd vs augroup example [duplicate]

Is there any difference between the following two commands: autocmd FileType html,htmldjango inoremap <buffer> <leader>1 &nbsp; And converted to an autocmd: augroup filetype_html ...
-2
votes
1answer
73 views

Damn I can't do it [duplicate]

Here is my .profile (macs don't usually bother with .bashrc) export VIMINIT="let $MYVIMRC='/Users/user/userbits/future.vimrc' | source $MYVIMRC" source /Users/user/userbits/future.source` ...
-3
votes
1answer
154 views

Make gvim show Q letter (character) [closed]

My vim doesn't represent the uppercase letter q Q? How to fix this? Here is my vimrc : set nocompatible " be iMproved, required filetype off " required syntax on set ...

1
24 25 26 27
28