All Questions

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

vim colorscheme color as variable

I have a vim colorscheme vim-coogle, which uses both hex value and named colors already defined in vim, like: hi Comment guifg=#FFF59D ctermfg=lightgrey Now, the problem is, I want do define my own ...
0
votes
0answers
29 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
0answers
14 views

How to follow while searching regex in vim? [duplicate]

In my previous vim, when i typed /something and after reaching upto so vim started immediately following and with each letter typed i got into new word until i got the perfect. However this following ...
0
votes
0answers
13 views

How to open netrw at each vim session but have the cursor on the code (and not on the tree) when opening

I found the following chunk of command on this blog to have a file browser open by starting vim that I added to my .vimrc. It splits the window into 2 panes: a file browser and the text editor. The ...
0
votes
1answer
24 views

Why cant i use `"+` in vim?

Previously, whenever I typed "+yy in vim, it yanked a line to the system clipboard. I reinstalled the OS again, and, when I try to do the same now the input disappears after entering +. Steps: I ...
0
votes
1answer
22 views

Is there a simple way to persist command history in Vim/Neovim?

Is there an option I can switch on the init.vim config file to let me keep command history between vim sessions?
0
votes
0answers
12 views

How can set up ALE to be opt-in?

I'm trying to use ALE for auto-formatting for one specific language, however it has everything turned on for all languages by default and I can't figure out how to configure it so that it's disabled ...
1
vote
0answers
33 views

:terminal colorscheme inside Vim is different from either Vim or Host Terminal

I have a gruvbox theme applied to Vim inside my vimrc. The problem is that when I run the :terminal command inside Vim the colorscheme is different from either the Vim theme or the terminal emulator's ...
2
votes
2answers
34 views

Execute a vim command after entering vim

Is it possible to send a command to vim from the command-line? For example, to open the last file something like: $ vim -e "`0" # execute `0 after opening vim Or, if I need to run a ...
0
votes
1answer
25 views

Quit script after a certain condition is true

I have a script that checks for a certain condition (it checks if pip dependencies are installed). If they are installed and everything is ok, I want to import a bunch of python functions from my ...
0
votes
0answers
22 views

NERDTree causes Vim exiting when open two buffers on same window

Here is what is happening: I open one file, either with o in NERDTree or with :edit file_a. I open another file, again with o in NERDTree or with :edit file_b, and the file opens at the same window ...
1
vote
0answers
39 views

Local “statusline” override problem

I'm currently writing a plugin, and got stuck with this problem. My plugin opens a new window with all local options I want, but also sets the statusline option to display some useful information. Vim ...
1
vote
1answer
21 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 ...
3
votes
1answer
36 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
14 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
24 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
17 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
1answer
37 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
310 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
25 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
29 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
17 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
609 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
23 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
42 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
38 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
31 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
38 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
67 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
37 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
116 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 ...
2
votes
2answers
25 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 ...

15 30 50 per page
1
2 3 4 5
186