All Questions

Filter by
Sorted by
Tagged with
20
votes
2answers
3k views

How can I make gx recognise full URLs in vim?

By default, if a buffer in vim contains a URL such as http://www.google.com, gx in normal mode will open a browser with that URL. That's very handy. However, if the URL has URL parameters (e.g. http://...
10
votes
4answers
2k views

How to achieve selection different length of texts on different lines?

assume I have following texts: aaa-dd-e: "aaa", bb-x: "bb", c-9: "c" I want to do selection like below: aaa-dd-e: "aaa", bb-x: "bb", c-9: "c" I tried using c-v to create a visual block, but after ...
8
votes
2answers
2k views

How to design a command in a plugin that can be called from vimrc

I'm working on a plugin that allows users to create custom operators. The operators would apply a VimL expression to the motion or text object that the operator moves over. Keeping a clean user ...
2
votes
1answer
1k views

Vim, lua and ctags

I work a bit on a lua project (not small, but most of the code is not my own), and I'd like to get tags working. Current ctags contains bug, which can be fixed by getting the latest code from svn ...
4
votes
1answer
166 views

Strange interaction of set hidden, shortmess and the status line

My .vimrc contains set hidden set shortmess=fotx I start Vim 7.3 with vim a b I modify a (optional), then I save it and switch to the next file with :wn. Then I use :prev to return to the previous ...
5
votes
3answers
6k views

How to stop gVim wrapping text at column 80

I have a README.txt file as follows: This document is a list of a) Known issues in the services or test environment, i.e. things expected to fail b) Things to be improved in the test suite c) ...
18
votes
4answers
13k views

How can I create my own colorscheme?

What files do I need to create? What should be inside these files? Is there a default colorscheme file somewhere that I can use and change color values accordingly?
9
votes
1answer
685 views

How can I limit number of suggestions when using YouCompleteMe?

I'm working on fairly large php codebase (~1.3 mil lines of code). I have generated tags and now when I'm typing something like $data-> YouCompleteMe lags really hard and basically freezes Vim ...
8
votes
1answer
2k views

How to change the value of timeout for one key command?

What I want To temporarily change the timeout value for certain key commands Where I've looked From :help 'timeout' I have : The timeout only happens when the 'timeout' and 'ttimeout' options tell so. ...
51
votes
5answers
15k views

Vim search replace all files in current (project) folder

One of the open questions I have about Vim is if there is a way to perform a search/replace in the current project (bear with me if I use this notion inherited from other editors). For instance, let'...
1
vote
1answer
75 views

Gvim doesn't remember cursor position within line if previous session ended on line 1

I noticed that whenever I quit Gvim, it will remember the line and position within the line that the cursor was on, unless the cursor was on line 1. If the cursor was on line 1, then it will not ...
5
votes
1answer
236 views

Disable vim-surround in a netrw buffer

Is there a way to disable a plugin (or a set of keymaps) on a specific filetype? vim-surround causes a delay in netrw when pressing d to create a new directory. I'm thinking that this might be ...
6
votes
1answer
1k views

How do I open a file that starts with an exclamation mark using filename completion

In gvim, I want to open a file that starts with an exclamationmark, say, for example, !this_is_my_file_whose_name_is_rather_long.txt. So, I type :e !this followed by pressing the tabulator. Gvim ...
8
votes
2answers
1k views

Is there a way to share vim command history?

Can I share Vim command history across instances in real time? By that I mean what people do in bash this way: export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND" That is, ...
28
votes
1answer
7k views

How do you open a new buffer in the current window?

I've got a few tabs open with different window setups. I'd like to open a new blank buffer in the current window, without having any more splits/windows or tabs Is there any way to do this? I know ...
3
votes
1answer
161 views

How can I edit a regular expression search string as if it were a file?

Sometimes a regular expression starts to get pretty complex, and it's hard to edit in Vim's commandline. It seems the obvious way is to edit the search term as though it's a file and be able to ...
18
votes
4answers
5k views

Send text from one split window to another

