All Questions

Filter by
Sorted by
Tagged with
3
votes
1answer
148 views

Is it safe to do other stuff on a system while a macro runs?

If I'm running a complex macro on a large file that I expect to take a few minutes, is it OK to do other stuff on the system (e.g. opening another application, typing in a different text editor, etc?) ...
0
votes
1answer
46 views

Linking the vsplit views of two different buffers? [duplicate]

How can I link the vsplit views of two buffers so that the lines from both files are always in sync?
3
votes
1answer
457 views

Sorting a list in the buffer?

Is there a way to sort a list (single column, each item separated by \r) in the buffer using just vim?
3
votes
4answers
774 views

Reopen splits after closing them with <C-w>o

I majorly use vim over an ssh session using putty. Sometimes I may have to copy code from ssh in a vim session but it's not very convenient. I do the following : <C-w>o :set nu! This close all ...
5
votes
2answers
428 views

One-handed Vim utilisation

Today I found myself struggling with Vim while being on the phone. I had only one hand to move around, so the home row was fine but with small hands, every <C-x> shortcuts (<C-d>, <C-u&...
1
vote
2answers
1k views

how to replace all space with “_” for the first quoted string

I have several lines , and each line has 2 quoted string, and I want to replace all space with "_" for the first quoted string. How to do that? could I use macro? select 'a b c','a b c' union all ...
2
votes
1answer
1k views

nnoremap is not working with `[v`]

I'm trying to add a simple mapping to visually select recently pasted text. However, even though `[v`] is working correctly in a vim session, when I try to use it in my .vimrc file, it doesn't work. ...
2
votes
2answers
888 views

Filtering text out to new tab with custom command

I would like to add to my vimrc a custom command (:customFilter {pattern}) for filtering text and placing result in a new tab. I tried using :global or :vimgrep /{pattern}/ % but the problem is that ...
1
vote
1answer
56 views

async_job patch in Kaoryia's gVim (windows)

Kaoryia's gVim builds for Win32/64 come with a number of extra, non-official patches enabled. Some of them are pretty clear: :set charspace=-1, for example, will tighten the space between characters;...
0
votes
1answer
765 views

Remove left bar in vim

I just installed tmux, iTerm2 and Vim. However, when i open Vim i have this bar with arrows on the left side. I don't know if it's there because of Vim or the terminal emulator. Is there a way to ...
10
votes
1answer
21k views

Execute normal command over range

For a file looking like this: 2 AD,42.546245,1.601554,Andorra,376 3 AE,23.424076,53.847818,United Arab Emirates,971 4 AF,33.93911,67.709953,Afghanistan,93 5 AG,17.060816,-61.796428,...
2
votes
1answer
1k views

Spacing appears in Vim Airline on right side

I just successfully installed vim-airline, and all the required stuff. I've downloaded the powerline-fonts, and successfully installed them. The only problem right now I'm having is: On right side of ...
4
votes
3answers
192 views

Finding out what number occurance of a matching pattern is under your cursor?

I know that if you press n you can hop to the next occurrence of a matching pattern, and that if you want to go to the previous match, you press N. But if my cursor is already in the middle of a ...
6
votes
1answer
515 views

Can I do array destructuring in VimL?

Can I do this in Vimscript? let [a, b] = s:MyFunc() function! s:MyFunc() return [1, 2] endfunction
2
votes
1answer
170 views

`normal` does not seem to allow automatic indentation

Why does this not work as expected? function! MyO() normal! o endfunction nnoremap TT :call MyO()<cr>i If this is the situation: | an indented text ^ (normal mode) typing o gives: ...
4
votes
2answers
493 views

Use vi/vim from shell to filter / format text

Is there a way to call vi/vim from the shell to format text? It would be like running a vim-golf sequence from the command line. It is so easy to compare effects of commands in vim that I can easily ...
1
vote
0answers
74 views

What is “open mode” and why is it in Vi but not in Vim? [duplicate]

