All Questions

Filter by
Sorted by
Tagged with
6
votes
2answers
2k views

Is the ~/.vim directory used for anything other than plugins?

What is ~/.vim used for, if anything, other than plugins? Is it part of Vim proper or was it "invented" by plugin managers like Vundle? I'm not sure what to tag this with, sorry
3
votes
2answers
743 views

How can I stop 'Obtaining <filename>'?

I am new to vim, and I use netrw as a file explorer. Frequently hit shift-P to open a file in a buffer. Sometimes I accidentally hit shift-O, and netrw will start obtaining the file. How do I ...
1
vote
0answers
86 views

Plugin conflict: vim-latex and abolish

After :Abolish tits that is to say, and tits, I get * that is to say with a star in front of it. This happens only when vim-latex is loaded and in .tex files. PS. The problem seems to lie somewhere ...
4
votes
3answers
309 views

Find number of regex matches per line

Say I do a regex search for a class of characters, e.g.: /[clsktb] Is there a way to either sort lines by the number of matched characters, or to show the number of matches next to the line numbers?
2
votes
0answers
211 views

VIM under Cygwin some characters missing

Just installed vim and vimified plugin set under cygwin. Everything works like a charm except one annoying issue - i can see some special symbols (like new line) and it seems that some characters are ...
16
votes
3answers
20k views

How to jump to function call?

After generating a tags file with exuberant-ctags I can jump from a function call to its declaration with <C-]> which is pretty convenient. My question is how to do it in the other way? When my ...
0
votes
0answers
66 views

using ex with perl support

I've just learnt how to run perl commands within vi, but I had to install vim.gtk in order to have perl support. But I want to incorporate these perl commands into bash scripts that call ex. Is ...
5
votes
1answer
583 views

Problems with paths that includes swedish characters

Update I've now also tried this on my Arch setup and everything works fine there. vim --version on that machine says: VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 28 2015 08:49:36) Included ...
4
votes
2answers
597 views

Is there a version of “strpart” that is aware of characters, rather than bytes

According to :help strpart(), the parameters start and len are bytes, not characters, so that returns a string of 2 characters, starting with the letter Beth. What I'd like to have is a function, ...
10
votes
1answer
339 views

What is the origin of the term “yank”?

I'm interested in learning how the term yank got its name. I'm also interested in why Vi/Vim "yank" differs from Emacs "yank". See also: same question on Unix & Linux; dual question about Emacs
12
votes
3answers
3k views

How do I reverse a string with Vim script

I am trying to reverse a string, so that 'abc defg hij' becomes 'jih gfed cba'. The solution I came up with is join(reverse(split(l:text, '.\zs')), '') Is there a more elegant solution or should I ...
4
votes
1answer
426 views

Where are vim compound (dotted) filetypes documented

Vim has some kind of support for dot-separated compound filetypes like "ruby.rspec" where settings/definitions for both will be loaded. I see mentions of it around the internet but I can't find any ...
2
votes
1answer
57 views

Distinguish between patterns that are inside open delimters and those that are not

I'm not sure of the right language here, but I need to modify all occurrences of a pattern (specifically &) that occur inside a pair of delimiters while leaving unmodified the pattern if it is '...
2
votes
1answer
623 views

How to use ~/.vimrc for vimdiff

How can I get git's difftool, when using vimdiff, to use my ~/.vimrc file?
0
votes
0answers
210 views

VIM behavior in Linux VM

The GVim window is having screen refresh issues in my vmware virtual machine. The problem is very evident when I scroll pages or go to a line or search for words. Pressing Ctrl-k repaints the screen ...
0
votes
2answers
44 views

Define new command that works only outside c++ comments

