All Questions

Filter by
Sorted by
Tagged with
0
votes
2answers
1k views

No folding of markdown files

Running neovim 0.1.7. When I open a markdown file, it does not fold - even when I try zM zR zc, etc. :set tells me ft=markdown and foldmethod=syntax How do I get the folding?
0
votes
1answer
1k views

gvim looks terrible on my RedHat. Unable to change font

When running gvim on my RedHat: Linux trex-06 3.10.0-514.el7.x86_64 #1 SMP Wed Oct 19 11:24:13 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux NAME="Red Hat Enterprise Linux Server" VERSION="7.3 (Maipo)" ID=...
0
votes
1answer
640 views

How do I break a line with :substitute?

I usually have to worry about escaping search parameters to get special characters to match literally, but this time I'm seeing a problem with my replacement string. I want to take text like this: @@...
0
votes
2answers
265 views

Strangely slow key bindings

I defined these maps, to yank into system clipboard. noremap <leader>y "*y noremap <leader>Y "*Y noremap <leader>yy "*yy But when I use the first one (<leader>y), I find it ...
0
votes
1answer
299 views

Problems in installing vim-latex

I try to install vim-latex, a plugin for vim to edit latex file, According to the download page In step 3 of 4 :To install the included latex-suite.txt and latexhelp.txt files as vim help ...
0
votes
1answer
68 views

How can you turn off text highlighting (hlsearch) with custom text objects?

I am implementing a custom text object in visual mode, but this text object uses regular expressions to find the beginning and ending of the selection. However, when I do this, other parts of the text ...
0
votes
1answer
252 views

What are viewport, layout and workspace in relation to tabs

I'm making tentative steps into using tabs in Vim. It seems a bit ridiculous, I've been using tabs in everything for the last 18 years: Visual Studio Every browser since Opera came up with them ...
0
votes
2answers
777 views

Working directory different than current file directory?

I saw something strange happen today. I was in directory /some/path/ and opened a file with vim file.html. I then did :pwd in vim and it gave me /some/other/path. What could cause this to happen? ...
0
votes
0answers
478 views

System clipboard not working via ssh [duplicate]

I work on a remote server and would like to yank stuff to the server's clipboard. However "+y gives me an error flash (visual terminal bell) and when quitting vim, I can't paste in the terminal. ...
0
votes
1answer
368 views

LaTex-vim cannot compile files with spaces in name

I followed the same procedure as in the answer to this question to download and install latex-vim. But when I compile a tex file, I get the following error message: || I can't find file `Rapport'. ...
0
votes
1answer
174 views

How can I get more features?

My vim version is "huge" without GUI. Nevertheless, it is missing a lot of features like clipboard and python. How can I get a more full-featured version? I read that there is a version vim-nox which ...
0
votes
1answer
92 views

Why is an autocmd using cryptmethod a better way to prevent Vim from recording events than a separate vimrc?

There is a comment by Carpetsmoker which suggests a way to prevent Vim from recording events for certain filetypes: I would not recommend using a separate vimrc file, for the simple reason that it'...
0
votes
1answer
652 views

Vertical Navigation secrets without a plugin

At my workplace using my current compiler I have a vim plugin enabled. The only thing that I am uncomfortable with vim is vertical line navigation and I wanted to know how some of the vim gurus ...
0
votes
1answer
360 views

Sharing vim commands history across different users and computers

I have configured .dotfiles. Eg. see here https://wiki.archlinux.org/index.php/Dotfiles So now I can do dgit push or dgit pull on whichever computer I want, and I have all my config files (including ....
0
votes
1answer
1k views

Changing the vim color scheme only highlights lines of text?

I'm a big noob to vim here. I was trying to change the colorscheme of vim by editing the .vimrc file, but as I was playing around with different color schemes (ayu and gruvbox, for example) I noticed ...
0
votes
1answer
329 views

Match pattern and highlight it in modeline for a specific filetype

I need to match Issue in .conf filetype and highlight it with custom color but set in mode line instead of a fix in syntax/conf.vim file. The use-case is for each kind of document I need to highlight ...
0
votes
1answer
104 views