From the Vim documentation: 1. Simulated command *simulated-command* This command is in Vi, but Vim only simulates it: *:o* *:op* *:...
2
votes
1answer
593 views

Search and replace in vimscript using a range?

I was wondering how it is that I would place VIMScript variable values in my regex range and also in the replacement portion of my regex? function! GoogleFormsStep(startnum, endnum) let x = ...
4
votes
1answer
665 views

Using Vim to syntax check some text

I'm using vim to write some long text documents in French and in English. I know how to enable spell check to check the words against a dictionary and verify than I don't misspell a word. My ...
1
vote
3answers
525 views

How to append a random number between a range [1,10] at the end of each line in vim

I have a graph data in a file with each line containing the source and destination node of an edge. I want to assign a random weight between [1, 10] for each edge to test my graph algorithm. How can i ...
0
votes
3answers
136 views

Mapping to “bh” causes cursor to be trapped in first column

I'm looking to map Ctrl-N to lbvhe in normal mode. This should visually select the word under the cursor, and works fine unless the word is at the beginning of a line. Having investigated, I've found ...
12
votes
3answers
850 views

Highlighted undo in Vim

I'm trying to have a highlighted undo in Vim, like spacemacs default config. Sometimes when I want quick undo's, I can't realize what changed because it's instantaneous. So I am trying to have ...
1
vote
1answer
80 views

Is there a way to tab through fields and values in a JSON file in VIM?

Is there a way to tab through fields and values in a json file in VIM as you would form fields on a web form?
1
vote
2answers
2k views

Can't get Ctags working

I have a fairly small Javascript project, and when I run ctags -R it seems to generate at least some tags. I get a tags file (no extension?) in the root folder, and when I run wc -l tags it says 8214 ...
-2
votes
1answer
663 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 ...
5
votes
4answers
582 views

How to search forward for pattern in the current line? Like `/` and `?` but stop at end of line

Is is possible to search for a regexp in only the current line. Here is an example line: This is some text that I have written. Can you find this word? ...
2
votes
2answers
155 views

How can I configure a three-piece comment?

When editing an Haskell file, I want to configure a comment format {- -} such that: {- <cr> - <cr> - -} But it doesn't work as expected (but almost there): {- <cr> - <cr> -...
4
votes
2answers
2k views

Creating a Vim function mapping that takes a count

I'm trying to create a function mapping that takes a count, in this case the number of lines to yank to the system clipboard. func! Clipboard() echo 'Clipboard function called' if v:count is 0 ...
2
votes
2answers
95 views

Visual block. Some right-end selections seem impossible

I want to use visual block mode (ctl-v) to select all the comments but none of the code: a = 1 // short comment b = 2 // this one is a longer comment c = 3 // ...
1
vote
1answer
56 views

Is it possible for a :map to insert text without fold-closing the inserted text AND leaving the other folds as they are?

I am facing the following problem: a function, triggered by a :nnoremap inserts a few lines into a buffer. Since I have folding enabled with foldexpr=... and the inserted text contains this expression,...
1
vote
0answers
210 views

Difference between smart_close_popup() and cancel_popup() in neocomplete?

I have started using neocomplete and there's one thing that confuses me. What's actually the difference between neocomplete#smart_close_popup() and neocomplete#cancel_popup() I am definitely not ...
2
votes
1answer
477 views

How can I yank two matches of regex group into two different registers?

This answer teaches me how to yank matches of regex group into one register. But I want to yank two into two different registers. I've tried the following but failed. :%s/\(regex1\)\(regex2\)/\=...
2
votes
1answer
325 views

How to add '.' to autocomplete suggestions in vim-latexsuite?

In vim-latexsuite how do I make vim completing references and equations labels with . in them? For example, I call the equations by chapters: label{eq:intro.x} label{eq:physics.y} But then, when ...
5
votes
4answers
1k views

How to generate patterns for comments?

As a way of organizing my codes, I like to include some titles as comments with specific patterns (I wish I can add ASCII art!). Consider for example, putting the following to mark a specific block of ...
1
vote
1answer
93 views

How to make mappings that yank text without overwriting the global registers

