Questions tagged [vimrc]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
348 views

How to substitute words in git rebase file

I'm trying to set up visual mode mappings for quickly editing git's generated rebase list from when doing interactive rebase (e.g. git rebase --interactive upstream/master). In such you're presented ...
10
votes
1answer
2k 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 ...
1
vote
1answer
205 views

Cannot get YouCompleteMe to function

I am trying to setup YouCompleteMe (YCM) with vim for my Linux Mint 18.1 KDE machine. I followed the steps on the git page for Ubuntu however cannot get it to work. Is it an issue with Linux Mint or ...
0
votes
0answers
616 views

Installed a VIM plugin but ran into an error: E117: Unkown function

I install google/vim-codefmt plugin and then install clang-format and restart VIM, then I run :FormatCode, but I'm getting the following error: Error formatting file: VIM(let):E117: Unkown function:...
0
votes
4answers
847 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 ...
0
votes
2answers
206 views

Is there a fuzzy finder option for vi?

I'm a convert to and now big fan of vim However there's still one thing that I'm envious of in other editors: Fuzzy finder matching Is there an option or plugin for those to work the way I see it ...
9
votes
2answers
2k views

Configure shortcut on Vim to save file

I was wondering is it possible to create a custom shortcut in vim or vi to save open file? For example, CtrlS instead of typing each time :w? Thanks!
2
votes
1answer
630 views

Is there a way to make vim automatically add a space at the beginning of a comment?

I'm setting up my .vimrc for learning Python. So far I have: " configure expansion of tabs for .py files au BufRead,BufNewFile *.py set expandtab set expandtab " Use spaces instead of TAB set ...
1
vote
1answer
388 views

modes not showing in status bar of vim

I installed vim version 7.4.1689 in my linux mint 18. I opened any file with vim but after switching between modes on the status bar it is not showing anything like which mode I am currently in. I ...
0
votes
3answers
849 views

How to change Vim window moving key combinations?

I found this :help window-move-cursor, but I tried to call it from the command line and doesn't work. Is there a way to change the key mapping for switch windows?
4
votes
3answers
2k 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, ...
7
votes
2answers
6k views

Can I remap ctrl-j and ctrl-k in vim?

I would like to remap ctrl + j to ctrl + d, and ctrl + k to ctrl + u for moving half a page down and up in normal mode. I have tried with noremap <c-j> <c-d> noremap <c-k> <c-u&...
6
votes
2answers
11k 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=...
1
vote
2answers
304 views

Vim, put off indent in global config

My vim have a auto indent future for C files. I can run it and :set nocindent to change this behaviour. I don’t know what to add to the global configuration file. I’ve tested these lines without ...
2
votes
1answer
424 views

Vim printoptions wont accept two options simultanenously

I want to print my code into a pdf file, and I found this answer very helpful. However, I want the generated pdf without header and with line number. From the comment and internet, I found I need to ...
2
votes
1answer
670 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 ...
3
votes
2answers
752 views

Two different vim configs for one user based on alias?

I'm trying to get two different vim setups to load based on who is using it. Problem two users use the 'root' user regularly each of us prefers different setup in vim. He uses a simple .exrc ...
9
votes
1answer
6k views

Powerline in vim errors setting up

I installed powerline using pip install as per their installation recommendations. I have it working fine in both zsh as a prompt and tmux as a statusline yet I can't get it to work in vim. When I ...
1
vote
1answer
568 views

Can't change default text width in GVim

Gvim is set to 78, can't change default text width to "0" at gvim, i edited "C:\Program Files (x86)\Vim_vimrc" set textwidth=0 or set tw=0 but neither helped. How do i disable textwidth parameter?
0
votes
2answers
1k 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 ...
0
votes
1answer
525 views

Highlight Vim escape characters e.g. \n

I'm using the Jellybeans vim colorscheme but it doesn't highlight any escape characters. For example if I'm using C++ and have the following... std::string word = "hello\n"; ... the whole string ...
3
votes
1answer
8k views

Vim color scheme not being applied

I am installing this theme using these instructions. $ vim --version VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr 08 2016 11:38:28) Included patches: 1-1689 Here is my ~/.vim/colors: xxx@xxx:~/....
4
votes
1answer
254 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 ...
0
votes
0answers
161 views

vim: map capital 'Y' in .vimrc does not work

If I try to map capital 'Y' in my vimrc, this is getting ignored. For example, if I put something like nmap Y :w<CR> in my vimrc, this has no effect. However if I run vim and I enter :nmap Y :...
0
votes
2answers
896 views

disable cursor color in putty client ssh terminal when in vi

I use putty.exe in windows 7 to connect to my Linux system. I use vi. I would like the cursor in vi to remain white all the time, and not change to green or blue around my if statement { } brackets ...
0
votes
1answer
2k views

Vim color scheme not being applied

I'm trying to use this color scheme: https://github.com/Konstruktionist/vim/blob/master/colors/Kafka.vim Here is my ~/.vim/colors: xxx@xxx:~/.vim/colors$ ls -l total 16 -rw-rw-r-- 1 xxx xxx 15245 ...
0
votes
1answer
301 views

Specify cursor position and mode when opening file in vim

I want cursor to be in the last character of first line, in INSERT mode when I open a file in vim. It should work in all cases:: Open file from CLI, like, $ vim fileName Open file from inside vim, ...
3
votes
2answers
960 views

vim sudo hack auto reload