Recently there was an add-on to NeoVim which allows opening terminal in a vim buffer. This has appealing possibilities to send text from one vim window to another replicating, for example, a REPL like ...
20
votes
6answers
4k views

Set cursor colour different when on a highlighted word

With the current colourscheme I have been using, it is hard to find where the cursor is positioned when navigating through search results. The highlighting colour and the cursor colour are blending in ...
14
votes
2answers
8k views

How to partially replace text in a selected text-block?

Not easy to find a nice title for my problem. I'm aware of inserting in front of a text-block: Ctrl-v select lines I type text ESC Now I would like to do this but also with replacing a part in my ...
5
votes
1answer
2k views

Triggering UltiSnips with enter

Is there any possible way to do expand trigger in UltiSnips with enter? I've tried <Enter>, <Return>, and <CR>. It works to trigger but doesn't work for new line. And I've tried to &...
4
votes
2answers
492 views

Vertically rotate visual block

How would one vertically rotate a visual block of text? For example given this: h e l l o Select those characters in visual block and rotate them once: o h e l l As you see, every character is ...
4
votes
1answer
4k views

Substitute pattern between braces

Is there a way to substitute a pattern only if it occurs inside the brace pair that the cursor is on? For instance, if I have the text int bar() { ... } int foo() { char bar; bar = 'a';...
2
votes
1answer
503 views

Prevent cursor movement when clicking “../” in netrw

When using netrw or the native vim file explorer, every time I click on ../, the cursor moves to the top of the page. This is very irritating when I'm trying to go up multiple directories - I have to ...
8
votes
2answers
3k views

How to write condition with regular expression?

I'm aware of the following comparison: if @% == "/tmp/crontab.zi5NeVPGRc" set nobackup set nowritebackup set noundofile set noswapfile endif But how can I use regular expression? For example ...
6
votes
2answers
3k views

What does [count]<leader> mean?

I found a command in NERDCommenter like this: [count]<leader>cc |NERDComComment| I have installed the plugin. But, I don't know how to make it work. So what's the meaning of that command? How ...
2
votes
1answer
122 views

How do you get which “side” of the visual mode selection the cursor is on in vimscript?

I'm writing some vimscript and would like to preserve the cursor position after a yank occurs in visual mode. Ths issue is that I can't find any way to get the cursor position while in visual mode. ...
3
votes
2answers
686 views

How to force quit if input was stdin?

I have q mapped to :qenter Q mapped to <esc>:qa!enter which means quit, unless something needs to be saved just quit My meanings for these keys clashes with vim's idea that stdin needs to be ...
4
votes
1answer
915 views

How to add multiple git projects to Ctrl-P search path

The main project I work on is split up into multiple git projects. I'd like to be able to Ctrl-P search for files in a different project than the one I'm currently in, but as far as I can tell, I can'...
1
vote
1answer
309 views

Macvim - CJK-specific font settings?

Currently in my MacVim, the English font (Source Code Pro Light) is fine, but the Chinese font is being rendered in a very ugly manner. Is there any way to specify what font to use/fontsize for CJK ...
-2
votes
1answer
2k views

Vim Powerline is at top of window instead of bottom

I just installed Powerline for the first time and the Powerline bar shows up at the top of my Vim window instead of at the bottom. This is both on MacVim and on terminal Vim. Running OS X 10.10 ...
3
votes
2answers
445 views

Is there a simple way to require clean syntax before saving?

I currently use Ricardo Signes's plugin to allow me to use a single command to both check my Perl syntax and save my code only if it is syntactically correct. However, isn't there a simpler way to do ...
2
votes
4answers
860 views

How can I surround the lines inside the html tag object?

I have the following piece of HTML: <div> <section> </section> </div> I would like to wrap the 2 section tags in a single article like so: <div> <article> ...
8
votes
3answers
1k views

How can I have vim automatically notify me when a file that I am editing changes?

I have a situation where sometimes my friend and I are working in the same file at the same time. Vim will tell me if the file has changed when I try to overwrite it. Can I have vim notify me as ...
8
votes
2answers
1k views

Create mappings that only apply to diff mode

In my vimrc I have <C-H>, <C-J>, <C-K> and <C-L> mapped to navigate between split windows in normal mode. When I use diff mode I only ever have windows in vertical splits, so ...
7
votes
2answers
2k views

How to use substitution on register?

Let say I've register which has string stored in it, but I'd like to use substitute command to change it. For example I've 5x5 html table: let @t='<table>'.repeat('<tr>'.repeat('<td&...
32
votes
4answers
6k views

How can I make Vim autoread a file while it doesn't have focus?

I'm using VIm for all kinds of things (or gVim in this case), including monitoring output written to a file; I use autoread to make Vim reread the file, which it does whenever I switch the keyboard ...
2
votes
1answer
42 views

How to repeat register on assignment to another register?

I'm trying to repeat register couple of times and assign it to another register whilst concatenating the strings. For example: let @d = '<td></td>' let @r = '<tr>' . 10@d . '</...
8
votes
2answers
252 views

What does [count]% do?

I would expect [count]% to jump back and forth between matching braces count times or something like that, but instead, typing that command seems to move the cursor to a random place in the buffer. ...
8
votes
1answer
2k views

What is the difference between Ex mode and improved Ex mode?

There are two vim Ex modes: the vi compatible Ex-mode (vim -e -s), vim improved Ex mode (vim -E -s). Vim improved Ex mode allows for more advanced commands than the vi compatible Ex-mode, however ...
1
vote
1answer
120 views

Is there a way to have sidescrolloff behave differently depending if I am end of a line?

I work in two broadly different ways in vim (that are relevant to this question): I am writing text or markdown-formatted content, writing paragraphs of text. In this case I am generally writing new ...
2
votes
1answer
140 views

Backward motions in Operator-pending mode move cursor

If i type, for example, y/foo<CR> in Normal mode, i "yank" all the text until the next occurrence of "foo" without side effects. However, if i type y?foo<CR> in Normal mode, i "yank" the ...
18
votes
1answer
1k views

Do large numbers make vim run slowly?

This seems like a really daft question, but I have a Python file that has a number in it that's a thousand digits long and that file seems to be running very slowly, I'm not sure if there's some kind ...
11
votes
3answers
4k views

Make Command-line mode type <Esc> and Ctrl commands

Imagine you want to quote the word below. If | is the cursor position you can easily quote the word with cw""<Esc>P from Normal mode. |below I want to achieve the same behaviour in Command-...
3
votes
1answer
804 views

How do I copy the error message I get from YCM

Is there a way to copy the error message that YCM shows at the bottom of vim? For example in the above image, it says: unused parameter 'sortFunction' I had an idea of using "howdoi [paste]" in ...
74
votes
5answers
78k views

How can I easily move a line?

What is the command (or shortcut) to move a line up or down in vim? My current workflow is to yank (copy) the line and than delete that line and than to put (paste) that line.
14
votes
1answer
16k views

How can I change the colour of the line highlighted with the 'cursorline' option?

I can highlight the current line like this :set cursorline, which underlines the current line. However I would like to highlight the entire line in a lighter color. How can I achieve this look?
2
votes
3answers
825 views

Run an external script from within Vim to compile (not C++)

I'm using Processing. I've created a Python script that enables me to compile a sketch from the directory that the processing file is in. I'm currently running as follows :!./make.py This works, ...
7
votes
3answers
291 views

How can I bind :Set to work exactly like :set

I quite often start typing the s before fully releasing the shift key, and having to correct the command afterwards is a bit annoying. Is there any way to make :Set ... an alias for :set ...?
3
votes
1answer
735 views

Embed showcmd in airline

How to embed first part of the command (operator pending mode) in airline? For example, I'd like to have separate section on the right side to show me this partial command. If I set this simply with ...
5
votes
1answer
3k views

Filetype that LaTeX should be

From :help filetype: If the first line of a *.tex file has the form %&<format> then this determined the file type: plaintex (for plain TeX), context (for ConTeXt), or tex (for ...

15 30 50 per page
1
183 184
185
186 187
196