All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
14 views

The line `eval local value=\“\${WORLD_$2[$1]}\”` breaks BASH syntax highlighting by inverting quote contents

So I have a BASH script I'm modifying and I've been noticing large blocks of script with broken syntax highlighting. They appear as though I have an unpaired double quote somewhere, despite all quotes ...
2
votes
1answer
24 views

Append to current copy buffer

I am copying multiple lines from different parts. I can for example do 3yy to copy the 3 next lines. Then I would like to scroll a bit and add 5 more lines: 5yy and so on. At the end, I want to paste ...
0
votes
0answers
10 views

Gruvbox theme for Airline resets every time Vim closes

I have installed gruvbox using vim-plug, then I installed Airline and set the theme following the recommendations. But every time I close Vim and open it, the theme for Airline is reset to default and ...
1
vote
0answers
17 views

embed one text file in another and edit the embedded file from the file it's embedded in

Is there any existing plugin or gist somewhere that would allow you to embed one text file inside another? Ideally it'd also allow editing the embedded file from the file in which it is embedded. ...
0
votes
0answers
15 views

Theme works in nvim on Windows, but not on Linux, what is the difference? [closed]

I'm quite new to the VIM scene but I already love it! However, I'm running into a problem with a theme I have created. I'm not really sure how to solve the problems since it is working on Windows, I'm ...
1
vote
0answers
26 views

changing font size leaves white bars in gvim

