All Questions

933 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
30 views

How can I make 'lnext' run 'lfirst' if it needs to be?

I use ALE for finding syntax errors in code in vim, which populates the loclist with any errors found. However, when I first open a file with errors, which populates that list (I have g:...
2
votes
0answers
53 views

How to use register in a script without side effect?

I want to create a function like this: function Foo() copy something from buffer into a register do something restore register endfunction Foo must have no side effect, every register ...
2
votes
0answers
25 views

Make <Esc> close completion menu and cancel selection, without side effects

I would like to make my Vim completion menu a little more IDE-like, and I was able to achieve this using the bindings suggested here. However, the <Esc> binding causes a bit of a problem: ...
2
votes
0answers
20 views

How to omit dictionary source file in dictionary completion

<C-X><C-K> complete words with long dictionary file name, such as /home/xxx/.vim/mydict. I'd like to omit or shorten the descriptive info. I have googled but got no hints. Any advice?
2
votes
0answers
58 views

How do I make vim's terminal use my emulator's cursor shape?

I am using ibeam a.k.a vertical bar cursor right now. When I switch to terminal mode in vim, it changes the cursor shape to block - but doesn't restore it after I quit the terminal. I tried changing ...
2
votes
0answers
44 views

Is it possible to call searchpair or searchpairpos on string instead of current buffer?

searchpair or searchpairpos works only on current buffer. Are there similar functions work on string instead of buffer?
2
votes
0answers
54 views

Unwanted extra indentation of multi-line statements

How can I make continuation lines indent 1 tab instead of align with the some text? With the default cindent options, I get the following: static int A = 0, B = 0, C = 0; But, ...
2
votes
0answers
51 views

Quickfix go to next error of specific type

I am starting to use quickfix to handle my latex compilation process. I found the vim-latex package (https://github.com/vim-latex/vim-latex) but I am only interested in the quickfix part, and I want ...
2
votes
0answers
43 views

Jump to last position when using vim netrw to open a file

I am looking to jump automatically to the last position in any file that I open. I have in my ~/.vimrc file: autocmd BufReadPost * ...
2
votes
0answers
78 views

Omni completion Pattern not found - Error loading rails environment

I'm trying to make Omni completion work with my Ruby files, but it only works with Ruby's core libraries; for instance, after typing String.<C-X><C-O> i get all Ruby's String methods, ...
2
votes
0answers
40 views

Go to current cursor position when invoking command-line edit mode

If I press v while using either the vi-mode zsh plugin or set -o vi in bash, it opens the line I'm working on in a full vim session. However, this puts my cursor at the beginning at the beginning of ...
2
votes
0answers
29 views

Do operator ranges/movements/textobjects always overwrite the last visual selection? workaround?

In vim, when I operate on a textobject from a plugin, say the 'inner indent' typed ii from kana/vim-textobj-indent, my last visual selection ('>, '<) is reset to where the operator worked on. ...
2
votes
0answers
52 views

Using an iTerm color scheme inside a Vim :terminal window

My normal terminal color scheme is set via a color preset in iTerm. When I open a terminal window in Vim (:terminal) that color scheme doesn't get applied, presumably because Vim has no knowledge of ...
2
votes
0answers
117 views

How can I record a macro across multiple files

I have two code files open and I'm trying to write a macro for moving code from one file to the other. I start recording the macro in file A. After I enter all of the commands I need in file A, I ...
2
votes
0answers
37 views

vi -u doesn't seem to work?

As system administrator I have to work under several user IDs, some of which are shared with others. We all have different tastes in what we like in terms of settings for our vi, so I am looking at ...
2
votes
0answers
60 views

Preventing autocmds from being redundantly repeated

I'm trying to figure out what is the proper way to prevent autocmds from being redundantly repeated. Here are articles which I have already read: Remove augroups around autocmds in .vimrc (related ...
2
votes
0answers
17 views

Applying full auto-format to comments but not code

I am considering using Vim's auto-format feature (i.e., adding a to formatoptions). However, I can't seem to figure out a combination of options that will give me the configuration that I want. For ...
2
votes
0answers
52 views

display list of buffers `ls` without scrolling down

Is there a way to display output at the bottom of the screen like ls does, but without scrolling down to accomodate the output? The Vim Wiki (no https) has the following snippet :nnoremap <A-n>...
2
votes
1answer
167 views

autocompletion - How to add phrases as thesaurus synonyms

I have a thesaurus file which contains synonyms for the word iterate. I would like to add an alternative phrase for iterate like loop over so I added it to the thesaurus. Unfortunately, this doesn't ...
2
votes
0answers
32 views

Substitute regex group in prompt when replace with confirmation

I am using vim to replace with simple regex: %s/Foo\(.\)/Bar\1Biz/gc I wanna to confirm each occurence and Vim asks: replace with Bar\1Biz (y/n/a/q/l/^E/^Y)? Is it possible to substitute group (\1) ...
2
votes
0answers
42 views

Function keys: won't work with macros (I tried a lot)

Specs: Vim 8.0 patch 500 gnome-terminal 3.18.3 on Ubuntu 16.04 running Unity Function keys in my vim slightly misbehave, however, in an annoying way: I can't completely use them in my macros. After ...
2
votes
0answers
34 views

Setup to not automatically open/close folds when writing fold-markers (in the presence of a modeline)

Say I have a file: // vim: syntax=rust fdm=syntax { blah blah } Let's say that lines 2 through 4 are folded: // vim: syntax=rust fdm=syntax + { ... } Now I am in insert mode. I insert a newline ...
2
votes
0answers
39 views

Extending the true line width to enable screen readers to see what blind users cannot

Vim is outstanding. It holds a lot of potential for blind users. I still have one out-of-the-box problem when using vim with screen readers (tested with both NVDA and System Access). But that surely ...
2
votes
0answers
58 views

Cursor change when GVIM lost focus

In GVIM I use vertical thin line as my cursor by adding following line to my .gvimrc set guicursor=a:ver13-Cursor This works perfectly as long as window remained focused. As soon as GVIM window lost ...
2
votes
0answers
163 views

Support for embedded languages

Vim supports syntax highlighting for embedded languages, also called fenced code (:h :syn-include). However, you usually want that other vim settings and mappings are adjusted for embedded languages ...
2
votes
0answers
56 views

vim recorded session like doitlive

I have a presentation to make for a conference and I'm not allowed to use slides, only live coding. Is there a tool in vim which will help me avoid typos ? :) Something like doitlive which you can ...
2
votes
0answers
85 views

How to escape paths for findfile() and finddir()?

I have run into an escaping problem with the path argument to findfile({name}, {path}) / finddir({name}, {path}). In my code path is a directory, obtained via fnamemodify(<file>, ':h'). Until ...
2
votes
1answer
134 views

How to autoformat a multi-line string

I want to format a multiline string according to a textwidth of 32. group: - normal: scalar - multiline: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor ...
2
votes
0answers
44 views

the matching pattern for TabClosed autocmd

If I want to setup a TabClosed autocmd for a specific tab page only, what should I do? Can I use the autocmd {pat} argument? Is this {pat} still matched against the filename? Moreover, the t: ...
2
votes
0answers
37 views

gvim gnome hides command prompt

This is not firmly reproducible but when I run ctrl+wv to create a vertical split window, I sometimes lose visibility to the colon command prompt. Command prompt still works invisibly. Sometimes I can ...
2
votes
0answers
148 views

Why gf is not working with variable?

If there is no variable in path, gf can open the file. Added sfname+={,} to .vimrc to support ${VARIABLE}. :!echo ${VAR}/test/file can correctly print full path with ${VAR} expanded. But if run 'gf' ...
2
votes
0answers
442 views

disable cursor blinking in terminal-vim

I thought this would be a 10 second google search, but no. I found a bazillion sources how to disable cursor blinking in GVim. But I would like to disable it in terminal vim. My terminal cursor is set ...
2
votes
0answers
49 views

How long can a file be non-existent when I'm saving it in vim

When I'm using vim to edit files in a django application that is running in developer mode I sometimes encounter this crash coming from the auto-reload utility: File "/home/zefciu/.virtualenvs/15five/...
2
votes
0answers
250 views

Vim not recognizing markdown and tex files

Here is a sample of my .vimrc, that doesn't do a thing (the autocmd does not work) when I open a .md or .tex file, but works fine for .py files: augroup filetype_python autocmd FileType python ...
2
votes
1answer
69 views

How do I pass a full filepath to a function in a Vim plug-in?

I have an exe program that checks for certain errors in a text file. I want to create a shortcut (like \+M) to run that exe file against the text file. My exe file's path is C:\Users\xyz\Documents\...
2
votes
0answers
29 views

How to make YouCompleteMe work with cgo

In C, YouCompleteMe could autocomplte the function if I include the header file in code: I want it work like C, when I write Go code and include the C header file in cgo: So, how should I config ...
2
votes
0answers
93 views

How to stop vim from reformatting lines inside a codeblock in a markdown file?

I keep the a formatoption in vim when I'm modifying markdown files, so my lines are automatically kept to textwidth characters long, with automatic reformatting when I modify text. How can I make ...
2
votes
0answers
48 views

Highlight arbitrary rectangular regions

Is it possible to highlight specific and arbitrary rectangles in a buffer? I want to implement a code scope highlight that groups code into a hierarchy of boxes. here is my mockup that I made: ...
2
votes
0answers
298 views

How to map <C-i> separate from <Tab>?

I want to remap <C-I> to print markdown * symbol around the previous word. For example: # user actions inside <...> some text typed in vim insert mode<cursor_position> <C-I> #...
2
votes
0answers
87 views

Bash process substitution on vim command line?

I want to be able to show someone a particular file's undo history in vim, remotely. It's a little complicated, so let me explain one step at a time. For starters, I can set a custom undofile and ...
2
votes
0answers
57 views

Is it possible to develop decent plugins using Ruby?

I've been playing around trying to learn VimL and to do so, I'm toying with the Evernote Ruby SDK to do basic stuff. Is there a reference manual where to find a full Ruby bindings guide or something ...
2
votes
0answers
61 views

Implement “Press any key to close” in neovim terminal buffer

When running shell commands in a terminal buffer I often just want to examine the output, and then close the buffer. Let's say I call :term ls. How would I implement a simple "Press any key to close" ...
2
votes
0answers
516 views

Why — ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y) Pattern not found?

vim --version VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 30 2017 18:21:38) Included patches: 1-197, 322, 377-378, 550, 703, 706-707 Modified by pkg-vim-maintainers@lists.alioth.debian.org ...
2
votes
0answers
84 views

