All Questions

Filter by
Sorted by
Tagged with
1
vote
0answers
2 views

How to open internal MediaWiki links with their full URL from within Vim?

I have a file in Mediawiki format, containing internal links (in a Mediawiki installation) * [[Topic A]] * [[Topic B]] * [[Vim]] I want to open these links with their full URL, e.g. https://en....
0
votes
1answer
12 views

Save buffer before opening new file

When I'm in a modified buffer and try to open a file using :e otherFile I get E37: No write since last change (add ! to override) Since this happens fairly often, I'd like to automatically save ...
1
vote
1answer
23 views

Toggle terminal buffer vimscript function

I'm new to vimscript and writing a function to toggle a terminal buffer. Here is what I tried: let g:toggle_term = "<C-j>" let g:term_buf_nr = -1 function! ToggleTerminal() if g:...
2
votes
1answer
20 views

Sourcing vimrc duplicates statusline in nvim

I'm new to vim so I'm not sure if this is intended behavior or not, but it seems like a bug. Desired Behavior After sourcing vimrc from within nvim, don't duplicate the contents of my statusline. Or ...
1
vote
1answer
17 views

Change definition of “under the cursor” for ctags with C++ qualifiers

When jumping to a tag it seems that ":" are ignored for the purpose of "under the cursor" (I'm assuming it's "word" "under the cursor"). For example if I want to jump to myTree::Node something I ...
2
votes
1answer
25 views

Visual/Operator-pending autocommand?

Last week, I turned off 'number' and have been using only 'relativenumber', plus a line/column count in my status line. I don't really look at line numbers that much. But now I've had a radical idea. ...
0
votes
1answer
22 views

Is it possible to make a terminal frame to be appeared on the bottom, not on the top?

I'm using :term bash to show a terminal buffer as it is specified in :h terminal-use. But the problem is that it is appeared on the top of the currently active vim buffer. Is there a vimrc ...
0
votes
1answer
22 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 ...
1
vote
1answer
21 views

How to fold nested “if then else end if” statements

I try to write a vim syntax file for folding if-else statements with the syntax: if <condition> then <block to fold> [else <block to fold>] end if Current approach syn region Then ...
0
votes
0answers
16 views

How can I create a customized vim [in my own pc] and could install it on every server that I use in future?

I like my own plugin full vim that I use, but every time I ssh to a server I have to reinstall those plugins and customizations. Does anyone have an easy method to install my own customized vim on ...
0
votes
0answers
20 views

coc not working in latest vim

I've installed coc following the instruction, using Vim-Plug (before that I did it without installing yarn and with kite still (partially) installed. I got a 'javascript file not found' error So I ...
0
votes
0answers
26 views

Can I use feedkeys() inside of a keyloop implemented by getchar()

I implemented a fuzzy filter, which accept a list argument, open a window with a scratch buffer whose content set to the list, then waiting for use input and do filtering. Here is why I ask this ...
3
votes
1answer
27 views

remove trailing dashes in foldtext

When I set foldtext to a simple value like getline(v:foldstart), vim should show the current line, as opposed to the usual + and appropriate number of hyphens - for the foldlevel. However, vim fills ...
0
votes
1answer
17 views

Line position after quickfix jump

I'm using fzf's Rg command to populate QuickFix window with all search results. I also have my own mappings to :cn and :cp commands. Everything is fine except one thing when I press mapped key for :...
3
votes
2answers
101 views

Is it necessary to always add ! to function and command

I can't remember start from when and why, i always add ! to function and command: function! .. ... endfunction command! ... But :h E122 says: When a function by this name already ...
0
votes
0answers
27 views

“earlier 1f” broke if I save twice?

To reproduce it : make first change. save make second change. save save (I have a bad habit to save twice sometimes.) execute :earlier 1f , both changes lost. What's even weird is that you need to ...
2
votes
1answer
16 views

Interaction of object-select with double quotes

I'm trying to understand logic of text-object-selection in the presence of double qoutes. In the following lines * denotes cursor position, // denotes my comments. a"b(c*d)e"f //di) deletes ...
1
vote
1answer
48 views