Many useful mappings need to temporarily save text. Some practical examples are: " Move line up/down nnoremap <c-j> ddp nnoremap <c-k> ddkP " Substitute word under cursor (use `cc` ...
7
votes
1answer
2k views

What's the difference between the “clipboard” and “xterm_clipboard” features?

What is the difference between the clipboard and xterm_clipboard features? When do I need to enable one or the other at compilation time? As an aside, how do these features relate to the mouse ...
2
votes
1answer
367 views

Motion key for next highlighted item?

Using the normal spell-check mechanism in vim one can jump from one misspelling to the next using ]s. Sadly vim's spell-check is completely useless for Turkish. Using the vimchant plugin that hooks ...
0
votes
1answer
151 views

NetRW bug? : vim scp://host1/filepath scp://host2/otherfilepath only opens first file

There is some strange behavior to observe in the current version of NetRW shipped with Debian Jessie (current as of Mid-2015) on my installation. Searching online doesn't immediately reveal other ...
5
votes
3answers
185 views

How can I quickly convert a Vim help tag to a vimhelp.appspot.com link?

One thing I often do here is to add links to documentation when writing :he foo, and I usually link to http://vimhelp.appspot.com. The problem is, that site's search is about slightly worse than the ...
6
votes
1answer
225 views

Can I detect whether current vim instance is launched by git?

My .vimrc does a lot of extra things I don't want to do if it's launched by git(for example, during commit), since the purpose of that Vim instance is very specific so it makes no sense to launch many ...
3
votes
1answer
400 views

How to skip over indentation whitespace with horizontal motion?

I have a file that uses 4-space indentation. By default, when I move horizontally, Vim moves over those spaces one by one. How can I configure Vim so that it moves 4 spaces horizontally when moving ...
0
votes
1answer
375 views

Why can't I tab complete after open?

I have set wildmenu and set wildmode=list,full in my .vimrc. If I go to enter a command such as buf or tabe, follow it with a space, and then hit tab, my wildmenu options take effect as I'd expect, ...
2
votes
1answer
2k views

“set hidden” leaves many *empty* buffers. Can I automatically get rid of them?

I recently added set hidden to my vimrc script because I didn't always want to :write a file before :editing another file. (With set nohidden, which is the default, this resulted in a E37: No write ...
6
votes
1answer
1k views

How to check with Vimscript whether python support is enabled?

I think it would be very nice if I can check whether current vim was compiled with python support, instead of having error message popping out every time vim is launched. Can this check be done in ...
17
votes
3answers
10k views

Multiple cursors at desired location

I'm using vim-multiple-cursors plugin. I would like to put cursors exactly where I want. For example ([x] are the cursor positions): Lorem ipsum dolor sit amet[1], consectetur adipiscing elit, sed ...
16
votes
1answer
2k views

Is it possible to get the matched string after calling :search()

In a vimscript-function, I need to assign a matched string to a variable l:matched after calling search() and I am wondering if there is a shorter way than what I am currently doing: let l:pattern =...
14
votes
2answers
10k views

Show listchars tab as spaces

I use list and listchars to show my whitespace, but the code style I adhere to uses tabs. Seeing > or ^I for all of my tabs is nauseating. How would I keep all of my existing list characters but ...
13
votes
1answer
2k views

Improve macro replay speed?

I recorded a simple macro and replayed it on following lines, but it seems replay speed is very slow (handle a very few lines per second). Is this expected and is there a way to improve such speed?
9
votes
2answers
3k views

Change vimtutor language

My vimtutor is in portuguese. I don't know why, because my Windows OS is in english, so as everything else. I don't remember to have chosen "portuguese" anywhere in the vim installing process. How do ...
2
votes
0answers
101 views

how to map # to , when , is my leader [closed]

My leader is ,: let mapleader = ',' Now, I want to map # to find previous match (when using f, F, t, T), I try this: nnoremap # , But nothing happens when I use #, obviously something is wrong. ...

15 30 50 per page
1
184 185
186
187 188
208