How can I change Javascript syntax to higlight objects?

I am trying to emulate the Atom JavaScript syntax highlighting in vim, but there are a few things missing. Namely, I'd like to highlight objects and their chains in red. It'd be dandy if I could ...
2
votes
0answers
169 views

vim auto indent suddenly stopped working

Recently, neovim auto indent was working fine, but suddenly it stopped working. here is my ~/.config/nvim/init.vim:- call plug#begin('~/.local/share/nvim/plugged') Plug 'townk/vim-autoclose' Plug ...
2
votes
0answers
204 views

Is it possible to color vim vertical indentation lines depending on the indentation level?

I'm using vim 8. In the attached picture you see yellow vertical lines that indicate the indentations of a code. Is it possible to color depending on their indentation level? E.g. all vertical ...
2
votes
0answers
359 views

The indent of wrapped lines

My vimrc about wrap is set like this: set wrap "Wrap lines set breakindent " indent after line wrapped But the wrapped lines are not equal in length, such as: line 1: some contents ..... <end&...
2
votes
0answers
354 views

Analyze NeoVim Performance Bottlenecks

My Vim is kinda slow for nearly everything. Opening a file takes five seconds, it flickers when I move up and down NerdTree and sometimes when I switch windows or tabs, it freezes for dozens of ...
2
votes
0answers
720 views

Unable to map ctrl-l

My _vimrc contains the following lines: set nocompatible source $VIMRUNTIME/vimrc_example.vim source $VIMRUNTIME/mswin.vim behave mswin nmap <c-l> :w<CR> nmap <c-m> :w<CR> ...
2
votes
0answers
173 views

Relative line number colouring

I have relative numbering turned on. There's no immediate way of telling which direction I want to move, however. For example, sometimes I see line number "7" and move 7j (7 lines down) when I really ...

15 30 50 per page