Highlighting arbitrary text

When I'm writing, I often have 2-3 buffers open. My main body of text in the middle, and then supporting materials on the left and right. I often read a paragraph from one of the supporting buffers ...
-2
votes
0answers
18 views

Numbers transferred from beginning to the end of a string REGEX [on hold]

tester.84tester:tester -> tester.84tester:tester84 this is what I need to be done, thank you for any help.
1
vote
1answer
24 views

Autoreload vimrc when writing to vimscript files

I wanted to have my vimrc automatically update when I write to a .vim file using this autocmd: autocmd BufWritePost *.vim,$MYVIMRC source $MYVIMRC But for some reason when I have this enabled and ...
0
votes
1answer
28 views

what is the purpose of the view folder in the .vim folder?

I got an error when opening my .vimrc with vim saying ".vimrc" 138L, 3781C Error detected while processing /home/fbence/.vim/view/~=+.vimrc=: line 117: E518: Unknown option: termkey= line 118: ...
1
vote
2answers
27 views

Move cursor and screen together

I am implementing a smooth scrolling function for <C-u> and <C-d>, which just sleeps for a few milliseconds and then moves the screen up (<C-y>) or down (<C-e>) one line: ...
1
vote
1answer
50 views

How to force overwriting ALL syntax highlighting in Vim?

Recently, I have tried to create my own colorscheme in only one color and no text decoration. That means Normal, Comment, ToolbarLine, Tooltip... are the same; Visual, Cursor... are reversed, of ...
0
votes
0answers
15 views

ftplugin not loading

This is my .vimrc set nocompatible " be iMproved, required filetype off " required " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle....
1
vote
2answers
48 views

Is there a way to paste at multiple locations/lines in vim?

I use :copy a fair bit. So like range :12,15 copy 20 will paste a block of text from 12 to 15 lines at 20th line. But when I want to paste a line at multiple places it doesn't work. For example :24 ...
1
vote
2answers
48 views

Highlight range for ex command

I'm trying to add more ex commands to my vim repertoire and I was wondering if there is setting or plugin that would allow to highlight the lines addressed by the command, if a range is give e.g., if ...
1
vote
1answer
17 views

Can I have a newline in balloonevalterm expressions?

I'm trying to use balloon text for my C macros, say, true and false as follows in the terminal version. function! MyBalloonExpr() let macros = { \ 'true':"true\n1", \ 'false':"false\n0", \ } ...
1
vote
2answers
158 views

How to insert text from a variable at current cursor position?

I am writing a vim script, and I need to insert the contents of a string variable at the current cursor position. What is an appropriate way to do this? let text = "Lorem ipsum sit dolor amet ..." " ...
0
votes
0answers
37 views

How to control .cache folder location?

Is there an option to control .cache folder location in Vim? Is there a setting or a variable for this?
2
votes
3answers
89 views

How can substitute() operate on a whole buffer?

In normal usage :%s/A/B/g is a simple way to substitute a pattern across the entire buffer. However the command mode implementation of :substitute is subject to many user configurable variables and as ...
1
vote
1answer
30 views

How do you read the contents of a macro into your buffer?

I know that you can use let @x = @w to copy the contents of a macro from one register to another, but how do you read the contents of your macro register into the buffer?
2
votes
1answer
38 views

Is there a 'toggle' :set option?

In my $VIMRC I have: nnoremap <leader>A :set formatoptions+=a<cr> nnoremap <leader>a :set formatoptions-=a<cr> What I'm wondering is if there's something more like: nnoremap ...
3
votes
1answer
61 views

VimL/Vimscript: how to access local variable of outer function from its inner function?

I posted this question on stackoverflow already, but realized afterwards that it's probably better to ask here. So I have a function of the following form: function! s:my_function(dict_arg) let ...
2
votes
0answers
15 views

neovim and youcompleteme

Anyone know how to get rid of the file path segment of the completion list. I'm using youcompleteme with rust.
4
votes
1answer
57 views