When I am coding in c++, I want vim to expand ( into ()<++> and place the cursor in the parenthesis. I do this by putting the following line in one of the files loaded at startup: inoremap ( ...
3
votes
1answer
467 views

Why `v:lnum` doesn't return 1 for the first line?

I really want to know why doesn't Vim's v:lnum return 1 for very first line. I tried googling and searching in Vim's docs, but I can't find an answer. I understand that v:lnum returns line number, ...
86
votes
6answers
48k views

Exit from Terminal mode in Neovim/Vim 8

I can't figure out how to go back to Normal mode after entering Terminal in Insert mode... Escape just doesn't seem to work. Any idea?
2
votes
2answers
95 views

How can I conveniently yank then change small text?

This is more of a specific deeper dive into vanilla Vim then the question Can I make Vim also save “small deletions” into register "1?. A common text editing situation I run into is to yank a text ...
0
votes
1answer
303 views

airline in conemu - changing colors on page scroll

I have finally got vim with airline plugin to work on windows with conemu thanks to this topic Almost everything is good right now except some problems with colors in airline when screen is scrolled....
4
votes
1answer
904 views

How to disable the autocomplete menu but still get words completed?

When I use <c-p> to autocomplete, a list of possible completions appears, which can be annoying. Can this be disabled?
6
votes
2answers
116 views

Shortcuts for phrases

What is the appropriate way to make shortcuts for phrases like ‘on the other hand’? I tried imap otoh on the other hand, but that produces an undesireable lag after all os.
8
votes
1answer
2k views

Mouse wheel scrolling inserts characters

I'm using macvim inside tmux inside iTerm2. Basically I just want to be able to scroll the buffer using the mousewheel. I've set set -g moude-mouse on in my .tmux.conf, and set mouse=a set ttymouse=...
4
votes
2answers
166 views

Apply formating with a script, or have ftplugin format particular text based on syntax

When I am writting a Latex document I generally like to keep an 80 column line width to keep things easy to read. However I don't like to use text wrapping because it can get in the way of typing ...
2
votes
1answer
416 views

how to change visual selector color with xoria256 colorscheme

I would like to change the visual highlight color in xoria256 colorscheme to the following: make the background brighter but keep the color of the letters the same. I've seen people do it and I ...
16
votes
3answers
10k views

search for lines which contain a pattern but do not contain a second pattern

I need to search for lines which contain some word but do not contain a second word. For example, find lines that contain the word "This" but not the word "red" so that for a file containing these ...
4
votes
2answers
173 views

modify conque to gate selected text

Via Conque I use vim as an IDE for all my coding. I am starting to work in python, which is persnickety about spacing, so to test deeply indented subroutines or code blocks, I need to gate code sent ...
0
votes
1answer
259 views

Match a pattern within matching delimiters

I'm trying to match a pattern only when it occurs between matching delimiters For example, in the lines below, I'd like to match the a in the first line, but not the a in the second, which is not ...
5
votes
3answers
449 views

Is there a trick to set 'ignorecase' locally

ignorecase is a global option, so it's not possible to locally set ic :setlocal ic This is a bit unfortunate, since I work on buffers in which I need to search case insensitively and other buffers ...
6
votes
2answers
1k views

How to make autocmd FileType work when a file has multiple / compound dot separated types?

While working a Markdown plugin, we've wanted to change the filetype from mkd to markdown to increase compatibility with other plugins. To avoid breaking users .vimrc that had autocommands like: ...
51
votes
1answer
12k views

What is the select mode and when is it relevant to use it?

I accidentally pressed gh in normal mode and started a selection, so I looked up the doc and found :h Select-mode. From what I understand the select mode is close to the visual mode excepted that: ...
11
votes
1answer
2k views

How should the option 'switchbuf' work?

I recently discovered the option switchbuf and tried to use it but I can't say if I don't understand how it should work or if it actually doesn't work on my Vim. About the different possible values, ...
5
votes
1answer
2k views

Overwrite colorscheme syntax highlighting

/* This is coming directly from Molokai's issue #36. */ The problem Molokai is a very nice theme for Vim but it has a terrible vimdiff highlighting (see left split, last 5 lines). + are not green ...
15
votes
1answer
1k views

How to treat underscores like space?

Is it possible for vim to treat underscores like spaces or hypens, so when I use the sequence dw, it doesn't delete whole sentence some_long_text_with_underscores, when the cursor is at the beginning?
3
votes
3answers
588 views

Avoid spaces getting converted to tabs automatically during shift(>>)

I use 2 spaces as indentation. So I set shiftwidth using :set sw=2. However when I do the shift operator(>>) on a line twice, the indentation converts the 4 spaces automatically to a tab. So to ...
1
vote
1answer
175 views

Globally replace text contained in curly braces

Unfortunately, I have to convert code created by mathtype into real latex code. My converted creates hideous expressions like \textstyleMTConvertedEquation{{\textbackslash}[\{X\_k\} {\...
0
votes
1answer
1k views

Supertab or Jedi for Python Autocompletion

I'm trying to add a good Tab autocompletion plugin for VIM and I've found Jedi, but on its docs it says to use Supertab. I don't understand the difference between the two. I'm writing Python and I ...
11
votes
3answers
14k views

Is there a difference between “sudo apt-get vim” and “./configure --with-features=huge”?

I'd like to install VIM via apt-get, but I'm not sure if I get all of its features. Is there a difference between this, and compiling it from source?
0
votes
2answers
340 views

Adding leading and trailing space when entering insert mode

I use vim with ruby. I have a habit of opening and closing brackets when I define new function or a block. For example I would type: array.map {}_ # _ - cursor position after finishing typing So I ...
3
votes
1answer
133 views

Error, polytonic Greek spell file

Is anyone using the polytonic Greek spell file successfully? I get Error detected while processing /Users/lawrence/.vim/spell/polytonic.utf-8.spl: E763: Word characters differ between spell files. PS....
2
votes
1answer
159 views

Custom motion to change, delete or select matching pattern

I'm looking how I might use "Operator-Pending" mode to make a custom motion that allows change, delete or visual selection of a pattern match under the current cursor position. In short, after ...
2
votes
1answer
174 views

How to get uniform tabs/spaces in other programs (like Less)

How does one get uniform tabs/spaces to display properly in other programs (like Less)? For example, say I am modifying my .vimrc in Vim and I've created two columns on the same line (one for rule ...
1
vote
1answer
296 views

How to pass a parameter to JSHint with Syntastic

I need to pass a paramter (-extract) to the jshint syntax checker such that it extracts JavaScript from HTML before checking. Unfortunatly I have no idea how to do that for syntastic.
3
votes
1answer
511 views

Syntax concealends not applied

I am developing a syntax file and I am struggling with a concealends property : syntax region Reference start="{reference}" end="{/reference}" conceal syntax region Name start="{name}" end="{/name}" ...
7
votes
1answer
12k views

How to enter tilde (~), back tick (`) and special chars with a non-US keyboard?

I usually use Vim with an Italian keyboard (I'm from Italy), (mainly in an Ubuntu Linux Virtualbox guest from a Windows host). I have problems when I have to enter some frequently used characters (...
2
votes
0answers
75 views

Dividing long paragraphs across pages

By default, vim will not split long paragraphs (or any paragraphs (= long lines)) across pages. Instead of showing the first part of a paragraph that does not fit into the page entirely, it leaves out ...
1
vote
1answer
47 views

How to use vim editing abilities while asking question on MSE

I have a pretty huge .vimrc by now which use to edit tex documents. I also ask questions on MathStackExchange frequently and there I do not have any of the keybindings which I have when I am working ...
3
votes
3answers
1k views

How to show all unsaved files opened in vim?

I'm not sure if I should ask this problem on vim or on Linux/Ubuntu forum. The thing is, I opened multiple terminals on my desktop, and several of them opened various of *.txt files. Not all of them ...
2
votes
2answers
546 views

How to execute a mapping on <F7> key from a script?

I have the following mapping in my project: nnoremap <F7> :execute '!gtags'<cr> :cscope kill -1<cr> :cscope add CTAGS<cr> Under certain conditions I want to be able to ...
11
votes
6answers
2k views

How to append some line at the end of the file only if it's not there yet?

I'd like to edit a file in-place by appending a line, only if doesn't exist yet to make my script bullet-proof. Normally I'd do something like: cat >> ~/.bashrc <<EOF export PATH=~/....

15 30 50 per page
1
180 181
182
183 184
208