I wanted an easy way to resize the font in gvim (GTK), so I found this post: Quickly switch between fonts at runtime I created the following bindings based on that post: let g:fc_list = [ \ ...
4
votes
1answer
298 views

Why does Vim say “Already at newest change” despite a full “changes” history list?

I seem to be unable to undo something in a file I saved, despite that the history of changes shows up with I press :changes. So the change history is known to vim but I cannot access it? I thought it ...
0
votes
1answer
21 views

Quick question about indentation

Just had a quick (and probably stupid) question about indentation. When I try editing a script, one of my settings seems to "freeze" the indentation several tabs in, and I can't figure out ...
1
vote
1answer
26 views

Can we make substitutions based on rules from a file?

I've been using the command mode for making replacements in a file. Something like :%s/foo/bar/g and to make a series of replacements: :%s/i/1/g | :%s/j/2/g | :%s/k/3/g | :%s/l/4/g | ... This line ...
0
votes
2answers
28 views

How to create regex group with dependency with earlier group via math operations

Imagine I have a file as follows, 10 10 10 11 ... 10 20 20 20 20 21 ... 20 40 40 40 40 41 ... I know simple regex such as To search two numbers /\d\+ \d\+ To search repeated numbers /\(\d\+\) \1 My ...
0
votes
1answer
14 views

switchin back another viewport from the terminal buffer [duplicate]

I created :term, then I switch to another viewport, but latter when I switch back to the term buffer "!/bin/bash" it is full screen and I don't understand how can I access the vim command ...
4
votes
4answers
603 views

Show exact number of matches even for large (>99) numbers

When I search for something /search-term and it shows up more than 100 times in my file, vim shows me that I'm on match x/>99 instead of x/121 etc. For smaller numbers it shows me the exact number ...
0
votes
1answer
22 views

<C-x><C-o> “Pattern not found” even with a Ctags file (C/C++)

<C-x><C-o> returns Pattern not found in C/C++ files even with a ctags file. It used to work and I haven't made any configuration/plugin changes that I know of Starting vim with vim -u ...
1
vote
0answers
41 views

No + or * register on Linux (accessed via SSH from macOS)? [duplicate]

I am on Ubuntu 14.04.3 and Vim 8.2. I'm trying to figure out how to access either the * or + clipboard on Ubuntu but it seems like it doesn't exist? After doing "*yy and "+yy on lines of ...
0
votes
1answer
34 views

How to paste/merge 2 blocks of text in vim

I search a way to paste/merge 2 block of text block A apple pear banana block B tomato beans potato to this apple tomato pear beans banana potato I'm looking for an easy way to do this using macros....
-1
votes
0answers
28 views

Sometimes <c-w> has to be followd by <b> [closed]

Occasionally, when I use <c-w>, the cursor will simply move to the end of the word. If I then immediately press <b>, the word is deleted and I'm placed into insert mode (as expected from &...
1
vote
0answers
27 views

rulerformat truncated when filename included

Given the limited screen real estate on my device (27x48), I'm trying set laststatus=1 set rulerformat=%25(%<%f%M\ %=%l\|%c%) No matter the minwid prefix, or if I apply it to %() or %f, or if I ...
1
vote
1answer
30 views

How to tell vim to ignore extern “C” brakets while indenting?

I have the following in my .vimrc to indent the whole file: nnoremap cu gg=G`` I have a problem using this in source files that have #ifdef __cplusplus extern "C" { #endif // code #ifdef ...
1
vote
0answers
30 views

Autocomplete filename from current directory in current buffer [duplicate]

So i have a bunch of files in a directory. I'm editing another file which have broken links/reference to these same files, and i want to edit them. There isn't too much so doing it manually wouldn't ...
2
votes
1answer
49 views

How to change the command line status message color and font?

I would like to change the color of part of the command line, the stuff that's echo'd from vim scripts. I know it can be different since when your search hits the bottom it prints a message in red ...
1
vote
0answers
37 views

autoupdate nvim terminal

Is it possible to make the nvim terminal always automatically scroll down so you can see the latest messages? For example I have my vim editor setup like this On the button half of the screen I have ...
5
votes
1answer
60 views

Vim find/replace highlighting

I'm a long time Vim user but a few months back started dabbling in Emacs. One of the things I really liked about Emacs was when doing a find/replace s/you/me it would highlight the word I was ...
1
vote
1answer
36 views

open file in an hidden buffer

I want to open a file invisibly such that I can operate using normal (programmatic) commands on it. How can it be achieved? Preferably, it should be hidden from the beginning. Thanks
3
votes
1answer
110 views

Close vim 8.1+ terminal buffer without unloading

I'm looking to be able to close a terminal buffer without unloading it, as I would with a normal buffer and either hidden or bufhidden=hide set. It appears, though, that said options are ignored for ...
0
votes
1answer
25 views

How to delete a word and enter insert mode? [duplicate]

I know that by pressing s, I can delete a character and enter insert mode. How do I do the same for words. Is there an equivalent to s for deleting a word and entering insert mode?
2
votes
1answer
66 views

TeX/LaTeX vim fold markers options

In complex files, especially when writing packages with basic TeX-LaTeX code, the standard definition of foldmarker, namely {{{,}}}, is unfortunate — in effect is quite common to have pieces of code ...
2
votes
1answer
10 views

How to jump to the first character of the first line of the next/previous block of text?

I am aware of {and } to navigate between blocks of texts , however these jump to blank lines in between blocks of text. When there are several blank lines in between 2 blocks of text these do not ...
0
votes
1answer
16 views

Suggested to use recursive or non-recursive mappings to normalize mapping

What approach would be preferred to allow a cmd-s to trigger a save, regardless of mode: " Allow i,c to call normal mode noremap <leader>S :silent call SaveFile()<CR>asdfidfo ...
0
votes
2answers
19 views

How to resource a file from within a function

I have a shortcut -- ⌘s to save a file. If it's not a vim file it will just run a :w, and if it hasn't been saved to a file yet it will ask the user for a filepath or name. However, if it's a vim file,...
0
votes
1answer
13 views

Filetype events in autocmd

To run an autocommand on a python file I can do: :autocmd FileType python nnoremap ... However, what 'event' does this run on? Is the event FileType or is Filetype python basically doing a ...
1
vote
1answer
19 views

Typing Russian characters in vim with vim-LaTeX

Occasionally, I need to type documents in Russian in LaTeX format. To use Russian in vim I follow the guidelines from this Habr post. In short, I have the following settings in my .vimrc file: set ...
0
votes
0answers
10 views

Paste into search instead to buffer with vim-fuzzyseach?

I’m using this plugin and find it useful with its regrex search and as it’s not updated recently, I find that when I map it to / to replace default function search of vim and then try to paste text ...
1
vote
1answer
21 views

Update a Vim Session file's loaded plugins without losing window positioning

I have a Vim Session file I created by doing: :mksession Then I quit Vim. I then downloaded a plugin to: ${HOME}/.vim/pack/vendor/start/vim-markdown-folding and then I fired up Vim with the session ...
0
votes
1answer
9 views

How to ignore helpfiles in a *.txt autocmd

In the following autocmd: " Default filetype, color if unrecognized (like a text file to write notes) augroup DefaultFiletype autocmd! autocmd BufRead, BufNewFile *.txt set ft=markdown ...
0
votes
1answer
29 views

Two types of method call

What is the difference between the following two ways of calling a function/method in vimscript? " This seems to always work call add (events, e) " This seems to occasionally work events-&...
0
votes
1answer
12 views

truthiness / boolean comparison in vim

I'm having a hard time understanding why the following equivalence produces two different results: echom a:events == '*' echom string(a:events) == '*' The first one returns 1 while the second one ...
0
votes
0answers
17 views

Understanding some autocmd events

When logging autocommand events, I came across a few ones that seem a bit strange: User -- seems to be logged very frequently, though the vim help really only mentions "it's not a real event and ...
1
vote
1answer
27 views

How to grab event type

I have the following script to log various events: augroup EventLogger autocmd! autocmd! BufWrite,BufEnter,User * call LogOutput(" getEventType() ") augroup END How would I ...
1
vote
1answer
9 views

Suppress output of expression register?

Is it possible to suppress the output of a register? For example, I am using getchar() to 'consume' a character, but I don't need it to return anything. I suppose I could add in a hackish ternary ...
3
votes
1answer
30 views

Understanding EatChar function

In using an iabbrev, vim help gives the following example of how it can be used to ignore the character after typing in the keyword: Towards the bottom of Abbreviations: You can even do more ...
0
votes
1answer
25 views

How to get autocmd/iabbrev command to update?

I have the following command which defines an iabbrev: if !snips_installed augroup VimLogger autocmd! autocmd Filetype vim iabbrev <buffer> log hello!! augroup END endif ...
0
votes
0answers
13 views

How to view when events fire? [duplicate]

Is there a verbose mode that shows when each of the various events fire? For example, I'm looking for something where I can use vim in the normal course of operations and see which events are being ...
0
votes
0answers
14 views

How to check if a user defined mapping exists from inside a vim script? [duplicate]

If I want to check weather I (or a plugin) have mapped some key, I can simply use the :map command and check it's output. How do I access and check this this output from inside a vim script? Or is ...
0
votes
1answer
30 views

How to get last *executed* command

To get the most recent command I can do: :<ctrl-p> Or: :<up> However, this will also show commands that might have been typed in, but weren't run, for example, I may recently typed in: :...
0
votes
1answer
10 views

Writing an autocomplete function

I am trying to use the omnicomplete. It is quite simple to use in insert mode, but I'm having a hard time using it from a function. Here is what I have so far: " Cmd-. to autocomplete tags, ...
0
votes
0answers
13 views

Understanding a filetype regex

How does the following regex (or is it a regex?) work: au BufWinEnter,BufRead ?* loadview I believe that ?* makes sure that the filepath has at least one character, but why isn't this then just .. ...
1
vote
1answer
28 views

Scoping an autocommand

Is the following a properly scoped autocommand to work on HTML files? " Option-space as &nbsp; in html augroup HTML autocmd! autocmd FileType html,htmldjango inoremap <buffer> &...
0
votes
1answer
14 views

Vim regex match between asterisks

What would be the following vim regex to get the word term in: hello my*term*here My thought was: *\zs[^*]\ze* But it seems like there are some things I need to escape here that aren't working. The ...
1
vote
1answer
12 views

Run autocmd when creating/deleting a buffer

I have two functions tex#PDFOpen() and tex#PDFClose() to automatically open and close the pdf file created by a TeX document. The way I assign them to autocommands is via the following autogroup in ~/....
1
vote
1answer
20 views

How to 'reset' an option to default

I have set foldtext like this: set foldtext=NeatFoldText() Is there a way to: view what the default value is for a option? reset option to its default value (without having to exit/re-enter vim)

15 30 50 per page
1
2 3 4 5
186