how to change local directory of terminal buffer whenever its shell change directory

After :term ++curwin zsh, I use that buffer as an alternative of tmux window. But there is one caveat, if I cd in zsh, vim will not know. Which cause problem in below case In terminal normal mode, ...
1
vote
2answers
48 views

Highlight important words/lines permanently

I'm working on a plain text file. I'd like to highlight important words or lines so that they stand out. How can I change background color and/or text color for selected text or word under cursor? ...
1
vote
1answer
39 views

Open quickfix Window Only, Don't Jump To First Result

Is there a way to open just the quickfix list without jumping to the first result when using :lt? I am using :lt to populate the location list with tags that match with the following binding: nmap &...
1
vote
3answers
32 views

Easily add/open a file in the same folder as the current file/buffer

I feel my current VIM setup is pretty sweet, but there is one thing that annoys me time and time again: how can I open a file or add a file to the same directory as the current file I am editing? If ...
0
votes
2answers
43 views

Is it possible to use colorcolumn on specific lines only

I am using a vimscript to "highlight" columns of interest in some text. However, using colorcolumn "highlights" the entire column on every row in the file. Is there a good way to define start and end ...
2
votes
0answers
26 views

Issues in changing font size in vim

I using konsole terminal emulator and I am facing some issue with changing the font size in vim. If I add the following snippet into my .vimrc. In the vim application, the font size will snap back to ...
5
votes
1answer
403 views

vim: (E)dit anyway without prompting

I work with many terminals, and very often hit the case where: a vim instance holds ~/sm/file I open another instance on the same file. My choice is always :(E)dit without prompting ... So I'd like ...
2
votes
1answer
36 views

Numpad behavior incorrect with vim.exe - Windows

On Windows with an installation of gvim 8.1, Numpad behavior is different between the GUI and the console. The GUI (gvim.exe) has a TERM of builtin_gui and the keypad (with Numlock On) works properly....
0
votes
1answer
45 views

viw breaks when i is remapped

I have the following in my init.vim (neovim): nnoremap i k nnoremap j h nnoremap k j xnoremap i k xnoremap j h xnoremap k j nnoremap h i nnoremap H I I find this arrow key-like configuration much ...
1
vote
2answers
41 views

C-N using try-catch

When using autocompletion with <C-n>, if no matching string is found, vim shows the message Pattern not found into the status bar. I tried something with this simple function: function! TestCN(...
0
votes
1answer
21 views

How to echo a message in BufWritePost so that it writes over the “~/.foo xxxL, xxC written” status message?

Say I write an autocommand for a particular file to do something when I save it, such as autocmd BufWritePost .Xresources silent! execute 'xrdb ~/.Xresources' I'm doing it with silent! execute, ...
0
votes
1answer
43 views

open coc-definition in new split in coc

I am using coc.vim in neovim. coc.vim suggests the following mapping for jumping to the definition of a class/method. nmap <silent> gd <Plug>(coc-definition) If there is only a single ...
1
vote
1answer
21 views

How to use matchadd to add exact word?

Referring to answer from this link.. Adding two groups, :highlight MyGroup1 ctermbg=green guibg=green :highlight MyGroup2 ctermbg=blue guibg=blue Then adding two words foo and bar into specific ...
2
votes
0answers
20 views

How to fix this `Omni completion (^O^N^P) Pattern not found` error?

I am trying to set up syntax keyword based omnicompletion in vim. I have defined a few syntax keyword Constants in ~/.config/nvim/syntax/spl.vim They are correctly detected and highlighted. They are ...
1
vote
1answer
32 views

Is it possible to have the cursor follow a newly-created window?

When I split my window (C-w v), is it possible to have the cursor automatically go to the new split right away? (I looked up switchbuf but I think that's something else; having to do with buffers ...
0
votes
2answers
42 views

quickfix Menu Usage With :tselect and :vimgrep

I am currently using the following mapping to search for knows tags: nnoremap <expr> <Leader>t "<ESC>:tselect /" . input("") . "<ESC>" I also use this mapping to grep all ...

15 30 50 per page