How to merge multiple strings in errorformat

Suppose a source code interpreter outputs the error messages in the following format: M123 Warning path/to/file 123 Description message That is: error_code error_type file line_number message How ...
0
votes
1answer
26 views

add python option in vimrc

For my fortran ft I use au BufWritePre <buffer> :silent %!fprettify --silent in my ftplugin. The fprettify is a python script with many command line options, using argparse. Now, my question is,...
0
votes
0answers
298 views

How to map the slash key “/”

I am trying to map the NERDCommenterToggle command from the nerdcommenter plugin. I want to use "Ctrl+/" for this: vmap <C-/> <plug>NERDCommenterToggle nmap <C-/> <plug&...
0
votes
1answer
79 views

:command to abort sequence?

To be honest upfront, I wanted to use global to find the first non-matching line, as in v,/usr/lib/, abort (having slashes in the search pattern is the reason for using g instead of / — I'm editing a ...
0
votes
1answer
279 views

Execute the contents of a register

Let's say I have the following text which I highlight: s/ /","/g And then I yank it into the a register: "ay How do I then run those commands? I thought doing @a would execute those commands, but ...
0
votes
1answer
441 views

Variable vs global variable

In h: internal-variables it mentions the "global" variable which is prefixed by g:. What would be the difference between: let g:var = "xyz" And: let var = "xyz" Does the absence of a prefix mean g:...
0
votes
1answer
32 views

Restricting filetype mappings

I have written the following mapping in my vimrc: autocmd FileType python :iabbrev <buffer> for for item in:<left> After I source the python file it works. However, now whenever I ...
0
votes
2answers
114 views

Shortcut based on filetype

I would like to do the following remap: :inoremap <Option-Space> &nbsp; In other words, pressing option-space would add an html-escaped space. How could this be done, so that it only works ...
0
votes
1answer
55 views

How to send contents of visual selection to an external script

I would like to write a python script that parses some vim data and returns a result. For example, we'll turn numbers, separated by lines, into a sorted list of unique numbers. If we had this as the ...
0
votes
1answer
49 views

get line of first occurence of pattern in buffer

I am trying to write a function which I bind to "n" and "N" to highlight the current search pattern. That part works. I would like to detect when the cursor wraps to the first match in the buffer (...
0
votes
0answers
689 views

How to (auto) complete filenames?

Developing in nodejs I have a lot of custom module require statements in my javascript source files, like this one: // // my nodejs program: // path/to/projecthome/lib/someModule.js // const EMOJI = ...
0
votes
1answer
113 views

search a pattern preceding cursor position, modify it and insert the modified string

I am writing a mapping to autocomplete tags Pattern: <.*?>, matches complete HTML tags only. The goal is to lookbehind and see if there exists a text like <html>. Mapping: inoremap <...
0
votes
1answer
457 views

Scrolling with trackpad not working Macvim

I have just installed MacVim on my new Macbook. But I have a problem: on Linux I was able to scroll through my code—vertically moving my cursor—by using my trackpad. But on Macvim this doesn't work ...
0
votes
1answer
107 views

Automatically reindent lines filtered through formatprg

I have following xml file: <?xml version="1.0" encoding="UTF-8"?> <graph id="G" edgedefault="undirected"> <edge id="e6" source="n5" target="n4"> <data key="d1">1.1</...
0
votes
2answers
272 views

change fold sign character

I know per my question remove trailing dashes in foldtext that I can remove the trailing dashes from collapsed fold lines. When a fold is 'open', the sign column has pipe characters '|'. I looked at ...
0
votes
1answer
145 views

May I have a Vim session report its “Mode” in its “Window Title”?

Clarification of the moving parts First, let me clarify what I mean by "Window Title", and what I expect to achieve On Windows OS, GUI programs will have three attributes: its Window Title texts, ...
0
votes
1answer
36 views

Is it possible to make a specific section have a different syntax? [duplicate]

I am working with markdown and writing snippets like: ```c int main() { return 0; } ``` It is highlighted as a code in vim. However would it possible for the c ...
0
votes
0answers
40 views

How to show “/foobar match 1 of ” or “E486: Pattern not found: foobar” in commandline when calling `normal! n` in function [duplicate]

I'm calling normal! n in a vimscript function. If there is a match, I don't get the message /foobar match 1 of 3 in the commandline. If there is no match, my commandline shortly flickers up and down ...
0
votes
1answer
343 views

how to control the :bp / :bn files I loop?

I'm using :bp to re-open the previous file I worked on, and :bn to go back, but I'm stuck on a loop with 3 files, and I only want to loop over 2 of them. Is there a way to edit the buffer and pop the ...
0
votes
3answers
316 views

Redirect output of vim command to external program

I would like to filter the output of vim commands with fzf. The idea is for example, if I use vim unimpaired plugin and I don't exactly remember which map was to navigate to the next git conflict but ...
0
votes
1answer
253 views

How do I control an external program from vim? The final end is to listen to audio and make a transcript in sync

So it seems that vim is great for so many things. And I love it. And yet, it is the configuration that sometimes is a limitation for those of us who don't get a tight grasp on how to tinker into it. I ...
0
votes
0answers
26 views

Can I map a netrw command and its arguments to a key?

I have this map: nmap <buffer> <F3> mX So one I press <F3> it opens a prompt so I can type a command. Can I give the command also in the map above? something like: nmap <buffer&...
0
votes
0answers
111 views

How to stop a function when <esc> is pressed? OR how to catch a <esc> signal in vimscript?

I have a function which calls another function that reads user input from input(). function! fun1() call fun2() endfunction function! fun2() let temp = input("Please input:") endfunction What I ...
0
votes
2answers
161 views

Jumping to prototype or definition of a function using tags

This post is connected with the following one. Jumping from function definition tag to prototype tag Somehow, I did what it is mentioned there. Now, when I generate my tags file using the option --c-...
0
votes
1answer
98 views

Delete word around cursor and move to insert mode

My Problem Going from: To: I'm doing some editing (interactive rebase on a git repo, but the problem is generally relevant). The cursor is on a word (pick), and I would like to delete it , ...
0
votes
0answers
89 views

My vim can't print Chinese right on my mac?

only the vim app can't show the Chinese right. I have checked the encoding, fileencoding and fileencodings configs, all of them are utf-8 at the first.
0
votes
1answer
142 views

Why is division of a negative number by 0 not the minimum number? [duplicate]

Related to Why does vim allow to divide by zero, what's going on here? :let a=-42/0 :echo a -2147483647 :let b=a - 1 :echo b -2147483648
0
votes
3answers
92 views

VIM Macro to delete all Perl POD?

POD is a markup format that is used by Perl. It's sometimes found embedded within the code. You can find more information on it from the official docs on perlpod, and perlpodspec. I'm wondering if ...
-1
votes
1answer
289 views

Why Error E172 on Execution?

Code "" http://vi.stackexchange.com/a/7787/2923 function! OpenSelectionAsTabs() range let tabnr = tabpagenr() for line in range(a:firstline, a:lastline) execute "tabedit " . getline(...
-1
votes
1answer
144 views

How do I evenly distribute GVim windows started from a key-binding? [closed]

Code % http://vi.stackexchange.com/a/7627/2923 if has("win32") || has("win64") :vnoremap <Leader>gf :<C-U>'<,'>g/^/silent! exec "!START /B gnvim " . shellescape('<cfile>') &...
-1
votes
1answer
84 views

How to check if total number of lines are bigger than 10 in Vim? [closed]

I want to check if number of lines are bigger than 10 in Vim. I tried to use this code in vimrc file: if line("$") > 10 colorscheme currentline endif Edit: I made a colorscheme with ...
-2
votes
1answer
95 views

How can I make a single mapping take effect for both Normal mode, Insert mode, and Visual mode?

I want to disable the arrow keys in Normal mode, Insert mode, and Visual mode. To achive this, I've created 12 mappings (see below) - 4 mappings for each mode. Is there a way to achieve the same using ...

15 30 50 per page
1
23 24 25 26
27