I've installed and aliased some a newer version of vim and aliased vim to call that version. I also aliased sudo so that it can just call the system default vi when I need to edit a file as sudo but ...
1
vote
1answer
75 views

vi needs two <enter> keystrokes instead of one

If I want to open a file using "vi", it needs two <enter> keystrokes instead of one. Any idea, how to fix it? Just few hours back it was working perfectly. I have been searching on the net ...
0
votes
2answers
103 views

How to make a .vimrc command dependent on a file existing?

My .vimrc uses pathogen by doing execute pathogen#infect() However if I set up a new computer and haven't installed pathogen with mkdir -p ~/.vim/autoload ~/.vim/bundle && \ curl -LSso ~/....
2
votes
1answer
509 views

VIM with Python - Multiple # do not get colored as a comment

Something changed on my system and now VIM screws up syntax highlighting of commented lines. This makes having 'debug' lines very difficult as it looks like the line is still active based on the ...
4
votes
1answer
20k views

Where to find the .vim directory?

I'm trying to find out my .vim file which is a hidden file and that should be in my home , I want to install a vim plugin and for that i need to access the plugin folder which is in .vim file. I'm ...
1
vote
0answers
126 views

Change colors of statusline in haskell-vim-now

I am using haskell-vim-now, which has many features I like when editing Haskell. However, it also sets a colorscheme I do not like. In my ~/.vimrc.local I already resetted to the default colorscheme. ...
1
vote
1answer
1k views

VIM function for creating new a file with a header including the filename and a timestamp

I have created a VIM function that generates a new file based on the arguments passed to it and on some zsh variables I have setup. Is it possible to extend this function to insert a header into this ...
0
votes
1answer
557 views

Not all Vim Text Transparent

I am using the following commands after setting the color scheme to make my vim transparent: highlight Normal ctermbg=none highlight NonText ctermbg=none highlight SpecialKey ctermbg=none However, ...
0
votes
1answer
273 views

how do I install both neovim and vim plugins which are in the same .vimrc file?

I'm using neovim and would like to know how to install both neovim and vim plugins which are in the same .vimrc file?
1
vote
1answer
836 views

vim issue with tab/space in multi-line abbreviations in vimrc

i am trying to write a vim abbreviation to create a template program in c I have given the abbreviation as below in the .vimrc abbr main #include<stdio.h> \^M#include<string.h> \^M#...
1
vote
2answers
55 views

Cursor points to bottom when a zip file is opened with vim

I am trying to open a .zip file via vim. By default the cursor points to the bottom of the file once it opens. How can I bring the cursor to the beginning of the file as soon as I open a zip file? ...
2
votes
1answer
113 views

Setting up a secondary Vim environment

I've setup the YADR dotfile repo on one of my machines, and find it very powerful/useful. Though it's definitely slower than my present Vim setup with all its plugins, I'd still like to be able to ...
6
votes
1answer
525 views

How can I make `sudo crontab -e` use my `sudoedit` environment?

I've started using sudoedit <file> instead of sudo vim <file>. One of the advantages is that it uses my local ~/.vimrc. However, when using sudo crontab -e, it uses /root/.vimrc instead. ...
6
votes
1answer
3k views

How can I expand directories by default in Vim's netrw tree view?

I can make netrw use the tree view by default by adding this to my vimrc: let g:netrw_liststyle=3 But I can't figure out how to expand sub-directories by default, is there a way?
3
votes
1answer
2k views

Using 256 colour themes not working in vim/putty

PuTTY shows the the correct xterm-256color. Colours section shows "Allow Terminal to specify ANSI colours" and "Allow terminal to use xterm-256-colour mode". Yet when I use themes, they don't work, ...
0
votes
0answers
124 views

Glitch with auto chmod line in .vimrc

I found a useful line for my .vimrc file from here that makes any file beginning with #! on line 1 executable when I save it. Here's the line: au BufWritePost * if getline(1) =~ "^#!" | silent !chmod ...
0
votes
1answer
116 views

Why these two vim autocmd overlap each other?

I got these two autocmd config in my .vimrc autocmd FileType python highlight OverLength ctermbg=red ctermfg=white guibg=red autocmd FileType python match OverLength /\%80v.\+/ autocmd FileType ...
0
votes
1answer
1k views

How should I split a string with no spaces in vim script?

How should I split a string with no spaces in vim script? All the options which I see are to split a string with spaces. I even tried split(string_name) without a delimiter , but it doesn't work.
1
vote
1answer
145 views

Vim auto line-breaking not working as expected (update: problem with neocomplete)

I'm trying to configure vim so that the text breaks automatically at 80 characters. I know the way to do this is with set textwidth=80 However, the lines don't automatically break when I typed ...
1
vote
2answers
520 views

Is there a sudoedit equivalent for vimdiff?

I'm trying to get into the habit of editing root-owned files with sudoedit, instead of sudo vim. This has a few advantages, one of which is that it uses my user's ~/.vimrc. Is there an equivalent, ...
1
vote
1answer
57 views

vim color changing between | |

I'm editing some rst files. In the math section, the color changes between | |. Why is this so? How can I change my rst.vim file to not change color between | |? Thank you in advance.
11
votes
1answer
6k views

Disable or remove default vim keybinding

Is there a way to disable or remove a default vim keybinding? For example, if I wanted <S-k> (shift-k) to do nothing, how would I achieve this?
4
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 ...